blame-1.3.1/0000777000076400007640000000000010531540137007610 500000000000000blame-1.3.1/AUTHORS0000664000076400007640000000005710125542443010601 00000000000000Michael Chapman blame-1.3.1/lib/0000777000076400007640000000000010531540137010356 500000000000000blame-1.3.1/lib/xstrndup.h0000644000076400007640000000205210527555557012352 00000000000000/* Duplicate a bounded initial segment of a string, with out-of-memory checking. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Return a newly allocated copy of at most N bytes of STRING. In other words, return a copy of the initial segment of length N of STRING. */ extern char *xstrndup (const char *string, size_t n); blame-1.3.1/lib/stdbool_.h0000644000076400007640000001100610527555560012261 00000000000000/* Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc. Written by Bruno Haible , 2001. 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _STDBOOL_H #define _STDBOOL_H /* ISO C 99 for platforms that lack it. */ /* Usage suggestions: Programs that use should be aware of some limitations and standards compliance issues. Standards compliance: - 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: - must be #included before the '_Bool' type can be used. - You cannot assume that _Bool is a typedef; it might be a macro. - 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'. 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 */ /* BeOS already #defines false 0, true 1. We use the same definitions below, but temporarily we have to #undef them. */ #ifdef __BEOS__ # include /* defines bool but not _Bool */ # undef false # undef true #endif /* For the sake of symbolic names in gdb, we 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 if we do this, values of type '_Bool' may 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 we add a negative value to the enum; this ensures that '_Bool' promotes to 'int'. */ #if defined __cplusplus || defined __BEOS__ /* A compiler known to have 'bool'. */ /* If the compiler already has both 'bool' and '_Bool', we can assume they are the same types. */ # if !@HAVE__BOOL@ typedef bool _Bool; # endif #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 http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html Similar bugs are likely with other compilers as well; this file wouldn't be used if 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". The only benefit of the enum type, debuggability, is not important with these compilers. So use 'signed char' and no typedef. */ # define _Bool signed char enum { false = 0, true = 1 }; # else /* With this compiler, trust the _Bool type if the compiler has it. */ # if !@HAVE__BOOL@ typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; # endif # endif #endif #define bool _Bool /* The other macros must be usable in preprocessor directives. */ #define false 0 #define true 1 #define __bool_true_false_are_defined 1 #endif /* _STDBOOL_H */ blame-1.3.1/lib/mempcpy.h0000644000076400007640000000216410241344116012115 00000000000000/* Copy memory area and return pointer after last written byte. Copyright (C) 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef mempcpy # if HAVE_MEMPCPY /* Get mempcpy() declaration. */ # include # else /* Get size_t */ # include /* Copy N bytes of SRC to DEST, return pointer to bytes after the last written byte. */ extern void *mempcpy (void *dest, const void *src, size_t n); # endif #endif blame-1.3.1/lib/gettext.h0000644000076400007640000002235110527555557012153 00000000000000/* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ # include /* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by the gettext() and ngettext() macros. This is an alternative to calling textdomain(), and is useful for libraries. */ # ifdef DEFAULT_TEXT_DOMAIN # undef gettext # define gettext(Msgid) \ dgettext (DEFAULT_TEXT_DOMAIN, Msgid) # undef ngettext # define ngettext(Msgid1, Msgid2, N) \ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) # endif #else /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) # include #endif /* Many header files from the libstdc++ coming with g++ 3.3 or newer include , which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. */ #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) # include # if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H # include # endif #endif /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # define gettext(Msgid) ((const char *) (Msgid)) # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) # define dcgettext(Domainname, Msgid, Category) \ ((void) (Category), dgettext (Domainname, Msgid)) # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 \ ? ((void) (Msgid2), (const char *) (Msgid1)) \ : ((void) (Msgid1), (const char *) (Msgid2))) # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) # define textdomain(Domainname) ((const char *) (Domainname)) # define bindtextdomain(Domainname, Dirname) \ ((void) (Domainname), (const char *) (Dirname)) # define bind_textdomain_codeset(Domainname, Codeset) \ ((void) (Domainname), (const char *) (Codeset)) #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String /* The separator between msgctxt and msgid in a .mo file. */ #define GETTEXT_CONTEXT_GLUE "\004" /* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be short and rarely need to change. The letter 'p' stands for 'particular' or 'special'. */ #ifdef DEFAULT_TEXT_DOMAIN # define pgettext(Msgctxt, Msgid) \ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #else # define pgettext(Msgctxt, Msgid) \ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #endif #define dpgettext(Domainname, Msgctxt, Msgid) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) #ifdef DEFAULT_TEXT_DOMAIN # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #else # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #endif #define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * pgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, int category) { const char *translation = dcgettext (domain, msg_ctxt_id, category); if (translation == msg_ctxt_id) return msgid; else return translation; } #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * npgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { const char *translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); if (translation == msg_ctxt_id || translation == msgid_plural) return (n == 1 ? msgid : msgid_plural); else return translation; } /* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID can be arbitrary expressions. But for string literals these macros are less efficient than those above. */ #include #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ (__GNUC__ >= 3 || __GNUG__ >= 2 /* || __STDC_VERSION__ >= 199901L */ ) #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS #include #endif #define pgettext_expr(Msgctxt, Msgid) \ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) #define dpgettext_expr(Domainname, Msgctxt, Msgid) \ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcgettext (domain, msg_ctxt_id, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (translation != msg_ctxt_id) return translation; } return msgid; } #define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcnpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (!(translation == msg_ctxt_id || translation == msgid_plural)) return translation; } return (n == 1 ? msgid : msgid_plural); } #endif /* _LIBGETTEXT_H */ blame-1.3.1/lib/strchrnul.h0000644000076400007640000000174010241344123012464 00000000000000/* Searching in a string. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if HAVE_STRCHRNUL /* Get strchrnul() declaration. */ #include #else /* Find the first occurrence of C in S or the final NUL byte. */ extern char *strchrnul (const char *s, int c_in); #endif blame-1.3.1/lib/memcmp.c0000644000076400007640000002114610527555557011741 00000000000000/* Copyright (C) 1991, 1993, 1995, 1997, 1998, 2003, 2006 Free Software Foundation, Inc. Contributed by Torbjorn Granlund (tege@sics.se). NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LIBC # include #endif #include #undef memcmp #ifdef _LIBC # include # include # if __BYTE_ORDER == __BIG_ENDIAN # define WORDS_BIGENDIAN # endif #else /* Not in the GNU C library. */ # include /* Type to use for aligned memory operations. This should normally be the biggest type supported by a single load and store. Must be an unsigned type. */ # define op_t unsigned long int # define OPSIZ (sizeof(op_t)) /* Threshold value for when to enter the unrolled loops. */ # define OP_T_THRES 16 /* Type to use for unaligned operations. */ typedef unsigned char byte; # ifndef WORDS_BIGENDIAN # define MERGE(w0, sh_1, w1, sh_2) (((w0) >> (sh_1)) | ((w1) << (sh_2))) # else # define MERGE(w0, sh_1, w1, sh_2) (((w0) << (sh_1)) | ((w1) >> (sh_2))) # endif #endif /* In the GNU C library. */ #ifdef WORDS_BIGENDIAN # define CMP_LT_OR_GT(a, b) ((a) > (b) ? 1 : -1) #else # define CMP_LT_OR_GT(a, b) memcmp_bytes ((a), (b)) #endif /* BE VERY CAREFUL IF YOU CHANGE THIS CODE! */ /* The strategy of this memcmp is: 1. Compare bytes until one of the block pointers is aligned. 2. Compare using memcmp_common_alignment or memcmp_not_common_alignment, regarding the alignment of the other block after the initial byte operations. The maximum number of full words (of type op_t) are compared in this way. 3. Compare the few remaining bytes. */ #ifndef WORDS_BIGENDIAN /* memcmp_bytes -- Compare A and B bytewise in the byte order of the machine. A and B are known to be different. This is needed only on little-endian machines. */ # ifdef __GNUC__ __inline # endif static int memcmp_bytes (long unsigned int a, long unsigned int b) { long int srcp1 = (long int) &a; long int srcp2 = (long int) &b; op_t a0, b0; do { a0 = ((byte *) srcp1)[0]; b0 = ((byte *) srcp2)[0]; srcp1 += 1; srcp2 += 1; } while (a0 == b0); return a0 - b0; } #endif /* memcmp_common_alignment -- Compare blocks at SRCP1 and SRCP2 with LEN `op_t' objects (not LEN bytes!). Both SRCP1 and SRCP2 should be aligned for memory operations on `op_t's. */ #ifdef __GNUC__ __inline #endif static int memcmp_common_alignment (long int srcp1, long int srcp2, size_t len) { op_t a0, a1; op_t b0, b1; switch (len % 4) { default: /* Avoid warning about uninitialized local variables. */ case 2: a0 = ((op_t *) srcp1)[0]; b0 = ((op_t *) srcp2)[0]; srcp1 -= 2 * OPSIZ; srcp2 -= 2 * OPSIZ; len += 2; goto do1; case 3: a1 = ((op_t *) srcp1)[0]; b1 = ((op_t *) srcp2)[0]; srcp1 -= OPSIZ; srcp2 -= OPSIZ; len += 1; goto do2; case 0: if (OP_T_THRES <= 3 * OPSIZ && len == 0) return 0; a0 = ((op_t *) srcp1)[0]; b0 = ((op_t *) srcp2)[0]; goto do3; case 1: a1 = ((op_t *) srcp1)[0]; b1 = ((op_t *) srcp2)[0]; srcp1 += OPSIZ; srcp2 += OPSIZ; len -= 1; if (OP_T_THRES <= 3 * OPSIZ && len == 0) goto do0; /* Fall through. */ } do { a0 = ((op_t *) srcp1)[0]; b0 = ((op_t *) srcp2)[0]; if (a1 != b1) return CMP_LT_OR_GT (a1, b1); do3: a1 = ((op_t *) srcp1)[1]; b1 = ((op_t *) srcp2)[1]; if (a0 != b0) return CMP_LT_OR_GT (a0, b0); do2: a0 = ((op_t *) srcp1)[2]; b0 = ((op_t *) srcp2)[2]; if (a1 != b1) return CMP_LT_OR_GT (a1, b1); do1: a1 = ((op_t *) srcp1)[3]; b1 = ((op_t *) srcp2)[3]; if (a0 != b0) return CMP_LT_OR_GT (a0, b0); srcp1 += 4 * OPSIZ; srcp2 += 4 * OPSIZ; len -= 4; } while (len != 0); /* This is the right position for do0. Please don't move it into the loop. */ do0: if (a1 != b1) return CMP_LT_OR_GT (a1, b1); return 0; } /* memcmp_not_common_alignment -- Compare blocks at SRCP1 and SRCP2 with LEN `op_t' objects (not LEN bytes!). SRCP2 should be aligned for memory operations on `op_t', but SRCP1 *should be unaligned*. */ #ifdef __GNUC__ __inline #endif static int memcmp_not_common_alignment (long int srcp1, long int srcp2, size_t len) { op_t a0, a1, a2, a3; op_t b0, b1, b2, b3; op_t x; int shl, shr; /* Calculate how to shift a word read at the memory operation aligned srcp1 to make it aligned for comparison. */ shl = 8 * (srcp1 % OPSIZ); shr = 8 * OPSIZ - shl; /* Make SRCP1 aligned by rounding it down to the beginning of the `op_t' it points in the middle of. */ srcp1 &= -OPSIZ; switch (len % 4) { default: /* Avoid warning about uninitialized local variables. */ case 2: a1 = ((op_t *) srcp1)[0]; a2 = ((op_t *) srcp1)[1]; b2 = ((op_t *) srcp2)[0]; srcp1 -= 1 * OPSIZ; srcp2 -= 2 * OPSIZ; len += 2; goto do1; case 3: a0 = ((op_t *) srcp1)[0]; a1 = ((op_t *) srcp1)[1]; b1 = ((op_t *) srcp2)[0]; srcp2 -= 1 * OPSIZ; len += 1; goto do2; case 0: if (OP_T_THRES <= 3 * OPSIZ && len == 0) return 0; a3 = ((op_t *) srcp1)[0]; a0 = ((op_t *) srcp1)[1]; b0 = ((op_t *) srcp2)[0]; srcp1 += 1 * OPSIZ; goto do3; case 1: a2 = ((op_t *) srcp1)[0]; a3 = ((op_t *) srcp1)[1]; b3 = ((op_t *) srcp2)[0]; srcp1 += 2 * OPSIZ; srcp2 += 1 * OPSIZ; len -= 1; if (OP_T_THRES <= 3 * OPSIZ && len == 0) goto do0; /* Fall through. */ } do { a0 = ((op_t *) srcp1)[0]; b0 = ((op_t *) srcp2)[0]; x = MERGE(a2, shl, a3, shr); if (x != b3) return CMP_LT_OR_GT (x, b3); do3: a1 = ((op_t *) srcp1)[1]; b1 = ((op_t *) srcp2)[1]; x = MERGE(a3, shl, a0, shr); if (x != b0) return CMP_LT_OR_GT (x, b0); do2: a2 = ((op_t *) srcp1)[2]; b2 = ((op_t *) srcp2)[2]; x = MERGE(a0, shl, a1, shr); if (x != b1) return CMP_LT_OR_GT (x, b1); do1: a3 = ((op_t *) srcp1)[3]; b3 = ((op_t *) srcp2)[3]; x = MERGE(a1, shl, a2, shr); if (x != b2) return CMP_LT_OR_GT (x, b2); srcp1 += 4 * OPSIZ; srcp2 += 4 * OPSIZ; len -= 4; } while (len != 0); /* This is the right position for do0. Please don't move it into the loop. */ do0: x = MERGE(a2, shl, a3, shr); if (x != b3) return CMP_LT_OR_GT (x, b3); return 0; } int rpl_memcmp (const void *s1, const void *s2, size_t len) { op_t a0; op_t b0; long int srcp1 = (long int) s1; long int srcp2 = (long int) s2; op_t res; if (len >= OP_T_THRES) { /* There are at least some bytes to compare. No need to test for LEN == 0 in this alignment loop. */ while (srcp2 % OPSIZ != 0) { a0 = ((byte *) srcp1)[0]; b0 = ((byte *) srcp2)[0]; srcp1 += 1; srcp2 += 1; res = a0 - b0; if (res != 0) return res; len -= 1; } /* SRCP2 is now aligned for memory operations on `op_t'. SRCP1 alignment determines if we can do a simple, aligned compare or need to shuffle bits. */ if (srcp1 % OPSIZ == 0) res = memcmp_common_alignment (srcp1, srcp2, len / OPSIZ); else res = memcmp_not_common_alignment (srcp1, srcp2, len / OPSIZ); if (res != 0) return res; /* Number of bytes remaining in the interval [0..OPSIZ-1]. */ srcp1 += len & -OPSIZ; srcp2 += len & -OPSIZ; len %= OPSIZ; } /* There are just a few bytes to compare. Use byte memory operations. */ while (len != 0) { a0 = ((byte *) srcp1)[0]; b0 = ((byte *) srcp2)[0]; srcp1 += 1; srcp2 += 1; res = a0 - b0; if (res != 0) return res; len -= 1; } return 0; } #ifdef weak_alias # undef bcmp weak_alias (memcmp, bcmp) #endif blame-1.3.1/lib/memcpy.c0000644000076400007640000000227110527555557011753 00000000000000/* Copyright (C) 1995, 1997, 2000, 2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Jim Meyering . */ #include #include /* Copy LEN bytes starting at SRCADDR to DESTADDR. Result undefined if the source overlaps with the destination. Return DESTADDR. */ void * memcpy (void *destaddr, void const *srcaddr, size_t len) { char *dest = destaddr; char const *src = srcaddr; while (len-- > 0) *dest++ = *src++; return destaddr; } blame-1.3.1/lib/vsnprintf.c0000644000076400007640000000401710527555560012504 00000000000000/* Formatted output to strings. Copyright (C) 2004, 2006 Free Software Foundation, Inc. Written by Simon Josefsson and Yoann Vandoorselaere . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "vsnprintf.h" #include #include #include #include #include #include #include "vasnprintf.h" /* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ #ifndef EOVERFLOW # define EOVERFLOW E2BIG #endif /* Print formatted output to string STR. Similar to vsprintf, but additional length SIZE limit how much is written into STR. Returns string length of formatted string (which may be larger than SIZE). STR may be NULL, in which case nothing will be written. On error, return a negative value. */ int vsnprintf (char *str, size_t size, const char *format, va_list args) { char *output; size_t len; size_t lenbuf = size; output = vasnprintf (str, &lenbuf, format, args); len = lenbuf; if (!output) return -1; if (output != str) { if (size) { size_t pruned_len = (len < size ? len : size - 1); memcpy (str, output, pruned_len); str[pruned_len] = '\0'; } free (output); } if (len > INT_MAX) { errno = EOVERFLOW; return -1; } return len; } blame-1.3.1/lib/size_max.h0000644000076400007640000000230710527555557012305 00000000000000/* size_max.h -- declare SIZE_MAX through system headers Copyright (C) 2005-2006 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GNULIB_SIZE_MAX_H #define GNULIB_SIZE_MAX_H /* Get SIZE_MAX declaration on systems like Solaris 7/8/9. */ # include /* Get SIZE_MAX declaration on systems like glibc 2. */ # if HAVE_STDINT_H # include # endif /* On systems where these include files don't define it, SIZE_MAX is defined in config.h. */ #endif /* GNULIB_SIZE_MAX_H */ blame-1.3.1/lib/strtoul.c0000644000076400007640000000151710241344123012151 00000000000000/* Copyright (C) 1991, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define UNSIGNED 1 #include "strtol.c" blame-1.3.1/lib/argp-fmtstream.c0000644000076400007640000002634010527555557013415 00000000000000/* Word-wrapping and line-truncating streams Copyright (C) 1997-1999,2001,2002,2003,2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* This package emulates glibc `line_wrap_stream' semantics for systems that don't have that. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include "argp-fmtstream.h" #include "argp-namefrob.h" #ifndef ARGP_FMTSTREAM_USE_LINEWRAP #ifndef isblank #define isblank(ch) ((ch)==' ' || (ch)=='\t') #endif #if defined _LIBC && defined USE_IN_LIBIO # include # include # define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a) #endif #define INIT_BUF_SIZE 200 #define PRINTF_SIZE_GUESS 150 /* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines written on it with LMARGIN spaces and limits them to RMARGIN columns total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by replacing the whitespace before them with a newline and WMARGIN spaces. Otherwise, chars beyond RMARGIN are simply dropped until a newline. Returns NULL if there was an error. */ argp_fmtstream_t __argp_make_fmtstream (FILE *stream, size_t lmargin, size_t rmargin, ssize_t wmargin) { argp_fmtstream_t fs; fs = (struct argp_fmtstream *) malloc (sizeof (struct argp_fmtstream)); if (fs != NULL) { fs->stream = stream; fs->lmargin = lmargin; fs->rmargin = rmargin; fs->wmargin = wmargin; fs->point_col = 0; fs->point_offs = 0; fs->buf = (char *) malloc (INIT_BUF_SIZE); if (! fs->buf) { free (fs); fs = 0; } else { fs->p = fs->buf; fs->end = fs->buf + INIT_BUF_SIZE; } } return fs; } #if 0 /* Not exported. */ #ifdef weak_alias weak_alias (__argp_make_fmtstream, argp_make_fmtstream) #endif #endif /* Flush FS to its stream, and free it (but don't close the stream). */ void __argp_fmtstream_free (argp_fmtstream_t fs) { __argp_fmtstream_update (fs); if (fs->p > fs->buf) { #ifdef USE_IN_LIBIO __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf); #else fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream); #endif } free (fs->buf); free (fs); } #if 0 /* Not exported. */ #ifdef weak_alias weak_alias (__argp_fmtstream_free, argp_fmtstream_free) #endif #endif /* Process FS's buffer so that line wrapping is done from POINT_OFFS to the end of its buffer. This code is mostly from glibc stdio/linewrap.c. */ void __argp_fmtstream_update (argp_fmtstream_t fs) { char *buf, *nl; size_t len; /* Scan the buffer for newlines. */ buf = fs->buf + fs->point_offs; while (buf < fs->p) { size_t r; if (fs->point_col == 0 && fs->lmargin != 0) { /* We are starting a new line. Print spaces to the left margin. */ const size_t pad = fs->lmargin; if (fs->p + pad < fs->end) { /* We can fit in them in the buffer by moving the buffer text up and filling in the beginning. */ memmove (buf + pad, buf, fs->p - buf); fs->p += pad; /* Compensate for bigger buffer. */ memset (buf, ' ', pad); /* Fill in the spaces. */ buf += pad; /* Don't bother searching them. */ } else { /* No buffer space for spaces. Must flush. */ size_t i; for (i = 0; i < pad; i++) { #ifdef USE_IN_LIBIO if (_IO_fwide (fs->stream, 0) > 0) putwc_unlocked (L' ', fs->stream); else #endif putc_unlocked (' ', fs->stream); } } fs->point_col = pad; } len = fs->p - buf; nl = memchr (buf, '\n', len); if (fs->point_col < 0) fs->point_col = 0; if (!nl) { /* The buffer ends in a partial line. */ if (fs->point_col + len < fs->rmargin) { /* The remaining buffer text is a partial line and fits within the maximum line width. Advance point for the characters to be written and stop scanning. */ fs->point_col += len; break; } else /* Set the end-of-line pointer for the code below to the end of the buffer. */ nl = fs->p; } else if (fs->point_col + (nl - buf) < (ssize_t) fs->rmargin) { /* The buffer contains a full line that fits within the maximum line width. Reset point and scan the next line. */ fs->point_col = 0; buf = nl + 1; continue; } /* This line is too long. */ r = fs->rmargin - 1; if (fs->wmargin < 0) { /* Truncate the line by overwriting the excess with the newline and anything after it in the buffer. */ if (nl < fs->p) { memmove (buf + (r - fs->point_col), nl, fs->p - nl); fs->p -= buf + (r - fs->point_col) - nl; /* Reset point for the next line and start scanning it. */ fs->point_col = 0; buf += r + 1; /* Skip full line plus \n. */ } else { /* The buffer ends with a partial line that is beyond the maximum line width. Advance point for the characters written, and discard those past the max from the buffer. */ fs->point_col += len; fs->p -= fs->point_col - r; break; } } else { /* Do word wrap. Go to the column just past the maximum line width and scan back for the beginning of the word there. Then insert a line break. */ char *p, *nextline; int i; p = buf + (r + 1 - fs->point_col); while (p >= buf && !isblank (*p)) --p; nextline = p + 1; /* This will begin the next line. */ if (nextline > buf) { /* Swallow separating blanks. */ if (p >= buf) do --p; while (p >= buf && isblank (*p)); nl = p + 1; /* The newline will replace the first blank. */ } else { /* A single word that is greater than the maximum line width. Oh well. Put it on an overlong line by itself. */ p = buf + (r + 1 - fs->point_col); /* Find the end of the long word. */ if (p < nl) do ++p; while (p < nl && !isblank (*p)); if (p == nl) { /* It already ends a line. No fussing required. */ fs->point_col = 0; buf = nl + 1; continue; } /* We will move the newline to replace the first blank. */ nl = p; /* Swallow separating blanks. */ do ++p; while (isblank (*p)); /* The next line will start here. */ nextline = p; } /* Note: There are a bunch of tests below for NEXTLINE == BUF + LEN + 1; this case is where NL happens to fall at the end of the buffer, and NEXTLINE is in fact empty (and so we need not be careful to maintain its contents). */ if ((nextline == buf + len + 1 ? fs->end - nl < fs->wmargin + 1 : nextline - (nl + 1) < fs->wmargin) && fs->p > nextline) { /* The margin needs more blanks than we removed. */ if (fs->end - fs->p > fs->wmargin + 1) /* Make some space for them. */ { size_t mv = fs->p - nextline; memmove (nl + 1 + fs->wmargin, nextline, mv); nextline = nl + 1 + fs->wmargin; len = nextline + mv - buf; *nl++ = '\n'; } else /* Output the first line so we can use the space. */ { #ifdef _LIBC __fxprintf (fs->stream, "%.*s\n", (int) (nl - fs->buf), fs->buf); #else if (nl > fs->buf) fwrite_unlocked (fs->buf, 1, nl - fs->buf, fs->stream); putc_unlocked ('\n', fs->stream); #endif len += buf - fs->buf; nl = buf = fs->buf; } } else /* We can fit the newline and blanks in before the next word. */ *nl++ = '\n'; if (nextline - nl >= fs->wmargin || (nextline == buf + len + 1 && fs->end - nextline >= fs->wmargin)) /* Add blanks up to the wrap margin column. */ for (i = 0; i < fs->wmargin; ++i) *nl++ = ' '; else for (i = 0; i < fs->wmargin; ++i) #ifdef USE_IN_LIBIO if (_IO_fwide (fs->stream, 0) > 0) putwc_unlocked (L' ', fs->stream); else #endif putc_unlocked (' ', fs->stream); /* Copy the tail of the original buffer into the current buffer position. */ if (nl < nextline) memmove (nl, nextline, buf + len - nextline); len -= nextline - buf; /* Continue the scan on the remaining lines in the buffer. */ buf = nl; /* Restore bufp to include all the remaining text. */ fs->p = nl + len; /* Reset the counter of what has been output this line. If wmargin is 0, we want to avoid the lmargin getting added, so we set point_col to a magic value of -1 in that case. */ fs->point_col = fs->wmargin ? fs->wmargin : -1; } } /* Remember that we've scanned as far as the end of the buffer. */ fs->point_offs = fs->p - fs->buf; } /* Ensure that FS has space for AMOUNT more bytes in its buffer, either by growing the buffer, or by flushing it. True is returned iff we succeed. */ int __argp_fmtstream_ensure (struct argp_fmtstream *fs, size_t amount) { if ((size_t) (fs->end - fs->p) < amount) { ssize_t wrote; /* Flush FS's buffer. */ __argp_fmtstream_update (fs); #ifdef _LIBC __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf); wrote = fs->p - fs->buf; #else wrote = fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream); #endif if (wrote == fs->p - fs->buf) { fs->p = fs->buf; fs->point_offs = 0; } else { fs->p -= wrote; fs->point_offs -= wrote; memmove (fs->buf, fs->buf + wrote, fs->p - fs->buf); return 0; } if ((size_t) (fs->end - fs->buf) < amount) /* Gotta grow the buffer. */ { size_t old_size = fs->end - fs->buf; size_t new_size = old_size + amount; char *new_buf; if (new_size < old_size || ! (new_buf = realloc (fs->buf, new_size))) { __set_errno (ENOMEM); return 0; } fs->buf = new_buf; fs->end = new_buf + new_size; fs->p = fs->buf; } } return 1; } ssize_t __argp_fmtstream_printf (struct argp_fmtstream *fs, const char *fmt, ...) { int out; size_t avail; size_t size_guess = PRINTF_SIZE_GUESS; /* How much space to reserve. */ do { va_list args; if (! __argp_fmtstream_ensure (fs, size_guess)) return -1; va_start (args, fmt); avail = fs->end - fs->p; out = __vsnprintf (fs->p, avail, fmt, args); va_end (args); if ((size_t) out >= avail) size_guess = out + 1; } while ((size_t) out >= avail); fs->p += out; return out; } #if 0 /* Not exported. */ #ifdef weak_alias weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf) #endif #endif #endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */ blame-1.3.1/lib/Makefile.in0000644000076400007640000013556710531540110012347 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2004-2006 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # Reproduce by: gnulib-tool --import --dir=. --lib=libmisc --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=. --no-libtool --macro-prefix=gl alloca argp calloc canonicalize dirname error exit free getcwd getline lstat malloc memchr memcmp memcpy memmove memset mktime obstack pathmax progname realloc setenv strchrnul strdup strftime strndup strpbrk strstr strtoul tzset unlocked-io xalloc xalloc-die xreadlink srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ ANSI2KNR = @ANSI2KNR@ subdir = lib DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in alloca.c ansi2knr.1 ansi2knr.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/allocsa.m4 \ $(top_srcdir)/m4/argp.m4 $(top_srcdir)/m4/calloc.m4 \ $(top_srcdir)/m4/canonicalize.m4 \ $(top_srcdir)/m4/cycle-check.m4 $(top_srcdir)/m4/d-ino.m4 \ $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ $(top_srcdir)/m4/double-slash-root.m4 \ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/eoverflow.m4 \ $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exitfail.m4 \ $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/filenamecat.m4 \ $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/getcwd-abort-bug.m4 \ $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ $(top_srcdir)/m4/getdelim.m4 $(top_srcdir)/m4/getline.m4 \ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/inline.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ $(top_srcdir)/m4/langinfo.m4 $(top_srcdir)/m4/longdouble.m4 \ $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memcmp.m4 \ $(top_srcdir)/m4/memcpy.m4 $(top_srcdir)/m4/memmove.m4 \ $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memset.m4 \ $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mktime.m4 \ $(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/pathmax.m4 \ $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/setenv.m4 \ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/ssize_t.m4 \ $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stdint.m4 \ $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcase.m4 \ $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \ $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strpbrk.m4 \ $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtol.m4 \ $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ $(top_srcdir)/m4/sysexits.m4 $(top_srcdir)/m4/time_r.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/tzset.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/unistd_h.m4 \ $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vsnprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \ $(top_srcdir)/m4/xreadlink.m4 $(top_srcdir)/m4/xsize.m4 \ $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libmisc_a_AR = $(AR) $(ARFLAGS) am__DEPENDENCIES_1 = am_libmisc_a_OBJECTS = allocsa$U.$(OBJEXT) argp-ba$U.$(OBJEXT) \ argp-eexst$U.$(OBJEXT) argp-fmtstream$U.$(OBJEXT) \ argp-fs-xinl$U.$(OBJEXT) argp-help$U.$(OBJEXT) \ argp-parse$U.$(OBJEXT) argp-pin$U.$(OBJEXT) \ argp-pv$U.$(OBJEXT) argp-pvh$U.$(OBJEXT) argp-xinl$U.$(OBJEXT) \ progname$U.$(OBJEXT) strnlen1$U.$(OBJEXT) \ xalloc-die$U.$(OBJEXT) xstrndup$U.$(OBJEXT) libmisc_a_OBJECTS = $(am_libmisc_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmisc_a_SOURCES) $(EXTRA_libmisc_a_SOURCES) DIST_SOURCES = $(libmisc_a_SOURCES) $(EXTRA_libmisc_a_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ FASTEXIT = @FASTEXIT@ FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR = @FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR@ GCC_FALSE = @GCC_FALSE@ GCC_TRUE = @GCC_TRUE@ GETOPT_H = @GETOPT_H@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ 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_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE__BOOL = @HAVE__BOOL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBMISC_LIBDEPS = @LIBMISC_LIBDEPS@ LIBMISC_LTLIBDEPS = @LIBMISC_LTLIBDEPS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYSEXITS_H = @SYSEXITS_H@ SYS_STAT_H = @SYS_STAT_H@ U = @U@ UNISTD_H = @UNISTD_H@ VERSION = @VERSION@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = 1.5 gnits noinst_LIBRARIES = libmisc.a libmisc_a_SOURCES = allocsa.h allocsa.c argp.h argp-ba.c argp-eexst.c \ argp-fmtstream.c argp-fmtstream.h argp-fs-xinl.c argp-help.c \ argp-namefrob.h argp-parse.c argp-pin.c argp-pv.c argp-pvh.c \ argp-xinl.c exit.h gettext.h mbuiter.h minmax.h progname.h \ progname.c size_max.h strnlen1.h strnlen1.c wcwidth.h \ xalloc-die.c xsize.h xstrndup.h xstrndup.c libmisc_a_LIBADD = $(gl_LIBOBJS) @ALLOCA@ libmisc_a_DEPENDENCIES = $(gl_LIBOBJS) @ALLOCA@ EXTRA_libmisc_a_SOURCES = alloca.c calloc.c canonicalize.c \ cycle-check.c basename.c dirname.c stripslash.c error.c \ exitfail.c filenamecat.c free.c getcwd.c getdelim.c getline.c \ getopt.c getopt1.c gettimeofday.c lstat.c malloc.c mbchar.c \ memchr.c memcmp.c memcpy.c memmove.c mempcpy.c memset.c \ mktime.c obstack.c readlink.c realloc.c setenv.c unsetenv.c \ strcasecmp.c strncasecmp.c strchrnul.c strdup.c strftime.c \ strndup.c strnlen.c strpbrk.c strstr.c strtol.c strtoul.c \ time_r.c asnprintf.c printf-args.c printf-parse.c vasnprintf.c \ vsnprintf.c xmalloc.c xgetcwd.c xreadlink.c noinst_HEADERS = EXTRA_DIST = alloca.c alloca_.h allocsa.valgrind calloc.c \ canonicalize.c canonicalize.h pathmax.h cycle-check.c \ cycle-check.h dev-ino.h basename.c dirname.c dirname.h \ stripslash.c error.c error.h exitfail.c exitfail.h \ filenamecat.c filenamecat.h free.c getcwd.c getcwd.h \ getdelim.c getdelim.h getline.c getline.h getopt.c getopt1.c \ getopt_.h getopt_int.h gettimeofday.c lstat.c lstat.h malloc.c \ mbchar.c mbchar.h memchr.c memcmp.c memcpy.c memmove.c \ mempcpy.c mempcpy.h memset.c mktime.c obstack.c obstack.h \ pathmax.h readlink.c realloc.c same-inode.h setenv.c setenv.h \ unsetenv.c stdbool_.h stdint_.h strcase.h strcasecmp.c \ strncasecmp.c strchrnul.c strchrnul.h strdup.c strdup.h \ strftime.c strftime.h strndup.c strndup.h strnlen.c strnlen.h \ strpbrk.c strpbrk.h strstr.c strstr.h strtol.c strtoul.c \ stat_.h sysexit_.h time_r.c time_r.h unlocked-io.h asnprintf.c \ printf-args.c printf-args.h printf-parse.c printf-parse.h \ vasnprintf.c vasnprintf.h vsnprintf.c vsnprintf.h xalloc.h \ xmalloc.c xgetcwd.c xgetcwd.h xreadlink.c xreadlink.h BUILT_SOURCES = $(ALLOCA_H) $(GETOPT_H) $(STDBOOL_H) $(STDINT_H) \ $(SYS_STAT_H) $(SYSEXITS_H) $(UNISTD_H) SUFFIXES = MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t getopt.h \ getopt.h-t stdbool.h stdbool.h-t stdint.h stdint.h-t \ sys/stat.h sys/stat.h-t sysexits.h sysexits.h-t unistd.h MOSTLYCLEANDIRS = sys CLEANFILES = DISTCLEANFILES = MAINTAINERCLEANFILES = AM_CPPFLAGS = all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnits lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmisc.a: $(libmisc_a_OBJECTS) $(libmisc_a_DEPENDENCIES) -rm -f libmisc.a $(libmisc_a_AR) libmisc.a $(libmisc_a_OBJECTS) $(libmisc_a_LIBADD) $(RANLIB) libmisc.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c ansi2knr: ansi2knr.$(OBJEXT) $(LINK) ansi2knr.$(OBJEXT) $(LIBS) ansi2knr.$(OBJEXT): $(CONFIG_HEADER) clean-krextra: -rm -f ansi2knr mostlyclean-kr: -test "$U" = "" || rm -f *_.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloca$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allocsa$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-ba$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-eexst$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-fmtstream$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-fs-xinl$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-help$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-parse$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-pin$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-pv$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-pvh$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argp-xinl$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asnprintf$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/calloc$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canonicalize$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cycle-check$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exitfail$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenamecat$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/free$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdelim$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getline$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbchar$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcmp$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcpy$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memmove$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mempcpy$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memset$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obstack$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/progname$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/realloc$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setenv$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcasecmp$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strchrnul$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strftime$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stripslash$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strncasecmp$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strndup$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen1$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strpbrk$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strstr$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtol$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoul$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_r$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unsetenv$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasnprintf$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vsnprintf$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xalloc-die$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xgetcwd$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xreadlink$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrndup$U.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` alloca_.c: alloca.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ allocsa_.c: allocsa.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/allocsa.c; then echo $(srcdir)/allocsa.c; else echo allocsa.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ argp-ba_.c: argp-ba.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argp-ba.c; then echo $(srcdir)/argp-ba.c; else echo argp-ba.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ argp-eexst_.c: argp-eexst.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argp-eexst.c; then echo $(srcdir)/argp-eexst.c; else echo argp-eexst.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ argp-fmtstream_.c: argp-fmtstream.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argp-fmtstream.c; then echo $(srcdir)/argp-fmtstream.c; else echo argp-fmtstream.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ argp-fs-xinl_.c: argp-fs-xinl.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argp-fs-xinl.c; then echo $(srcdir)/argp-fs-xinl.c; else echo argp-fs-xinl.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ argp-help_.c: argp-help.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argp-help.c; then echo $(srcdir)/argp-help.c; else echo argp-help.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ argp-parse_.c: argp-parse.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argp-parse.c; then echo $(srcdir)/argp-parse.c; else echo argp-parse.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ argp-pin_.c: argp-pin.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argp-pin.c; then echo $(srcdir)/argp-pin.c; else echo argp-pin.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ argp-pv_.c: argp-pv.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argp-pv.c; then echo $(srcdir)/argp-pv.c; else echo argp-pv.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ argp-pvh_.c: argp-pvh.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argp-pvh.c; then echo $(srcdir)/argp-pvh.c; else echo argp-pvh.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ argp-xinl_.c: argp-xinl.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argp-xinl.c; then echo $(srcdir)/argp-xinl.c; else echo argp-xinl.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ asnprintf_.c: asnprintf.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/asnprintf.c; then echo $(srcdir)/asnprintf.c; else echo asnprintf.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ basename_.c: basename.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/basename.c; then echo $(srcdir)/basename.c; else echo basename.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ calloc_.c: calloc.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/calloc.c; then echo $(srcdir)/calloc.c; else echo calloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ canonicalize_.c: canonicalize.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/canonicalize.c; then echo $(srcdir)/canonicalize.c; else echo canonicalize.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ cycle-check_.c: cycle-check.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/cycle-check.c; then echo $(srcdir)/cycle-check.c; else echo cycle-check.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ dirname_.c: dirname.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dirname.c; then echo $(srcdir)/dirname.c; else echo dirname.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ error_.c: error.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ exitfail_.c: exitfail.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/exitfail.c; then echo $(srcdir)/exitfail.c; else echo exitfail.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ filenamecat_.c: filenamecat.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/filenamecat.c; then echo $(srcdir)/filenamecat.c; else echo filenamecat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ free_.c: free.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/free.c; then echo $(srcdir)/free.c; else echo free.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ getcwd_.c: getcwd.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getcwd.c; then echo $(srcdir)/getcwd.c; else echo getcwd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ getdelim_.c: getdelim.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getdelim.c; then echo $(srcdir)/getdelim.c; else echo getdelim.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ getline_.c: getline.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getline.c; then echo $(srcdir)/getline.c; else echo getline.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ getopt_.c: getopt.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ getopt1_.c: getopt1.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ gettimeofday_.c: gettimeofday.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/gettimeofday.c; then echo $(srcdir)/gettimeofday.c; else echo gettimeofday.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ lstat_.c: lstat.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lstat.c; then echo $(srcdir)/lstat.c; else echo lstat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ malloc_.c: malloc.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ mbchar_.c: mbchar.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mbchar.c; then echo $(srcdir)/mbchar.c; else echo mbchar.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ memchr_.c: memchr.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memchr.c; then echo $(srcdir)/memchr.c; else echo memchr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ memcmp_.c: memcmp.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ memcpy_.c: memcpy.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ memmove_.c: memmove.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memmove.c; then echo $(srcdir)/memmove.c; else echo memmove.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ mempcpy_.c: mempcpy.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mempcpy.c; then echo $(srcdir)/mempcpy.c; else echo mempcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ memset_.c: memset.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ mktime_.c: mktime.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ obstack_.c: obstack.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/obstack.c; then echo $(srcdir)/obstack.c; else echo obstack.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ printf-args_.c: printf-args.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/printf-args.c; then echo $(srcdir)/printf-args.c; else echo printf-args.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ printf-parse_.c: printf-parse.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/printf-parse.c; then echo $(srcdir)/printf-parse.c; else echo printf-parse.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ progname_.c: progname.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/progname.c; then echo $(srcdir)/progname.c; else echo progname.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ readlink_.c: readlink.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/readlink.c; then echo $(srcdir)/readlink.c; else echo readlink.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ realloc_.c: realloc.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ setenv_.c: setenv.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/setenv.c; then echo $(srcdir)/setenv.c; else echo setenv.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ strcasecmp_.c: strcasecmp.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strcasecmp.c; then echo $(srcdir)/strcasecmp.c; else echo strcasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ strchrnul_.c: strchrnul.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strchrnul.c; then echo $(srcdir)/strchrnul.c; else echo strchrnul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ strdup_.c: strdup.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ strftime_.c: strftime.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strftime.c; then echo $(srcdir)/strftime.c; else echo strftime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ stripslash_.c: stripslash.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stripslash.c; then echo $(srcdir)/stripslash.c; else echo stripslash.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ strncasecmp_.c: strncasecmp.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strncasecmp.c; then echo $(srcdir)/strncasecmp.c; else echo strncasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ strndup_.c: strndup.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strndup.c; then echo $(srcdir)/strndup.c; else echo strndup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ strnlen_.c: strnlen.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strnlen.c; then echo $(srcdir)/strnlen.c; else echo strnlen.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ strnlen1_.c: strnlen1.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strnlen1.c; then echo $(srcdir)/strnlen1.c; else echo strnlen1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ strpbrk_.c: strpbrk.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strpbrk.c; then echo $(srcdir)/strpbrk.c; else echo strpbrk.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ strstr_.c: strstr.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ strtol_.c: strtol.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ strtoul_.c: strtoul.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ time_r_.c: time_r.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/time_r.c; then echo $(srcdir)/time_r.c; else echo time_r.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ unsetenv_.c: unsetenv.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/unsetenv.c; then echo $(srcdir)/unsetenv.c; else echo unsetenv.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ vasnprintf_.c: vasnprintf.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/vasnprintf.c; then echo $(srcdir)/vasnprintf.c; else echo vasnprintf.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ vsnprintf_.c: vsnprintf.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/vsnprintf.c; then echo $(srcdir)/vsnprintf.c; else echo vsnprintf.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ xalloc-die_.c: xalloc-die.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xalloc-die.c; then echo $(srcdir)/xalloc-die.c; else echo xalloc-die.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ xgetcwd_.c: xgetcwd.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xgetcwd.c; then echo $(srcdir)/xgetcwd.c; else echo xgetcwd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ xmalloc_.c: xmalloc.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xmalloc.c; then echo $(srcdir)/xmalloc.c; else echo xmalloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ xreadlink_.c: xreadlink.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xreadlink.c; then echo $(srcdir)/xreadlink.c; else echo xreadlink.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ xstrndup_.c: xstrndup.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrndup.c; then echo $(srcdir)/xstrndup.c; else echo xstrndup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ alloca_.$(OBJEXT) allocsa_.$(OBJEXT) argp-ba_.$(OBJEXT) \ argp-eexst_.$(OBJEXT) argp-fmtstream_.$(OBJEXT) \ argp-fs-xinl_.$(OBJEXT) argp-help_.$(OBJEXT) argp-parse_.$(OBJEXT) \ argp-pin_.$(OBJEXT) argp-pv_.$(OBJEXT) argp-pvh_.$(OBJEXT) \ argp-xinl_.$(OBJEXT) asnprintf_.$(OBJEXT) basename_.$(OBJEXT) \ calloc_.$(OBJEXT) canonicalize_.$(OBJEXT) cycle-check_.$(OBJEXT) \ dirname_.$(OBJEXT) error_.$(OBJEXT) exitfail_.$(OBJEXT) \ filenamecat_.$(OBJEXT) free_.$(OBJEXT) getcwd_.$(OBJEXT) \ getdelim_.$(OBJEXT) getline_.$(OBJEXT) getopt_.$(OBJEXT) \ getopt1_.$(OBJEXT) gettimeofday_.$(OBJEXT) lstat_.$(OBJEXT) \ malloc_.$(OBJEXT) mbchar_.$(OBJEXT) memchr_.$(OBJEXT) \ memcmp_.$(OBJEXT) memcpy_.$(OBJEXT) memmove_.$(OBJEXT) \ mempcpy_.$(OBJEXT) memset_.$(OBJEXT) mktime_.$(OBJEXT) \ obstack_.$(OBJEXT) printf-args_.$(OBJEXT) printf-parse_.$(OBJEXT) \ progname_.$(OBJEXT) readlink_.$(OBJEXT) realloc_.$(OBJEXT) \ setenv_.$(OBJEXT) strcasecmp_.$(OBJEXT) strchrnul_.$(OBJEXT) \ strdup_.$(OBJEXT) strftime_.$(OBJEXT) stripslash_.$(OBJEXT) \ strncasecmp_.$(OBJEXT) strndup_.$(OBJEXT) strnlen_.$(OBJEXT) \ strnlen1_.$(OBJEXT) strpbrk_.$(OBJEXT) strstr_.$(OBJEXT) \ strtol_.$(OBJEXT) strtoul_.$(OBJEXT) time_r_.$(OBJEXT) \ unsetenv_.$(OBJEXT) vasnprintf_.$(OBJEXT) vsnprintf_.$(OBJEXT) \ xalloc-die_.$(OBJEXT) xgetcwd_.$(OBJEXT) xmalloc_.$(OBJEXT) \ xreadlink_.$(OBJEXT) xstrndup_.$(OBJEXT) : $(ANSI2KNR) uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(ANSI2KNR) $(LIBRARIES) $(HEADERS) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-krextra clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr \ mostlyclean-local pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-krextra clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-kr mostlyclean-local pdf \ pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am # We need the following in order to create when the system # doesn't have one that works with the given compiler. alloca.h: alloca_.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/alloca_.h; \ } > $@-t mv -f $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. getopt.h: getopt_.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/getopt_.h; \ } > $@-t mv -f $@-t $@ # We need the following in order to create when the system # doesn't have one that works. stdbool.h: stdbool_.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. stdint.h: stdint_.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ -e 's|@''ABSOLUTE_STDINT_H''@|$(ABSOLUTE_STDINT_H)|g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -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_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ -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' \ < $(srcdir)/stdint_.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # has one that is incomplete. sys/stat.h: stat_.h test -d sys || mkdir sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''ABSOLUTE_SYS_STAT_H''@|$(ABSOLUTE_SYS_STAT_H)|g' \ < $(srcdir)/stat_.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. sysexits.h: sysexit_.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/sysexit_.h; \ } > $@-t mv -f $@-t $@ # We need the following in order to create an empty placeholder for # when the system doesn't have one. unistd.h: { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ echo '/* Empty placeholder for $@. */'; \ } > $@ mostlyclean-local: mostlyclean-generic @for dir in '' $(MOSTLYCLEANDIRS); do \ if test -n "$$dir" && test -d $$dir; then \ echo "rmdir $$dir"; rmdir $$dir; \ fi; \ done # 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. .NOEXPORT: blame-1.3.1/lib/memset.c0000644000076400007640000000170510241344117011731 00000000000000/* memset.c -- set an area of memory to a given value Copyright (C) 1991, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include void * memset (void *str, int c, size_t len) { register char *st = str; while (len-- > 0) *st++ = c; return str; } blame-1.3.1/lib/dirname.h0000644000076400007640000000437110527555557012110 00000000000000/* Take file names apart into directory and base names. Copyright (C) 1998, 2001, 2003-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DIRNAME_H_ # define DIRNAME_H_ 1 # include # include # ifndef DIRECTORY_SEPARATOR # define DIRECTORY_SEPARATOR '/' # endif # ifndef ISSLASH # define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) # endif # ifndef FILE_SYSTEM_PREFIX_LEN # if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX /* This internal macro assumes ASCII, but all hosts that support drive letters use ASCII. */ # define _IS_DRIVE_LETTER(c) (((unsigned int) (c) | ('a' - 'A')) - 'a' \ <= 'z' - 'a') # define FILE_SYSTEM_PREFIX_LEN(Filename) \ (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0) # else # define FILE_SYSTEM_PREFIX_LEN(Filename) 0 # endif # endif # ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE # define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0 # endif # ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT # define DOUBLE_SLASH_IS_DISTINCT_ROOT 1 # endif # if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE # define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)]) # else # define IS_ABSOLUTE_FILE_NAME(F) \ (ISSLASH ((F)[0]) || 0 < FILE_SYSTEM_PREFIX_LEN (F)) # endif # define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F)) char *base_name (char const *file); char *dir_name (char const *file); size_t base_len (char const *file); size_t dir_len (char const *file); char *last_component (char const *file); bool strip_trailing_slashes (char *file); #endif /* not DIRNAME_H_ */ blame-1.3.1/lib/asnprintf.c0000644000076400007640000000214410527555557012464 00000000000000/* Formatted output to strings. Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Specification. */ #include "vasnprintf.h" #include char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) { va_list args; char *result; va_start (args, format); result = vasnprintf (resultbuf, lengthp, format, args); va_end (args); return result; } blame-1.3.1/lib/strncasecmp.c0000644000076400007640000000354710527555560013004 00000000000000/* strncasecmp.c -- case insensitive string comparator Copyright (C) 1998-1999, 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Specification. */ #include "strcase.h" #include #include #define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) /* Compare no more than N bytes of strings S1 and S2, ignoring case, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. */ int strncasecmp (const char *s1, const char *s2, size_t n) { register const unsigned char *p1 = (const unsigned char *) s1; register const unsigned char *p2 = (const unsigned char *) s2; unsigned char c1, c2; if (p1 == p2 || n == 0) return 0; do { c1 = TOLOWER (*p1); c2 = TOLOWER (*p2); if (--n == 0 || c1 == '\0') break; ++p1; ++p2; } while (c1 == c2); if (UCHAR_MAX <= INT_MAX) return c1 - c2; else /* On machines where 'char' and 'int' are types of the same size, the difference of two 'unsigned char' values - including the sign bit - doesn't fit in an 'int'. */ return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); } blame-1.3.1/lib/strcasecmp.c0000644000076400007640000000537110527555560012623 00000000000000/* Case-insensitive string comparison function. Copyright (C) 1998-1999, 2005-2006 Free Software Foundation, Inc. Written by Bruno Haible , 2005, based on earlier glibc code. 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Specification. */ #include "strcase.h" #include #include #if HAVE_MBRTOWC # include "mbuiter.h" #endif #define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) /* Compare strings S1 and S2, ignoring case, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. Note: This function may, in multibyte locales, return 0 for strings of different lengths! */ int strcasecmp (const char *s1, const char *s2) { if (s1 == s2) return 0; /* Be careful not to look at the entire extent of s1 or s2 until needed. This is useful because when two strings differ, the difference is most often already in the very few first characters. */ #if HAVE_MBRTOWC if (MB_CUR_MAX > 1) { mbui_iterator_t iter1; mbui_iterator_t iter2; mbui_init (iter1, s1); mbui_init (iter2, s2); while (mbui_avail (iter1) && mbui_avail (iter2)) { int cmp = mb_casecmp (mbui_cur (iter1), mbui_cur (iter2)); if (cmp != 0) return cmp; mbui_advance (iter1); mbui_advance (iter2); } if (mbui_avail (iter1)) /* s2 terminated before s1. */ return 1; if (mbui_avail (iter2)) /* s1 terminated before s2. */ return -1; return 0; } else #endif { const unsigned char *p1 = (const unsigned char *) s1; const unsigned char *p2 = (const unsigned char *) s2; unsigned char c1, c2; do { c1 = TOLOWER (*p1); c2 = TOLOWER (*p2); if (c1 == '\0') break; ++p1; ++p2; } while (c1 == c2); if (UCHAR_MAX <= INT_MAX) return c1 - c2; else /* On machines where 'char' and 'int' are types of the same size, the difference of two 'unsigned char' values - including the sign bit - doesn't fit in an 'int'. */ return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); } } blame-1.3.1/lib/time_r.c0000644000076400007640000000241310527555560011730 00000000000000/* Reentrant time functions like localtime_r. Copyright (C) 2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert. */ #include #include "time_r.h" #include static struct tm * copy_tm_result (struct tm *dest, struct tm const *src) { if (! src) return 0; *dest = *src; return dest; } struct tm * gmtime_r (time_t const * restrict t, struct tm * restrict tp) { return copy_tm_result (tp, gmtime (t)); } struct tm * localtime_r (time_t const * restrict t, struct tm * restrict tp) { return copy_tm_result (tp, localtime (t)); } blame-1.3.1/lib/vsnprintf.h0000644000076400007640000000221310241344124012466 00000000000000/* Formatted output to strings. Copyright (C) 2004 Free Software Foundation, Inc. Written by Simon Josefsson and Yoann Vandoorselaere . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef VSNPRINTF_H #define VSNPRINTF_H #include /* Get vsnprintf declaration, if available. */ #include #if defined HAVE_DECL_VSNPRINTF && !HAVE_DECL_VSNPRINTF int vsnprintf (char *str, size_t size, const char *format, va_list args); #endif #endif /* VSNPRINTF_H */ blame-1.3.1/lib/progname.h0000644000076400007640000000354410527555557012302 00000000000000/* Program name management. Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc. Written by Bruno Haible , 2001. 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PROGNAME_H #define _PROGNAME_H /* Programs using this file should do the following in main(): set_program_name (argv[0]); */ #ifdef __cplusplus extern "C" { #endif /* String containing name the program is called with. */ extern const char *program_name; /* Set program_name, based on argv[0]. */ extern void set_program_name (const char *argv0); #if ENABLE_RELOCATABLE /* Set program_name, based on argv[0], and original installation prefix and directory, for relocatability. */ extern void set_program_name_and_installdir (const char *argv0, const char *orig_installprefix, const char *orig_installdir); #undef set_program_name #define set_program_name(ARG0) \ set_program_name_and_installdir (ARG0, INSTALLPREFIX, INSTALLDIR) /* Return the full pathname of the current executable, based on the earlier call to set_program_name_and_installdir. Return NULL if unknown. */ extern char *get_full_program_name (void); #endif #ifdef __cplusplus } #endif #endif /* _PROGNAME_H */ blame-1.3.1/lib/getopt1.c0000644000076400007640000000762310527555557012052 00000000000000/* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef _LIBC # include #else # include # include "getopt.h" #endif #include "getopt_int.h" #include /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (int argc, char *__getopt_argv_const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal (argc, (char **) argv, options, long_options, opt_index, 0, 0); } int _getopt_long_r (int argc, char **argv, const char *options, const struct option *long_options, int *opt_index, struct _getopt_data *d) { return _getopt_internal_r (argc, argv, options, long_options, opt_index, 0, 0, d); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (int argc, char *__getopt_argv_const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal (argc, (char **) argv, options, long_options, opt_index, 1, 0); } int _getopt_long_only_r (int argc, char **argv, const char *options, const struct option *long_options, int *opt_index, struct _getopt_data *d) { return _getopt_internal_r (argc, argv, options, long_options, opt_index, 1, 0, d); } #ifdef TEST #include int main (int argc, char **argv) { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ blame-1.3.1/lib/dirname.c0000644000076400007640000000573510527555557012110 00000000000000/* dirname.c -- return all but the last element in a file name Copyright (C) 1990, 1998, 2000, 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "dirname.h" #include #include "xalloc.h" /* Return the length of the prefix of FILE that will be used by dir_name. If FILE is in the working directory, this returns zero even though `dir_name (FILE)' will return ".". Works properly even if there are trailing slashes (by effectively ignoring them). */ size_t dir_len (char const *file) { size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file); size_t length; /* Advance prefix_length beyond important leading slashes. */ prefix_length += (prefix_length != 0 ? (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE && ISSLASH (file[prefix_length])) : (ISSLASH (file[0]) ? ((DOUBLE_SLASH_IS_DISTINCT_ROOT && ISSLASH (file[1]) && ! ISSLASH (file[2]) ? 2 : 1)) : 0)); /* Strip the basename and any redundant slashes before it. */ for (length = last_component (file) - file; prefix_length < length; length--) if (! ISSLASH (file[length - 1])) break; return length; } /* In general, we can't use the builtin `dirname' function if available, since it has different meanings in different environments. In some environments the builtin `dirname' modifies its argument. Return the leading directories part of FILE, allocated with xmalloc. Works properly even if there are trailing slashes (by effectively ignoring them). Unlike POSIX dirname(), FILE cannot be NULL. If lstat (FILE) would succeed, then { chdir (dir_name (FILE)); lstat (base_name (FILE)); } will access the same file. Likewise, if the sequence { chdir (dir_name (FILE)); rename (base_name (FILE), "foo"); } succeeds, you have renamed FILE to "foo" in the same directory FILE was in. */ char * dir_name (char const *file) { size_t length = dir_len (file); bool append_dot = (length == 0 || (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE && length == FILE_SYSTEM_PREFIX_LEN (file) && file[2] != '\0' && ! ISSLASH (file[2]))); char *dir = xmalloc (length + append_dot + 1); memcpy (dir, file, length); if (append_dot) dir[length++] = '.'; dir[length] = '\0'; return dir; } blame-1.3.1/lib/filenamecat.c0000644000076400007640000000727710527555557012744 00000000000000/* Concatenate two arbitrary file names. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Jim Meyering. */ #include /* Specification. */ #include "filenamecat.h" #include #include "dirname.h" #include "xalloc.h" #if ! HAVE_MEMPCPY && ! defined mempcpy # define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N))) #endif /* Return the longest suffix of F that is a relative file name. If it has no such suffix, return the empty string. */ static char const * longest_relative_suffix (char const *f) { for (f += FILE_SYSTEM_PREFIX_LEN (f); ISSLASH (*f); f++) continue; return f; } /* Concatenate two file name components, DIR and ABASE, in newly-allocated storage and return the result. The resulting file name F is such that the commands "ls F" and "(cd DIR; ls BASE)" refer to the same file, where BASE is ABASE with any file system prefixes and leading separators removed. Arrange for a directory separator if necessary between DIR and BASE in the result, removing any redundant separators. In any case, if BASE_IN_RESULT is non-NULL, set *BASE_IN_RESULT to point to the copy of ABASE in the returned concatenation. However, if ABASE begins with more than one slash, set *BASE_IN_RESULT to point to the sole corresponding slash that is copied into the result buffer. Report an error if memory is exhausted. */ char * file_name_concat (char const *dir, char const *abase, char **base_in_result) { char const *dirbase = last_component (dir); size_t dirbaselen = base_len (dirbase); size_t dirlen = dirbase - dir + dirbaselen; size_t needs_separator = (dirbaselen && ! ISSLASH (dirbase[dirbaselen - 1])); char const *base = longest_relative_suffix (abase); size_t baselen = strlen (base); char *p_concat = xmalloc (dirlen + needs_separator + baselen + 1); char *p; p = mempcpy (p_concat, dir, dirlen); *p = DIRECTORY_SEPARATOR; p += needs_separator; if (base_in_result) *base_in_result = p - IS_ABSOLUTE_FILE_NAME (abase); p = mempcpy (p, base, baselen); *p = '\0'; return p_concat; } #ifdef TEST_FILE_NAME_CONCAT # include # include int main () { static char const *const tests[][3] = { {"a", "b", "a/b"}, {"a/", "b", "a/b"}, {"a/", "/b", "a/b"}, {"a", "/b", "a/b"}, {"/", "b", "/b"}, {"/", "/b", "/b"}, {"/", "/", "/"}, {"a", "/", "a/"}, /* this might deserve a diagnostic */ {"/a", "/", "/a/"}, /* this might deserve a diagnostic */ {"a", "//b", "a/b"}, }; size_t i; bool fail = false; for (i = 0; i < sizeof tests / sizeof tests[0]; i++) { char *base_in_result; char const *const *t = tests[i]; char *res = file_name_concat (t[0], t[1], &base_in_result); if (strcmp (res, t[2]) != 0) { printf ("got %s, expected %s\n", res, t[2]); fail = true; } } exit (fail ? EXIT_FAILURE : EXIT_SUCCESS); } #endif blame-1.3.1/lib/time_r.h0000644000076400007640000000350410527555560011737 00000000000000/* Reentrant time functions like localtime_r. Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert. */ #ifndef _TIME_R_H #define _TIME_R_H /* Include first, since it may declare these functions with signatures that disagree with POSIX, and we don't want to rename those declarations. */ #include #if !HAVE_TIME_R_POSIX /* Don't bother with asctime_r and ctime_r, since these functions are not safe (like asctime and ctime, they can overrun their 26-byte output buffers when given outlandish struct tm values), and we don't want to encourage applications to use unsafe functions. Use strftime or even sprintf instead. */ # undef gmtime_r # undef localtime_r # define gmtime_r rpl_gmtime_r # define localtime_r rpl_localtime_r /* See the POSIX:2001 specification . */ struct tm *gmtime_r (time_t const * restrict, struct tm * restrict); /* See the POSIX:2001 specification . */ struct tm *localtime_r (time_t const * restrict, struct tm * restrict); #endif #endif blame-1.3.1/lib/malloc.c0000644000076400007640000000207410527555557011731 00000000000000/* malloc() function that is glibc compatible. Copyright (C) 1997, 1998, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* written by Jim Meyering */ #include #undef malloc #include /* Allocate an N-byte block of memory from the heap. If N is zero, allocate a 1-byte block. */ void * rpl_malloc (size_t n) { if (n == 0) n = 1; return malloc (n); } blame-1.3.1/lib/xgetcwd.c0000644000076400007640000000234210527555560012117 00000000000000/* xgetcwd.c -- return current directory with unlimited length Copyright (C) 2001, 2003, 2004, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Jim Meyering. */ #include #include "xgetcwd.h" #include #include "getcwd.h" #include "xalloc.h" /* Return the current directory, newly allocated. Upon an out-of-memory error, call xalloc_die. Upon any other type of error, return NULL. */ char * xgetcwd (void) { char *cwd = getcwd (NULL, 0); if (! cwd && errno == ENOMEM) xalloc_die (); return cwd; } blame-1.3.1/lib/strnlen1.h0000644000076400007640000000234010527555560012223 00000000000000/* Find the length of STRING + 1, but scan at most MAXLEN bytes. Copyright (C) 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _STRNLEN1_H #define _STRNLEN1_H #include #ifdef __cplusplus extern "C" { #endif /* Find the length of STRING + 1, but scan at most MAXLEN bytes. If no '\0' terminator is found in that many characters, return MAXLEN. */ /* This is the same as strnlen (string, maxlen - 1) + 1. */ extern size_t strnlen1 (const char *string, size_t maxlen); #ifdef __cplusplus } #endif #endif /* _STRNLEN1_H */ blame-1.3.1/lib/strstr.c0000644000076400007640000000641610527555560012021 00000000000000/* Searching in a string. Copyright (C) 2005-2006 Free Software Foundation, Inc. Written by Bruno Haible , 2005. 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Specification. */ #include "strstr.h" #include /* for NULL */ #if HAVE_MBRTOWC # include "mbuiter.h" #endif /* Find the first occurrence of NEEDLE in HAYSTACK. */ char * strstr (const char *haystack, const char *needle) { /* Be careful not to look at the entire extent of haystack or needle until needed. This is useful because of these two cases: - haystack may be very long, and a match of needle found early, - needle may be very long, and not even a short initial segment of needle may be found in haystack. */ #if HAVE_MBRTOWC if (MB_CUR_MAX > 1) { mbui_iterator_t iter_needle; mbui_init (iter_needle, needle); if (mbui_avail (iter_needle)) { mbui_iterator_t iter_haystack; mbui_init (iter_haystack, haystack); for (;; mbui_advance (iter_haystack)) { if (!mbui_avail (iter_haystack)) /* No match. */ return NULL; if (mb_equal (mbui_cur (iter_haystack), mbui_cur (iter_needle))) /* The first character matches. */ { mbui_iterator_t rhaystack; mbui_iterator_t rneedle; memcpy (&rhaystack, &iter_haystack, sizeof (mbui_iterator_t)); mbui_advance (rhaystack); mbui_init (rneedle, needle); if (!mbui_avail (rneedle)) abort (); mbui_advance (rneedle); for (;; mbui_advance (rhaystack), mbui_advance (rneedle)) { if (!mbui_avail (rneedle)) /* Found a match. */ return (char *) mbui_cur_ptr (iter_haystack); if (!mbui_avail (rhaystack)) /* No match. */ return NULL; if (!mb_equal (mbui_cur (rhaystack), mbui_cur (rneedle))) /* Nothing in this round. */ break; } } } } else return (char *) haystack; } else #endif { if (*needle != '\0') { /* Speed up the following searches of needle by caching its first character. */ char b = *needle++; for (;; haystack++) { if (*haystack == '\0') /* No match. */ return NULL; if (*haystack == b) /* The first character matches. */ { const char *rhaystack = haystack + 1; const char *rneedle = needle; for (;; rhaystack++, rneedle++) { if (*rneedle == '\0') /* Found a match. */ return (char *) haystack; if (*rhaystack == '\0') /* No match. */ return NULL; if (*rhaystack != *rneedle) /* Nothing in this round. */ break; } } } } else return (char *) haystack; } } blame-1.3.1/lib/obstack.h0000644000076400007640000004660010527555557012120 00000000000000/* obstack.h - object stack macros Copyright (C) 1988-1994,1996-1999,2003,2004,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Summary: All the apparent functions defined here are macros. The idea is that you would use these pre-tested macros to solve a very specific set of problems, and they would run fast. Caution: no side-effects in arguments please!! They may be evaluated MANY times!! These macros operate a stack of objects. Each object starts life small, and may grow to maturity. (Consider building a word syllable by syllable.) An object can move while it is growing. Once it has been "finished" it never changes address again. So the "top of the stack" is typically an immature growing object, while the rest of the stack is of mature, fixed size and fixed address objects. These routines grab large chunks of memory, using a function you supply, called `obstack_chunk_alloc'. On occasion, they free chunks, by calling `obstack_chunk_free'. You must define them and declare them before using any obstack macros. Each independent stack is represented by a `struct obstack'. Each of the obstack macros expects a pointer to such a structure as the first argument. One motivation for this package is the problem of growing char strings in symbol tables. Unless you are "fascist pig with a read-only mind" --Gosper's immortal quote from HAKMEM item 154, out of context--you would not like to put any arbitrary upper limit on the length of your symbols. In practice this often means you will build many short symbols and a few long symbols. At the time you are reading a symbol you don't know how long it is. One traditional method is to read a symbol into a buffer, realloc()ating the buffer every time you try to read a symbol that is longer than the buffer. This is beaut, but you still will want to copy the symbol from the buffer to a more permanent symbol-table entry say about half the time. With obstacks, you can work differently. Use one obstack for all symbol names. As you read a symbol, grow the name in the obstack gradually. When the name is complete, finalize it. Then, if the symbol exists already, free the newly read name. The way we do this is to take a large chunk, allocating memory from low addresses. When you want to build a symbol in the chunk you just add chars above the current "high water mark" in the chunk. When you have finished adding chars, because you got to the end of the symbol, you know how long the chars are, and you can create a new object. Mostly the chars will not burst over the highest address of the chunk, because you would typically expect a chunk to be (say) 100 times as long as an average object. In case that isn't clear, when we have enough chars to make up the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed) so we just point to it where it lies. No moving of chars is needed and this is the second win: potentially long strings need never be explicitly shuffled. Once an object is formed, it does not change its address during its lifetime. When the chars burst over a chunk boundary, we allocate a larger chunk, and then copy the partly formed object from the end of the old chunk to the beginning of the new larger chunk. We then carry on accreting characters to the end of the object as we normally would. A special macro is provided to add a single char at a time to a growing object. This allows the use of register variables, which break the ordinary 'growth' macro. Summary: We allocate large chunks. We carve out one object at a time from the current chunk. Once carved, an object never moves. We are free to append data of any size to the currently growing object. Exactly one object is growing in an obstack at any one time. You can run one obstack per control block. You may have as many control blocks as you dare. Because of the way we do it, you can `unwind' an obstack back to a previous state. (You may remove objects much as you would with a stack.) */ /* Don't do the contents of this file more than once. */ #ifndef _OBSTACK_H #define _OBSTACK_H 1 #ifdef __cplusplus extern "C" { #endif /* We need the type of a pointer subtraction. If __PTRDIFF_TYPE__ is defined, as with GNU C, use that; that way we don't pollute the namespace with 's symbols. Otherwise, include and use ptrdiff_t. */ #ifdef __PTRDIFF_TYPE__ # define PTR_INT_TYPE __PTRDIFF_TYPE__ #else # include # define PTR_INT_TYPE ptrdiff_t #endif /* If B is the base of an object addressed by P, return the result of aligning P to the next multiple of A + 1. B and P must be of type char *. A + 1 must be a power of 2. */ #define __BPTR_ALIGN(B, P, A) ((B) + (((P) - (B) + (A)) & ~(A))) /* Similiar to _BPTR_ALIGN (B, P, A), except optimize the common case where pointers can be converted to integers, aligned as integers, and converted back again. If PTR_INT_TYPE is narrower than a pointer (e.g., the AS/400), play it safe and compute the alignment relative to B. Otherwise, use the faster strategy of computing the alignment relative to 0. */ #define __PTR_ALIGN(B, P, A) \ __BPTR_ALIGN (sizeof (PTR_INT_TYPE) < sizeof (void *) ? (B) : (char *) 0, \ P, A) #include struct _obstack_chunk /* Lives at front of each chunk. */ { char *limit; /* 1 past end of this chunk */ struct _obstack_chunk *prev; /* address of prior chunk or NULL */ char contents[4]; /* objects begin here */ }; struct obstack /* control current object in current chunk */ { long chunk_size; /* preferred size to allocate chunks in */ struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */ char *object_base; /* address of object we are building */ char *next_free; /* where to add next char to current object */ char *chunk_limit; /* address of char after current chunk */ union { PTR_INT_TYPE tempint; void *tempptr; } temp; /* Temporary for some macros. */ int alignment_mask; /* Mask of alignment for each object. */ /* These prototypes vary based on `use_extra_arg', and we use casts to the prototypeless function type in all assignments, but having prototypes here quiets -Wstrict-prototypes. */ struct _obstack_chunk *(*chunkfun) (void *, long); void (*freefun) (void *, struct _obstack_chunk *); void *extra_arg; /* first arg for chunk alloc/dealloc funcs */ unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */ unsigned maybe_empty_object:1;/* There is a possibility that the current chunk contains a zero-length object. This prevents freeing the chunk if we allocate a bigger chunk to replace it. */ unsigned alloc_failed:1; /* No longer used, as we now call the failed handler on error, but retained for binary compatibility. */ }; /* Declare the external functions we use; they are in obstack.c. */ extern void _obstack_newchunk (struct obstack *, int); extern int _obstack_begin (struct obstack *, int, int, void *(*) (long), void (*) (void *)); extern int _obstack_begin_1 (struct obstack *, int, int, void *(*) (void *, long), void (*) (void *, void *), void *); extern int _obstack_memory_used (struct obstack *); /* The default name of the function for freeing a chunk is 'obstack_free', but gnulib users can override this by defining '__obstack_free'. */ #ifndef __obstack_free # define __obstack_free obstack_free #endif extern void __obstack_free (struct obstack *obstack, void *block); /* Error handler called when `obstack_chunk_alloc' failed to allocate more memory. This can be set to a user defined function which should either abort gracefully or use longjump - but shouldn't return. The default action is to print a message and abort. */ extern void (*obstack_alloc_failed_handler) (void); /* Exit value used when `print_and_abort' is used. */ extern int obstack_exit_failure; /* Pointer to beginning of object being allocated or to be allocated next. Note that this might not be the final address of the object because a new chunk might be needed to hold the final size. */ #define obstack_base(h) ((void *) (h)->object_base) /* Size for allocating ordinary chunks. */ #define obstack_chunk_size(h) ((h)->chunk_size) /* Pointer to next byte not yet allocated in current chunk. */ #define obstack_next_free(h) ((h)->next_free) /* Mask specifying low bits that should be clear in address of an object. */ #define obstack_alignment_mask(h) ((h)->alignment_mask) /* To prevent prototype warnings provide complete argument list. */ #define obstack_init(h) \ _obstack_begin ((h), 0, 0, \ (void *(*) (long)) obstack_chunk_alloc, \ (void (*) (void *)) obstack_chunk_free) #define obstack_begin(h, size) \ _obstack_begin ((h), (size), 0, \ (void *(*) (long)) obstack_chunk_alloc, \ (void (*) (void *)) obstack_chunk_free) #define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \ _obstack_begin ((h), (size), (alignment), \ (void *(*) (long)) (chunkfun), \ (void (*) (void *)) (freefun)) #define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \ _obstack_begin_1 ((h), (size), (alignment), \ (void *(*) (void *, long)) (chunkfun), \ (void (*) (void *, void *)) (freefun), (arg)) #define obstack_chunkfun(h, newchunkfun) \ ((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun)) #define obstack_freefun(h, newfreefun) \ ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun)) #define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar)) #define obstack_blank_fast(h,n) ((h)->next_free += (n)) #define obstack_memory_used(h) _obstack_memory_used (h) #if defined __GNUC__ && defined __STDC__ && __STDC__ /* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and does not implement __extension__. But that compiler doesn't define __GNUC_MINOR__. */ # if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__) # define __extension__ # endif /* For GNU C, if not -traditional, we can define these macros to compute all args only once without using a global variable. Also, we can avoid using the `temp' slot, to make faster code. */ # define obstack_object_size(OBSTACK) \ __extension__ \ ({ struct obstack const *__o = (OBSTACK); \ (unsigned) (__o->next_free - __o->object_base); }) # define obstack_room(OBSTACK) \ __extension__ \ ({ struct obstack const *__o = (OBSTACK); \ (unsigned) (__o->chunk_limit - __o->next_free); }) # define obstack_make_room(OBSTACK,length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->chunk_limit - __o->next_free < __len) \ _obstack_newchunk (__o, __len); \ (void) 0; }) # define obstack_empty_p(OBSTACK) \ __extension__ \ ({ struct obstack const *__o = (OBSTACK); \ (__o->chunk->prev == 0 \ && __o->next_free == __PTR_ALIGN ((char *) __o->chunk, \ __o->chunk->contents, \ __o->alignment_mask)); }) # define obstack_grow(OBSTACK,where,length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->next_free + __len > __o->chunk_limit) \ _obstack_newchunk (__o, __len); \ memcpy (__o->next_free, where, __len); \ __o->next_free += __len; \ (void) 0; }) # define obstack_grow0(OBSTACK,where,length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->next_free + __len + 1 > __o->chunk_limit) \ _obstack_newchunk (__o, __len + 1); \ memcpy (__o->next_free, where, __len); \ __o->next_free += __len; \ *(__o->next_free)++ = 0; \ (void) 0; }) # define obstack_1grow(OBSTACK,datum) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + 1 > __o->chunk_limit) \ _obstack_newchunk (__o, 1); \ obstack_1grow_fast (__o, datum); \ (void) 0; }) /* These assume that the obstack alignment is good enough for pointers or ints, and that the data added so far to the current object shares that much alignment. */ # define obstack_ptr_grow(OBSTACK,datum) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + sizeof (void *) > __o->chunk_limit) \ _obstack_newchunk (__o, sizeof (void *)); \ obstack_ptr_grow_fast (__o, datum); }) \ # define obstack_int_grow(OBSTACK,datum) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + sizeof (int) > __o->chunk_limit) \ _obstack_newchunk (__o, sizeof (int)); \ obstack_int_grow_fast (__o, datum); }) # define obstack_ptr_grow_fast(OBSTACK,aptr) \ __extension__ \ ({ struct obstack *__o1 = (OBSTACK); \ *(const void **) __o1->next_free = (aptr); \ __o1->next_free += sizeof (const void *); \ (void) 0; }) # define obstack_int_grow_fast(OBSTACK,aint) \ __extension__ \ ({ struct obstack *__o1 = (OBSTACK); \ *(int *) __o1->next_free = (aint); \ __o1->next_free += sizeof (int); \ (void) 0; }) # define obstack_blank(OBSTACK,length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->chunk_limit - __o->next_free < __len) \ _obstack_newchunk (__o, __len); \ obstack_blank_fast (__o, __len); \ (void) 0; }) # define obstack_alloc(OBSTACK,length) \ __extension__ \ ({ struct obstack *__h = (OBSTACK); \ obstack_blank (__h, (length)); \ obstack_finish (__h); }) # define obstack_copy(OBSTACK,where,length) \ __extension__ \ ({ struct obstack *__h = (OBSTACK); \ obstack_grow (__h, (where), (length)); \ obstack_finish (__h); }) # define obstack_copy0(OBSTACK,where,length) \ __extension__ \ ({ struct obstack *__h = (OBSTACK); \ obstack_grow0 (__h, (where), (length)); \ obstack_finish (__h); }) /* The local variable is named __o1 to avoid a name conflict when obstack_blank is called. */ # define obstack_finish(OBSTACK) \ __extension__ \ ({ struct obstack *__o1 = (OBSTACK); \ void *__value = (void *) __o1->object_base; \ if (__o1->next_free == __value) \ __o1->maybe_empty_object = 1; \ __o1->next_free \ = __PTR_ALIGN (__o1->object_base, __o1->next_free, \ __o1->alignment_mask); \ if (__o1->next_free - (char *)__o1->chunk \ > __o1->chunk_limit - (char *)__o1->chunk) \ __o1->next_free = __o1->chunk_limit; \ __o1->object_base = __o1->next_free; \ __value; }) # define obstack_free(OBSTACK, OBJ) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ void *__obj = (OBJ); \ if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \ __o->next_free = __o->object_base = (char *)__obj; \ else (__obstack_free) (__o, __obj); }) #else /* not __GNUC__ or not __STDC__ */ # define obstack_object_size(h) \ (unsigned) ((h)->next_free - (h)->object_base) # define obstack_room(h) \ (unsigned) ((h)->chunk_limit - (h)->next_free) # define obstack_empty_p(h) \ ((h)->chunk->prev == 0 \ && (h)->next_free == __PTR_ALIGN ((char *) (h)->chunk, \ (h)->chunk->contents, \ (h)->alignment_mask)) /* Note that the call to _obstack_newchunk is enclosed in (..., 0) so that we can avoid having void expressions in the arms of the conditional expression. Casting the third operand to void was tried before, but some compilers won't accept it. */ # define obstack_make_room(h,length) \ ( (h)->temp.tempint = (length), \ (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0)) # define obstack_grow(h,where,length) \ ( (h)->temp.tempint = (length), \ (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \ memcpy ((h)->next_free, where, (h)->temp.tempint), \ (h)->next_free += (h)->temp.tempint) # define obstack_grow0(h,where,length) \ ( (h)->temp.tempint = (length), \ (((h)->next_free + (h)->temp.tempint + 1 > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), (h)->temp.tempint + 1), 0) : 0), \ memcpy ((h)->next_free, where, (h)->temp.tempint), \ (h)->next_free += (h)->temp.tempint, \ *((h)->next_free)++ = 0) # define obstack_1grow(h,datum) \ ( (((h)->next_free + 1 > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), 1), 0) : 0), \ obstack_1grow_fast (h, datum)) # define obstack_ptr_grow(h,datum) \ ( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \ obstack_ptr_grow_fast (h, datum)) # define obstack_int_grow(h,datum) \ ( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \ obstack_int_grow_fast (h, datum)) # define obstack_ptr_grow_fast(h,aptr) \ (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr)) # define obstack_int_grow_fast(h,aint) \ (((int *) ((h)->next_free += sizeof (int)))[-1] = (aint)) # define obstack_blank(h,length) \ ( (h)->temp.tempint = (length), \ (((h)->chunk_limit - (h)->next_free < (h)->temp.tempint) \ ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \ obstack_blank_fast (h, (h)->temp.tempint)) # define obstack_alloc(h,length) \ (obstack_blank ((h), (length)), obstack_finish ((h))) # define obstack_copy(h,where,length) \ (obstack_grow ((h), (where), (length)), obstack_finish ((h))) # define obstack_copy0(h,where,length) \ (obstack_grow0 ((h), (where), (length)), obstack_finish ((h))) # define obstack_finish(h) \ ( ((h)->next_free == (h)->object_base \ ? (((h)->maybe_empty_object = 1), 0) \ : 0), \ (h)->temp.tempptr = (h)->object_base, \ (h)->next_free \ = __PTR_ALIGN ((h)->object_base, (h)->next_free, \ (h)->alignment_mask), \ (((h)->next_free - (char *) (h)->chunk \ > (h)->chunk_limit - (char *) (h)->chunk) \ ? ((h)->next_free = (h)->chunk_limit) : 0), \ (h)->object_base = (h)->next_free, \ (h)->temp.tempptr) # define obstack_free(h,obj) \ ( (h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk, \ ((((h)->temp.tempint > 0 \ && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk)) \ ? (int) ((h)->next_free = (h)->object_base \ = (h)->temp.tempint + (char *) (h)->chunk) \ : (((__obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 0))) #endif /* not __GNUC__ or not __STDC__ */ #ifdef __cplusplus } /* C++ */ #endif #endif /* obstack.h */ blame-1.3.1/lib/argp-xinl.c0000644000076400007640000000256410337302606012347 00000000000000/* Real definitions for extern inline functions in argp.h Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #if defined _LIBC || defined HAVE_FEATURES_H # include #endif #ifndef __USE_EXTERN_INLINES # define __USE_EXTERN_INLINES 1 #endif #define ARGP_EI #undef __OPTIMIZE__ #define __OPTIMIZE__ 1 #include "argp.h" /* Add weak aliases. */ #if _LIBC - 0 && defined (weak_alias) weak_alias (__argp_usage, argp_usage) weak_alias (__option_is_short, _option_is_short) weak_alias (__option_is_end, _option_is_end) #endif blame-1.3.1/lib/progname.c0000644000076400007640000000333210527555557012270 00000000000000/* Program name management. Copyright (C) 2001-2003, 2005-2006 Free Software Foundation, Inc. Written by Bruno Haible , 2001. 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Specification. */ #undef ENABLE_RELOCATABLE /* avoid defining set_program_name as a macro */ #include "progname.h" #include /* String containing name the program is called with. To be initialized by main(). */ const char *program_name = NULL; /* Set program_name, based on argv[0]. */ void set_program_name (const char *argv0) { /* libtool creates a temporary executable whose name is sometimes prefixed with "lt-" (depends on the platform). It also makes argv[0] absolute. Remove this "/.libs/" or "/.libs/lt-" prefix here. */ const char *slash; const char *base; slash = strrchr (argv0, '/'); base = (slash != NULL ? slash + 1 : argv0); if (base - argv0 >= 7 && memcmp (base - 7, "/.libs/", 7) == 0) argv0 = base; if (strncmp (base, "lt-", 3) == 0) argv0 = base + 3; program_name = argv0; } blame-1.3.1/lib/setenv.c0000644000076400007640000001777610527555557012005 00000000000000/* Copyright (C) 1992,1995-1999,2000-2003,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !_LIBC # include #endif #include #include #ifndef __set_errno # define __set_errno(ev) ((errno) = (ev)) #endif #include #include #if _LIBC || HAVE_UNISTD_H # include #endif #if !_LIBC # include "allocsa.h" #endif #if !_LIBC # define __environ environ # ifndef HAVE_ENVIRON_DECL extern char **environ; # endif #endif #if _LIBC /* This lock protects against simultaneous modifications of `environ'. */ # include __libc_lock_define_initialized (static, envlock) # define LOCK __libc_lock_lock (envlock) # define UNLOCK __libc_lock_unlock (envlock) #else # define LOCK # define UNLOCK #endif /* In the GNU C library we must keep the namespace clean. */ #ifdef _LIBC # define setenv __setenv # define clearenv __clearenv # define tfind __tfind # define tsearch __tsearch #endif /* In the GNU C library implementation we try to be more clever and allow arbitrarily many changes of the environment given that the used values are from a small set. Outside glibc this will eat up all memory after a while. */ #if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH \ && defined __GNUC__) # define USE_TSEARCH 1 # include typedef int (*compar_fn_t) (const void *, const void *); /* This is a pointer to the root of the search tree with the known values. */ static void *known_values; # define KNOWN_VALUE(Str) \ ({ \ void *value = tfind (Str, &known_values, (compar_fn_t) strcmp); \ value != NULL ? *(char **) value : NULL; \ }) # define STORE_VALUE(Str) \ tsearch (Str, &known_values, (compar_fn_t) strcmp) #else # undef USE_TSEARCH # define KNOWN_VALUE(Str) NULL # define STORE_VALUE(Str) do { } while (0) #endif /* If this variable is not a null pointer we allocated the current environment. */ static char **last_environ; /* This function is used by `setenv' and `putenv'. The difference between the two functions is that for the former must create a new string which is then placed in the environment, while the argument of `putenv' must be used directly. This is all complicated by the fact that we try to reuse values once generated for a `setenv' call since we can never free the strings. */ int __add_to_environ (const char *name, const char *value, const char *combined, int replace) { register char **ep; register size_t size; const size_t namelen = strlen (name); const size_t vallen = value != NULL ? strlen (value) + 1 : 0; LOCK; /* We have to get the pointer now that we have the lock and not earlier since another thread might have created a new environment. */ ep = __environ; size = 0; if (ep != NULL) { for (; *ep != NULL; ++ep) if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=') break; else ++size; } if (ep == NULL || *ep == NULL) { char **new_environ; #ifdef USE_TSEARCH char *new_value; #endif /* We allocated this space; we can extend it. */ new_environ = (char **) (last_environ == NULL ? malloc ((size + 2) * sizeof (char *)) : realloc (last_environ, (size + 2) * sizeof (char *))); if (new_environ == NULL) { UNLOCK; return -1; } /* If the whole entry is given add it. */ if (combined != NULL) /* We must not add the string to the search tree since it belongs to the user. */ new_environ[size] = (char *) combined; else { /* See whether the value is already known. */ #ifdef USE_TSEARCH # ifdef _LIBC new_value = (char *) alloca (namelen + 1 + vallen); __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1), value, vallen); # else new_value = (char *) allocsa (namelen + 1 + vallen); if (new_value == NULL) { __set_errno (ENOMEM); UNLOCK; return -1; } memcpy (new_value, name, namelen); new_value[namelen] = '='; memcpy (&new_value[namelen + 1], value, vallen); # endif new_environ[size] = KNOWN_VALUE (new_value); if (new_environ[size] == NULL) #endif { new_environ[size] = (char *) malloc (namelen + 1 + vallen); if (new_environ[size] == NULL) { #if defined USE_TSEARCH && !defined _LIBC freesa (new_value); #endif __set_errno (ENOMEM); UNLOCK; return -1; } #ifdef USE_TSEARCH memcpy (new_environ[size], new_value, namelen + 1 + vallen); #else memcpy (new_environ[size], name, namelen); new_environ[size][namelen] = '='; memcpy (&new_environ[size][namelen + 1], value, vallen); #endif /* And save the value now. We cannot do this when we remove the string since then we cannot decide whether it is a user string or not. */ STORE_VALUE (new_environ[size]); } #if defined USE_TSEARCH && !defined _LIBC freesa (new_value); #endif } if (__environ != last_environ) memcpy ((char *) new_environ, (char *) __environ, size * sizeof (char *)); new_environ[size + 1] = NULL; last_environ = __environ = new_environ; } else if (replace) { char *np; /* Use the user string if given. */ if (combined != NULL) np = (char *) combined; else { #ifdef USE_TSEARCH char *new_value; # ifdef _LIBC new_value = alloca (namelen + 1 + vallen); __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1), value, vallen); # else new_value = allocsa (namelen + 1 + vallen); if (new_value == NULL) { __set_errno (ENOMEM); UNLOCK; return -1; } memcpy (new_value, name, namelen); new_value[namelen] = '='; memcpy (&new_value[namelen + 1], value, vallen); # endif np = KNOWN_VALUE (new_value); if (np == NULL) #endif { np = malloc (namelen + 1 + vallen); if (np == NULL) { #if defined USE_TSEARCH && !defined _LIBC freesa (new_value); #endif __set_errno (ENOMEM); UNLOCK; return -1; } #ifdef USE_TSEARCH memcpy (np, new_value, namelen + 1 + vallen); #else memcpy (np, name, namelen); np[namelen] = '='; memcpy (&np[namelen + 1], value, vallen); #endif /* And remember the value. */ STORE_VALUE (np); } #if defined USE_TSEARCH && !defined _LIBC freesa (new_value); #endif } *ep = np; } UNLOCK; return 0; } int setenv (const char *name, const char *value, int replace) { return __add_to_environ (name, value, NULL, replace); } /* The `clearenv' was planned to be added to POSIX.1 but probably never made it. Nevertheless the POSIX.9 standard (POSIX bindings for Fortran 77) requires this function. */ int clearenv (void) { LOCK; if (__environ == last_environ && __environ != NULL) { /* We allocated this environment so we can free it. */ free (__environ); last_environ = NULL; } /* Clear the environment pointer removes the whole environment. */ __environ = NULL; UNLOCK; return 0; } #ifdef _LIBC static void free_mem (void) { /* Remove all traces. */ clearenv (); /* Now remove the search tree. */ __tdestroy (known_values, free); known_values = NULL; } text_set_element (__libc_subfreeres, free_mem); # undef setenv # undef clearenv weak_alias (__setenv, setenv) weak_alias (__clearenv, clearenv) #endif blame-1.3.1/lib/Makefile.am0000644000076400007640000003330410527555570012345 00000000000000## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. # Copyright (C) 2004-2006 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # Reproduce by: gnulib-tool --import --dir=. --lib=libmisc --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=. --no-libtool --macro-prefix=gl alloca argp calloc canonicalize dirname error exit free getcwd getline lstat malloc memchr memcmp memcpy memmove memset mktime obstack pathmax progname realloc setenv strchrnul strdup strftime strndup strpbrk strstr strtoul tzset unlocked-io xalloc xalloc-die xreadlink AUTOMAKE_OPTIONS = 1.5 gnits noinst_LIBRARIES = libmisc.a libmisc_a_SOURCES = libmisc_a_LIBADD = $(gl_LIBOBJS) libmisc_a_DEPENDENCIES = $(gl_LIBOBJS) EXTRA_libmisc_a_SOURCES = noinst_HEADERS = EXTRA_DIST = BUILT_SOURCES = SUFFIXES = MOSTLYCLEANFILES = core *.stackdump MOSTLYCLEANDIRS = CLEANFILES = DISTCLEANFILES = MAINTAINERCLEANFILES = AM_CPPFLAGS = ## begin gnulib module alloca EXTRA_DIST += alloca.c EXTRA_libmisc_a_SOURCES += alloca.c libmisc_a_LIBADD += @ALLOCA@ libmisc_a_DEPENDENCIES += @ALLOCA@ ## end gnulib module alloca ## begin gnulib module alloca-opt BUILT_SOURCES += $(ALLOCA_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. alloca.h: alloca_.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/alloca_.h; \ } > $@-t mv -f $@-t $@ MOSTLYCLEANFILES += alloca.h alloca.h-t EXTRA_DIST += alloca_.h ## end gnulib module alloca-opt ## begin gnulib module allocsa libmisc_a_SOURCES += allocsa.h allocsa.c EXTRA_DIST += allocsa.valgrind ## end gnulib module allocsa ## begin gnulib module argp libmisc_a_SOURCES += argp.h argp-ba.c argp-eexst.c \ argp-fmtstream.c argp-fmtstream.h argp-fs-xinl.c argp-help.c \ argp-namefrob.h argp-parse.c argp-pin.c argp-pv.c argp-pvh.c \ argp-xinl.c ## end gnulib module argp ## begin gnulib module calloc EXTRA_DIST += calloc.c EXTRA_libmisc_a_SOURCES += calloc.c ## end gnulib module calloc ## begin gnulib module canonicalize EXTRA_DIST += canonicalize.c canonicalize.h pathmax.h EXTRA_libmisc_a_SOURCES += canonicalize.c ## end gnulib module canonicalize ## begin gnulib module cycle-check EXTRA_DIST += cycle-check.c cycle-check.h EXTRA_libmisc_a_SOURCES += cycle-check.c ## end gnulib module cycle-check ## begin gnulib module dev-ino EXTRA_DIST += dev-ino.h ## end gnulib module dev-ino ## begin gnulib module dirname EXTRA_DIST += basename.c dirname.c dirname.h stripslash.c EXTRA_libmisc_a_SOURCES += basename.c dirname.c stripslash.c ## end gnulib module dirname ## begin gnulib module error EXTRA_DIST += error.c error.h EXTRA_libmisc_a_SOURCES += error.c ## end gnulib module error ## begin gnulib module exit libmisc_a_SOURCES += exit.h ## end gnulib module exit ## begin gnulib module exitfail EXTRA_DIST += exitfail.c exitfail.h EXTRA_libmisc_a_SOURCES += exitfail.c ## end gnulib module exitfail ## begin gnulib module filenamecat EXTRA_DIST += filenamecat.c filenamecat.h EXTRA_libmisc_a_SOURCES += filenamecat.c ## end gnulib module filenamecat ## begin gnulib module free EXTRA_DIST += free.c EXTRA_libmisc_a_SOURCES += free.c ## end gnulib module free ## begin gnulib module getcwd EXTRA_DIST += getcwd.c getcwd.h EXTRA_libmisc_a_SOURCES += getcwd.c ## end gnulib module getcwd ## begin gnulib module getdelim EXTRA_DIST += getdelim.c getdelim.h EXTRA_libmisc_a_SOURCES += getdelim.c ## end gnulib module getdelim ## begin gnulib module getline EXTRA_DIST += getline.c getline.h EXTRA_libmisc_a_SOURCES += getline.c ## end gnulib module getline ## begin gnulib module getopt BUILT_SOURCES += $(GETOPT_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. getopt.h: getopt_.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/getopt_.h; \ } > $@-t mv -f $@-t $@ MOSTLYCLEANFILES += getopt.h getopt.h-t EXTRA_DIST += getopt.c getopt1.c getopt_.h getopt_int.h EXTRA_libmisc_a_SOURCES += getopt.c getopt1.c ## end gnulib module getopt ## begin gnulib module gettext-h libmisc_a_SOURCES += gettext.h ## end gnulib module gettext-h ## begin gnulib module gettimeofday EXTRA_DIST += gettimeofday.c EXTRA_libmisc_a_SOURCES += gettimeofday.c ## end gnulib module gettimeofday ## begin gnulib module lstat EXTRA_DIST += lstat.c lstat.h EXTRA_libmisc_a_SOURCES += lstat.c ## end gnulib module lstat ## begin gnulib module malloc EXTRA_DIST += malloc.c EXTRA_libmisc_a_SOURCES += malloc.c ## end gnulib module malloc ## begin gnulib module mbchar EXTRA_DIST += mbchar.c mbchar.h EXTRA_libmisc_a_SOURCES += mbchar.c ## end gnulib module mbchar ## begin gnulib module mbuiter libmisc_a_SOURCES += mbuiter.h ## end gnulib module mbuiter ## begin gnulib module memchr EXTRA_DIST += memchr.c EXTRA_libmisc_a_SOURCES += memchr.c ## end gnulib module memchr ## begin gnulib module memcmp EXTRA_DIST += memcmp.c EXTRA_libmisc_a_SOURCES += memcmp.c ## end gnulib module memcmp ## begin gnulib module memcpy EXTRA_DIST += memcpy.c EXTRA_libmisc_a_SOURCES += memcpy.c ## end gnulib module memcpy ## begin gnulib module memmove EXTRA_DIST += memmove.c EXTRA_libmisc_a_SOURCES += memmove.c ## end gnulib module memmove ## begin gnulib module mempcpy EXTRA_DIST += mempcpy.c mempcpy.h EXTRA_libmisc_a_SOURCES += mempcpy.c ## end gnulib module mempcpy ## begin gnulib module memset EXTRA_DIST += memset.c EXTRA_libmisc_a_SOURCES += memset.c ## end gnulib module memset ## begin gnulib module minmax libmisc_a_SOURCES += minmax.h ## end gnulib module minmax ## begin gnulib module mktime EXTRA_DIST += mktime.c EXTRA_libmisc_a_SOURCES += mktime.c ## end gnulib module mktime ## begin gnulib module obstack EXTRA_DIST += obstack.c obstack.h EXTRA_libmisc_a_SOURCES += obstack.c ## end gnulib module obstack ## begin gnulib module pathmax EXTRA_DIST += pathmax.h ## end gnulib module pathmax ## begin gnulib module progname libmisc_a_SOURCES += progname.h progname.c ## end gnulib module progname ## begin gnulib module readlink EXTRA_DIST += readlink.c EXTRA_libmisc_a_SOURCES += readlink.c ## end gnulib module readlink ## begin gnulib module realloc EXTRA_DIST += realloc.c EXTRA_libmisc_a_SOURCES += realloc.c ## end gnulib module realloc ## begin gnulib module same-inode EXTRA_DIST += same-inode.h ## end gnulib module same-inode ## begin gnulib module setenv EXTRA_DIST += setenv.c setenv.h unsetenv.c EXTRA_libmisc_a_SOURCES += setenv.c unsetenv.c ## end gnulib module setenv ## begin gnulib module size_max libmisc_a_SOURCES += size_max.h ## end gnulib module size_max ## begin gnulib module stdbool BUILT_SOURCES += $(STDBOOL_H) # We need the following in order to create when the system # doesn't have one that works. stdbool.h: stdbool_.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdbool.h stdbool.h-t EXTRA_DIST += stdbool_.h ## end gnulib module stdbool ## begin gnulib module stdint BUILT_SOURCES += $(STDINT_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. stdint.h: stdint_.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ -e 's|@''ABSOLUTE_STDINT_H''@|$(ABSOLUTE_STDINT_H)|g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -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_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ -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' \ < $(srcdir)/stdint_.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdint.h stdint.h-t EXTRA_DIST += stdint_.h ## end gnulib module stdint ## begin gnulib module strcase EXTRA_DIST += strcase.h strcasecmp.c strncasecmp.c EXTRA_libmisc_a_SOURCES += strcasecmp.c strncasecmp.c ## end gnulib module strcase ## begin gnulib module strchrnul EXTRA_DIST += strchrnul.c strchrnul.h EXTRA_libmisc_a_SOURCES += strchrnul.c ## end gnulib module strchrnul ## begin gnulib module strdup EXTRA_DIST += strdup.c strdup.h EXTRA_libmisc_a_SOURCES += strdup.c ## end gnulib module strdup ## begin gnulib module strftime EXTRA_DIST += strftime.c strftime.h EXTRA_libmisc_a_SOURCES += strftime.c ## end gnulib module strftime ## begin gnulib module strndup EXTRA_DIST += strndup.c strndup.h EXTRA_libmisc_a_SOURCES += strndup.c ## end gnulib module strndup ## begin gnulib module strnlen EXTRA_DIST += strnlen.c strnlen.h EXTRA_libmisc_a_SOURCES += strnlen.c ## end gnulib module strnlen ## begin gnulib module strnlen1 libmisc_a_SOURCES += strnlen1.h strnlen1.c ## end gnulib module strnlen1 ## begin gnulib module strpbrk EXTRA_DIST += strpbrk.c strpbrk.h EXTRA_libmisc_a_SOURCES += strpbrk.c ## end gnulib module strpbrk ## begin gnulib module strstr EXTRA_DIST += strstr.c strstr.h EXTRA_libmisc_a_SOURCES += strstr.c ## end gnulib module strstr ## begin gnulib module strtol EXTRA_DIST += strtol.c EXTRA_libmisc_a_SOURCES += strtol.c ## end gnulib module strtol ## begin gnulib module strtoul EXTRA_DIST += strtoul.c EXTRA_libmisc_a_SOURCES += strtoul.c ## end gnulib module strtoul ## begin gnulib module sys_stat BUILT_SOURCES += $(SYS_STAT_H) # We need the following in order to create when the system # has one that is incomplete. sys/stat.h: stat_.h test -d sys || mkdir sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''ABSOLUTE_SYS_STAT_H''@|$(ABSOLUTE_SYS_STAT_H)|g' \ < $(srcdir)/stat_.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t MOSTLYCLEANDIRS += sys EXTRA_DIST += stat_.h ## end gnulib module sys_stat ## begin gnulib module sysexits BUILT_SOURCES += $(SYSEXITS_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. sysexits.h: sysexit_.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ cat $(srcdir)/sysexit_.h; \ } > $@-t mv -f $@-t $@ MOSTLYCLEANFILES += sysexits.h sysexits.h-t EXTRA_DIST += sysexit_.h ## end gnulib module sysexits ## begin gnulib module time_r EXTRA_DIST += time_r.c time_r.h EXTRA_libmisc_a_SOURCES += time_r.c ## end gnulib module time_r ## begin gnulib module unistd BUILT_SOURCES += $(UNISTD_H) # We need the following in order to create an empty placeholder for # when the system doesn't have one. unistd.h: { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ echo '/* Empty placeholder for $@. */'; \ } > $@ MOSTLYCLEANFILES += unistd.h ## end gnulib module unistd ## begin gnulib module unlocked-io EXTRA_DIST += unlocked-io.h ## end gnulib module unlocked-io ## begin gnulib module vasnprintf EXTRA_DIST += asnprintf.c printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h EXTRA_libmisc_a_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c ## end gnulib module vasnprintf ## begin gnulib module vsnprintf EXTRA_DIST += vsnprintf.c vsnprintf.h EXTRA_libmisc_a_SOURCES += vsnprintf.c ## end gnulib module vsnprintf ## begin gnulib module wcwidth libmisc_a_SOURCES += wcwidth.h ## end gnulib module wcwidth ## begin gnulib module xalloc EXTRA_DIST += xalloc.h xmalloc.c EXTRA_libmisc_a_SOURCES += xmalloc.c ## end gnulib module xalloc ## begin gnulib module xalloc-die libmisc_a_SOURCES += xalloc-die.c ## end gnulib module xalloc-die ## begin gnulib module xgetcwd EXTRA_DIST += xgetcwd.c xgetcwd.h EXTRA_libmisc_a_SOURCES += xgetcwd.c ## end gnulib module xgetcwd ## begin gnulib module xreadlink EXTRA_DIST += xreadlink.c xreadlink.h EXTRA_libmisc_a_SOURCES += xreadlink.c ## end gnulib module xreadlink ## begin gnulib module xsize libmisc_a_SOURCES += xsize.h ## end gnulib module xsize ## begin gnulib module xstrndup libmisc_a_SOURCES += xstrndup.h xstrndup.c ## end gnulib module xstrndup mostlyclean-local: mostlyclean-generic @for dir in '' $(MOSTLYCLEANDIRS); do \ if test -n "$$dir" && test -d $$dir; then \ echo "rmdir $$dir"; rmdir $$dir; \ fi; \ done blame-1.3.1/lib/xalloc-die.c0000644000076400007640000000254310527555560012476 00000000000000/* Report a memory allocation failure and exit. Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "xalloc.h" #include #include "error.h" #include "exitfail.h" #include "gettext.h" #define _(msgid) gettext (msgid) void xalloc_die (void) { error (exit_failure, 0, "%s", _("memory exhausted")); /* The `noreturn' cannot be given to error, since it may return if its first argument is 0. To help compilers understand the xalloc_die does not return, call abort. Also, the abort is a safety feature if exit_failure is 0 (which shouldn't happen). */ abort (); } blame-1.3.1/lib/alloca_.h0000644000076400007640000000347610527555557012070 00000000000000/* Memory allocation on the stack. Copyright (C) 1995, 1999, 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H means there is a real alloca function. */ #ifndef _GNULIB_ALLOCA_H # define _GNULIB_ALLOCA_H /* alloca (N) returns a pointer to N bytes of memory allocated on the stack, which will last until the function returns. Use of alloca should be avoided: - inside arguments of function calls - undefined behaviour, - in inline functions - the allocation may actually last until the calling function returns, - for huge N (say, N >= 65536) - you never know how large (or small) the stack is, and when the stack cannot fulfill the memory allocation request, the program just crashes. */ #ifndef alloca # ifdef __GNUC__ # define alloca __builtin_alloca # elif defined _AIX # define alloca __alloca # elif defined _MSC_VER # include # define alloca _alloca # else # include # ifdef __cplusplus extern "C" # endif void *alloca (size_t); # endif #endif #endif /* _GNULIB_ALLOCA_H */ blame-1.3.1/lib/filenamecat.h0000664000076400007640000000165110247667341012733 00000000000000/* Concatenate two arbitrary file names. Copyright (C) 1996, 1997, 2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Jim Meyering. */ char *file_name_concat (char const *dir, char const *base, char **base_in_result); blame-1.3.1/lib/basename.c0000644000076400007640000000745410527555557012244 00000000000000/* basename.c -- return the last element in a file name Copyright (C) 1990, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "dirname.h" #include #include "xalloc.h" #include "xstrndup.h" /* Return the address of the last file name component of NAME. If NAME has no relative file name components because it is a file system root, return the empty string. */ char * last_component (char const *name) { char const *base = name + FILE_SYSTEM_PREFIX_LEN (name); char const *p; bool saw_slash = false; while (ISSLASH (*base)) base++; for (p = base; *p; p++) { if (ISSLASH (*p)) saw_slash = true; else if (saw_slash) { base = p; saw_slash = false; } } return (char *) base; } /* In general, we can't use the builtin `basename' function if available, since it has different meanings in different environments. In some environments the builtin `basename' modifies its argument. Return the last file name component of NAME, allocated with xmalloc. On systems with drive letters, a leading "./" distinguishes relative names that would otherwise look like a drive letter. Unlike POSIX basename(), NAME cannot be NULL, base_name("") returns "", and the first trailing slash is not stripped. If lstat (NAME) would succeed, then { chdir (dir_name (NAME)); lstat (base_name (NAME)); } will access the same file. Likewise, if the sequence { chdir (dir_name (NAME)); rename (base_name (NAME), "foo"); } succeeds, you have renamed NAME to "foo" in the same directory NAME was in. */ char * base_name (char const *name) { char const *base = last_component (name); size_t length; /* If there is no last component, then name is a file system root or the empty string. */ if (! *base) return xstrndup (name, base_len (name)); /* Collapse a sequence of trailing slashes into one. */ length = base_len (base); if (ISSLASH (base[length])) length++; /* On systems with drive letters, `a/b:c' must return `./b:c' rather than `b:c' to avoid confusion with a drive letter. On systems with pure POSIX semantics, this is not an issue. */ if (FILE_SYSTEM_PREFIX_LEN (base)) { char *p = xmalloc (length + 3); p[0] = '.'; p[1] = '/'; memcpy (p + 2, base, length); p[length + 2] = '\0'; return p; } /* Finally, copy the basename. */ return xstrndup (base, length); } /* Return the length of the basename NAME. Typically NAME is the value returned by base_name or last_component. Act like strlen (NAME), except omit all trailing slashes. */ size_t base_len (char const *name) { size_t len; size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name); for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--) continue; if (DOUBLE_SLASH_IS_DISTINCT_ROOT && len == 1 && ISSLASH (name[0]) && ISSLASH (name[1]) && ! name[2]) return 2; if (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE && prefix_len && len == prefix_len && ISSLASH (name[prefix_len])) return prefix_len + 1; return len; } blame-1.3.1/lib/readlink.c0000644000076400007640000000306010527555557012247 00000000000000/* Stub for readlink(). Copyright (C) 2003-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #if !HAVE_READLINK /* readlink() substitute for systems that don't have a readlink() function, such as DJGPP 2.03 and mingw32. */ /* The official POSIX return type of readlink() is ssize_t, but since here we have no declaration in a public header file, we use 'int' as return type. */ int readlink (const char *path, char *buf, size_t bufsize) { struct stat statbuf; /* In general we should use lstat() here, not stat(). But on platforms without symbolic links lstat() - if it exists - would be equivalent to stat(), therefore we can use stat(). This saves us a configure check. */ if (stat (path, &statbuf) >= 0) errno = EINVAL; return -1; } #endif blame-1.3.1/lib/lstat.h0000664000076400007640000000170010257017120011566 00000000000000/* Retrieving information about files. Copyright (C) 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #if !LSTAT_FOLLOWS_SLASHED_SYMLINK extern int rpl_lstat (const char *name, struct stat *buf); # undef lstat # define lstat rpl_lstat #endif blame-1.3.1/lib/wcwidth.h0000644000076400007640000000377710527555557012153 00000000000000/* Determine the number of screen columns needed for a character. Copyright (C) 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _gl_WCWIDTH_H #define _gl_WCWIDTH_H #if HAVE_WCHAR_T /* Get wcwidth if available, along with wchar_t. */ # if HAVE_WCHAR_H /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.1 has a bug: and must be included before . */ # include # include # include # endif /* Get iswprint. */ # if HAVE_WCTYPE_H # include # endif # if !defined iswprint && !HAVE_ISWPRINT static inline int # if HAVE_WINT_T iswprint (wint_t wc) # else iswprint (int wc) # endif { return (wc >= 0 && wc < 128 ? wc >= ' ' && wc <= '~' : 1); } # define iswprint iswprint # endif # ifndef HAVE_DECL_WCWIDTH "this configure-time declaration test was not run" # endif # ifndef wcwidth # if !HAVE_WCWIDTH /* wcwidth doesn't exist, so assume all printable characters have width 1. */ static inline int wcwidth (wchar_t wc) { return wc == 0 ? 0 : iswprint (wc) ? 1 : -1; } # elif !HAVE_DECL_WCWIDTH /* wcwidth exists but is not declared. */ extern # ifdef __cplusplus "C" # endif int wcwidth (int /* actually wchar_t */); # endif # endif #endif /* HAVE_WCHAR_H */ #endif /* _gl_WCWIDTH_H */ blame-1.3.1/lib/printf-parse.h0000644000076400007640000000416010241344120013046 00000000000000/* Parse printf format string. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PRINTF_PARSE_H #define _PRINTF_PARSE_H #include "printf-args.h" /* Flags */ #define FLAG_GROUP 1 /* ' flag */ #define FLAG_LEFT 2 /* - flag */ #define FLAG_SHOWSIGN 4 /* + flag */ #define FLAG_SPACE 8 /* space flag */ #define FLAG_ALT 16 /* # flag */ #define FLAG_ZERO 32 /* arg_index value indicating that no argument is consumed. */ #define ARG_NONE (~(size_t)0) /* A parsed directive. */ typedef struct { const char* dir_start; const char* dir_end; int flags; const char* width_start; const char* width_end; size_t width_arg_index; const char* precision_start; const char* precision_end; size_t precision_arg_index; char conversion; /* d i o u x X f e E g G c s p n U % but not C S */ size_t arg_index; } char_directive; /* A parsed format string. */ typedef struct { size_t count; char_directive *dir; size_t max_width_length; size_t max_precision_length; } char_directives; /* Parses the format string. Fills in the number N of directives, and fills in directives[0], ..., directives[N-1], and sets directives[N].dir_start to the end of the format string. Also fills in the arg_type fields of the arguments and the needed count of arguments. */ #ifdef STATIC STATIC #else extern #endif int printf_parse (const char *format, char_directives *d, arguments *a); #endif /* _PRINTF_PARSE_H */ blame-1.3.1/lib/realloc.c0000644000076400007640000000245110527555557012102 00000000000000/* realloc() function that is glibc compatible. Copyright (C) 1997, 2003, 2004, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* written by Jim Meyering */ #include #undef realloc #include /* Change the size of an allocated block of memory P to N bytes, with error checking. If N is zero, change it to 1. If P is NULL, use malloc. */ void * rpl_realloc (void *p, size_t n) { if (n == 0) { n = 1; /* In theory realloc might fail, so don't rely on it to free. */ free (p); p = NULL; } if (p == NULL) return malloc (n); return realloc (p, n); } blame-1.3.1/lib/strnlen.c0000644000076400007640000000226410527555560012142 00000000000000/* Find the length of STRING, but scan at most MAXLEN characters. Copyright (C) 2005, 2006 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "strnlen.h" /* Find the length of STRING, but scan at most MAXLEN characters. If no '\0' terminator is found in that many characters, return MAXLEN. */ size_t strnlen (const char *string, size_t maxlen) { const char *end = memchr (string, '\0', maxlen); return end ? (size_t) (end - string) : maxlen; } blame-1.3.1/lib/stdint_.h0000644000076400007640000003265210527555557012140 00000000000000/* Copyright (C) 2001-2002, 2004-2006 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 General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GL_STDINT_H #define _GL_STDINT_H /* * ISO C 99 for platforms that lack it. * */ /* Get those types that are already defined in other system include files, so that we can "#define int8_t signed char" below without worrying about a later system include file containing a "typedef signed char int8_t;" that will get messed up by our macro. Our macros should all be consistent with the system versions, except for the "fast" types and macros, which we recommend against using in public interfaces due to compiler differences. */ #if @HAVE_STDINT_H@ # if defined __sgi && ! defined __c99 /* Bypass IRIX's if in C89 mode, since it merely annoys users with "This header file is to be used only for c99 mode compilations" diagnostics. */ # define __STDINT_H__ # endif /* Other systems may have an incomplete or buggy . Include it before , since any "#include " in would reinclude us, skipping our contents because _GL_STDINT_H is defined. */ # include @ABSOLUTE_STDINT_H@ #endif /* defines some of the stdint.h types as well, on glibc, IRIX 6.5, and OpenBSD 3.8 (via ). AIX 5.2 isn't needed and causes troubles. MacOS X 10.4.6 includes (which is us), but relies on the system definitions, so include after @ABSOLUTE_STDINT_H@. */ #if @HAVE_SYS_TYPES_H@ && ! defined _AIX # include #endif /* Get LONG_MIN, LONG_MAX, ULONG_MAX. */ #include #if @HAVE_INTTYPES_H@ /* In OpenBSD 3.8, includes , which defines int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. also defines intptr_t and uintptr_t. */ # define _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H # include # undef _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H #elif @HAVE_SYS_INTTYPES_H@ /* Solaris 7 has the types except the *_fast*_t types, and the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ # include #endif #if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ /* Linux libc4 >= 4.6.7 and libc5 have a that defines int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is included by . */ # include #endif #if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS /* Get WCHAR_MIN, WCHAR_MAX. */ # if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) /* BSD/OS 4.1 has a bug: and must be included before . */ # include # include # include # endif #endif /* Minimum and maximum values for a integer type under the usual assumption. Return an unspecified value if BITS == 0, adding a check to pacify picky compilers. */ #define _STDINT_MIN(signed, bits, zero) \ ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero)) #define _STDINT_MAX(signed, bits, zero) \ ((signed) \ ? ~ _STDINT_MIN (signed, bits, zero) \ : ((((zero) + 1) << ((bits) ? (bits) - 1 : 0)) - 1) * 2 + 1) /* 7.18.1.1. Exact-width integer types */ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. */ #undef int8_t #undef uint8_t #define int8_t signed char #define uint8_t unsigned char #undef int16_t #undef uint16_t #define int16_t short int #define uint16_t unsigned short int #undef int32_t #undef uint32_t #define int32_t int #define uint32_t unsigned int #undef int64_t #if LONG_MAX >> 31 >> 31 == 1 # define int64_t long int #elif defined _MSC_VER # define int64_t __int64 #elif @HAVE_LONG_LONG_INT@ # define int64_t long long int #endif #undef uint64_t #if ULONG_MAX >> 31 >> 31 >> 1 == 1 # define uint64_t unsigned long int #elif defined _MSC_VER # define uint64_t unsigned __int64 #elif @HAVE_UNSIGNED_LONG_LONG_INT@ # define uint64_t unsigned long long int #endif /* Avoid collision with Solaris 2.5.1 etc. */ #define _UINT8_T #define _UINT32_T #define _UINT64_T /* 7.18.1.2. Minimum-width integer types */ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types are the same as the corresponding N_t types. */ #undef int_least8_t #undef uint_least8_t #undef int_least16_t #undef uint_least16_t #undef int_least32_t #undef uint_least32_t #undef int_least64_t #undef uint_least64_t #define int_least8_t int8_t #define uint_least8_t uint8_t #define int_least16_t int16_t #define uint_least16_t uint16_t #define int_least32_t int32_t #define uint_least32_t uint32_t #ifdef int64_t # define int_least64_t int64_t #endif #ifdef uint64_t # define uint_least64_t uint64_t #endif /* 7.18.1.3. Fastest minimum-width integer types */ /* Note: Other substitutes may define these types differently. It is not recommended to use these types in public header files. */ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types are taken from the same list of types. Assume that 'long int' is fast enough for all narrower integers. */ #undef int_fast8_t #undef uint_fast8_t #undef int_fast16_t #undef uint_fast16_t #undef int_fast32_t #undef uint_fast32_t #undef int_fast64_t #undef uint_fast64_t #define int_fast8_t long int #define uint_fast8_t unsigned int_fast8_t #define int_fast16_t long int #define uint_fast16_t unsigned int_fast16_t #define int_fast32_t long int #define uint_fast32_t unsigned int_fast32_t #ifdef int64_t # define int_fast64_t int64_t #endif #ifdef uint64_t # define uint_fast64_t uint64_t #endif /* 7.18.1.4. Integer types capable of holding object pointers */ #undef intptr_t #undef uintptr_t #define intptr_t long int #define uintptr_t unsigned long int /* 7.18.1.5. Greatest-width integer types */ /* Note: These types are compiler dependent. It may be unwise to use them in public header files. */ #undef intmax_t #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 # define intmax_t long long int #elif defined int64_t # define intmax_t int64_t #else # define intmax_t long int #endif #undef uintmax_t #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 # define uintmax_t unsigned long long int #elif defined uint64_t # define uintmax_t uint64_t #else # define uintmax_t unsigned long int #endif /* 7.18.2. Limits of specified-width integer types */ #if ! defined __cplusplus || defined __STDC_LIMIT_MACROS /* 7.18.2.1. Limits of exact-width integer types */ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. */ #undef INT8_MIN #undef INT8_MAX #undef UINT8_MAX #define INT8_MIN (~ INT8_MAX) #define INT8_MAX 127 #define UINT8_MAX 255 #undef INT16_MIN #undef INT16_MAX #undef UINT16_MAX #define INT16_MIN (~ INT16_MAX) #define INT16_MAX 32767 #define UINT16_MAX 65535 #undef INT32_MIN #undef INT32_MAX #undef UINT32_MAX #define INT32_MIN (~ INT32_MAX) #define INT32_MAX 2147483647 #define UINT32_MAX 4294967295U #undef INT64_MIN #undef INT64_MAX #ifdef int64_t # define INT64_MIN (~ INT64_MAX) # define INT64_MAX INTMAX_C (9223372036854775807) #endif #undef UINT64_MAX #ifdef uint64_t # define UINT64_MAX UINTMAX_C (18446744073709551615) #endif /* 7.18.2.2. Limits of minimum-width integer types */ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types are the same as the corresponding N_t types. */ #undef INT_LEAST8_MIN #undef INT_LEAST8_MAX #undef UINT_LEAST8_MAX #define INT_LEAST8_MIN INT8_MIN #define INT_LEAST8_MAX INT8_MAX #define UINT_LEAST8_MAX UINT8_MAX #undef INT_LEAST16_MIN #undef INT_LEAST16_MAX #undef UINT_LEAST16_MAX #define INT_LEAST16_MIN INT16_MIN #define INT_LEAST16_MAX INT16_MAX #define UINT_LEAST16_MAX UINT16_MAX #undef INT_LEAST32_MIN #undef INT_LEAST32_MAX #undef UINT_LEAST32_MAX #define INT_LEAST32_MIN INT32_MIN #define INT_LEAST32_MAX INT32_MAX #define UINT_LEAST32_MAX UINT32_MAX #undef INT_LEAST64_MIN #undef INT_LEAST64_MAX #ifdef int64_t # define INT_LEAST64_MIN INT64_MIN # define INT_LEAST64_MAX INT64_MAX #endif #undef UINT_LEAST64_MAX #ifdef uint64_t # define UINT_LEAST64_MAX UINT64_MAX #endif /* 7.18.2.3. Limits of fastest minimum-width integer types */ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types are taken from the same list of types. */ #undef INT_FAST8_MIN #undef INT_FAST8_MAX #undef UINT_FAST8_MAX #define INT_FAST8_MIN LONG_MIN #define INT_FAST8_MAX LONG_MAX #define UINT_FAST8_MAX ULONG_MAX #undef INT_FAST16_MIN #undef INT_FAST16_MAX #undef UINT_FAST16_MAX #define INT_FAST16_MIN LONG_MIN #define INT_FAST16_MAX LONG_MAX #define UINT_FAST16_MAX ULONG_MAX #undef INT_FAST32_MIN #undef INT_FAST32_MAX #undef UINT_FAST32_MAX #define INT_FAST32_MIN LONG_MIN #define INT_FAST32_MAX LONG_MAX #define UINT_FAST32_MAX ULONG_MAX #undef INT_FAST64_MIN #undef INT_FAST64_MAX #ifdef int64_t # define INT_FAST64_MIN INT64_MIN # define INT_FAST64_MAX INT64_MAX #endif #undef UINT_FAST64_MAX #ifdef uint64_t # define UINT_FAST64_MAX UINT64_MAX #endif /* 7.18.2.4. Limits of integer types capable of holding object pointers */ #undef INTPTR_MIN #undef INTPTR_MAX #undef UINTPTR_MAX #define INTPTR_MIN LONG_MIN #define INTPTR_MAX LONG_MAX #define UINTPTR_MAX ULONG_MAX /* 7.18.2.5. Limits of greatest-width integer types */ #undef INTMAX_MIN #undef INTMAX_MAX #define INTMAX_MIN (~ INTMAX_MAX) #ifdef INT64_MAX # define INTMAX_MAX INT64_MAX #else # define INTMAX_MAX INT32_MAX #endif #undef UINTMAX_MAX #ifdef UINT64_MAX # define UINTMAX_MAX UINT64_MAX #else # define UINTMAX_MAX UINT32_MAX #endif /* 7.18.3. Limits of other integer types */ /* ptrdiff_t limits */ #undef PTRDIFF_MIN #undef PTRDIFF_MAX #define PTRDIFF_MIN \ _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) #define PTRDIFF_MAX \ _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) /* sig_atomic_t limits */ #undef SIG_ATOMIC_MIN #undef SIG_ATOMIC_MAX #define SIG_ATOMIC_MIN \ _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ 0@SIG_ATOMIC_T_SUFFIX@) #define SIG_ATOMIC_MAX \ _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ 0@SIG_ATOMIC_T_SUFFIX@) /* size_t limit */ #undef SIZE_MAX #define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) /* wchar_t limits */ #undef WCHAR_MIN #undef WCHAR_MAX #define WCHAR_MIN \ _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) #define WCHAR_MAX \ _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) /* wint_t limits */ #undef WINT_MIN #undef WINT_MAX #define WINT_MIN \ _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) #define WINT_MAX \ _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) #endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */ /* 7.18.4. Macros for integer constants */ #if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS /* 7.18.4.1. Macros for minimum-width integer constants */ /* According to ISO C 99 Technical Corrigendum 1 */ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ #undef INT8_C #undef UINT8_C #define INT8_C(x) x #define UINT8_C(x) x #undef INT16_C #undef UINT16_C #define INT16_C(x) x #define UINT16_C(x) x #undef INT32_C #undef UINT32_C #define INT32_C(x) x #define UINT32_C(x) x ## U #undef INT64_C #undef UINT64_C #if LONG_MAX >> 31 >> 31 == 1 # define INT64_C(x) x##L #elif defined _MSC_VER # define INT64_C(x) x##i64 #elif @HAVE_LONG_LONG_INT@ # 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@ # define UINT64_C(x) x##ULL #endif /* 7.18.4.2. Macros for greatest-width integer constants */ #undef INTMAX_C #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 # define INTMAX_C(x) x##LL #elif defined int64_t # define INTMAX_C(x) INT64_C(x) #else # define INTMAX_C(x) x##L #endif #undef UINTMAX_C #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 # define UINTMAX_C(x) x##ULL #elif defined uint64_t # define UINTMAX_C(x) UINT64_C(x) #else # define UINTMAX_C(x) x##UL #endif #endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */ #endif /* _GL_STDINT_H */ blame-1.3.1/lib/exitfail.c0000644000076400007640000000163310527555557012267 00000000000000/* Failure exit status Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "exitfail.h" #include "exit.h" int volatile exit_failure = EXIT_FAILURE; blame-1.3.1/lib/strpbrk.h0000644000076400007640000000175110241344123012131 00000000000000/* Searching in a string. Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if HAVE_STRPBRK /* Get strpbrk() declaration. */ #include #else /* Find the first occurrence in S of any character in ACCEPT. */ extern char *strpbrk (const char *s, const char *accept); #endif blame-1.3.1/lib/xreadlink.c0000644000076400007640000000510410527555560012432 00000000000000/* xreadlink.c -- readlink wrapper to return the link name in malloc'd storage Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Jim Meyering */ #include #include "xreadlink.h" #include #include #include #include #include #include #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif #ifndef SSIZE_MAX # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) #endif #define MAXSIZE (SIZE_MAX < SSIZE_MAX ? SIZE_MAX : SSIZE_MAX) #include "xalloc.h" /* Call readlink to get the symbolic link value of FILE. SIZE is a hint as to how long the link is expected to be; typically it is taken from st_size. It need not be correct. Return a pointer to that NUL-terminated string in malloc'd storage. If readlink fails, return NULL (caller may use errno to diagnose). If malloc fails, or if the link value is longer than SSIZE_MAX :-), give a diagnostic and exit. */ char * xreadlink (char const *file, size_t size) { /* The initial buffer size for the link value. A power of 2 detects arithmetic overflow earlier, but is not required. */ size_t buf_size = size < MAXSIZE ? size + 1 : MAXSIZE; while (1) { char *buffer = xmalloc (buf_size); ssize_t r = readlink (file, buffer, buf_size); size_t link_length = r; /* On AIX 5L v5.3 and HP-UX 11i v2 04/09, readlink returns -1 with errno == ERANGE if the buffer is too small. */ if (r < 0 && errno != ERANGE) { int saved_errno = errno; free (buffer); errno = saved_errno; return NULL; } if (link_length < buf_size) { buffer[link_length] = 0; return buffer; } free (buffer); if (buf_size <= MAXSIZE / 2) buf_size *= 2; else if (buf_size < MAXSIZE) buf_size = MAXSIZE; else xalloc_die (); } } blame-1.3.1/lib/allocsa.valgrind0000664000076400007640000000026210142427523013443 00000000000000# Suppress a valgrind message about use of uninitialized memory in freesa(). # This use is OK because it provides only a speedup. { freesa Memcheck:Cond fun:freesa } blame-1.3.1/lib/argp-ba.c0000644000076400007640000000236210241344111011742 00000000000000/* Default definition for ARGP_PROGRAM_BUG_ADDRESS. Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* If set by the user program, it should point to string that is the bug-reporting address for the program. It will be printed by argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various standard help messages), embedded in a sentence that says something like `Report bugs to ADDR.'. */ const char *argp_program_bug_address; blame-1.3.1/lib/minmax.h0000644000076400007640000000456310254677263011761 00000000000000/* MIN, MAX macros. Copyright (C) 1995, 1998, 2001, 2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _MINMAX_H #define _MINMAX_H /* Note: MIN, MAX are also defined in on some systems (glibc, IRIX, HP-UX, OSF/1). Therefore you might get warnings about MIN, MAX macro redefinitions on some systems; the workaround is to #include this file as the last one among the #include list. */ /* Before we define the following symbols we get the file since otherwise we get redefinitions on some systems if is included after this file. Likewise for . If more than one of these system headers define MIN and MAX, pick just one of the headers (because the definitions most likely are the same). */ #if HAVE_MINMAX_IN_LIMITS_H # include #elif HAVE_MINMAX_IN_SYS_PARAM_H # include #endif /* Note: MIN and MAX should be used with two arguments of the same type. They might not return the minimum and maximum of their two arguments, if the arguments have different types or have unusual floating-point values. For example, on a typical host with 32-bit 'int', 64-bit 'long long', and 64-bit IEEE 754 'double' types: MAX (-1, 2147483648) returns 4294967295. MAX (9007199254740992.0, 9007199254740993) returns 9007199254740992.0. MAX (NaN, 0.0) returns 0.0. MAX (+0.0, -0.0) returns -0.0. and in each case the answer is in some sense bogus. */ /* MAX(a,b) returns the maximum of A and B. */ #ifndef MAX # define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif /* MIN(a,b) returns the minimum of A and B. */ #ifndef MIN # define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif #endif /* _MINMAX_H */ blame-1.3.1/lib/strtol.c0000644000076400007640000002546710527555560012016 00000000000000/* Convert string representation of a number into an integer value. Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2005, 2006 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef _LIBC # define USE_NUMBER_GROUPING #else # include #endif #include #include #ifndef __set_errno # define __set_errno(Val) errno = (Val) #endif #include #include #include #include #ifdef USE_NUMBER_GROUPING # include "../locale/localeinfo.h" #endif /* Nonzero if we are defining `strtoul' or `strtoull', operating on unsigned integers. */ #ifndef UNSIGNED # define UNSIGNED 0 # define INT LONG int #else # define INT unsigned LONG int #endif /* Determine the name. */ #ifdef USE_IN_EXTENDED_LOCALE_MODEL # if UNSIGNED # ifdef USE_WIDE_CHAR # ifdef QUAD # define strtol __wcstoull_l # else # define strtol __wcstoul_l # endif # else # ifdef QUAD # define strtol __strtoull_l # else # define strtol __strtoul_l # endif # endif # else # ifdef USE_WIDE_CHAR # ifdef QUAD # define strtol __wcstoll_l # else # define strtol __wcstol_l # endif # else # ifdef QUAD # define strtol __strtoll_l # else # define strtol __strtol_l # endif # endif # endif #else # if UNSIGNED # ifdef USE_WIDE_CHAR # ifdef QUAD # define strtol wcstoull # else # define strtol wcstoul # endif # else # ifdef QUAD # define strtol strtoull # else # define strtol strtoul # endif # endif # else # ifdef USE_WIDE_CHAR # ifdef QUAD # define strtol wcstoll # else # define strtol wcstol # endif # else # ifdef QUAD # define strtol strtoll # endif # endif # endif #endif /* If QUAD is defined, we are defining `strtoll' or `strtoull', operating on `long long int's. */ #ifdef QUAD # define LONG long long # define STRTOL_LONG_MIN LONG_LONG_MIN # define STRTOL_LONG_MAX LONG_LONG_MAX # define STRTOL_ULONG_MAX ULONG_LONG_MAX /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ /* True if negative values of the signed integer type T use two's complement, ones' complement, or signed magnitude representation, respectively. Much GNU code assumes two's complement, but some people like to be portable to all possible C hosts. */ # define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) # define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) # define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) /* True if the arithmetic type T is signed. */ # define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) /* The maximum and minimum values for the integer type T. These macros have undefined behavior if T is signed and has padding bits. If this is a problem for you, please let us know how to fix it for your host. */ # define TYPE_MINIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) 0 \ : TYPE_SIGNED_MAGNITUDE (t) \ ? ~ (t) 0 \ : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) # define TYPE_MAXIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) -1 \ : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) # ifndef ULONG_LONG_MAX # define ULONG_LONG_MAX TYPE_MAXIMUM (unsigned long long) # endif # ifndef LONG_LONG_MAX # define LONG_LONG_MAX TYPE_MAXIMUM (long long int) # endif # ifndef LONG_LONG_MIN # define LONG_LONG_MIN TYPE_MINIMUM (long long int) # endif # if __GNUC__ == 2 && __GNUC_MINOR__ < 7 /* Work around gcc bug with using this constant. */ static const unsigned long long int maxquad = ULONG_LONG_MAX; # undef STRTOL_ULONG_MAX # define STRTOL_ULONG_MAX maxquad # endif #else # define LONG long # define STRTOL_LONG_MIN LONG_MIN # define STRTOL_LONG_MAX LONG_MAX # define STRTOL_ULONG_MAX ULONG_MAX #endif /* We use this code also for the extended locale handling where the function gets as an additional argument the locale which has to be used. To access the values we have to redefine the _NL_CURRENT macro. */ #ifdef USE_IN_EXTENDED_LOCALE_MODEL # undef _NL_CURRENT # define _NL_CURRENT(category, item) \ (current->values[_NL_ITEM_INDEX (item)].string) # define LOCALE_PARAM , loc # define LOCALE_PARAM_PROTO , __locale_t loc #else # define LOCALE_PARAM # define LOCALE_PARAM_PROTO #endif #if defined _LIBC || defined HAVE_WCHAR_H # include #endif #ifdef USE_WIDE_CHAR # include # define L_(Ch) L##Ch # define UCHAR_TYPE wint_t # define STRING_TYPE wchar_t # ifdef USE_IN_EXTENDED_LOCALE_MODEL # define ISSPACE(Ch) __iswspace_l ((Ch), loc) # define ISALPHA(Ch) __iswalpha_l ((Ch), loc) # define TOUPPER(Ch) __towupper_l ((Ch), loc) # else # define ISSPACE(Ch) iswspace (Ch) # define ISALPHA(Ch) iswalpha (Ch) # define TOUPPER(Ch) towupper (Ch) # endif #else # define L_(Ch) Ch # define UCHAR_TYPE unsigned char # define STRING_TYPE char # ifdef USE_IN_EXTENDED_LOCALE_MODEL # define ISSPACE(Ch) __isspace_l ((Ch), loc) # define ISALPHA(Ch) __isalpha_l ((Ch), loc) # define TOUPPER(Ch) __toupper_l ((Ch), loc) # else # define ISSPACE(Ch) isspace (Ch) # define ISALPHA(Ch) isalpha (Ch) # define TOUPPER(Ch) toupper (Ch) # endif #endif #define INTERNAL(X) INTERNAL1(X) #define INTERNAL1(X) __##X##_internal #define WEAKNAME(X) WEAKNAME1(X) #ifdef USE_NUMBER_GROUPING /* This file defines a function to check for correct grouping. */ # include "grouping.h" #endif /* Convert NPTR to an `unsigned long int' or `long int' in base BASE. If BASE is 0 the base is determined by the presence of a leading zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal. If BASE is < 2 or > 36, it is reset to 10. If ENDPTR is not NULL, a pointer to the character after the last one converted is stored in *ENDPTR. */ INT INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr, int base, int group LOCALE_PARAM_PROTO) { int negative; register unsigned LONG int cutoff; register unsigned int cutlim; register unsigned LONG int i; register const STRING_TYPE *s; register UCHAR_TYPE c; const STRING_TYPE *save, *end; int overflow; #ifdef USE_NUMBER_GROUPING # ifdef USE_IN_EXTENDED_LOCALE_MODEL struct locale_data *current = loc->__locales[LC_NUMERIC]; # endif /* The thousands character of the current locale. */ wchar_t thousands = L'\0'; /* The numeric grouping specification of the current locale, in the format described in . */ const char *grouping; if (group) { grouping = _NL_CURRENT (LC_NUMERIC, GROUPING); if (*grouping <= 0 || *grouping == CHAR_MAX) grouping = NULL; else { /* Figure out the thousands separator character. */ # if defined _LIBC || defined _HAVE_BTOWC thousands = __btowc (*_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP)); if (thousands == WEOF) thousands = L'\0'; # endif if (thousands == L'\0') grouping = NULL; } } else grouping = NULL; #endif if (base < 0 || base == 1 || base > 36) { __set_errno (EINVAL); return 0; } save = s = nptr; /* Skip white space. */ while (ISSPACE (*s)) ++s; if (*s == L_('\0')) goto noconv; /* Check for a sign. */ if (*s == L_('-')) { negative = 1; ++s; } else if (*s == L_('+')) { negative = 0; ++s; } else negative = 0; /* Recognize number prefix and if BASE is zero, figure it out ourselves. */ if (*s == L_('0')) { if ((base == 0 || base == 16) && TOUPPER (s[1]) == L_('X')) { s += 2; base = 16; } else if (base == 0) base = 8; } else if (base == 0) base = 10; /* Save the pointer so we can check later if anything happened. */ save = s; #ifdef USE_NUMBER_GROUPING if (group) { /* Find the end of the digit string and check its grouping. */ end = s; for (c = *end; c != L_('\0'); c = *++end) if ((wchar_t) c != thousands && ((wchar_t) c < L_('0') || (wchar_t) c > L_('9')) && (!ISALPHA (c) || (int) (TOUPPER (c) - L_('A') + 10) >= base)) break; if (*s == thousands) end = s; else end = correctly_grouped_prefix (s, end, thousands, grouping); } else #endif end = NULL; cutoff = STRTOL_ULONG_MAX / (unsigned LONG int) base; cutlim = STRTOL_ULONG_MAX % (unsigned LONG int) base; overflow = 0; i = 0; for (c = *s; c != L_('\0'); c = *++s) { if (s == end) break; if (c >= L_('0') && c <= L_('9')) c -= L_('0'); else if (ISALPHA (c)) c = TOUPPER (c) - L_('A') + 10; else break; if ((int) c >= base) break; /* Check for overflow. */ if (i > cutoff || (i == cutoff && c > cutlim)) overflow = 1; else { i *= (unsigned LONG int) base; i += c; } } /* Check if anything actually happened. */ if (s == save) goto noconv; /* Store in ENDPTR the address of one character past the last character we converted. */ if (endptr != NULL) *endptr = (STRING_TYPE *) s; #if !UNSIGNED /* Check for a value that is within the range of `unsigned LONG int', but outside the range of `LONG int'. */ if (overflow == 0 && i > (negative ? -((unsigned LONG int) (STRTOL_LONG_MIN + 1)) + 1 : (unsigned LONG int) STRTOL_LONG_MAX)) overflow = 1; #endif if (overflow) { __set_errno (ERANGE); #if UNSIGNED return STRTOL_ULONG_MAX; #else return negative ? STRTOL_LONG_MIN : STRTOL_LONG_MAX; #endif } /* Return the result of the appropriate sign. */ return negative ? -i : i; noconv: /* We must handle a special case here: the base is 0 or 16 and the first two characters are '0' and 'x', but the rest are no hexadecimal digits. This is no error case. We return 0 and ENDPTR points to the `x`. */ if (endptr != NULL) { if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X') && save[-2] == L_('0')) *endptr = (STRING_TYPE *) &save[-1]; else /* There was no number to convert. */ *endptr = (STRING_TYPE *) nptr; } return 0L; } /* External user entry point. */ INT #ifdef weak_function weak_function #endif strtol (const STRING_TYPE *nptr, STRING_TYPE **endptr, int base LOCALE_PARAM_PROTO) { return INTERNAL (strtol) (nptr, endptr, base, 0 LOCALE_PARAM); } blame-1.3.1/lib/ansi2knr.c0000664000076400007640000004746010260234752012204 00000000000000/* Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved. */ /*$Id: ansi2knr.c,v 1.1.1.1 2004/09/26 13:33:23 foonly Exp $*/ /* Convert ANSI C function definitions to K&R ("traditional C") syntax */ /* ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. No author or distributor accepts responsibility to anyone for the consequences of using it or for whether it serves any particular purpose or works at all, unless he says so in writing. Refer to the GNU General Public License (the "GPL") for full details. Everyone is granted permission to copy, modify and redistribute ansi2knr, but only under the conditions described in the GPL. A copy of this license is supposed to have been given to you along with ansi2knr so you can know your rights and responsibilities. It should be in a file named COPYLEFT, or, if there is no file named COPYLEFT, a file named COPYING. Among other things, the copyright notice and this notice must be preserved on all copies. We explicitly state here what we believe is already implied by the GPL: if the ansi2knr program is distributed as a separate set of sources and a separate executable file which are aggregated on a storage medium together with another program, this in itself does not bring the other program under the GPL, nor does the mere fact that such a program or the procedures for constructing it invoke the ansi2knr executable bring any other part of the program under the GPL. */ /* * Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]] * --filename provides the file name for the #line directive in the output, * overriding input_file (if present). * If no input_file is supplied, input is read from stdin. * If no output_file is supplied, output goes to stdout. * There are no error messages. * * ansi2knr recognizes function definitions by seeing a non-keyword * identifier at the left margin, followed by a left parenthesis, with a * right parenthesis as the last character on the line, and with a left * brace as the first token on the following line (ignoring possible * intervening comments and/or preprocessor directives), except that a line * consisting of only * identifier1(identifier2) * will not be considered a function definition unless identifier2 is * the word "void", and a line consisting of * identifier1(identifier2, <>) * will not be considered a function definition. * ansi2knr will recognize a multi-line header provided that no intervening * line ends with a left or right brace or a semicolon. These algorithms * ignore whitespace, comments, and preprocessor directives, except that * the function name must be the first thing on the line. The following * constructs will confuse it: * - Any other construct that starts at the left margin and * follows the above syntax (such as a macro or function call). * - Some macros that tinker with the syntax of function headers. */ /* * The original and principal author of ansi2knr is L. Peter Deutsch * . Other authors are noted in the change history * that follows (in reverse chronological order): lpd 2000-04-12 backs out Eggert's changes because of bugs: - concatlits didn't declare the type of its bufend argument; - concatlits didn't recognize when it was inside a comment; - scanstring could scan backward past the beginning of the string; when - the check for \ + newline in scanstring was unnecessary. 2000-03-05 Paul Eggert Add support for concatenated string literals. * ansi2knr.c (concatlits): New decl. (main): Invoke concatlits to concatenate string literals. (scanstring): Handle backslash-newline correctly. Work with character constants. Fix bug when scanning backwards through backslash-quote. Check for unterminated strings. (convert1): Parse character constants, too. (appendline, concatlits): New functions. * ansi2knr.1: Document this. lpd 1999-08-17 added code to allow preprocessor directives wherever comments are allowed lpd 1999-04-12 added minor fixes from Pavel Roskin for clean compilation with gcc -W -Wall lpd 1999-03-22 added hack to recognize lines consisting of identifier1(identifier2, xxx) as *not* being procedures lpd 1999-02-03 made indentation of preprocessor commands consistent lpd 1999-01-28 fixed two bugs: a '/' in an argument list caused an endless loop; quoted strings within an argument list confused the parser lpd 1999-01-24 added a check for write errors on the output, suggested by Jim Meyering lpd 1998-11-09 added further hack to recognize identifier(void) as being a procedure lpd 1998-10-23 added hack to recognize lines consisting of identifier1(identifier2) as *not* being procedures lpd 1997-12-08 made input_file optional; only closes input and/or output file if not stdin or stdout respectively; prints usage message on stderr rather than stdout; adds --filename switch (changes suggested by ) lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with compilers that don't understand void, as suggested by Tom Lane lpd 1996-01-15 changed to require that the first non-comment token on the line following a function header be a left brace, to reduce sensitivity to macros, as suggested by Tom Lane lpd 1995-06-22 removed #ifndefs whose sole purpose was to define undefined preprocessor symbols as 0; changed all #ifdefs for configuration symbols to #ifs lpd 1995-04-05 changed copyright notice to make it clear that including ansi2knr in a program does not bring the entire program under the GPL lpd 1994-12-18 added conditionals for systems where ctype macros don't handle 8-bit characters properly, suggested by Francois Pinard ; removed --varargs switch (this is now the default) lpd 1994-10-10 removed CONFIG_BROKETS conditional lpd 1994-07-16 added some conditionals to help GNU `configure', suggested by Francois Pinard ; properly erase prototype args in function parameters, contributed by Jim Avera ; correct error in writeblanks (it shouldn't erase EOLs) lpd 1989-xx-xx original version */ /* Most of the conditionals here are to make ansi2knr work with */ /* or without the GNU configure machinery. */ #if HAVE_CONFIG_H # include #endif #include #include #if HAVE_CONFIG_H /* For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h). This will define HAVE_CONFIG_H and so, activate the following lines. */ # if STDC_HEADERS || HAVE_STRING_H # include # else # include # endif #else /* not HAVE_CONFIG_H */ /* Otherwise do it the hard way */ # ifdef BSD # include # else # ifdef VMS extern int strlen(), strncmp(); # else # include # endif # endif #endif /* not HAVE_CONFIG_H */ #if STDC_HEADERS # include #else /* malloc and free should be declared in stdlib.h, but if you've got a K&R compiler, they probably aren't. */ # ifdef MSDOS # include # else # ifdef VMS extern char *malloc(); extern void free(); # else extern char *malloc(); extern int free(); # endif # endif #endif /* Define NULL (for *very* old compilers). */ #ifndef NULL # define NULL (0) #endif /* * The ctype macros don't always handle 8-bit characters correctly. * Compensate for this here. */ #ifdef isascii # undef HAVE_ISASCII /* just in case */ # define HAVE_ISASCII 1 #else #endif #if STDC_HEADERS || !HAVE_ISASCII # define is_ascii(c) 1 #else # define is_ascii(c) isascii(c) #endif #define is_space(c) (is_ascii(c) && isspace(c)) #define is_alpha(c) (is_ascii(c) && isalpha(c)) #define is_alnum(c) (is_ascii(c) && isalnum(c)) /* Scanning macros */ #define isidchar(ch) (is_alnum(ch) || (ch) == '_') #define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_') /* Forward references */ char *ppdirforward(); char *ppdirbackward(); char *skipspace(); char *scanstring(); int writeblanks(); int test1(); int convert1(); /* The main program */ int main(argc, argv) int argc; char *argv[]; { FILE *in = stdin; FILE *out = stdout; char *filename = 0; char *program_name = argv[0]; char *output_name = 0; #define bufsize 5000 /* arbitrary size */ char *buf; char *line; char *more; char *usage = "Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n"; /* * In previous versions, ansi2knr recognized a --varargs switch. * If this switch was supplied, ansi2knr would attempt to convert * a ... argument to va_alist and va_dcl; if this switch was not * supplied, ansi2knr would simply drop any such arguments. * Now, ansi2knr always does this conversion, and we only * check for this switch for backward compatibility. */ int convert_varargs = 1; int output_error; while ( argc > 1 && argv[1][0] == '-' ) { if ( !strcmp(argv[1], "--varargs") ) { convert_varargs = 1; argc--; argv++; continue; } if ( !strcmp(argv[1], "--filename") && argc > 2 ) { filename = argv[2]; argc -= 2; argv += 2; continue; } fprintf(stderr, "%s: Unrecognized switch: %s\n", program_name, argv[1]); fprintf(stderr, usage); exit(1); } switch ( argc ) { default: fprintf(stderr, usage); exit(0); case 3: output_name = argv[2]; out = fopen(output_name, "w"); if ( out == NULL ) { fprintf(stderr, "%s: Cannot open output file %s\n", program_name, output_name); exit(1); } /* falls through */ case 2: in = fopen(argv[1], "r"); if ( in == NULL ) { fprintf(stderr, "%s: Cannot open input file %s\n", program_name, argv[1]); exit(1); } if ( filename == 0 ) filename = argv[1]; /* falls through */ case 1: break; } if ( filename ) fprintf(out, "#line 1 \"%s\"\n", filename); buf = malloc(bufsize); if ( buf == NULL ) { fprintf(stderr, "Unable to allocate read buffer!\n"); exit(1); } line = buf; while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL ) { test: line += strlen(line); switch ( test1(buf) ) { case 2: /* a function header */ convert1(buf, out, 1, convert_varargs); break; case 1: /* a function */ /* Check for a { at the start of the next line. */ more = ++line; f: if ( line >= buf + (bufsize - 1) ) /* overflow check */ goto wl; if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL ) goto wl; switch ( *skipspace(ppdirforward(more), 1) ) { case '{': /* Definitely a function header. */ convert1(buf, out, 0, convert_varargs); fputs(more, out); break; case 0: /* The next line was blank or a comment: */ /* keep scanning for a non-comment. */ line += strlen(line); goto f; default: /* buf isn't a function header, but */ /* more might be. */ fputs(buf, out); strcpy(buf, more); line = buf; goto test; } break; case -1: /* maybe the start of a function */ if ( line != buf + (bufsize - 1) ) /* overflow check */ continue; /* falls through */ default: /* not a function */ wl: fputs(buf, out); break; } line = buf; } if ( line != buf ) fputs(buf, out); free(buf); if ( output_name ) { output_error = ferror(out); output_error |= fclose(out); } else { /* out == stdout */ fflush(out); output_error = ferror(out); } if ( output_error ) { fprintf(stderr, "%s: error writing to %s\n", program_name, (output_name ? output_name : "stdout")); exit(1); } if ( in != stdin ) fclose(in); return 0; } /* * Skip forward or backward over one or more preprocessor directives. */ char * ppdirforward(p) char *p; { for (; *p == '#'; ++p) { for (; *p != '\r' && *p != '\n'; ++p) if (*p == 0) return p; if (*p == '\r' && p[1] == '\n') ++p; } return p; } char * ppdirbackward(p, limit) char *p; char *limit; { char *np = p; for (;; p = --np) { if (*np == '\n' && np[-1] == '\r') --np; for (; np > limit && np[-1] != '\r' && np[-1] != '\n'; --np) if (np[-1] == 0) return np; if (*np != '#') return p; } } /* * Skip over whitespace, comments, and preprocessor directives, * in either direction. */ char * skipspace(p, dir) char *p; int dir; /* 1 for forward, -1 for backward */ { for ( ; ; ) { while ( is_space(*p) ) p += dir; if ( !(*p == '/' && p[dir] == '*') ) break; p += dir; p += dir; while ( !(*p == '*' && p[dir] == '/') ) { if ( *p == 0 ) return p; /* multi-line comment?? */ p += dir; } p += dir; p += dir; } return p; } /* Scan over a quoted string, in either direction. */ char * scanstring(p, dir) char *p; int dir; { for (p += dir; ; p += dir) if (*p == '"' && p[-dir] != '\\') return p + dir; } /* * Write blanks over part of a string. * Don't overwrite end-of-line characters. */ int writeblanks(start, end) char *start; char *end; { char *p; for ( p = start; p < end; p++ ) if ( *p != '\r' && *p != '\n' ) *p = ' '; return 0; } /* * Test whether the string in buf is a function definition. * The string may contain and/or end with a newline. * Return as follows: * 0 - definitely not a function definition; * 1 - definitely a function definition; * 2 - definitely a function prototype (NOT USED); * -1 - may be the beginning of a function definition, * append another line and look again. * The reason we don't attempt to convert function prototypes is that * Ghostscript's declaration-generating macros look too much like * prototypes, and confuse the algorithms. */ int test1(buf) char *buf; { char *p = buf; char *bend; char *endfn; int contin; if ( !isidfirstchar(*p) ) return 0; /* no name at left margin */ bend = skipspace(ppdirbackward(buf + strlen(buf) - 1, buf), -1); switch ( *bend ) { case ';': contin = 0 /*2*/; break; case ')': contin = 1; break; case '{': return 0; /* not a function */ case '}': return 0; /* not a function */ default: contin = -1; } while ( isidchar(*p) ) p++; endfn = p; p = skipspace(p, 1); if ( *p++ != '(' ) return 0; /* not a function */ p = skipspace(p, 1); if ( *p == ')' ) return 0; /* no parameters */ /* Check that the apparent function name isn't a keyword. */ /* We only need to check for keywords that could be followed */ /* by a left parenthesis (which, unfortunately, is most of them). */ { static char *words[] = { "asm", "auto", "case", "char", "const", "double", "extern", "float", "for", "if", "int", "long", "register", "return", "short", "signed", "sizeof", "static", "switch", "typedef", "unsigned", "void", "volatile", "while", 0 }; char **key = words; char *kp; unsigned len = endfn - buf; while ( (kp = *key) != 0 ) { if ( strlen(kp) == len && !strncmp(kp, buf, len) ) return 0; /* name is a keyword */ key++; } } { char *id = p; int len; /* * Check for identifier1(identifier2) and not * identifier1(void), or identifier1(identifier2, xxxx). */ while ( isidchar(*p) ) p++; len = p - id; p = skipspace(p, 1); if (*p == ',' || (*p == ')' && (len != 4 || strncmp(id, "void", 4))) ) return 0; /* not a function */ } /* * If the last significant character was a ), we need to count * parentheses, because it might be part of a formal parameter * that is a procedure. */ if (contin > 0) { int level = 0; for (p = skipspace(buf, 1); *p; p = skipspace(p + 1, 1)) level += (*p == '(' ? 1 : *p == ')' ? -1 : 0); if (level > 0) contin = -1; } return contin; } /* Convert a recognized function definition or header to K&R syntax. */ int convert1(buf, out, header, convert_varargs) char *buf; FILE *out; int header; /* Boolean */ int convert_varargs; /* Boolean */ { char *endfn; char *p; /* * The breaks table contains pointers to the beginning and end * of each argument. */ char **breaks; unsigned num_breaks = 2; /* for testing */ char **btop; char **bp; char **ap; char *vararg = 0; /* Pre-ANSI implementations don't agree on whether strchr */ /* is called strchr or index, so we open-code it here. */ for ( endfn = buf; *(endfn++) != '('; ) ; top: p = endfn; breaks = (char **)malloc(sizeof(char *) * num_breaks * 2); if ( breaks == NULL ) { /* Couldn't allocate break table, give up */ fprintf(stderr, "Unable to allocate break table!\n"); fputs(buf, out); return -1; } btop = breaks + num_breaks * 2 - 2; bp = breaks; /* Parse the argument list */ do { int level = 0; char *lp = NULL; char *rp = NULL; char *end = NULL; if ( bp >= btop ) { /* Filled up break table. */ /* Allocate a bigger one and start over. */ free((char *)breaks); num_breaks <<= 1; goto top; } *bp++ = p; /* Find the end of the argument */ for ( ; end == NULL; p++ ) { switch(*p) { case ',': if ( !level ) end = p; break; case '(': if ( !level ) lp = p; level++; break; case ')': if ( --level < 0 ) end = p; else rp = p; break; case '/': if (p[1] == '*') p = skipspace(p, 1) - 1; break; case '"': p = scanstring(p, 1) - 1; break; default: ; } } /* Erase any embedded prototype parameters. */ if ( lp && rp ) writeblanks(lp + 1, rp); p--; /* back up over terminator */ /* Find the name being declared. */ /* This is complicated because of procedure and */ /* array modifiers. */ for ( ; ; ) { p = skipspace(p - 1, -1); switch ( *p ) { case ']': /* skip array dimension(s) */ case ')': /* skip procedure args OR name */ { int level = 1; while ( level ) switch ( *--p ) { case ']': case ')': level++; break; case '[': case '(': level--; break; case '/': if (p > buf && p[-1] == '*') p = skipspace(p, -1) + 1; break; case '"': p = scanstring(p, -1) + 1; break; default: ; } } if ( *p == '(' && *skipspace(p + 1, 1) == '*' ) { /* We found the name being declared */ while ( !isidfirstchar(*p) ) p = skipspace(p, 1) + 1; goto found; } break; default: goto found; } } found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' ) { if ( convert_varargs ) { *bp++ = "va_alist"; vararg = p-2; } else { p++; if ( bp == breaks + 1 ) /* sole argument */ writeblanks(breaks[0], p); else writeblanks(bp[-1] - 1, p); bp--; } } else { while ( isidchar(*p) ) p--; *bp++ = p+1; } p = end; } while ( *p++ == ',' ); *bp = p; /* Make a special check for 'void' arglist */ if ( bp == breaks+2 ) { p = skipspace(breaks[0], 1); if ( !strncmp(p, "void", 4) ) { p = skipspace(p+4, 1); if ( p == breaks[2] - 1 ) { bp = breaks; /* yup, pretend arglist is empty */ writeblanks(breaks[0], p + 1); } } } /* Put out the function name and left parenthesis. */ p = buf; while ( p != endfn ) putc(*p, out), p++; /* Put out the declaration. */ if ( header ) { fputs(");", out); for ( p = breaks[0]; *p; p++ ) if ( *p == '\r' || *p == '\n' ) putc(*p, out); } else { for ( ap = breaks+1; ap < bp; ap += 2 ) { p = *ap; while ( isidchar(*p) ) putc(*p, out), p++; if ( ap < bp - 1 ) fputs(", ", out); } fputs(") ", out); /* Put out the argument declarations */ for ( ap = breaks+2; ap <= bp; ap += 2 ) (*ap)[-1] = ';'; if ( vararg != 0 ) { *vararg = 0; fputs(breaks[0], out); /* any prior args */ fputs("va_dcl", out); /* the final arg */ fputs(bp[0], out); } else fputs(breaks[0], out); } free((char *)breaks); return 0; } blame-1.3.1/lib/argp-eexst.c0000644000076400007640000000226310337302606012521 00000000000000/* Default definition for ARGP_ERR_EXIT_STATUS Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include "argp.h" /* The exit status that argp will use when exiting due to a parsing error. If not defined or set by the user program, this defaults to EX_USAGE from . */ error_t argp_err_exit_status = EX_USAGE; blame-1.3.1/lib/same-inode.h0000644000076400007640000000177510527555557012517 00000000000000/* Determine whether two stat buffers refer to the same file. Copyright (C) 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SAME_INODE_H # define SAME_INODE_H 1 # define SAME_INODE(Stat_buf_1, Stat_buf_2) \ ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \ && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev) #endif blame-1.3.1/lib/strndup.c0000644000076400007640000000221310527555560012146 00000000000000/* A replacement function, for systems that lack strndup. Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "strndup.h" #include #include #include "strnlen.h" char * strndup (char const *s, size_t n) { size_t len = strnlen (s, n); char *new = malloc (len + 1); if (new == NULL) return NULL; new[len] = '\0'; return memcpy (new, s, len); } blame-1.3.1/lib/stripslash.c0000644000076400007640000000311410527555560012644 00000000000000/* stripslash.c -- remove redundant trailing slashes from a file name Copyright (C) 1990, 2001, 2003-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "dirname.h" /* Remove trailing slashes from FILE. Return true if a trailing slash was removed. This is useful when using file name completion from a shell that adds a "/" after directory names (such as tcsh and bash), because on symlinks to directories, several system calls have different semantics according to whether a trailing slash is present. */ bool strip_trailing_slashes (char *file) { char *base = last_component (file); char *base_lim; bool had_slash; /* last_component returns "" for file system roots, but we need to turn `///' into `/'. */ if (! *base) base = file; base_lim = base + base_len (base); had_slash = (*base_lim != '\0'); *base_lim = '\0'; return had_slash; } blame-1.3.1/lib/xreadlink.h0000644000076400007640000000170510241344125012424 00000000000000/* readlink wrapper to return the link name in malloc'd storage Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Jim Meyering */ #include char *xreadlink (char const *, size_t); blame-1.3.1/lib/getcwd.h0000644000076400007640000000303110337302606011716 00000000000000/* Get the working directory, compatibly with the GNU C Library. Copyright (C) 2004-2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert. */ /* Include the headers that might declare getcwd so that they will not cause confusion if included after this file. */ #include #include /* If necessary, systematically rename identifiers so that they do not collide with the system function. Renaming avoids problems with some compilers and linkers. */ #ifdef __GETCWD_PREFIX # undef getcwd # define __GETCWD_CONCAT(x, y) x ## y # define __GETCWD_XCONCAT(x, y) __GETCWD_CONCAT (x, y) # define __GETCWD_ID(y) __GETCWD_XCONCAT (__GETCWD_PREFIX, y) # define getcwd __GETCWD_ID (getcwd) /* See the POSIX:2001 specification . */ char *getcwd (char *, size_t); #endif blame-1.3.1/lib/error.h0000644000076400007640000000465710527555557011631 00000000000000/* Declaration for error-reporting function Copyright (C) 1995, 1996, 1997, 2003, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _ERROR_H #define _ERROR_H 1 #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __format__ format # define __printf__ printf # endif #endif #ifdef __cplusplus extern "C" { #endif /* Print a message with `fprintf (stderr, FORMAT, ...)'; if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ extern void error (int __status, int __errnum, const char *__format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern void error_at_line (int __status, int __errnum, const char *__fname, unsigned int __lineno, const char *__format, ...) __attribute__ ((__format__ (__printf__, 5, 6))); /* If NULL, error will flush stdout, then print on stderr the program name, a colon and a space. Otherwise, error will call this function without parameters instead. */ extern void (*error_print_progname) (void); /* This variable is incremented each time `error' is called. */ extern unsigned int error_message_count; /* Sometimes we want to have at most one error per line. This variable controls whether this mode is selected or not. */ extern int error_one_per_line; #ifdef __cplusplus } #endif #endif /* error.h */ blame-1.3.1/lib/setenv.h0000644000076400007640000000271710241344121011747 00000000000000/* Setting environment variables. Copyright (C) 2001-2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if HAVE_SETENV || HAVE_UNSETENV /* Get setenv(), unsetenv() declarations. */ # include #endif #ifdef __cplusplus extern "C" { #endif #if !HAVE_SETENV /* Set NAME to VALUE in the environment. If REPLACE is nonzero, overwrite an existing value. */ extern int setenv (const char *name, const char *value, int replace); #endif #if HAVE_UNSETENV # if VOID_UNSETENV /* On some systems, unsetenv() returns void. This is the case for FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4. */ # define unsetenv(name) ((unsetenv)(name), 0) # endif #else /* Remove the variable NAME from the environment. */ extern int unsetenv (const char *name); #endif #ifdef __cplusplus } #endif blame-1.3.1/lib/obstack.c0000644000076400007640000003401310527555557012106 00000000000000/* obstack.c - subroutines used implicitly by object stack macros Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef _LIBC # include # include #else # include # include "obstack.h" #endif /* NOTE BEFORE MODIFYING THIS FILE: This version number must be incremented whenever callers compiled using an old obstack.h can no longer properly call the functions in this obstack.c. */ #define OBSTACK_INTERFACE_VERSION 1 /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself, and the installed library supports the same library interface we do. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #include /* Random thing to get __GNU_LIBRARY__. */ #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1 # include # if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION # define ELIDE_CODE # endif #endif #include #ifndef ELIDE_CODE # include /* Determine default alignment. */ union fooround { uintmax_t i; long double d; void *p; }; struct fooalign { char c; union fooround u; }; /* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT. But in fact it might be less smart and round addresses to as much as DEFAULT_ROUNDING. So we prepare for it to do that. */ enum { DEFAULT_ALIGNMENT = offsetof (struct fooalign, u), DEFAULT_ROUNDING = sizeof (union fooround) }; /* When we copy a long block of data, this is the unit to do it with. On some machines, copying successive ints does not work; in such a case, redefine COPYING_UNIT to `long' (if that works) or `char' as a last resort. */ # ifndef COPYING_UNIT # define COPYING_UNIT int # endif /* The functions allocating more room by calling `obstack_chunk_alloc' jump to the handler pointed to by `obstack_alloc_failed_handler'. This can be set to a user defined function which should either abort gracefully or use longjump - but shouldn't return. This variable by default points to the internal function `print_and_abort'. */ static void print_and_abort (void); void (*obstack_alloc_failed_handler) (void) = print_and_abort; /* Exit value used when `print_and_abort' is used. */ # include # ifdef _LIBC int obstack_exit_failure = EXIT_FAILURE; # else # include "exitfail.h" # define obstack_exit_failure exit_failure # endif # ifdef _LIBC # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) /* A looong time ago (before 1994, anyway; we're not sure) this global variable was used by non-GNU-C macros to avoid multiple evaluation. The GNU C library still exports it because somebody might use it. */ struct obstack *_obstack_compat; compat_symbol (libc, _obstack_compat, _obstack, GLIBC_2_0); # endif # endif /* Define a macro that either calls functions with the traditional malloc/free calling interface, or calls functions with the mmalloc/mfree interface (that adds an extra first argument), based on the state of use_extra_arg. For free, do not use ?:, since some compilers, like the MIPS compilers, do not allow (expr) ? void : void. */ # define CALL_CHUNKFUN(h, size) \ (((h) -> use_extra_arg) \ ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ : (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size))) # define CALL_FREEFUN(h, old_chunk) \ do { \ if ((h) -> use_extra_arg) \ (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ else \ (*(void (*) (void *)) (h)->freefun) ((old_chunk)); \ } while (0) /* Initialize an obstack H for use. Specify chunk size SIZE (0 means default). Objects start on multiples of ALIGNMENT (0 means use default). CHUNKFUN is the function to use to allocate chunks, and FREEFUN the function to free them. Return nonzero if successful, calls obstack_alloc_failed_handler if allocation fails. */ int _obstack_begin (struct obstack *h, int size, int alignment, void *(*chunkfun) (long), void (*freefun) (void *)) { register struct _obstack_chunk *chunk; /* points to new chunk */ if (alignment == 0) alignment = DEFAULT_ALIGNMENT; if (size == 0) /* Default size is what GNU malloc can fit in a 4096-byte block. */ { /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc. Use the values for range checking, because if range checking is off, the extra bytes won't be missed terribly, but if range checking is on and we used a larger request, a whole extra 4096 bytes would be allocated. These number are irrelevant to the new GNU malloc. I suspect it is less sensitive to the size of the request. */ int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)) + 4 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)); size = 4096 - extra; } h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun; h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; h->chunk_size = size; h->alignment_mask = alignment - 1; h->use_extra_arg = 0; chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); if (!chunk) (*obstack_alloc_failed_handler) (); h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents, alignment - 1); h->chunk_limit = chunk->limit = (char *) chunk + h->chunk_size; chunk->prev = 0; /* The initial chunk now contains no empty object. */ h->maybe_empty_object = 0; h->alloc_failed = 0; return 1; } int _obstack_begin_1 (struct obstack *h, int size, int alignment, void *(*chunkfun) (void *, long), void (*freefun) (void *, void *), void *arg) { register struct _obstack_chunk *chunk; /* points to new chunk */ if (alignment == 0) alignment = DEFAULT_ALIGNMENT; if (size == 0) /* Default size is what GNU malloc can fit in a 4096-byte block. */ { /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc. Use the values for range checking, because if range checking is off, the extra bytes won't be missed terribly, but if range checking is on and we used a larger request, a whole extra 4096 bytes would be allocated. These number are irrelevant to the new GNU malloc. I suspect it is less sensitive to the size of the request. */ int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)) + 4 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)); size = 4096 - extra; } h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun; h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; h->chunk_size = size; h->alignment_mask = alignment - 1; h->extra_arg = arg; h->use_extra_arg = 1; chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); if (!chunk) (*obstack_alloc_failed_handler) (); h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents, alignment - 1); h->chunk_limit = chunk->limit = (char *) chunk + h->chunk_size; chunk->prev = 0; /* The initial chunk now contains no empty object. */ h->maybe_empty_object = 0; h->alloc_failed = 0; return 1; } /* Allocate a new current chunk for the obstack *H on the assumption that LENGTH bytes need to be added to the current object, or a new object of length LENGTH allocated. Copies any partial object from the end of the old chunk to the beginning of the new one. */ void _obstack_newchunk (struct obstack *h, int length) { register struct _obstack_chunk *old_chunk = h->chunk; register struct _obstack_chunk *new_chunk; register long new_size; register long obj_size = h->next_free - h->object_base; register long i; long already; char *object_base; /* Compute size for new chunk. */ new_size = (obj_size + length) + (obj_size >> 3) + h->alignment_mask + 100; if (new_size < h->chunk_size) new_size = h->chunk_size; /* Allocate and initialize the new chunk. */ new_chunk = CALL_CHUNKFUN (h, new_size); if (!new_chunk) (*obstack_alloc_failed_handler) (); h->chunk = new_chunk; new_chunk->prev = old_chunk; new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size; /* Compute an aligned object_base in the new chunk */ object_base = __PTR_ALIGN ((char *) new_chunk, new_chunk->contents, h->alignment_mask); /* Move the existing object to the new chunk. Word at a time is fast and is safe if the object is sufficiently aligned. */ if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT) { for (i = obj_size / sizeof (COPYING_UNIT) - 1; i >= 0; i--) ((COPYING_UNIT *)object_base)[i] = ((COPYING_UNIT *)h->object_base)[i]; /* We used to copy the odd few remaining bytes as one extra COPYING_UNIT, but that can cross a page boundary on a machine which does not do strict alignment for COPYING_UNITS. */ already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT); } else already = 0; /* Copy remaining bytes one by one. */ for (i = already; i < obj_size; i++) object_base[i] = h->object_base[i]; /* If the object just copied was the only data in OLD_CHUNK, free that chunk and remove it from the chain. But not if that chunk might contain an empty object. */ if (! h->maybe_empty_object && (h->object_base == __PTR_ALIGN ((char *) old_chunk, old_chunk->contents, h->alignment_mask))) { new_chunk->prev = old_chunk->prev; CALL_FREEFUN (h, old_chunk); } h->object_base = object_base; h->next_free = h->object_base + obj_size; /* The new chunk certainly contains no empty object yet. */ h->maybe_empty_object = 0; } # ifdef _LIBC libc_hidden_def (_obstack_newchunk) # endif /* Return nonzero if object OBJ has been allocated from obstack H. This is here for debugging. If you use it in a program, you are probably losing. */ /* Suppress -Wmissing-prototypes warning. We don't want to declare this in obstack.h because it is just for debugging. */ int _obstack_allocated_p (struct obstack *h, void *obj); int _obstack_allocated_p (struct obstack *h, void *obj) { register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */ register struct _obstack_chunk *plp; /* point to previous chunk if any */ lp = (h)->chunk; /* We use >= rather than > since the object cannot be exactly at the beginning of the chunk but might be an empty object exactly at the end of an adjacent chunk. */ while (lp != 0 && ((void *) lp >= obj || (void *) (lp)->limit < obj)) { plp = lp->prev; lp = plp; } return lp != 0; } /* Free objects in obstack H, including OBJ and everything allocate more recently than OBJ. If OBJ is zero, free everything in H. */ # undef obstack_free void __obstack_free (struct obstack *h, void *obj) { register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */ register struct _obstack_chunk *plp; /* point to previous chunk if any */ lp = h->chunk; /* We use >= because there cannot be an object at the beginning of a chunk. But there can be an empty object at that address at the end of another chunk. */ while (lp != 0 && ((void *) lp >= obj || (void *) (lp)->limit < obj)) { plp = lp->prev; CALL_FREEFUN (h, lp); lp = plp; /* If we switch chunks, we can't tell whether the new current chunk contains an empty object, so assume that it may. */ h->maybe_empty_object = 1; } if (lp) { h->object_base = h->next_free = (char *) (obj); h->chunk_limit = lp->limit; h->chunk = lp; } else if (obj != 0) /* obj is not in any of the chunks! */ abort (); } # ifdef _LIBC /* Older versions of libc used a function _obstack_free intended to be called by non-GCC compilers. */ strong_alias (obstack_free, _obstack_free) # endif int _obstack_memory_used (struct obstack *h) { register struct _obstack_chunk* lp; register int nbytes = 0; for (lp = h->chunk; lp != 0; lp = lp->prev) { nbytes += lp->limit - (char *) lp; } return nbytes; } /* Define the error handler. */ # ifdef _LIBC # include # else # include "gettext.h" # endif # ifndef _ # define _(msgid) gettext (msgid) # endif # ifdef _LIBC # include # endif # ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) # define __attribute__(Spec) /* empty */ # endif # endif static void __attribute__ ((noreturn)) print_and_abort (void) { /* Don't change any of these strings. Yes, it would be possible to add the newline to the string and use fputs or so. But this must not happen because the "memory exhausted" message appears in other places like this and the translation should be reused instead of creating a very similar string which requires a separate translation. */ # ifdef _LIBC (void) __fxprintf (NULL, "%s\n", _("memory exhausted")); # else fprintf (stderr, "%s\n", _("memory exhausted")); # endif exit (obstack_exit_failure); } #endif /* !ELIDE_CODE */ blame-1.3.1/lib/pathmax.h0000644000076400007640000000270010337302607012106 00000000000000/* Define PATH_MAX somehow. Requires sys/types.h. Copyright (C) 1992, 1999, 2001, 2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PATHMAX_H # define _PATHMAX_H # include # include # ifndef _POSIX_PATH_MAX # define _POSIX_PATH_MAX 256 # endif # if !defined PATH_MAX && defined _PC_PATH_MAX # define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 \ : pathconf ("/", _PC_PATH_MAX)) # endif /* Don't include sys/param.h if it already has been. */ # if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN # include # endif # if !defined PATH_MAX && defined MAXPATHLEN # define PATH_MAX MAXPATHLEN # endif # ifndef PATH_MAX # define PATH_MAX _POSIX_PATH_MAX # endif #endif /* _PATHMAX_H */ blame-1.3.1/lib/argp.h0000644000076400007640000006521110527555557011422 00000000000000/* Hierarchial argument parsing, layered over getopt. Copyright (C) 1995-1999,2003-2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _ARGP_H #define _ARGP_H #include #include #include #include #define __need_error_t #include #ifndef __THROW # define __THROW #endif #ifndef __NTH # define __NTH(fct) fct __THROW #endif #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || __STRICT_ANSI__ # define __format__ format # define __printf__ printf # endif #endif /* GCC 2.95 and later have "__restrict"; C99 compilers have "restrict", and "configure" may have defined "restrict". */ #ifndef __restrict # if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)) # if defined restrict || 199901L <= __STDC_VERSION__ # define __restrict restrict # else # define __restrict # endif # endif #endif #ifndef __error_t_defined typedef int error_t; # define __error_t_defined #endif #ifdef __cplusplus extern "C" { #endif /* A description of a particular option. A pointer to an array of these is passed in the OPTIONS field of an argp structure. Each option entry can correspond to one long option and/or one short option; more names for the same option can be added by following an entry in an option array with options having the OPTION_ALIAS flag set. */ struct argp_option { /* The long option name. For more than one name for the same option, you can use following options with the OPTION_ALIAS flag set. */ const char *name; /* What key is returned for this option. If > 0 and printable, then it's also accepted as a short option. */ int key; /* If non-NULL, this is the name of the argument associated with this option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */ const char *arg; /* OPTION_ flags. */ int flags; /* The doc string for this option. If both NAME and KEY are 0, This string will be printed outdented from the normal option column, making it useful as a group header (it will be the first thing printed in its group); in this usage, it's conventional to end the string with a `:'. Write the initial value as N_("TEXT") if you want xgettext to collect it into a POT file. */ const char *doc; /* The group this option is in. In a long help message, options are sorted alphabetically within each group, and the groups presented in the order 0, 1, 2, ..., n, -m, ..., -2, -1. Every entry in an options array with if this field 0 will inherit the group number of the previous entry, or zero if it's the first one, unless its a group header (NAME and KEY both 0), in which case, the previous entry + 1 is the default. Automagic options such as --help are put into group -1. */ int group; }; /* The argument associated with this option is optional. */ #define OPTION_ARG_OPTIONAL 0x1 /* This option isn't displayed in any help messages. */ #define OPTION_HIDDEN 0x2 /* This option is an alias for the closest previous non-alias option. This means that it will be displayed in the same help entry, and will inherit fields other than NAME and KEY from the aliased option. */ #define OPTION_ALIAS 0x4 /* This option isn't actually an option (and so should be ignored by the actual option parser), but rather an arbitrary piece of documentation that should be displayed in much the same manner as the options. If this flag is set, then the option NAME field is displayed unmodified (e.g., no `--' prefix is added) at the left-margin (where a *short* option would normally be displayed), and the documentation string in the normal place. The NAME field will be translated using gettext, unless OPTION_NO_TRANS is set (see below). For purposes of sorting, any leading whitespace and punctuation is ignored, except that if the first non-whitespace character is not `-', this entry is displayed after all options (and OPTION_DOC entries with a leading `-') in the same group. */ #define OPTION_DOC 0x8 /* This option shouldn't be included in `long' usage messages (but is still included in help messages). This is mainly intended for options that are completely documented in an argp's ARGS_DOC field, in which case including the option in the generic usage list would be redundant. For instance, if ARGS_DOC is "FOO BAR\n-x BLAH", and the `-x' option's purpose is to distinguish these two cases, -x should probably be marked OPTION_NO_USAGE. */ #define OPTION_NO_USAGE 0x10 /* Valid only in conjunction with OPTION_DOC. This option disables translation of option name. */ #define OPTION_NO_TRANS 0x20 struct argp; /* fwd declare this type */ struct argp_state; /* " */ struct argp_child; /* " */ /* The type of a pointer to an argp parsing function. */ typedef error_t (*argp_parser_t) (int key, char *arg, struct argp_state *state); /* What to return for unrecognized keys. For special ARGP_KEY_ keys, such returns will simply be ignored. For user keys, this error will be turned into EINVAL (if the call to argp_parse is such that errors are propagated back to the user instead of exiting); returning EINVAL itself would result in an immediate stop to parsing in *all* cases. */ #define ARGP_ERR_UNKNOWN E2BIG /* Hurd should never need E2BIG. XXX */ /* Special values for the KEY argument to an argument parsing function. ARGP_ERR_UNKNOWN should be returned if they aren't understood. The sequence of keys to a parsing function is either (where each uppercased word should be prefixed by `ARGP_KEY_' and opt is a user key): INIT opt... NO_ARGS END SUCCESS -- No non-option arguments at all or INIT (opt | ARG)... END SUCCESS -- All non-option args parsed or INIT (opt | ARG)... SUCCESS -- Some non-option arg unrecognized The third case is where every parser returned ARGP_KEY_UNKNOWN for an argument, in which case parsing stops at that argument (returning the unparsed arguments to the caller of argp_parse if requested, or stopping with an error message if not). If an error occurs (either detected by argp, or because the parsing function returned an error value), then the parser is called with ARGP_KEY_ERROR, and no further calls are made. */ /* This is not an option at all, but rather a command line argument. If a parser receiving this key returns success, the fact is recorded, and the ARGP_KEY_NO_ARGS case won't be used. HOWEVER, if while processing the argument, a parser function decrements the NEXT field of the state it's passed, the option won't be considered processed; this is to allow you to actually modify the argument (perhaps into an option), and have it processed again. */ #define ARGP_KEY_ARG 0 /* There are remaining arguments not parsed by any parser, which may be found starting at (STATE->argv + STATE->next). If success is returned, but STATE->next left untouched, it's assumed that all arguments were consume, otherwise, the parser should adjust STATE->next to reflect any arguments consumed. */ #define ARGP_KEY_ARGS 0x1000006 /* There are no more command line arguments at all. */ #define ARGP_KEY_END 0x1000001 /* Because it's common to want to do some special processing if there aren't any non-option args, user parsers are called with this key if they didn't successfully process any non-option arguments. Called just before ARGP_KEY_END (where more general validity checks on previously parsed arguments can take place). */ #define ARGP_KEY_NO_ARGS 0x1000002 /* Passed in before any parsing is done. Afterwards, the values of each element of the CHILD_INPUT field, if any, in the state structure is copied to each child's state to be the initial value of the INPUT field. */ #define ARGP_KEY_INIT 0x1000003 /* Use after all other keys, including SUCCESS & END. */ #define ARGP_KEY_FINI 0x1000007 /* Passed in when parsing has successfully been completed (even if there are still arguments remaining). */ #define ARGP_KEY_SUCCESS 0x1000004 /* Passed in if an error occurs. */ #define ARGP_KEY_ERROR 0x1000005 /* An argp structure contains a set of options declarations, a function to deal with parsing one, documentation string, a possible vector of child argp's, and perhaps a function to filter help output. When actually parsing options, getopt is called with the union of all the argp structures chained together through their CHILD pointers, with conflicts being resolved in favor of the first occurrence in the chain. */ struct argp { /* An array of argp_option structures, terminated by an entry with both NAME and KEY having a value of 0. */ const struct argp_option *options; /* What to do with an option from this structure. KEY is the key associated with the option, and ARG is any associated argument (NULL if none was supplied). If KEY isn't understood, ARGP_ERR_UNKNOWN should be returned. If a non-zero, non-ARGP_ERR_UNKNOWN value is returned, then parsing is stopped immediately, and that value is returned from argp_parse(). For special (non-user-supplied) values of KEY, see the ARGP_KEY_ definitions below. */ argp_parser_t parser; /* A string describing what other arguments are wanted by this program. It is only used by argp_usage to print the `Usage:' message. If it contains newlines, the strings separated by them are considered alternative usage patterns, and printed on separate lines (lines after the first are prefix by ` or: ' instead of `Usage:'). */ const char *args_doc; /* If non-NULL, a string containing extra text to be printed before and after the options in a long help message (separated by a vertical tab `\v' character). Write the initial value as N_("BEFORE-TEXT") "\v" N_("AFTER-TEXT") if you want xgettext to collect the two pieces of text into a POT file. */ const char *doc; /* A vector of argp_children structures, terminated by a member with a 0 argp field, pointing to child argps should be parsed with this one. Any conflicts are resolved in favor of this argp, or early argps in the CHILDREN list. This field is useful if you use libraries that supply their own argp structure, which you want to use in conjunction with your own. */ const struct argp_child *children; /* If non-zero, this should be a function to filter the output of help messages. KEY is either a key from an option, in which case TEXT is that option's help text, or a special key from the ARGP_KEY_HELP_ defines, below, describing which other help text TEXT is. The function should return either TEXT, if it should be used as-is, a replacement string, which should be malloced, and will be freed by argp, or NULL, meaning `print nothing'. The value for TEXT is *after* any translation has been done, so if any of the replacement text also needs translation, that should be done by the filter function. INPUT is either the input supplied to argp_parse, or NULL, if argp_help was called directly. */ char *(*help_filter) (int __key, const char *__text, void *__input); /* If non-zero the strings used in the argp library are translated using the domain described by this string. Otherwise the currently installed default domain is used. */ const char *argp_domain; }; /* Possible KEY arguments to a help filter function. */ #define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceeding options. */ #define ARGP_KEY_HELP_POST_DOC 0x2000002 /* Help text following options. */ #define ARGP_KEY_HELP_HEADER 0x2000003 /* Option header string. */ #define ARGP_KEY_HELP_EXTRA 0x2000004 /* After all other documentation; TEXT is NULL for this key. */ /* Explanatory note emitted when duplicate option arguments have been suppressed. */ #define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005 #define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */ /* When an argp has a non-zero CHILDREN field, it should point to a vector of argp_child structures, each of which describes a subsidiary argp. */ struct argp_child { /* The child parser. */ const struct argp *argp; /* Flags for this child. */ int flags; /* If non-zero, an optional header to be printed in help output before the child options. As a side-effect, a non-zero value forces the child options to be grouped together; to achieve this effect without actually printing a header string, use a value of "". */ const char *header; /* Where to group the child options relative to the other (`consolidated') options in the parent argp; the values are the same as the GROUP field in argp_option structs, but all child-groupings follow parent options at a particular group level. If both this field and HEADER are zero, then they aren't grouped at all, but rather merged with the parent options (merging the child's grouping levels with the parents). */ int group; }; /* Parsing state. This is provided to parsing functions called by argp, which may examine and, as noted, modify fields. */ struct argp_state { /* The top level ARGP being parsed. */ const struct argp *root_argp; /* The argument vector being parsed. May be modified. */ int argc; char **argv; /* The index in ARGV of the next arg that to be parsed. May be modified. */ int next; /* The flags supplied to argp_parse. May be modified. */ unsigned flags; /* While calling a parsing function with a key of ARGP_KEY_ARG, this is the number of the current arg, starting at zero, and incremented after each such call returns. At all other times, this is the number of such arguments that have been processed. */ unsigned arg_num; /* If non-zero, the index in ARGV of the first argument following a special `--' argument (which prevents anything following being interpreted as an option). Only set once argument parsing has proceeded past this point. */ int quoted; /* An arbitrary pointer passed in from the user. */ void *input; /* Values to pass to child parsers. This vector will be the same length as the number of children for the current parser. */ void **child_inputs; /* For the parser's use. Initialized to 0. */ void *hook; /* The name used when printing messages. This is initialized to ARGV[0], or PROGRAM_INVOCATION_NAME if that is unavailable. */ char *name; /* Streams used when argp prints something. */ FILE *err_stream; /* For errors; initialized to stderr. */ FILE *out_stream; /* For information; initialized to stdout. */ void *pstate; /* Private, for use by argp. */ }; /* Flags for argp_parse (note that the defaults are those that are convenient for program command line parsing): */ /* Don't ignore the first element of ARGV. Normally (and always unless ARGP_NO_ERRS is set) the first element of the argument vector is skipped for option parsing purposes, as it corresponds to the program name in a command line. */ #define ARGP_PARSE_ARGV0 0x01 /* Don't print error messages for unknown options to stderr; unless this flag is set, ARGP_PARSE_ARGV0 is ignored, as ARGV[0] is used as the program name in the error messages. This flag implies ARGP_NO_EXIT (on the assumption that silent exiting upon errors is bad behaviour). */ #define ARGP_NO_ERRS 0x02 /* Don't parse any non-option args. Normally non-option args are parsed by calling the parse functions with a key of ARGP_KEY_ARG, and the actual arg as the value. Since it's impossible to know which parse function wants to handle it, each one is called in turn, until one returns 0 or an error other than ARGP_ERR_UNKNOWN; if an argument is handled by no one, the argp_parse returns prematurely (but with a return value of 0). If all args have been parsed without error, all parsing functions are called one last time with a key of ARGP_KEY_END. This flag needn't normally be set, as the normal behavior is to stop parsing as soon as some argument can't be handled. */ #define ARGP_NO_ARGS 0x04 /* Parse options and arguments in the same order they occur on the command line -- normally they're rearranged so that all options come first. */ #define ARGP_IN_ORDER 0x08 /* Don't provide the standard long option --help, which causes usage and option help information to be output to stdout, and exit (0) called. */ #define ARGP_NO_HELP 0x10 /* Don't exit on errors (they may still result in error messages). */ #define ARGP_NO_EXIT 0x20 /* Use the gnu getopt `long-only' rules for parsing arguments. */ #define ARGP_LONG_ONLY 0x40 /* Turns off any message-printing/exiting options. */ #define ARGP_SILENT (ARGP_NO_EXIT | ARGP_NO_ERRS | ARGP_NO_HELP) /* Parse the options strings in ARGC & ARGV according to the options in ARGP. FLAGS is one of the ARGP_ flags above. If ARG_INDEX is non-NULL, the index in ARGV of the first unparsed option is returned in it. If an unknown option is present, ARGP_ERR_UNKNOWN is returned; if some parser routine returned a non-zero value, it is returned; otherwise 0 is returned. This function may also call exit unless the ARGP_NO_HELP flag is set. INPUT is a pointer to a value to be passed in to the parser. */ extern error_t argp_parse (const struct argp *__restrict __argp, int /*argc*/, char **__restrict /*argv*/, unsigned __flags, int *__restrict __arg_index, void *__restrict __input); extern error_t __argp_parse (const struct argp *__restrict __argp, int /*argc*/, char **__restrict /*argv*/, unsigned __flags, int *__restrict __arg_index, void *__restrict __input); /* Global variables. */ /* GNULIB makes sure both program_invocation_name and program_invocation_short_name are available */ #ifdef GNULIB_PROGRAM_INVOCATION_NAME extern char *program_invocation_name; # undef HAVE_DECL_PROGRAM_INVOCATION_NAME # define HAVE_DECL_PROGRAM_INVOCATION_NAME 1 #endif #ifdef GNULIB_PROGRAM_INVOCATION_SHORT_NAME extern char *program_invocation_short_name; # undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME # define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 1 #endif /* If defined or set by the user program to a non-zero value, then a default option --version is added (unless the ARGP_NO_HELP flag is used), which will print this string followed by a newline and exit (unless the ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */ extern const char *argp_program_version; /* If defined or set by the user program to a non-zero value, then a default option --version is added (unless the ARGP_NO_HELP flag is used), which calls this function with a stream to print the version to and a pointer to the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is used). This variable takes precedent over ARGP_PROGRAM_VERSION. */ extern void (*argp_program_version_hook) (FILE *__restrict __stream, struct argp_state *__restrict __state); /* If defined or set by the user program, it should point to string that is the bug-reporting address for the program. It will be printed by argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various standard help messages), embedded in a sentence that says something like `Report bugs to ADDR.'. */ extern const char *argp_program_bug_address; /* The exit status that argp will use when exiting due to a parsing error. If not defined or set by the user program, this defaults to EX_USAGE from . */ extern error_t argp_err_exit_status; /* Flags for argp_help. */ #define ARGP_HELP_USAGE 0x01 /* a Usage: message. */ #define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */ #define ARGP_HELP_SEE 0x04 /* a `Try ... for more help' message. */ #define ARGP_HELP_LONG 0x08 /* a long help message. */ #define ARGP_HELP_PRE_DOC 0x10 /* doc string preceding long help. */ #define ARGP_HELP_POST_DOC 0x20 /* doc string following long help. */ #define ARGP_HELP_DOC (ARGP_HELP_PRE_DOC | ARGP_HELP_POST_DOC) #define ARGP_HELP_BUG_ADDR 0x40 /* bug report address */ #define ARGP_HELP_LONG_ONLY 0x80 /* modify output appropriately to reflect ARGP_LONG_ONLY mode. */ /* These ARGP_HELP flags are only understood by argp_state_help. */ #define ARGP_HELP_EXIT_ERR 0x100 /* Call exit(1) instead of returning. */ #define ARGP_HELP_EXIT_OK 0x200 /* Call exit(0) instead of returning. */ /* The standard thing to do after a program command line parsing error, if an error message has already been printed. */ #define ARGP_HELP_STD_ERR \ (ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR) /* The standard thing to do after a program command line parsing error, if no more specific error message has been printed. */ #define ARGP_HELP_STD_USAGE \ (ARGP_HELP_SHORT_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR) /* The standard thing to do in response to a --help option. */ #define ARGP_HELP_STD_HELP \ (ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK \ | ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR) /* Output a usage message for ARGP to STREAM. FLAGS are from the set ARGP_HELP_*. */ extern void argp_help (const struct argp *__restrict __argp, FILE *__restrict __stream, unsigned __flags, char *__restrict __name); extern void __argp_help (const struct argp *__restrict __argp, FILE *__restrict __stream, unsigned __flags, char *__name); /* The following routines are intended to be called from within an argp parsing routine (thus taking an argp_state structure as the first argument). They may or may not print an error message and exit, depending on the flags in STATE -- in any case, the caller should be prepared for them *not* to exit, and should return an appropiate error after calling them. [argp_usage & argp_error should probably be called argp_state_..., but they're used often enough that they should be short] */ /* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are from the set ARGP_HELP_*. */ extern void argp_state_help (const struct argp_state *__restrict __state, FILE *__restrict __stream, unsigned int __flags); extern void __argp_state_help (const struct argp_state *__restrict __state, FILE *__restrict __stream, unsigned int __flags); /* Possibly output the standard usage message for ARGP to stderr and exit. */ extern void argp_usage (const struct argp_state *__state); extern void __argp_usage (const struct argp_state *__state); /* If appropriate, print the printf string FMT and following args, preceded by the program name and `:', to stderr, and followed by a `Try ... --help' message, then exit (1). */ extern void argp_error (const struct argp_state *__restrict __state, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); extern void __argp_error (const struct argp_state *__restrict __state, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); /* Similar to the standard gnu error-reporting function error(), but will respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print to STATE->err_stream. This is useful for argument parsing code that is shared between program startup (when exiting is desired) and runtime option parsing (when typically an error code is returned instead). The difference between this function and argp_error is that the latter is for *parsing errors*, and the former is for other problems that occur during parsing but don't reflect a (syntactic) problem with the input. */ extern void argp_failure (const struct argp_state *__restrict __state, int __status, int __errnum, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 4, 5))); extern void __argp_failure (const struct argp_state *__restrict __state, int __status, int __errnum, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 4, 5))); /* Returns true if the option OPT is a valid short option. */ extern int _option_is_short (const struct argp_option *__opt) __THROW; extern int __option_is_short (const struct argp_option *__opt) __THROW; /* Returns true if the option OPT is in fact the last (unused) entry in an options array. */ extern int _option_is_end (const struct argp_option *__opt) __THROW; extern int __option_is_end (const struct argp_option *__opt) __THROW; /* Return the input field for ARGP in the parser corresponding to STATE; used by the help routines. */ extern void *_argp_input (const struct argp *__restrict __argp, const struct argp_state *__restrict __state) __THROW; extern void *__argp_input (const struct argp *__restrict __argp, const struct argp_state *__restrict __state) __THROW; #ifdef __USE_EXTERN_INLINES # if !_LIBC # define __argp_usage argp_usage # define __argp_state_help argp_state_help # define __option_is_short _option_is_short # define __option_is_end _option_is_end # endif # ifndef ARGP_EI # define ARGP_EI extern __inline__ # endif ARGP_EI void __argp_usage (const struct argp_state *__state) { __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE); } ARGP_EI int __NTH (__option_is_short (const struct argp_option *__opt)) { if (__opt->flags & OPTION_DOC) return 0; else { int __key = __opt->key; return __key > 0 && __key <= UCHAR_MAX && isprint (__key); } } ARGP_EI int __NTH (__option_is_end (const struct argp_option *__opt)) { return !__opt->key && !__opt->name && !__opt->doc && !__opt->group; } # if !_LIBC # undef __argp_usage # undef __argp_state_help # undef __option_is_short # undef __option_is_end # endif #endif /* Use extern inlines. */ #ifdef __cplusplus } #endif #endif /* argp.h */ blame-1.3.1/lib/getcwd.c0000644000076400007640000002414710527555557011744 00000000000000/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2004,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !_LIBC # include # include "getcwd.h" #endif #include #include #include #include #include #include /* For AT_FDCWD on Solaris 9. */ #ifndef __set_errno # define __set_errno(val) (errno = (val)) #endif #include #ifndef _D_EXACT_NAMLEN # define _D_EXACT_NAMLEN(d) strlen ((d)->d_name) #endif #ifndef _D_ALLOC_NAMLEN # define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1) #endif #include #include #include #if _LIBC # ifndef mempcpy # define mempcpy __mempcpy # endif #else # include "mempcpy.h" #endif #include /* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its value exceeds INT_MAX, so its use as an int doesn't conform to the C standard, and GCC and Sun C complain in some cases. */ #if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553 # undef AT_FDCWD # define AT_FDCWD (-3041965) #endif #ifdef ENAMETOOLONG # define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG) #else # define is_ENAMETOOLONG(x) 0 #endif #ifndef MAX # define MAX(a, b) ((a) < (b) ? (b) : (a)) #endif #ifndef MIN # define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif #ifndef PATH_MAX # ifdef MAXPATHLEN # define PATH_MAX MAXPATHLEN # else # define PATH_MAX 1024 # endif #endif #if D_INO_IN_DIRENT # define MATCHING_INO(dp, ino) ((dp)->d_ino == (ino)) #else # define MATCHING_INO(dp, ino) true #endif #if !_LIBC # define __getcwd getcwd # define __lstat lstat # define __closedir closedir # define __opendir opendir # define __readdir readdir #endif /* Get the name of the current working directory, and put it in SIZE bytes of BUF. Returns NULL if the directory couldn't be determined or SIZE was too small. If successful, returns BUF. In GNU, 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. */ char * __getcwd (char *buf, size_t size) { /* Lengths of big file name components and entire file names, and a deep level of file name nesting. These numbers are not upper bounds; they are merely large values suitable for initial allocations, designed to be large enough for most real-world uses. */ enum { BIG_FILE_NAME_COMPONENT_LENGTH = 255, BIG_FILE_NAME_LENGTH = MIN (4095, PATH_MAX - 1), DEEP_NESTING = 100 }; #ifdef AT_FDCWD int fd = AT_FDCWD; bool fd_needs_closing = false; #else char dots[DEEP_NESTING * sizeof ".." + BIG_FILE_NAME_COMPONENT_LENGTH + 1]; char *dotlist = dots; size_t dotsize = sizeof dots; size_t dotlen = 0; #endif DIR *dirstream = NULL; dev_t rootdev, thisdev; ino_t rootino, thisino; char *dir; register char *dirp; struct stat st; size_t allocated = size; size_t used; #if HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD /* The system getcwd works, except it sometimes fails when it shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT. If AT_FDCWD is not defined, the algorithm below is O(N**2) and this is much slower than the system getcwd (at least on GNU/Linux). So trust the system getcwd's results unless they look suspicious. */ # undef getcwd dir = getcwd (buf, size); if (dir || (errno != ERANGE && !is_ENAMETOOLONG (errno) && errno != ENOENT)) return dir; #endif if (size == 0) { if (buf != NULL) { __set_errno (EINVAL); return NULL; } allocated = BIG_FILE_NAME_LENGTH + 1; } if (buf == NULL) { dir = malloc (allocated); if (dir == NULL) return NULL; } else dir = buf; dirp = dir + allocated; *--dirp = '\0'; if (__lstat (".", &st) < 0) goto lose; thisdev = st.st_dev; thisino = st.st_ino; if (__lstat ("/", &st) < 0) goto lose; rootdev = st.st_dev; rootino = st.st_ino; while (!(thisdev == rootdev && thisino == rootino)) { struct dirent *d; dev_t dotdev; ino_t dotino; bool mount_point; int parent_status; size_t dirroom; size_t namlen; bool use_d_ino = true; /* Look at the parent directory. */ #ifdef AT_FDCWD fd = openat (fd, "..", O_RDONLY); if (fd < 0) goto lose; fd_needs_closing = true; parent_status = fstat (fd, &st); #else dotlist[dotlen++] = '.'; dotlist[dotlen++] = '.'; dotlist[dotlen] = '\0'; parent_status = __lstat (dotlist, &st); #endif if (parent_status != 0) goto lose; if (dirstream && __closedir (dirstream) != 0) { dirstream = NULL; goto lose; } /* Figure out if this directory is a mount point. */ dotdev = st.st_dev; dotino = st.st_ino; mount_point = dotdev != thisdev; /* Search for the last directory. */ #ifdef AT_FDCWD dirstream = fdopendir (fd); if (dirstream == NULL) goto lose; fd_needs_closing = false; #else dirstream = __opendir (dotlist); if (dirstream == NULL) goto lose; dotlist[dotlen++] = '/'; #endif for (;;) { /* Clear errno to distinguish EOF from error if readdir returns NULL. */ __set_errno (0); d = __readdir (dirstream); /* When we've iterated through all directory entries without finding one with a matching d_ino, rewind the stream and consider each name again, but this time, using lstat. This is necessary in a chroot on at least one system (glibc-2.3.6 + linux 2.6.12), where .., ../.., ../../.., etc. all had the same device number, yet the d_ino values for entries in / did not match those obtained via lstat. */ if (d == NULL && errno == 0 && use_d_ino) { use_d_ino = false; rewinddir (dirstream); d = __readdir (dirstream); } if (d == NULL) { if (errno == 0) /* EOF on dirstream, which can mean e.g., that the current directory has been removed. */ __set_errno (ENOENT); goto lose; } if (d->d_name[0] == '.' && (d->d_name[1] == '\0' || (d->d_name[1] == '.' && d->d_name[2] == '\0'))) continue; if (use_d_ino) { bool match = (MATCHING_INO (d, thisino) || mount_point); if (! match) continue; } { int entry_status; #ifdef AT_FDCWD entry_status = fstatat (fd, d->d_name, &st, AT_SYMLINK_NOFOLLOW); #else /* Compute size needed for this file name, or for the file name ".." in the same directory, whichever is larger. Room for ".." might be needed the next time through the outer loop. */ size_t name_alloc = _D_ALLOC_NAMLEN (d); size_t filesize = dotlen + MAX (sizeof "..", name_alloc); if (filesize < dotlen) goto memory_exhausted; if (dotsize < filesize) { /* My, what a deep directory tree you have, Grandma. */ size_t newsize = MAX (filesize, dotsize * 2); size_t i; if (newsize < dotsize) goto memory_exhausted; if (dotlist != dots) free (dotlist); dotlist = malloc (newsize); if (dotlist == NULL) goto lose; dotsize = newsize; i = 0; do { dotlist[i++] = '.'; dotlist[i++] = '.'; dotlist[i++] = '/'; } while (i < dotlen); } memcpy (dotlist + dotlen, d->d_name, _D_ALLOC_NAMLEN (d)); entry_status = __lstat (dotlist, &st); #endif /* We don't fail here if we cannot stat() a directory entry. This can happen when (network) file systems fail. If this entry is in fact the one we are looking for we will find out soon as we reach the end of the directory without having found anything. */ if (entry_status == 0 && S_ISDIR (st.st_mode) && st.st_dev == thisdev && st.st_ino == thisino) break; } } dirroom = dirp - dir; namlen = _D_EXACT_NAMLEN (d); if (dirroom <= namlen) { if (size != 0) { __set_errno (ERANGE); goto lose; } else { char *tmp; size_t oldsize = allocated; allocated += MAX (allocated, namlen); if (allocated < oldsize || ! (tmp = realloc (dir, allocated))) goto memory_exhausted; /* Move current contents up to the end of the buffer. This is guaranteed to be non-overlapping. */ dirp = memcpy (tmp + allocated - (oldsize - dirroom), tmp + dirroom, oldsize - dirroom); dir = tmp; } } dirp -= namlen; memcpy (dirp, d->d_name, namlen); *--dirp = '/'; thisdev = dotdev; thisino = dotino; } if (dirstream && __closedir (dirstream) != 0) { dirstream = NULL; goto lose; } if (dirp == &dir[allocated - 1]) *--dirp = '/'; #ifndef AT_FDCWD if (dotlist != dots) free (dotlist); #endif used = dir + allocated - dirp; memmove (dir, dirp, used); if (buf == NULL && size == 0) /* Ensure that the buffer is only as large as necessary. */ buf = realloc (dir, used); if (buf == NULL) /* Either buf was NULL all along, or `realloc' failed but we still have the original string. */ buf = dir; return buf; memory_exhausted: __set_errno (ENOMEM); lose: { int save = errno; if (dirstream) __closedir (dirstream); #ifdef AT_FDCWD if (fd_needs_closing) close (fd); #else if (dotlist != dots) free (dotlist); #endif if (buf == NULL) free (dir); __set_errno (save); } return NULL; } #ifdef weak_alias weak_alias (__getcwd, getcwd) #endif blame-1.3.1/lib/lstat.c0000644000076400007640000000530510527555557011611 00000000000000/* Work around a bug of lstat on some systems Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* written by Jim Meyering */ #include /* The specification of these functions is in sys_stat.h. But we cannot include this include file here, because on some systems, a "#define lstat lstat64" is being used, and sys_stat.h deletes this definition. */ #include #include #include #include /* lstat works differently on Linux and Solaris systems. POSIX (see `pathname resolution' in the glossary) requires that programs like `ls' take into consideration the fact that FILE has a trailing slash when FILE is a symbolic link. On Linux and Solaris 10 systems, the lstat function already has the desired semantics (in treating `lstat ("symlink/", sbuf)' just like `lstat ("symlink/.", sbuf)', but on Solaris 9 and earlier it does not. If FILE has a trailing slash and specifies a symbolic link, then use stat() to get more info on the referent of FILE. If the referent is a non-directory, then set errno to ENOTDIR and return -1. Otherwise, return stat's result. */ int rpl_lstat (const char *file, struct stat *sbuf) { size_t len; int lstat_result = lstat (file, sbuf); if (lstat_result != 0 || !S_ISLNK (sbuf->st_mode)) return lstat_result; len = strlen (file); if (len == 0 || file[len - 1] != '/') return 0; /* FILE refers to a symbolic link and the name ends with a slash. Call stat() to get info about the link's referent. */ /* If stat fails, then we do the same. */ if (stat (file, sbuf) != 0) return -1; /* If FILE references a directory, return 0. */ if (S_ISDIR (sbuf->st_mode)) return 0; /* Here, we know stat succeeded and FILE references a non-directory. But it was specified via a name including a trailing slash. Fail with errno set to ENOTDIR to indicate the contradiction. */ errno = ENOTDIR; return -1; } blame-1.3.1/lib/vasnprintf.h0000644000076400007640000000541010241344124012631 00000000000000/* vsprintf with automatic memory allocation. Copyright (C) 2002-2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _VASNPRINTF_H #define _VASNPRINTF_H /* Get va_list. */ #include /* Get size_t. */ #include #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __format__ format # define __printf__ printf # endif #endif #ifdef __cplusplus extern "C" { #endif /* Write formatted output to a string dynamically allocated with malloc(). You can pass a preallocated buffer for the result in RESULTBUF and its size in *LENGTHP; otherwise you pass RESULTBUF = NULL. If successful, return the address of the string (this may be = RESULTBUF if no dynamic memory allocation was necessary) and set *LENGTHP to the number of resulting bytes, excluding the trailing NUL. Upon error, set errno and return NULL. When dynamic memory allocation occurs, the preallocated buffer is left alone (with possibly modified contents). This makes it possible to use a statically allocated or stack-allocated buffer, like this: char buf[100]; size_t len = sizeof (buf); char *output = vasnprintf (buf, &len, format, args); if (output == NULL) ... error handling ...; else { ... use the output string ...; if (output != buf) free (output); } */ extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) __attribute__ ((__format__ (__printf__, 3, 0))); #ifdef __cplusplus } #endif #endif /* _VASNPRINTF_H */ blame-1.3.1/lib/ansi2knr.10000664000076400007640000000277110260234751012115 00000000000000.TH ANSI2KNR 1 "19 Jan 1996" .SH NAME ansi2knr \- convert ANSI C to Kernighan & Ritchie C .SH SYNOPSIS .I ansi2knr [--varargs] input_file [output_file] .SH DESCRIPTION If no output_file is supplied, output goes to stdout. .br There are no error messages. .sp .I ansi2knr recognizes function definitions by seeing a non-keyword identifier at the left margin, followed by a left parenthesis, with a right parenthesis as the last character on the line, and with a left brace as the first token on the following line (ignoring possible intervening comments). It will recognize a multi-line header provided that no intervening line ends with a left or right brace or a semicolon. These algorithms ignore whitespace and comments, except that the function name must be the first thing on the line. .sp The following constructs will confuse it: .br - Any other construct that starts at the left margin and follows the above syntax (such as a macro or function call). .br - Some macros that tinker with the syntax of the function header. .sp The --varargs switch is obsolete, and is recognized only for backwards compatibility. The present version of .I ansi2knr will always attempt to convert a ... argument to va_alist and va_dcl. .SH AUTHOR L. Peter Deutsch wrote the original ansi2knr and continues to maintain the current version; most of the code in the current version is his work. ansi2knr also includes contributions by Francois Pinard and Jim Avera . blame-1.3.1/lib/argp-pvh.c0000644000076400007640000000264310337302606012170 00000000000000/* Default definition for ARGP_PROGRAM_VERSION_HOOK. Copyright (C) 1996, 1997, 1999, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "argp.h" /* If set by the user program to a non-zero value, then a default option --version is added (unless the ARGP_NO_HELP flag is used), which calls this function with a stream to print the version to and a pointer to the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is used). This variable takes precedent over ARGP_PROGRAM_VERSION. */ void (*argp_program_version_hook) (FILE *stream, struct argp_state *state) = NULL; blame-1.3.1/lib/exitfail.h0000644000076400007640000000150310241344113012241 00000000000000/* Failure exit status Copyright (C) 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ extern int volatile exit_failure; blame-1.3.1/lib/strftime.h0000644000076400007640000000157510241344123012303 00000000000000/* declarations for strftime.c Copyright (C) 2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include size_t nstrftime (char *, size_t, char const *, struct tm const *, int, int); blame-1.3.1/lib/memmove.c0000644000076400007640000000124110527555557012122 00000000000000/* memmove.c -- copy memory. Copy LENGTH bytes from SOURCE to DEST. Does not null-terminate. In the public domain. By David MacKenzie . */ #include #include void * memmove (void *dest0, void const *source0, size_t length) { char *dest = dest0; char const *source = source0; if (source < dest) /* Moving from low mem to hi mem; start at end. */ for (source += length, dest += length; length; --length) *--dest = *--source; else if (source != dest) { /* Moving from hi mem to low mem; start at beginning. */ for (; length; --length) *dest++ = *source++; } return dest0; } blame-1.3.1/lib/mempcpy.c0000644000076400007640000000207310241344116012107 00000000000000/* Copy memory area and return pointer after last written byte. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Specification. */ #include "mempcpy.h" #include /* Copy N bytes of SRC to DEST, return pointer to bytes after the last written byte. */ void * mempcpy (void *dest, const void *src, size_t n) { return (char *) memcpy (dest, src, n) + n; } blame-1.3.1/lib/argp-help.c0000644000076400007640000015703010527555557012344 00000000000000/* Hierarchial argument parsing help output Copyright (C) 1995-2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #ifdef USE_IN_LIBIO # include #endif #ifdef _LIBC # include # undef dgettext # define dgettext(domain, msgid) \ INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES) #else # include "gettext.h" #endif #include "argp.h" #include "argp-fmtstream.h" #include "argp-namefrob.h" #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif /* User-selectable (using an environment variable) formatting parameters. These may be specified in an environment variable called `ARGP_HELP_FMT', with a contents like: VAR1=VAL1,VAR2=VAL2,BOOLVAR2,no-BOOLVAR2 Where VALn must be a positive integer. The list of variables is in the UPARAM_NAMES vector, below. */ /* Default parameters. */ #define DUP_ARGS 0 /* True if option argument can be duplicated. */ #define DUP_ARGS_NOTE 1 /* True to print a note about duplicate args. */ #define SHORT_OPT_COL 2 /* column in which short options start */ #define LONG_OPT_COL 6 /* column in which long options start */ #define DOC_OPT_COL 2 /* column in which doc options start */ #define OPT_DOC_COL 29 /* column in which option text starts */ #define HEADER_COL 1 /* column in which group headers are printed */ #define USAGE_INDENT 12 /* indentation of wrapped usage lines */ #define RMARGIN 79 /* right margin used for wrapping */ /* User-selectable (using an environment variable) formatting parameters. They must all be of type `int' for the parsing code to work. */ struct uparams { /* If true, arguments for an option are shown with both short and long options, even when a given option has both, e.g. `-x ARG, --longx=ARG'. If false, then if an option has both, the argument is only shown with the long one, e.g., `-x, --longx=ARG', and a message indicating that this really means both is printed below the options. */ int dup_args; /* This is true if when DUP_ARGS is false, and some duplicate arguments have been suppressed, an explanatory message should be printed. */ int dup_args_note; /* Various output columns. */ int short_opt_col; /* column in which short options start */ int long_opt_col; /* column in which long options start */ int doc_opt_col; /* column in which doc options start */ int opt_doc_col; /* column in which option text starts */ int header_col; /* column in which group headers are printed */ int usage_indent; /* indentation of wrapped usage lines */ int rmargin; /* right margin used for wrapping */ int valid; /* True when the values in here are valid. */ }; /* This is a global variable, as user options are only ever read once. */ static struct uparams uparams = { DUP_ARGS, DUP_ARGS_NOTE, SHORT_OPT_COL, LONG_OPT_COL, DOC_OPT_COL, OPT_DOC_COL, HEADER_COL, USAGE_INDENT, RMARGIN, 0 }; /* A particular uparam, and what the user name is. */ struct uparam_name { const char *name; /* User name. */ int is_bool; /* Whether it's `boolean'. */ size_t uparams_offs; /* Location of the (int) field in UPARAMS. */ }; /* The name-field mappings we know about. */ static const struct uparam_name uparam_names[] = { { "dup-args", 1, offsetof (struct uparams, dup_args) }, { "dup-args-note", 1, offsetof (struct uparams, dup_args_note) }, { "short-opt-col", 0, offsetof (struct uparams, short_opt_col) }, { "long-opt-col", 0, offsetof (struct uparams, long_opt_col) }, { "doc-opt-col", 0, offsetof (struct uparams, doc_opt_col) }, { "opt-doc-col", 0, offsetof (struct uparams, opt_doc_col) }, { "header-col", 0, offsetof (struct uparams, header_col) }, { "usage-indent", 0, offsetof (struct uparams, usage_indent) }, { "rmargin", 0, offsetof (struct uparams, rmargin) }, { 0 } }; static void validate_uparams (const struct argp_state *state, struct uparams *upptr) { const struct uparam_name *up; for (up = uparam_names; up->name; up++) { if (up->is_bool || up->uparams_offs == offsetof (struct uparams, rmargin)) continue; if (*(int *)((char *)upptr + up->uparams_offs) >= upptr->rmargin) { __argp_failure (state, 0, 0, dgettext (state->root_argp->argp_domain, "\ ARGP_HELP_FMT: %s value is less than or equal to %s"), "rmargin", up->name); return; } } uparams = *upptr; uparams.valid = 1; } /* Read user options from the environment, and fill in UPARAMS appropiately. */ static void fill_in_uparams (const struct argp_state *state) { const char *var = getenv ("ARGP_HELP_FMT"); struct uparams new_params = uparams; #define SKIPWS(p) do { while (isspace (*p)) p++; } while (0); if (var) { /* Parse var. */ while (*var) { SKIPWS (var); if (isalpha (*var)) { size_t var_len; const struct uparam_name *un; int unspec = 0, val = 0; const char *arg = var; while (isalnum (*arg) || *arg == '-' || *arg == '_') arg++; var_len = arg - var; SKIPWS (arg); if (*arg == '\0' || *arg == ',') unspec = 1; else if (*arg == '=') { arg++; SKIPWS (arg); } if (unspec) { if (var[0] == 'n' && var[1] == 'o' && var[2] == '-') { val = 0; var += 3; var_len -= 3; } else val = 1; } else if (isdigit (*arg)) { val = atoi (arg); while (isdigit (*arg)) arg++; SKIPWS (arg); } for (un = uparam_names; un->name; un++) if (strlen (un->name) == var_len && strncmp (var, un->name, var_len) == 0) { if (unspec && !un->is_bool) __argp_failure (state, 0, 0, dgettext (state->root_argp->argp_domain, "\ %.*s: ARGP_HELP_FMT parameter requires a value"), (int) var_len, var); else if (val < 0) __argp_failure (state, 0, 0, dgettext (state->root_argp->argp_domain, "\ %.*s: ARGP_HELP_FMT parameter must be positive"), (int) var_len, var); else *(int *)((char *)&new_params + un->uparams_offs) = val; break; } if (! un->name) __argp_failure (state, 0, 0, dgettext (state->root_argp->argp_domain, "\ %.*s: Unknown ARGP_HELP_FMT parameter"), (int) var_len, var); var = arg; if (*var == ',') var++; } else if (*var) { __argp_failure (state, 0, 0, dgettext (state->root_argp->argp_domain, "Garbage in ARGP_HELP_FMT: %s"), var); break; } } validate_uparams (state, &new_params); } } /* Returns true if OPT hasn't been marked invisible. Visibility only affects whether OPT is displayed or used in sorting, not option shadowing. */ #define ovisible(opt) (! ((opt)->flags & OPTION_HIDDEN)) /* Returns true if OPT is an alias for an earlier option. */ #define oalias(opt) ((opt)->flags & OPTION_ALIAS) /* Returns true if OPT is an documentation-only entry. */ #define odoc(opt) ((opt)->flags & OPTION_DOC) /* Returns true if OPT should not be translated */ #define onotrans(opt) ((opt)->flags & OPTION_NO_TRANS) /* Returns true if OPT is the end-of-list marker for a list of options. */ #define oend(opt) __option_is_end (opt) /* Returns true if OPT has a short option. */ #define oshort(opt) __option_is_short (opt) /* The help format for a particular option is like: -xARG, -yARG, --long1=ARG, --long2=ARG Documentation... Where ARG will be omitted if there's no argument, for this option, or will be surrounded by "[" and "]" appropiately if the argument is optional. The documentation string is word-wrapped appropiately, and if the list of options is long enough, it will be started on a separate line. If there are no short options for a given option, the first long option is indented slighly in a way that's supposed to make most long options appear to be in a separate column. For example, the following output (from ps): -p PID, --pid=PID List the process PID --pgrp=PGRP List processes in the process group PGRP -P, -x, --no-parent Include processes without parents -Q, --all-fields Don't elide unusable fields (normally if there's some reason ps can't print a field for any process, it's removed from the output entirely) -r, --reverse, --gratuitously-long-reverse-option Reverse the order of any sort --session[=SID] Add the processes from the session SID (which defaults to the sid of the current process) Here are some more options: -f ZOT, --foonly=ZOT Glork a foonly -z, --zaza Snit a zar -?, --help Give this help list --usage Give a short usage message -V, --version Print program version The struct argp_option array for the above could look like: { {"pid", 'p', "PID", 0, "List the process PID"}, {"pgrp", OPT_PGRP, "PGRP", 0, "List processes in the process group PGRP"}, {"no-parent", 'P', 0, 0, "Include processes without parents"}, {0, 'x', 0, OPTION_ALIAS}, {"all-fields",'Q', 0, 0, "Don't elide unusable fields (normally" " if there's some reason ps can't" " print a field for any process, it's" " removed from the output entirely)" }, {"reverse", 'r', 0, 0, "Reverse the order of any sort"}, {"gratuitously-long-reverse-option", 0, 0, OPTION_ALIAS}, {"session", OPT_SESS, "SID", OPTION_ARG_OPTIONAL, "Add the processes from the session" " SID (which defaults to the sid of" " the current process)" }, {0,0,0,0, "Here are some more options:"}, {"foonly", 'f', "ZOT", 0, "Glork a foonly"}, {"zaza", 'z', 0, 0, "Snit a zar"}, {0} } Note that the last three options are automatically supplied by argp_parse, unless you tell it not to with ARGP_NO_HELP. */ /* Returns true if CH occurs between BEG and END. */ static int find_char (char ch, char *beg, char *end) { while (beg < end) if (*beg == ch) return 1; else beg++; return 0; } struct hol_cluster; /* fwd decl */ struct hol_entry { /* First option. */ const struct argp_option *opt; /* Number of options (including aliases). */ unsigned num; /* A pointers into the HOL's short_options field, to the first short option letter for this entry. The order of the characters following this point corresponds to the order of options pointed to by OPT, and there are at most NUM. A short option recorded in a option following OPT is only valid if it occurs in the right place in SHORT_OPTIONS (otherwise it's probably been shadowed by some other entry). */ char *short_options; /* Entries are sorted by their group first, in the order: 1, 2, ..., n, 0, -m, ..., -2, -1 and then alphabetically within each group. The default is 0. */ int group; /* The cluster of options this entry belongs to, or 0 if none. */ struct hol_cluster *cluster; /* The argp from which this option came. */ const struct argp *argp; }; /* A cluster of entries to reflect the argp tree structure. */ struct hol_cluster { /* A descriptive header printed before options in this cluster. */ const char *header; /* Used to order clusters within the same group with the same parent, according to the order in which they occurred in the parent argp's child list. */ int index; /* How to sort this cluster with respect to options and other clusters at the same depth (clusters always follow options in the same group). */ int group; /* The cluster to which this cluster belongs, or 0 if it's at the base level. */ struct hol_cluster *parent; /* The argp from which this cluster is (eventually) derived. */ const struct argp *argp; /* The distance this cluster is from the root. */ int depth; /* Clusters in a given hol are kept in a linked list, to make freeing them possible. */ struct hol_cluster *next; }; /* A list of options for help. */ struct hol { /* An array of hol_entry's. */ struct hol_entry *entries; /* The number of entries in this hol. If this field is zero, the others are undefined. */ unsigned num_entries; /* A string containing all short options in this HOL. Each entry contains pointers into this string, so the order can't be messed with blindly. */ char *short_options; /* Clusters of entries in this hol. */ struct hol_cluster *clusters; }; /* Create a struct hol from the options in ARGP. CLUSTER is the hol_cluster in which these entries occur, or 0, if at the root. */ static struct hol * make_hol (const struct argp *argp, struct hol_cluster *cluster) { char *so; const struct argp_option *o; const struct argp_option *opts = argp->options; struct hol_entry *entry; unsigned num_short_options = 0; struct hol *hol = malloc (sizeof (struct hol)); assert (hol); hol->num_entries = 0; hol->clusters = 0; if (opts) { int cur_group = 0; /* The first option must not be an alias. */ assert (! oalias (opts)); /* Calculate the space needed. */ for (o = opts; ! oend (o); o++) { if (! oalias (o)) hol->num_entries++; if (oshort (o)) num_short_options++; /* This is an upper bound. */ } hol->entries = malloc (sizeof (struct hol_entry) * hol->num_entries); hol->short_options = malloc (num_short_options + 1); assert (hol->entries && hol->short_options); if (SIZE_MAX <= UINT_MAX) assert (hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry)); /* Fill in the entries. */ so = hol->short_options; for (o = opts, entry = hol->entries; ! oend (o); entry++) { entry->opt = o; entry->num = 0; entry->short_options = so; entry->group = cur_group = o->group ? o->group : ((!o->name && !o->key) ? cur_group + 1 : cur_group); entry->cluster = cluster; entry->argp = argp; do { entry->num++; if (oshort (o) && ! find_char (o->key, hol->short_options, so)) /* O has a valid short option which hasn't already been used.*/ *so++ = o->key; o++; } while (! oend (o) && oalias (o)); } *so = '\0'; /* null terminated so we can find the length */ } return hol; } /* Add a new cluster to HOL, with the given GROUP and HEADER (taken from the associated argp child list entry), INDEX, and PARENT, and return a pointer to it. ARGP is the argp that this cluster results from. */ static struct hol_cluster * hol_add_cluster (struct hol *hol, int group, const char *header, int index, struct hol_cluster *parent, const struct argp *argp) { struct hol_cluster *cl = malloc (sizeof (struct hol_cluster)); if (cl) { cl->group = group; cl->header = header; cl->index = index; cl->parent = parent; cl->argp = argp; cl->depth = parent ? parent->depth + 1 : 0; cl->next = hol->clusters; hol->clusters = cl; } return cl; } /* Free HOL and any resources it uses. */ static void hol_free (struct hol *hol) { struct hol_cluster *cl = hol->clusters; while (cl) { struct hol_cluster *next = cl->next; free (cl); cl = next; } if (hol->num_entries > 0) { free (hol->entries); free (hol->short_options); } free (hol); } static int hol_entry_short_iterate (const struct hol_entry *entry, int (*func)(const struct argp_option *opt, const struct argp_option *real, const char *domain, void *cookie), const char *domain, void *cookie) { unsigned nopts; int val = 0; const struct argp_option *opt, *real = entry->opt; char *so = entry->short_options; for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--) if (oshort (opt) && *so == opt->key) { if (!oalias (opt)) real = opt; if (ovisible (opt)) val = (*func)(opt, real, domain, cookie); so++; } return val; } static inline int __attribute__ ((always_inline)) hol_entry_long_iterate (const struct hol_entry *entry, int (*func)(const struct argp_option *opt, const struct argp_option *real, const char *domain, void *cookie), const char *domain, void *cookie) { unsigned nopts; int val = 0; const struct argp_option *opt, *real = entry->opt; for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--) if (opt->name) { if (!oalias (opt)) real = opt; if (ovisible (opt)) val = (*func)(opt, real, domain, cookie); } return val; } /* Iterator that returns true for the first short option. */ static inline int until_short (const struct argp_option *opt, const struct argp_option *real, const char *domain, void *cookie) { return oshort (opt) ? opt->key : 0; } /* Returns the first valid short option in ENTRY, or 0 if there is none. */ static char hol_entry_first_short (const struct hol_entry *entry) { return hol_entry_short_iterate (entry, until_short, entry->argp->argp_domain, 0); } /* Returns the first valid long option in ENTRY, or 0 if there is none. */ static const char * hol_entry_first_long (const struct hol_entry *entry) { const struct argp_option *opt; unsigned num; for (opt = entry->opt, num = entry->num; num > 0; opt++, num--) if (opt->name && ovisible (opt)) return opt->name; return 0; } /* Returns the entry in HOL with the long option name NAME, or 0 if there is none. */ static struct hol_entry * hol_find_entry (struct hol *hol, const char *name) { struct hol_entry *entry = hol->entries; unsigned num_entries = hol->num_entries; while (num_entries-- > 0) { const struct argp_option *opt = entry->opt; unsigned num_opts = entry->num; while (num_opts-- > 0) if (opt->name && ovisible (opt) && strcmp (opt->name, name) == 0) return entry; else opt++; entry++; } return 0; } /* If an entry with the long option NAME occurs in HOL, set it's special sort position to GROUP. */ static void hol_set_group (struct hol *hol, const char *name, int group) { struct hol_entry *entry = hol_find_entry (hol, name); if (entry) entry->group = group; } /* Order by group: 0, 1, 2, ..., n, -m, ..., -2, -1. EQ is what to return if GROUP1 and GROUP2 are the same. */ static int group_cmp (int group1, int group2, int eq) { if (group1 == group2) return eq; else if ((group1 < 0 && group2 < 0) || (group1 >= 0 && group2 >= 0)) return group1 - group2; else return group2 - group1; } /* Compare clusters CL1 & CL2 by the order that they should appear in output. */ static int hol_cluster_cmp (const struct hol_cluster *cl1, const struct hol_cluster *cl2) { /* If one cluster is deeper than the other, use its ancestor at the same level, so that finding the common ancestor is straightforward. */ while (cl1->depth < cl2->depth) cl1 = cl1->parent; while (cl2->depth < cl1->depth) cl2 = cl2->parent; /* Now reduce both clusters to their ancestors at the point where both have a common parent; these can be directly compared. */ while (cl1->parent != cl2->parent) cl1 = cl1->parent, cl2 = cl2->parent; return group_cmp (cl1->group, cl2->group, cl2->index - cl1->index); } /* Return the ancestor of CL that's just below the root (i.e., has a parent of 0). */ static struct hol_cluster * hol_cluster_base (struct hol_cluster *cl) { while (cl->parent) cl = cl->parent; return cl; } /* Return true if CL1 is a child of CL2. */ static int hol_cluster_is_child (const struct hol_cluster *cl1, const struct hol_cluster *cl2) { while (cl1 && cl1 != cl2) cl1 = cl1->parent; return cl1 == cl2; } /* Given the name of a OPTION_DOC option, modifies NAME to start at the tail that should be used for comparisons, and returns true iff it should be treated as a non-option. */ static int canon_doc_option (const char **name) { int non_opt; if (!*name) non_opt = 1; else { /* Skip initial whitespace. */ while (isspace (**name)) (*name)++; /* Decide whether this looks like an option (leading `-') or not. */ non_opt = (**name != '-'); /* Skip until part of name used for sorting. */ while (**name && !isalnum (**name)) (*name)++; } return non_opt; } /* Order ENTRY1 & ENTRY2 by the order which they should appear in a help listing. */ static int hol_entry_cmp (const struct hol_entry *entry1, const struct hol_entry *entry2) { /* The group numbers by which the entries should be ordered; if either is in a cluster, then this is just the group within the cluster. */ int group1 = entry1->group, group2 = entry2->group; if (entry1->cluster != entry2->cluster) { /* The entries are not within the same cluster, so we can't compare them directly, we have to use the appropiate clustering level too. */ if (! entry1->cluster) /* ENTRY1 is at the `base level', not in a cluster, so we have to compare it's group number with that of the base cluster in which ENTRY2 resides. Note that if they're in the same group, the clustered option always comes laster. */ return group_cmp (group1, hol_cluster_base (entry2->cluster)->group, -1); else if (! entry2->cluster) /* Likewise, but ENTRY2's not in a cluster. */ return group_cmp (hol_cluster_base (entry1->cluster)->group, group2, 1); else /* Both entries are in clusters, we can just compare the clusters. */ return hol_cluster_cmp (entry1->cluster, entry2->cluster); } else if (group1 == group2) /* The entries are both in the same cluster and group, so compare them alphabetically. */ { int short1 = hol_entry_first_short (entry1); int short2 = hol_entry_first_short (entry2); int doc1 = odoc (entry1->opt); int doc2 = odoc (entry2->opt); const char *long1 = hol_entry_first_long (entry1); const char *long2 = hol_entry_first_long (entry2); if (doc1) doc1 = canon_doc_option (&long1); if (doc2) doc2 = canon_doc_option (&long2); if (doc1 != doc2) /* `documentation' options always follow normal options (or documentation options that *look* like normal options). */ return doc1 - doc2; else if (!short1 && !short2 && long1 && long2) /* Only long options. */ return __strcasecmp (long1, long2); else /* Compare short/short, long/short, short/long, using the first character of long options. Entries without *any* valid options (such as options with OPTION_HIDDEN set) will be put first, but as they're not displayed, it doesn't matter where they are. */ { char first1 = short1 ? short1 : long1 ? *long1 : 0; char first2 = short2 ? short2 : long2 ? *long2 : 0; #ifdef _tolower int lower_cmp = _tolower (first1) - _tolower (first2); #else int lower_cmp = tolower (first1) - tolower (first2); #endif /* Compare ignoring case, except when the options are both the same letter, in which case lower-case always comes first. */ return lower_cmp ? lower_cmp : first2 - first1; } } else /* Within the same cluster, but not the same group, so just compare groups. */ return group_cmp (group1, group2, 0); } /* Version of hol_entry_cmp with correct signature for qsort. */ static int hol_entry_qcmp (const void *entry1_v, const void *entry2_v) { return hol_entry_cmp (entry1_v, entry2_v); } /* Sort HOL by group and alphabetically by option name (with short options taking precedence over long). Since the sorting is for display purposes only, the shadowing of options isn't effected. */ static void hol_sort (struct hol *hol) { if (hol->num_entries > 0) qsort (hol->entries, hol->num_entries, sizeof (struct hol_entry), hol_entry_qcmp); } /* Append MORE to HOL, destroying MORE in the process. Options in HOL shadow any in MORE with the same name. */ static void hol_append (struct hol *hol, struct hol *more) { struct hol_cluster **cl_end = &hol->clusters; /* Steal MORE's cluster list, and add it to the end of HOL's. */ while (*cl_end) cl_end = &(*cl_end)->next; *cl_end = more->clusters; more->clusters = 0; /* Merge entries. */ if (more->num_entries > 0) { if (hol->num_entries == 0) { hol->num_entries = more->num_entries; hol->entries = more->entries; hol->short_options = more->short_options; more->num_entries = 0; /* Mark MORE's fields as invalid. */ } else /* Append the entries in MORE to those in HOL, taking care to only add non-shadowed SHORT_OPTIONS values. */ { unsigned left; char *so, *more_so; struct hol_entry *e; unsigned num_entries = hol->num_entries + more->num_entries; struct hol_entry *entries = malloc (num_entries * sizeof (struct hol_entry)); unsigned hol_so_len = strlen (hol->short_options); char *short_options = malloc (hol_so_len + strlen (more->short_options) + 1); assert (entries && short_options); if (SIZE_MAX <= UINT_MAX) assert (num_entries <= SIZE_MAX / sizeof (struct hol_entry)); __mempcpy (__mempcpy (entries, hol->entries, hol->num_entries * sizeof (struct hol_entry)), more->entries, more->num_entries * sizeof (struct hol_entry)); __mempcpy (short_options, hol->short_options, hol_so_len); /* Fix up the short options pointers from HOL. */ for (e = entries, left = hol->num_entries; left > 0; e++, left--) e->short_options += (short_options - hol->short_options); /* Now add the short options from MORE, fixing up its entries too. */ so = short_options + hol_so_len; more_so = more->short_options; for (left = more->num_entries; left > 0; e++, left--) { int opts_left; const struct argp_option *opt; e->short_options = so; for (opts_left = e->num, opt = e->opt; opts_left; opt++, opts_left--) { int ch = *more_so; if (oshort (opt) && ch == opt->key) /* The next short option in MORE_SO, CH, is from OPT. */ { if (! find_char (ch, short_options, short_options + hol_so_len)) /* The short option CH isn't shadowed by HOL's options, so add it to the sum. */ *so++ = ch; more_so++; } } } *so = '\0'; free (hol->entries); free (hol->short_options); hol->entries = entries; hol->num_entries = num_entries; hol->short_options = short_options; } } hol_free (more); } /* Inserts enough spaces to make sure STREAM is at column COL. */ static void indent_to (argp_fmtstream_t stream, unsigned col) { int needed = col - __argp_fmtstream_point (stream); while (needed-- > 0) __argp_fmtstream_putc (stream, ' '); } /* Output to STREAM either a space, or a newline if there isn't room for at least ENSURE characters before the right margin. */ static void space (argp_fmtstream_t stream, size_t ensure) { if (__argp_fmtstream_point (stream) + ensure >= __argp_fmtstream_rmargin (stream)) __argp_fmtstream_putc (stream, '\n'); else __argp_fmtstream_putc (stream, ' '); } /* If the option REAL has an argument, we print it in using the printf format REQ_FMT or OPT_FMT depending on whether it's a required or optional argument. */ static void arg (const struct argp_option *real, const char *req_fmt, const char *opt_fmt, const char *domain, argp_fmtstream_t stream) { if (real->arg) { if (real->flags & OPTION_ARG_OPTIONAL) __argp_fmtstream_printf (stream, opt_fmt, dgettext (domain, real->arg)); else __argp_fmtstream_printf (stream, req_fmt, dgettext (domain, real->arg)); } } /* Helper functions for hol_entry_help. */ /* State used during the execution of hol_help. */ struct hol_help_state { /* PREV_ENTRY should contain the previous entry printed, or 0. */ struct hol_entry *prev_entry; /* If an entry is in a different group from the previous one, and SEP_GROUPS is true, then a blank line will be printed before any output. */ int sep_groups; /* True if a duplicate option argument was suppressed (only ever set if UPARAMS.dup_args is false). */ int suppressed_dup_arg; }; /* Some state used while printing a help entry (used to communicate with helper functions). See the doc for hol_entry_help for more info, as most of the fields are copied from its arguments. */ struct pentry_state { const struct hol_entry *entry; argp_fmtstream_t stream; struct hol_help_state *hhstate; /* True if nothing's been printed so far. */ int first; /* If non-zero, the state that was used to print this help. */ const struct argp_state *state; }; /* If a user doc filter should be applied to DOC, do so. */ static const char * filter_doc (const char *doc, int key, const struct argp *argp, const struct argp_state *state) { if (argp->help_filter) /* We must apply a user filter to this output. */ { void *input = __argp_input (argp, state); return (*argp->help_filter) (key, doc, input); } else /* No filter. */ return doc; } /* Prints STR as a header line, with the margin lines set appropiately, and notes the fact that groups should be separated with a blank line. ARGP is the argp that should dictate any user doc filtering to take place. Note that the previous wrap margin isn't restored, but the left margin is reset to 0. */ static void print_header (const char *str, const struct argp *argp, struct pentry_state *pest) { const char *tstr = dgettext (argp->argp_domain, str); const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_HEADER, argp, pest->state); if (fstr) { if (*fstr) { if (pest->hhstate->prev_entry) /* Precede with a blank line. */ __argp_fmtstream_putc (pest->stream, '\n'); indent_to (pest->stream, uparams.header_col); __argp_fmtstream_set_lmargin (pest->stream, uparams.header_col); __argp_fmtstream_set_wmargin (pest->stream, uparams.header_col); __argp_fmtstream_puts (pest->stream, fstr); __argp_fmtstream_set_lmargin (pest->stream, 0); __argp_fmtstream_putc (pest->stream, '\n'); } pest->hhstate->sep_groups = 1; /* Separate subsequent groups. */ } if (fstr != tstr) free ((char *) fstr); } /* Inserts a comma if this isn't the first item on the line, and then makes sure we're at least to column COL. If this *is* the first item on a line, prints any pending whitespace/headers that should precede this line. Also clears FIRST. */ static void comma (unsigned col, struct pentry_state *pest) { if (pest->first) { const struct hol_entry *pe = pest->hhstate->prev_entry; const struct hol_cluster *cl = pest->entry->cluster; if (pest->hhstate->sep_groups && pe && pest->entry->group != pe->group) __argp_fmtstream_putc (pest->stream, '\n'); if (cl && cl->header && *cl->header && (!pe || (pe->cluster != cl && !hol_cluster_is_child (pe->cluster, cl)))) /* If we're changing clusters, then this must be the start of the ENTRY's cluster unless that is an ancestor of the previous one (in which case we had just popped into a sub-cluster for a bit). If so, then print the cluster's header line. */ { int old_wm = __argp_fmtstream_wmargin (pest->stream); print_header (cl->header, cl->argp, pest); __argp_fmtstream_set_wmargin (pest->stream, old_wm); } pest->first = 0; } else __argp_fmtstream_puts (pest->stream, ", "); indent_to (pest->stream, col); } /* Print help for ENTRY to STREAM. */ static void hol_entry_help (struct hol_entry *entry, const struct argp_state *state, argp_fmtstream_t stream, struct hol_help_state *hhstate) { unsigned num; const struct argp_option *real = entry->opt, *opt; char *so = entry->short_options; int have_long_opt = 0; /* We have any long options. */ /* Saved margins. */ int old_lm = __argp_fmtstream_set_lmargin (stream, 0); int old_wm = __argp_fmtstream_wmargin (stream); /* PEST is a state block holding some of our variables that we'd like to share with helper functions. */ struct pentry_state pest; pest.entry = entry; pest.stream = stream; pest.hhstate = hhstate; pest.first = 1; pest.state = state; if (! odoc (real)) for (opt = real, num = entry->num; num > 0; opt++, num--) if (opt->name && ovisible (opt)) { have_long_opt = 1; break; } /* First emit short options. */ __argp_fmtstream_set_wmargin (stream, uparams.short_opt_col); /* For truly bizarre cases. */ for (opt = real, num = entry->num; num > 0; opt++, num--) if (oshort (opt) && opt->key == *so) /* OPT has a valid (non shadowed) short option. */ { if (ovisible (opt)) { comma (uparams.short_opt_col, &pest); __argp_fmtstream_putc (stream, '-'); __argp_fmtstream_putc (stream, *so); if (!have_long_opt || uparams.dup_args) arg (real, " %s", "[%s]", state->root_argp->argp_domain, stream); else if (real->arg) hhstate->suppressed_dup_arg = 1; } so++; } /* Now, long options. */ if (odoc (real)) /* A `documentation' option. */ { __argp_fmtstream_set_wmargin (stream, uparams.doc_opt_col); for (opt = real, num = entry->num; num > 0; opt++, num--) if (opt->name && *opt->name && ovisible (opt)) { comma (uparams.doc_opt_col, &pest); /* Calling dgettext here isn't quite right, since sorting will have been done on the original; but documentation options should be pretty rare anyway... */ __argp_fmtstream_puts (stream, onotrans (opt) ? opt->name : dgettext (state->root_argp->argp_domain, opt->name)); } } else /* A real long option. */ { int first_long_opt = 1; __argp_fmtstream_set_wmargin (stream, uparams.long_opt_col); for (opt = real, num = entry->num; num > 0; opt++, num--) if (opt->name && ovisible (opt)) { comma (uparams.long_opt_col, &pest); __argp_fmtstream_printf (stream, "--%s", opt->name); if (first_long_opt || uparams.dup_args) arg (real, "=%s", "[=%s]", state->root_argp->argp_domain, stream); else if (real->arg) hhstate->suppressed_dup_arg = 1; } } /* Next, documentation strings. */ __argp_fmtstream_set_lmargin (stream, 0); if (pest.first) { /* Didn't print any switches, what's up? */ if (!oshort (real) && !real->name) /* This is a group header, print it nicely. */ print_header (real->doc, entry->argp, &pest); else /* Just a totally shadowed option or null header; print nothing. */ goto cleanup; /* Just return, after cleaning up. */ } else { const char *tstr = real->doc ? dgettext (state->root_argp->argp_domain, real->doc) : 0; const char *fstr = filter_doc (tstr, real->key, entry->argp, state); if (fstr && *fstr) { unsigned int col = __argp_fmtstream_point (stream); __argp_fmtstream_set_lmargin (stream, uparams.opt_doc_col); __argp_fmtstream_set_wmargin (stream, uparams.opt_doc_col); if (col > (unsigned int) (uparams.opt_doc_col + 3)) __argp_fmtstream_putc (stream, '\n'); else if (col >= (unsigned int) uparams.opt_doc_col) __argp_fmtstream_puts (stream, " "); else indent_to (stream, uparams.opt_doc_col); __argp_fmtstream_puts (stream, fstr); } if (fstr && fstr != tstr) free ((char *) fstr); /* Reset the left margin. */ __argp_fmtstream_set_lmargin (stream, 0); __argp_fmtstream_putc (stream, '\n'); } hhstate->prev_entry = entry; cleanup: __argp_fmtstream_set_lmargin (stream, old_lm); __argp_fmtstream_set_wmargin (stream, old_wm); } /* Output a long help message about the options in HOL to STREAM. */ static void hol_help (struct hol *hol, const struct argp_state *state, argp_fmtstream_t stream) { unsigned num; struct hol_entry *entry; struct hol_help_state hhstate = { 0, 0, 0 }; for (entry = hol->entries, num = hol->num_entries; num > 0; entry++, num--) hol_entry_help (entry, state, stream, &hhstate); if (hhstate.suppressed_dup_arg && uparams.dup_args_note) { const char *tstr = dgettext (state->root_argp->argp_domain, "\ Mandatory or optional arguments to long options are also mandatory or \ optional for any corresponding short options."); const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_DUP_ARGS_NOTE, state ? state->root_argp : 0, state); if (fstr && *fstr) { __argp_fmtstream_putc (stream, '\n'); __argp_fmtstream_puts (stream, fstr); __argp_fmtstream_putc (stream, '\n'); } if (fstr && fstr != tstr) free ((char *) fstr); } } /* Helper functions for hol_usage. */ /* If OPT is a short option without an arg, append its key to the string pointer pointer to by COOKIE, and advance the pointer. */ static int add_argless_short_opt (const struct argp_option *opt, const struct argp_option *real, const char *domain, void *cookie) { char **snao_end = cookie; if (!(opt->arg || real->arg) && !((opt->flags | real->flags) & OPTION_NO_USAGE)) *(*snao_end)++ = opt->key; return 0; } /* If OPT is a short option with an arg, output a usage entry for it to the stream pointed at by COOKIE. */ static int usage_argful_short_opt (const struct argp_option *opt, const struct argp_option *real, const char *domain, void *cookie) { argp_fmtstream_t stream = cookie; const char *arg = opt->arg; int flags = opt->flags | real->flags; if (! arg) arg = real->arg; if (arg && !(flags & OPTION_NO_USAGE)) { arg = dgettext (domain, arg); if (flags & OPTION_ARG_OPTIONAL) __argp_fmtstream_printf (stream, " [-%c[%s]]", opt->key, arg); else { /* Manually do line wrapping so that it (probably) won't get wrapped at the embedded space. */ space (stream, 6 + strlen (arg)); __argp_fmtstream_printf (stream, "[-%c %s]", opt->key, arg); } } return 0; } /* Output a usage entry for the long option opt to the stream pointed at by COOKIE. */ static int usage_long_opt (const struct argp_option *opt, const struct argp_option *real, const char *domain, void *cookie) { argp_fmtstream_t stream = cookie; const char *arg = opt->arg; int flags = opt->flags | real->flags; if (! arg) arg = real->arg; if (! (flags & OPTION_NO_USAGE) && !odoc (opt)) { if (arg) { arg = dgettext (domain, arg); if (flags & OPTION_ARG_OPTIONAL) __argp_fmtstream_printf (stream, " [--%s[=%s]]", opt->name, arg); else __argp_fmtstream_printf (stream, " [--%s=%s]", opt->name, arg); } else __argp_fmtstream_printf (stream, " [--%s]", opt->name); } return 0; } /* Print a short usage description for the arguments in HOL to STREAM. */ static void hol_usage (struct hol *hol, argp_fmtstream_t stream) { if (hol->num_entries > 0) { unsigned nentries; struct hol_entry *entry; char *short_no_arg_opts = alloca (strlen (hol->short_options) + 1); char *snao_end = short_no_arg_opts; /* First we put a list of short options without arguments. */ for (entry = hol->entries, nentries = hol->num_entries ; nentries > 0 ; entry++, nentries--) hol_entry_short_iterate (entry, add_argless_short_opt, entry->argp->argp_domain, &snao_end); if (snao_end > short_no_arg_opts) { *snao_end++ = 0; __argp_fmtstream_printf (stream, " [-%s]", short_no_arg_opts); } /* Now a list of short options *with* arguments. */ for (entry = hol->entries, nentries = hol->num_entries ; nentries > 0 ; entry++, nentries--) hol_entry_short_iterate (entry, usage_argful_short_opt, entry->argp->argp_domain, stream); /* Finally, a list of long options (whew!). */ for (entry = hol->entries, nentries = hol->num_entries ; nentries > 0 ; entry++, nentries--) hol_entry_long_iterate (entry, usage_long_opt, entry->argp->argp_domain, stream); } } /* Make a HOL containing all levels of options in ARGP. CLUSTER is the cluster in which ARGP's entries should be clustered, or 0. */ static struct hol * argp_hol (const struct argp *argp, struct hol_cluster *cluster) { const struct argp_child *child = argp->children; struct hol *hol = make_hol (argp, cluster); if (child) while (child->argp) { struct hol_cluster *child_cluster = ((child->group || child->header) /* Put CHILD->argp within its own cluster. */ ? hol_add_cluster (hol, child->group, child->header, child - argp->children, cluster, argp) /* Just merge it into the parent's cluster. */ : cluster); hol_append (hol, argp_hol (child->argp, child_cluster)) ; child++; } return hol; } /* Calculate how many different levels with alternative args strings exist in ARGP. */ static size_t argp_args_levels (const struct argp *argp) { size_t levels = 0; const struct argp_child *child = argp->children; if (argp->args_doc && strchr (argp->args_doc, '\n')) levels++; if (child) while (child->argp) levels += argp_args_levels ((child++)->argp); return levels; } /* Print all the non-option args documented in ARGP to STREAM. Any output is preceded by a space. LEVELS is a pointer to a byte vector the length returned by argp_args_levels; it should be initialized to zero, and updated by this routine for the next call if ADVANCE is true. True is returned as long as there are more patterns to output. */ static int argp_args_usage (const struct argp *argp, const struct argp_state *state, char **levels, int advance, argp_fmtstream_t stream) { char *our_level = *levels; int multiple = 0; const struct argp_child *child = argp->children; const char *tdoc = dgettext (argp->argp_domain, argp->args_doc), *nl = 0; const char *fdoc = filter_doc (tdoc, ARGP_KEY_HELP_ARGS_DOC, argp, state); if (fdoc) { const char *cp = fdoc; nl = __strchrnul (cp, '\n'); if (*nl != '\0') /* This is a `multi-level' args doc; advance to the correct position as determined by our state in LEVELS, and update LEVELS. */ { int i; multiple = 1; for (i = 0; i < *our_level; i++) cp = nl + 1, nl = __strchrnul (cp, '\n'); (*levels)++; } /* Manually do line wrapping so that it (probably) won't get wrapped at any embedded spaces. */ space (stream, 1 + nl - cp); __argp_fmtstream_write (stream, cp, nl - cp); } if (fdoc && fdoc != tdoc) free ((char *)fdoc); /* Free user's modified doc string. */ if (child) while (child->argp) advance = !argp_args_usage ((child++)->argp, state, levels, advance, stream); if (advance && multiple) { /* Need to increment our level. */ if (*nl) /* There's more we can do here. */ { (*our_level)++; advance = 0; /* Our parent shouldn't advance also. */ } else if (*our_level > 0) /* We had multiple levels, but used them up; reset to zero. */ *our_level = 0; } return !advance; } /* Print the documentation for ARGP to STREAM; if POST is false, then everything preceeding a `\v' character in the documentation strings (or the whole string, for those with none) is printed, otherwise, everything following the `\v' character (nothing for strings without). Each separate bit of documentation is separated a blank line, and if PRE_BLANK is true, then the first is as well. If FIRST_ONLY is true, only the first occurrence is output. Returns true if anything was output. */ static int argp_doc (const struct argp *argp, const struct argp_state *state, int post, int pre_blank, int first_only, argp_fmtstream_t stream) { const char *text; const char *inp_text; size_t inp_text_len = 0; const char *trans_text; void *input = 0; int anything = 0; const struct argp_child *child = argp->children; if (argp->doc) { char *vt = strchr (argp->doc, '\v'); if (vt) { if (post) inp_text = vt + 1; else { inp_text_len = vt - argp->doc; inp_text = __strndup (argp->doc, inp_text_len); } } else inp_text = post ? 0 : argp->doc; trans_text = inp_text ? dgettext (argp->argp_domain, inp_text) : NULL; } else trans_text = inp_text = 0; if (argp->help_filter) /* We have to filter the doc strings. */ { input = __argp_input (argp, state); text = (*argp->help_filter) (post ? ARGP_KEY_HELP_POST_DOC : ARGP_KEY_HELP_PRE_DOC, trans_text, input); } else text = (const char *) trans_text; if (text) { if (pre_blank) __argp_fmtstream_putc (stream, '\n'); __argp_fmtstream_puts (stream, text); if (__argp_fmtstream_point (stream) > __argp_fmtstream_lmargin (stream)) __argp_fmtstream_putc (stream, '\n'); anything = 1; } if (text && text != trans_text) free ((char *) text); /* Free TEXT returned from the help filter. */ if (inp_text && inp_text_len) free ((char *) inp_text); /* We copied INP_TEXT, so free it now. */ if (post && argp->help_filter) /* Now see if we have to output a ARGP_KEY_HELP_EXTRA text. */ { text = (*argp->help_filter) (ARGP_KEY_HELP_EXTRA, 0, input); if (text) { if (anything || pre_blank) __argp_fmtstream_putc (stream, '\n'); __argp_fmtstream_puts (stream, text); free ((char *) text); if (__argp_fmtstream_point (stream) > __argp_fmtstream_lmargin (stream)) __argp_fmtstream_putc (stream, '\n'); anything = 1; } } if (child) while (child->argp && !(first_only && anything)) anything |= argp_doc ((child++)->argp, state, post, anything || pre_blank, first_only, stream); return anything; } /* Output a usage message for ARGP to STREAM. If called from argp_state_help, STATE is the relevent parsing state. FLAGS are from the set ARGP_HELP_*. NAME is what to use wherever a `program name' is needed. */ static void _help (const struct argp *argp, const struct argp_state *state, FILE *stream, unsigned flags, char *name) { int anything = 0; /* Whether we've output anything. */ struct hol *hol = 0; argp_fmtstream_t fs; if (! stream) return; #if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) __flockfile (stream); #endif if (! uparams.valid) fill_in_uparams (state); fs = __argp_make_fmtstream (stream, 0, uparams.rmargin, 0); if (! fs) { #if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) __funlockfile (stream); #endif return; } if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG)) { hol = argp_hol (argp, 0); /* If present, these options always come last. */ hol_set_group (hol, "help", -1); hol_set_group (hol, "version", -1); hol_sort (hol); } if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE)) /* Print a short `Usage:' message. */ { int first_pattern = 1, more_patterns; size_t num_pattern_levels = argp_args_levels (argp); char *pattern_levels = alloca (num_pattern_levels); memset (pattern_levels, 0, num_pattern_levels); do { int old_lm; int old_wm = __argp_fmtstream_set_wmargin (fs, uparams.usage_indent); char *levels = pattern_levels; if (first_pattern) __argp_fmtstream_printf (fs, "%s %s", dgettext (argp->argp_domain, "Usage:"), name); else __argp_fmtstream_printf (fs, "%s %s", dgettext (argp->argp_domain, " or: "), name); /* We set the lmargin as well as the wmargin, because hol_usage manually wraps options with newline to avoid annoying breaks. */ old_lm = __argp_fmtstream_set_lmargin (fs, uparams.usage_indent); if (flags & ARGP_HELP_SHORT_USAGE) /* Just show where the options go. */ { if (hol->num_entries > 0) __argp_fmtstream_puts (fs, dgettext (argp->argp_domain, " [OPTION...]")); } else /* Actually print the options. */ { hol_usage (hol, fs); flags |= ARGP_HELP_SHORT_USAGE; /* But only do so once. */ } more_patterns = argp_args_usage (argp, state, &levels, 1, fs); __argp_fmtstream_set_wmargin (fs, old_wm); __argp_fmtstream_set_lmargin (fs, old_lm); __argp_fmtstream_putc (fs, '\n'); anything = 1; first_pattern = 0; } while (more_patterns); } if (flags & ARGP_HELP_PRE_DOC) anything |= argp_doc (argp, state, 0, 0, 1, fs); if (flags & ARGP_HELP_SEE) { __argp_fmtstream_printf (fs, dgettext (argp->argp_domain, "\ Try `%s --help' or `%s --usage' for more information.\n"), name, name); anything = 1; } if (flags & ARGP_HELP_LONG) /* Print a long, detailed help message. */ { /* Print info about all the options. */ if (hol->num_entries > 0) { if (anything) __argp_fmtstream_putc (fs, '\n'); hol_help (hol, state, fs); anything = 1; } } if (flags & ARGP_HELP_POST_DOC) /* Print any documentation strings at the end. */ anything |= argp_doc (argp, state, 1, anything, 0, fs); if ((flags & ARGP_HELP_BUG_ADDR) && argp_program_bug_address) { if (anything) __argp_fmtstream_putc (fs, '\n'); __argp_fmtstream_printf (fs, dgettext (argp->argp_domain, "Report bugs to %s.\n"), argp_program_bug_address); anything = 1; } #if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) __funlockfile (stream); #endif if (hol) hol_free (hol); __argp_fmtstream_free (fs); } /* Output a usage message for ARGP to STREAM. FLAGS are from the set ARGP_HELP_*. NAME is what to use wherever a `program name' is needed. */ void __argp_help (const struct argp *argp, FILE *stream, unsigned flags, char *name) { struct argp_state state; memset (&state, 0, sizeof state); state.root_argp = argp; _help (argp, &state, stream, flags, name); } #ifdef weak_alias weak_alias (__argp_help, argp_help) #endif #if ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME) char * __argp_short_program_name (void) { # if HAVE_DECL_PROGRAM_INVOCATION_NAME return __argp_base_name (program_invocation_name); # else /* FIXME: What now? Miles suggests that it is better to use NULL, but currently the value is passed on directly to fputs_unlocked, so that requires more changes. */ # if __GNUC__ # warning No reasonable value to return # endif /* __GNUC__ */ return ""; # endif } #endif /* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are from the set ARGP_HELP_*. */ void __argp_state_help (const struct argp_state *state, FILE *stream, unsigned flags) { if ((!state || ! (state->flags & ARGP_NO_ERRS)) && stream) { if (state && (state->flags & ARGP_LONG_ONLY)) flags |= ARGP_HELP_LONG_ONLY; _help (state ? state->root_argp : 0, state, stream, flags, state ? state->name : __argp_short_program_name ()); if (!state || ! (state->flags & ARGP_NO_EXIT)) { if (flags & ARGP_HELP_EXIT_ERR) exit (argp_err_exit_status); if (flags & ARGP_HELP_EXIT_OK) exit (0); } } } #ifdef weak_alias weak_alias (__argp_state_help, argp_state_help) #endif /* If appropriate, print the printf string FMT and following args, preceded by the program name and `:', to stderr, and followed by a `Try ... --help' message, then exit (1). */ void __argp_error (const struct argp_state *state, const char *fmt, ...) { if (!state || !(state->flags & ARGP_NO_ERRS)) { FILE *stream = state ? state->err_stream : stderr; if (stream) { va_list ap; #if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) __flockfile (stream); #endif va_start (ap, fmt); #ifdef USE_IN_LIBIO if (_IO_fwide (stream, 0) > 0) { char *buf; if (__asprintf (&buf, fmt, ap) < 0) buf = NULL; __fwprintf (stream, L"%s: %s\n", state ? state->name : __argp_short_program_name (), buf); free (buf); } else #endif { fputs_unlocked (state ? state->name : __argp_short_program_name (), stream); putc_unlocked (':', stream); putc_unlocked (' ', stream); vfprintf (stream, fmt, ap); putc_unlocked ('\n', stream); } __argp_state_help (state, stream, ARGP_HELP_STD_ERR); va_end (ap); #if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) __funlockfile (stream); #endif } } } #ifdef weak_alias weak_alias (__argp_error, argp_error) #endif /* Similar to the standard gnu error-reporting function error(), but will respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print to STATE->err_stream. This is useful for argument parsing code that is shared between program startup (when exiting is desired) and runtime option parsing (when typically an error code is returned instead). The difference between this function and argp_error is that the latter is for *parsing errors*, and the former is for other problems that occur during parsing but don't reflect a (syntactic) problem with the input. */ void __argp_failure (const struct argp_state *state, int status, int errnum, const char *fmt, ...) { if (!state || !(state->flags & ARGP_NO_ERRS)) { FILE *stream = state ? state->err_stream : stderr; if (stream) { #if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) __flockfile (stream); #endif #ifdef USE_IN_LIBIO if (_IO_fwide (stream, 0) > 0) __fwprintf (stream, L"%s", state ? state->name : __argp_short_program_name ()); else #endif fputs_unlocked (state ? state->name : __argp_short_program_name (), stream); if (fmt) { va_list ap; va_start (ap, fmt); #ifdef USE_IN_LIBIO if (_IO_fwide (stream, 0) > 0) { char *buf; if (__asprintf (&buf, fmt, ap) < 0) buf = NULL; __fwprintf (stream, L": %s", buf); free (buf); } else #endif { putc_unlocked (':', stream); putc_unlocked (' ', stream); vfprintf (stream, fmt, ap); } va_end (ap); } if (errnum) { char buf[200]; #ifdef USE_IN_LIBIO if (_IO_fwide (stream, 0) > 0) __fwprintf (stream, L": %s", __strerror_r (errnum, buf, sizeof (buf))); else #endif { char const *s = NULL; putc_unlocked (':', stream); putc_unlocked (' ', stream); #if _LIBC || (HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P) s = __strerror_r (errnum, buf, sizeof buf); #elif HAVE_DECL_STRERROR_R if (__strerror_r (errnum, buf, sizeof buf) == 0) s = buf; #endif #if !_LIBC if (! s && ! (s = strerror (errnum))) s = dgettext (state->root_argp->argp_domain, "Unknown system error"); #endif fputs (s, stream); } } #ifdef USE_IN_LIBIO if (_IO_fwide (stream, 0) > 0) putwc_unlocked (L'\n', stream); else #endif putc_unlocked ('\n', stream); #if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE) __funlockfile (stream); #endif if (status && (!state || !(state->flags & ARGP_NO_EXIT))) exit (status); } } } #ifdef weak_alias weak_alias (__argp_failure, argp_failure) #endif blame-1.3.1/lib/mktime.c0000644000076400007640000005164410527555557011757 00000000000000/* Convert a `struct tm' to a time_t value. Copyright (C) 1993-1999, 2002-2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Eggert . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Define this to have a standalone program to test this implementation of mktime. */ /* #define DEBUG 1 */ #ifdef HAVE_CONFIG_H # include #endif /* Assume that leap seconds are possible, unless told otherwise. If the host has a `zic' command with a `-L leapsecondfilename' option, then it supports leap seconds; otherwise it probably doesn't. */ #ifndef LEAP_SECONDS_POSSIBLE # define LEAP_SECONDS_POSSIBLE 1 #endif #include /* Some systems define `time_t' here. */ #include #include #include /* For the real memcpy prototype. */ #if DEBUG # include # include /* Make it work even if the system's libc has its own mktime routine. */ # define mktime my_mktime #endif /* DEBUG */ /* Shift A right by B bits portably, by dividing A by 2**B and truncating towards minus infinity. A and B should be free of side effects, and B should be in the range 0 <= B <= INT_BITS - 2, where INT_BITS is the number of useful bits in an int. GNU code can assume that INT_BITS is at least 32. ISO C99 says that A >> B is implementation-defined if A < 0. Some implementations (e.g., UNICOS 9.0 on a Cray Y-MP EL) don't shift right in the usual way when A < 0, so SHR falls back on division if ordinary A >> B doesn't seem to be the usual signed shift. */ #define SHR(a, b) \ (-1 >> 1 == -1 \ ? (a) >> (b) \ : (a) / (1 << (b)) - ((a) % (1 << (b)) < 0)) /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ /* True if the arithmetic type T is an integer type. bool counts as an integer. */ #define TYPE_IS_INTEGER(t) ((t) 1.5 == 1) /* True if negative values of the signed integer type T use two's complement, ones' complement, or signed magnitude representation, respectively. Much GNU code assumes two's complement, but some people like to be portable to all possible C hosts. */ #define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) #define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) #define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) /* True if the arithmetic type T is signed. */ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) /* The maximum and minimum values for the integer type T. These macros have undefined behavior if T is signed and has padding bits. If this is a problem for you, please let us know how to fix it for your host. */ #define TYPE_MINIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) 0 \ : TYPE_SIGNED_MAGNITUDE (t) \ ? ~ (t) 0 \ : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) #define TYPE_MAXIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) -1 \ : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) #ifndef TIME_T_MIN # define TIME_T_MIN TYPE_MINIMUM (time_t) #endif #ifndef TIME_T_MAX # define TIME_T_MAX TYPE_MAXIMUM (time_t) #endif #define TIME_T_MIDPOINT (SHR (TIME_T_MIN + TIME_T_MAX, 1) + 1) /* Verify a requirement at compile-time (unlike assert, which is runtime). */ #define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; } verify (time_t_is_integer, TYPE_IS_INTEGER (time_t)); verify (twos_complement_arithmetic, TYPE_TWOS_COMPLEMENT (int)); /* The code also assumes that signed integer overflow silently wraps around, but this assumption can't be stated without causing a diagnostic on some hosts. */ #define EPOCH_YEAR 1970 #define TM_YEAR_BASE 1900 verify (base_year_is_a_multiple_of_100, TM_YEAR_BASE % 100 == 0); /* Return 1 if YEAR + TM_YEAR_BASE is a leap year. */ static inline int leapyear (long int year) { /* Don't add YEAR to TM_YEAR_BASE, as that might overflow. Also, work even if YEAR is negative. */ return ((year & 3) == 0 && (year % 100 != 0 || ((year / 100) & 3) == (- (TM_YEAR_BASE / 100) & 3))); } /* How many days come before each month (0-12). */ #ifndef _LIBC static #endif const unsigned short int __mon_yday[2][13] = { /* Normal years. */ { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, /* Leap years. */ { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } }; #ifndef _LIBC /* Portable standalone applications should supply a "time_r.h" that declares a POSIX-compliant localtime_r, for the benefit of older implementations that lack localtime_r or have a nonstandard one. See the gnulib time_r module for one way to implement this. */ # include "time_r.h" # undef __localtime_r # define __localtime_r localtime_r # define __mktime_internal mktime_internal #endif /* Return an integer value measuring (YEAR1-YDAY1 HOUR1:MIN1:SEC1) - (YEAR0-YDAY0 HOUR0:MIN0:SEC0) in seconds, assuming that the clocks were not adjusted between the time stamps. The YEAR values uses the same numbering as TP->tm_year. Values need not be in the usual range. However, YEAR1 must not be less than 2 * INT_MIN or greater than 2 * INT_MAX. The result may overflow. It is the caller's responsibility to detect overflow. */ static inline time_t ydhms_diff (long int year1, long int yday1, int hour1, int min1, int sec1, int year0, int yday0, int hour0, int min0, int sec0) { verify (C99_integer_division, -1 / 2 == 0); verify (long_int_year_and_yday_are_wide_enough, INT_MAX <= LONG_MAX / 2 || TIME_T_MAX <= UINT_MAX); /* Compute intervening leap days correctly even if year is negative. Take care to avoid integer overflow here. */ int a4 = SHR (year1, 2) + SHR (TM_YEAR_BASE, 2) - ! (year1 & 3); int b4 = SHR (year0, 2) + SHR (TM_YEAR_BASE, 2) - ! (year0 & 3); int a100 = a4 / 25 - (a4 % 25 < 0); int b100 = b4 / 25 - (b4 % 25 < 0); int a400 = SHR (a100, 2); int b400 = SHR (b100, 2); int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); /* Compute the desired time in time_t precision. Overflow might occur here. */ time_t tyear1 = year1; time_t years = tyear1 - year0; time_t days = 365 * years + yday1 - yday0 + intervening_leap_days; time_t hours = 24 * days + hour1 - hour0; time_t minutes = 60 * hours + min1 - min0; time_t seconds = 60 * minutes + sec1 - sec0; return seconds; } /* Return a time_t value corresponding to (YEAR-YDAY HOUR:MIN:SEC), assuming that *T corresponds to *TP and that no clock adjustments occurred between *TP and the desired time. If TP is null, return a value not equal to *T; this avoids false matches. If overflow occurs, yield the minimal or maximal value, except do not yield a value equal to *T. */ static time_t guess_time_tm (long int year, long int yday, int hour, int min, int sec, const time_t *t, const struct tm *tp) { if (tp) { time_t d = ydhms_diff (year, yday, hour, min, sec, tp->tm_year, tp->tm_yday, tp->tm_hour, tp->tm_min, tp->tm_sec); time_t t1 = *t + d; if ((t1 < *t) == (TYPE_SIGNED (time_t) ? d < 0 : TIME_T_MAX / 2 < d)) return t1; } /* Overflow occurred one way or another. Return the nearest result that is actually in range, except don't report a zero difference if the actual difference is nonzero, as that would cause a false match; and don't oscillate between two values, as that would confuse the spring-forward gap detector. */ return (*t < TIME_T_MIDPOINT ? (*t <= TIME_T_MIN + 1 ? *t + 1 : TIME_T_MIN) : (TIME_T_MAX - 1 <= *t ? *t - 1 : TIME_T_MAX)); } /* Use CONVERT to convert *T to a broken down time in *TP. If *T is out of range for conversion, adjust it so that it is the nearest in-range value and then convert that. */ static struct tm * ranged_convert (struct tm *(*convert) (const time_t *, struct tm *), time_t *t, struct tm *tp) { struct tm *r = convert (t, tp); if (!r && *t) { time_t bad = *t; time_t ok = 0; /* BAD is a known unconvertible time_t, and OK is a known good one. Use binary search to narrow the range between BAD and OK until they differ by 1. */ while (bad != ok + (bad < 0 ? -1 : 1)) { time_t mid = *t = (bad < 0 ? bad + ((ok - bad) >> 1) : ok + ((bad - ok) >> 1)); r = convert (t, tp); if (r) ok = mid; else bad = mid; } if (!r && ok) { /* The last conversion attempt failed; revert to the most recent successful attempt. */ *t = ok; r = convert (t, tp); } } return r; } /* Convert *TP to a time_t value, inverting the monotonic and mostly-unit-linear conversion function CONVERT. Use *OFFSET to keep track of a guess at the offset of the result, compared to what the result would be for UTC without leap seconds. If *OFFSET's guess is correct, only one CONVERT call is needed. This function is external because it is used also by timegm.c. */ time_t __mktime_internal (struct tm *tp, struct tm *(*convert) (const time_t *, struct tm *), time_t *offset) { time_t t, gt, t0, t1, t2; struct tm tm; /* The maximum number of probes (calls to CONVERT) should be enough to handle any combinations of time zone rule changes, solar time, leap seconds, and oscillations around a spring-forward gap. POSIX.1 prohibits leap seconds, but some hosts have them anyway. */ int remaining_probes = 6; /* Time requested. Copy it in case CONVERT modifies *TP; this can occur if TP is localtime's returned value and CONVERT is localtime. */ int sec = tp->tm_sec; int min = tp->tm_min; int hour = tp->tm_hour; int mday = tp->tm_mday; int mon = tp->tm_mon; int year_requested = tp->tm_year; int isdst = tp->tm_isdst; /* 1 if the previous probe was DST. */ int dst2; /* Ensure that mon is in range, and set year accordingly. */ int mon_remainder = mon % 12; int negative_mon_remainder = mon_remainder < 0; int mon_years = mon / 12 - negative_mon_remainder; long int lyear_requested = year_requested; long int year = lyear_requested + mon_years; /* The other values need not be in range: the remaining code handles minor overflows correctly, assuming int and time_t arithmetic wraps around. Major overflows are caught at the end. */ /* Calculate day of year from year, month, and day of month. The result need not be in range. */ int mon_yday = ((__mon_yday[leapyear (year)] [mon_remainder + 12 * negative_mon_remainder]) - 1); long int lmday = mday; long int yday = mon_yday + lmday; time_t guessed_offset = *offset; int sec_requested = sec; if (LEAP_SECONDS_POSSIBLE) { /* Handle out-of-range seconds specially, since ydhms_tm_diff assumes every minute has 60 seconds. */ if (sec < 0) sec = 0; if (59 < sec) sec = 59; } /* Invert CONVERT by probing. First assume the same offset as last time. */ t0 = ydhms_diff (year, yday, hour, min, sec, EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0, - guessed_offset); if (TIME_T_MAX / INT_MAX / 366 / 24 / 60 / 60 < 3) { /* time_t isn't large enough to rule out overflows, so check for major overflows. A gross check suffices, since if t0 has overflowed, it is off by a multiple of TIME_T_MAX - TIME_T_MIN + 1. So ignore any component of the difference that is bounded by a small value. */ /* Approximate log base 2 of the number of time units per biennium. A biennium is 2 years; use this unit instead of years to avoid integer overflow. For example, 2 average Gregorian years are 2 * 365.2425 * 24 * 60 * 60 seconds, which is 63113904 seconds, and rint (log2 (63113904)) is 26. */ int ALOG2_SECONDS_PER_BIENNIUM = 26; int ALOG2_MINUTES_PER_BIENNIUM = 20; int ALOG2_HOURS_PER_BIENNIUM = 14; int ALOG2_DAYS_PER_BIENNIUM = 10; int LOG2_YEARS_PER_BIENNIUM = 1; int approx_requested_biennia = (SHR (year_requested, LOG2_YEARS_PER_BIENNIUM) - SHR (EPOCH_YEAR - TM_YEAR_BASE, LOG2_YEARS_PER_BIENNIUM) + SHR (mday, ALOG2_DAYS_PER_BIENNIUM) + SHR (hour, ALOG2_HOURS_PER_BIENNIUM) + SHR (min, ALOG2_MINUTES_PER_BIENNIUM) + (LEAP_SECONDS_POSSIBLE ? 0 : SHR (sec, ALOG2_SECONDS_PER_BIENNIUM))); int approx_biennia = SHR (t0, ALOG2_SECONDS_PER_BIENNIUM); int diff = approx_biennia - approx_requested_biennia; int abs_diff = diff < 0 ? - diff : diff; /* IRIX 4.0.5 cc miscaculates TIME_T_MIN / 3: it erroneously gives a positive value of 715827882. Setting a variable first then doing math on it seems to work. (ghazi@caip.rutgers.edu) */ time_t time_t_max = TIME_T_MAX; time_t time_t_min = TIME_T_MIN; time_t overflow_threshold = (time_t_max / 3 - time_t_min / 3) >> ALOG2_SECONDS_PER_BIENNIUM; if (overflow_threshold < abs_diff) { /* Overflow occurred. Try repairing it; this might work if the time zone offset is enough to undo the overflow. */ time_t repaired_t0 = -1 - t0; approx_biennia = SHR (repaired_t0, ALOG2_SECONDS_PER_BIENNIUM); diff = approx_biennia - approx_requested_biennia; abs_diff = diff < 0 ? - diff : diff; if (overflow_threshold < abs_diff) return -1; guessed_offset += repaired_t0 - t0; t0 = repaired_t0; } } /* Repeatedly use the error to improve the guess. */ for (t = t1 = t2 = t0, dst2 = 0; (gt = guess_time_tm (year, yday, hour, min, sec, &t, ranged_convert (convert, &t, &tm)), t != gt); t1 = t2, t2 = t, t = gt, dst2 = tm.tm_isdst != 0) if (t == t1 && t != t2 && (tm.tm_isdst < 0 || (isdst < 0 ? dst2 <= (tm.tm_isdst != 0) : (isdst != 0) != (tm.tm_isdst != 0)))) /* We can't possibly find a match, as we are oscillating between two values. The requested time probably falls within a spring-forward gap of size GT - T. Follow the common practice in this case, which is to return a time that is GT - T away from the requested time, preferring a time whose tm_isdst differs from the requested value. (If no tm_isdst was requested and only one of the two values has a nonzero tm_isdst, prefer that value.) In practice, this is more useful than returning -1. */ goto offset_found; else if (--remaining_probes == 0) return -1; /* We have a match. Check whether tm.tm_isdst has the requested value, if any. */ if (isdst != tm.tm_isdst && 0 <= isdst && 0 <= tm.tm_isdst) { /* tm.tm_isdst has the wrong value. Look for a neighboring time with the right value, and use its UTC offset. Heuristic: probe the adjacent timestamps in both directions, looking for the desired isdst. This should work for all real time zone histories in the tz database. */ /* Distance between probes when looking for a DST boundary. In tzdata2003a, the shortest period of DST is 601200 seconds (e.g., America/Recife starting 2000-10-08 01:00), and the shortest period of non-DST surrounded by DST is 694800 seconds (Africa/Tunis starting 1943-04-17 01:00). Use the minimum of these two values, so we don't miss these short periods when probing. */ int stride = 601200; /* The longest period of DST in tzdata2003a is 536454000 seconds (e.g., America/Jujuy starting 1946-10-01 01:00). The longest period of non-DST is much longer, but it makes no real sense to search for more than a year of non-DST, so use the DST max. */ int duration_max = 536454000; /* Search in both directions, so the maximum distance is half the duration; add the stride to avoid off-by-1 problems. */ int delta_bound = duration_max / 2 + stride; int delta, direction; for (delta = stride; delta < delta_bound; delta += stride) for (direction = -1; direction <= 1; direction += 2) { time_t ot = t + delta * direction; if ((ot < t) == (direction < 0)) { struct tm otm; ranged_convert (convert, &ot, &otm); if (otm.tm_isdst == isdst) { /* We found the desired tm_isdst. Extrapolate back to the desired time. */ t = guess_time_tm (year, yday, hour, min, sec, &ot, &otm); ranged_convert (convert, &t, &tm); goto offset_found; } } } } offset_found: *offset = guessed_offset + t - t0; if (LEAP_SECONDS_POSSIBLE && sec_requested != tm.tm_sec) { /* Adjust time to reflect the tm_sec requested, not the normalized value. Also, repair any damage from a false match due to a leap second. */ int sec_adjustment = (sec == 0 && tm.tm_sec == 60) - sec; t1 = t + sec_requested; t2 = t1 + sec_adjustment; if (((t1 < t) != (sec_requested < 0)) | ((t2 < t1) != (sec_adjustment < 0)) | ! convert (&t2, &tm)) return -1; t = t2; } *tp = tm; return t; } /* FIXME: This should use a signed type wide enough to hold any UTC offset in seconds. 'int' should be good enough for GNU code. We can't fix this unilaterally though, as other modules invoke __mktime_internal. */ static time_t localtime_offset; /* Convert *TP to a time_t value. */ time_t mktime (struct tm *tp) { #ifdef _LIBC /* POSIX.1 8.1.1 requires that whenever mktime() is called, the time zone names contained in the external variable `tzname' shall be set as if the tzset() function had been called. */ __tzset (); #endif return __mktime_internal (tp, __localtime_r, &localtime_offset); } #ifdef weak_alias weak_alias (mktime, timelocal) #endif #ifdef _LIBC libc_hidden_def (mktime) libc_hidden_weak (timelocal) #endif #if DEBUG static int not_equal_tm (const struct tm *a, const struct tm *b) { return ((a->tm_sec ^ b->tm_sec) | (a->tm_min ^ b->tm_min) | (a->tm_hour ^ b->tm_hour) | (a->tm_mday ^ b->tm_mday) | (a->tm_mon ^ b->tm_mon) | (a->tm_year ^ b->tm_year) | (a->tm_yday ^ b->tm_yday) | (a->tm_isdst ^ b->tm_isdst)); } static void print_tm (const struct tm *tp) { if (tp) printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d", tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday, tp->tm_hour, tp->tm_min, tp->tm_sec, tp->tm_yday, tp->tm_wday, tp->tm_isdst); else printf ("0"); } static int check_result (time_t tk, struct tm tmk, time_t tl, const struct tm *lt) { if (tk != tl || !lt || not_equal_tm (&tmk, lt)) { printf ("mktime ("); print_tm (lt); printf (")\nyields ("); print_tm (&tmk); printf (") == %ld, should be %ld\n", (long int) tk, (long int) tl); return 1; } return 0; } int main (int argc, char **argv) { int status = 0; struct tm tm, tmk, tml; struct tm *lt; time_t tk, tl, tl1; char trailer; if ((argc == 3 || argc == 4) && (sscanf (argv[1], "%d-%d-%d%c", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer) == 3) && (sscanf (argv[2], "%d:%d:%d%c", &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer) == 3)) { tm.tm_year -= TM_YEAR_BASE; tm.tm_mon--; tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]); tmk = tm; tl = mktime (&tmk); lt = localtime (&tl); if (lt) { tml = *lt; lt = &tml; } printf ("mktime returns %ld == ", (long int) tl); print_tm (&tmk); printf ("\n"); status = check_result (tl, tmk, tl, lt); } else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0)) { time_t from = atol (argv[1]); time_t by = atol (argv[2]); time_t to = atol (argv[3]); if (argc == 4) for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1) { lt = localtime (&tl); if (lt) { tmk = tml = *lt; tk = mktime (&tmk); status |= check_result (tk, tmk, tl, &tml); } else { printf ("localtime (%ld) yields 0\n", (long int) tl); status = 1; } tl1 = tl + by; if ((tl1 < tl) != (by < 0)) break; } else for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1) { /* Null benchmark. */ lt = localtime (&tl); if (lt) { tmk = tml = *lt; tk = tl; status |= check_result (tk, tmk, tl, &tml); } else { printf ("localtime (%ld) yields 0\n", (long int) tl); status = 1; } tl1 = tl + by; if ((tl1 < tl) != (by < 0)) break; } } else printf ("Usage:\ \t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\ \t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\ \t%s FROM BY TO - # Do not test those values (for benchmark).\n", argv[0], argv[0], argv[0]); return status; } #endif /* DEBUG */ /* Local Variables: compile-command: "gcc -DDEBUG -Wall -W -O -g mktime.c -o mktime" End: */ blame-1.3.1/lib/argp-fmtstream.h0000644000076400007640000002511610527555557013422 00000000000000/* Word-wrapping and line-truncating streams. Copyright (C) 1997, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* This package emulates glibc `line_wrap_stream' semantics for systems that don't have that. If the system does have it, it is just a wrapper for that. This header file is only used internally while compiling argp, and shouldn't be installed. */ #ifndef _ARGP_FMTSTREAM_H #define _ARGP_FMTSTREAM_H #include #include #include #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || __STRICT_ANSI__ # define __format__ format # define __printf__ printf # endif #endif #if (_LIBC - 0 && !defined (USE_IN_LIBIO)) \ || (defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H)) /* line_wrap_stream is available, so use that. */ #define ARGP_FMTSTREAM_USE_LINEWRAP #endif #ifdef ARGP_FMTSTREAM_USE_LINEWRAP /* Just be a simple wrapper for line_wrap_stream; the semantics are *slightly* different, as line_wrap_stream doesn't actually make a new object, it just modifies the given stream (reversibly) to do line-wrapping. Since we control who uses this code, it doesn't matter. */ #include typedef FILE *argp_fmtstream_t; #define argp_make_fmtstream line_wrap_stream #define __argp_make_fmtstream line_wrap_stream #define argp_fmtstream_free line_unwrap_stream #define __argp_fmtstream_free line_unwrap_stream #define __argp_fmtstream_putc(fs,ch) putc(ch,fs) #define argp_fmtstream_putc(fs,ch) putc(ch,fs) #define __argp_fmtstream_puts(fs,str) fputs(str,fs) #define argp_fmtstream_puts(fs,str) fputs(str,fs) #define __argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs) #define argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs) #define __argp_fmtstream_printf fprintf #define argp_fmtstream_printf fprintf #define __argp_fmtstream_lmargin line_wrap_lmargin #define argp_fmtstream_lmargin line_wrap_lmargin #define __argp_fmtstream_set_lmargin line_wrap_set_lmargin #define argp_fmtstream_set_lmargin line_wrap_set_lmargin #define __argp_fmtstream_rmargin line_wrap_rmargin #define argp_fmtstream_rmargin line_wrap_rmargin #define __argp_fmtstream_set_rmargin line_wrap_set_rmargin #define argp_fmtstream_set_rmargin line_wrap_set_rmargin #define __argp_fmtstream_wmargin line_wrap_wmargin #define argp_fmtstream_wmargin line_wrap_wmargin #define __argp_fmtstream_set_wmargin line_wrap_set_wmargin #define argp_fmtstream_set_wmargin line_wrap_set_wmargin #define __argp_fmtstream_point line_wrap_point #define argp_fmtstream_point line_wrap_point #else /* !ARGP_FMTSTREAM_USE_LINEWRAP */ /* Guess we have to define our own version. */ struct argp_fmtstream { FILE *stream; /* The stream we're outputting to. */ size_t lmargin, rmargin; /* Left and right margins. */ ssize_t wmargin; /* Margin to wrap to, or -1 to truncate. */ /* Point in buffer to which we've processed for wrapping, but not output. */ size_t point_offs; /* Output column at POINT_OFFS, or -1 meaning 0 but don't add lmargin. */ ssize_t point_col; char *buf; /* Output buffer. */ char *p; /* Current end of text in BUF. */ char *end; /* Absolute end of BUF. */ }; typedef struct argp_fmtstream *argp_fmtstream_t; /* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines written on it with LMARGIN spaces and limits them to RMARGIN columns total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by replacing the whitespace before them with a newline and WMARGIN spaces. Otherwise, chars beyond RMARGIN are simply dropped until a newline. Returns NULL if there was an error. */ extern argp_fmtstream_t __argp_make_fmtstream (FILE *__stream, size_t __lmargin, size_t __rmargin, ssize_t __wmargin); extern argp_fmtstream_t argp_make_fmtstream (FILE *__stream, size_t __lmargin, size_t __rmargin, ssize_t __wmargin); /* Flush __FS to its stream, and free it (but don't close the stream). */ extern void __argp_fmtstream_free (argp_fmtstream_t __fs); extern void argp_fmtstream_free (argp_fmtstream_t __fs); extern ssize_t __argp_fmtstream_printf (argp_fmtstream_t __fs, const char *__fmt, ...) __attribute__ ((__format__ (printf, 2, 3))); extern ssize_t argp_fmtstream_printf (argp_fmtstream_t __fs, const char *__fmt, ...) __attribute__ ((__format__ (printf, 2, 3))); extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch); extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch); extern int __argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str); extern int argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str); extern size_t __argp_fmtstream_write (argp_fmtstream_t __fs, const char *__str, size_t __len); extern size_t argp_fmtstream_write (argp_fmtstream_t __fs, const char *__str, size_t __len); /* Access macros for various bits of state. */ #define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin) #define argp_fmtstream_rmargin(__fs) ((__fs)->rmargin) #define argp_fmtstream_wmargin(__fs) ((__fs)->wmargin) #define __argp_fmtstream_lmargin argp_fmtstream_lmargin #define __argp_fmtstream_rmargin argp_fmtstream_rmargin #define __argp_fmtstream_wmargin argp_fmtstream_wmargin /* Set __FS's left margin to LMARGIN and return the old value. */ extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, size_t __lmargin); extern size_t __argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, size_t __lmargin); /* Set __FS's right margin to __RMARGIN and return the old value. */ extern size_t argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, size_t __rmargin); extern size_t __argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, size_t __rmargin); /* Set __FS's wrap margin to __WMARGIN and return the old value. */ extern size_t argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, size_t __wmargin); extern size_t __argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, size_t __wmargin); /* Return the column number of the current output point in __FS. */ extern size_t argp_fmtstream_point (argp_fmtstream_t __fs); extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs); /* Internal routines. */ extern void _argp_fmtstream_update (argp_fmtstream_t __fs); extern void __argp_fmtstream_update (argp_fmtstream_t __fs); extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount); extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount); #ifdef __OPTIMIZE__ /* Inline versions of above routines. */ #if !_LIBC #define __argp_fmtstream_putc argp_fmtstream_putc #define __argp_fmtstream_puts argp_fmtstream_puts #define __argp_fmtstream_write argp_fmtstream_write #define __argp_fmtstream_set_lmargin argp_fmtstream_set_lmargin #define __argp_fmtstream_set_rmargin argp_fmtstream_set_rmargin #define __argp_fmtstream_set_wmargin argp_fmtstream_set_wmargin #define __argp_fmtstream_point argp_fmtstream_point #define __argp_fmtstream_update _argp_fmtstream_update #define __argp_fmtstream_ensure _argp_fmtstream_ensure #endif #ifndef ARGP_FS_EI #define ARGP_FS_EI extern inline #endif ARGP_FS_EI size_t __argp_fmtstream_write (argp_fmtstream_t __fs, const char *__str, size_t __len) { if (__fs->p + __len <= __fs->end || __argp_fmtstream_ensure (__fs, __len)) { memcpy (__fs->p, __str, __len); __fs->p += __len; return __len; } else return 0; } ARGP_FS_EI int __argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str) { size_t __len = strlen (__str); if (__len) { size_t __wrote = __argp_fmtstream_write (__fs, __str, __len); return __wrote == __len ? 0 : -1; } else return 0; } ARGP_FS_EI int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch) { if (__fs->p < __fs->end || __argp_fmtstream_ensure (__fs, 1)) return *__fs->p++ = __ch; else return EOF; } /* Set __FS's left margin to __LMARGIN and return the old value. */ ARGP_FS_EI size_t __argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, size_t __lmargin) { size_t __old; if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs) __argp_fmtstream_update (__fs); __old = __fs->lmargin; __fs->lmargin = __lmargin; return __old; } /* Set __FS's right margin to __RMARGIN and return the old value. */ ARGP_FS_EI size_t __argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, size_t __rmargin) { size_t __old; if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs) __argp_fmtstream_update (__fs); __old = __fs->rmargin; __fs->rmargin = __rmargin; return __old; } /* Set FS's wrap margin to __WMARGIN and return the old value. */ ARGP_FS_EI size_t __argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, size_t __wmargin) { size_t __old; if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs) __argp_fmtstream_update (__fs); __old = __fs->wmargin; __fs->wmargin = __wmargin; return __old; } /* Return the column number of the current output point in __FS. */ ARGP_FS_EI size_t __argp_fmtstream_point (argp_fmtstream_t __fs) { if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs) __argp_fmtstream_update (__fs); return __fs->point_col >= 0 ? __fs->point_col : 0; } #if !_LIBC #undef __argp_fmtstream_putc #undef __argp_fmtstream_puts #undef __argp_fmtstream_write #undef __argp_fmtstream_set_lmargin #undef __argp_fmtstream_set_rmargin #undef __argp_fmtstream_set_wmargin #undef __argp_fmtstream_point #undef __argp_fmtstream_update #undef __argp_fmtstream_ensure #endif #endif /* __OPTIMIZE__ */ #endif /* ARGP_FMTSTREAM_USE_LINEWRAP */ #endif /* argp-fmtstream.h */ blame-1.3.1/lib/getline.c0000644000076400007640000000202010527555557012100 00000000000000/* getline.c --- Implementation of replacement getline function. Copyright (C) 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Simon Josefsson. */ #include #include "getdelim.h" #include "getline.h" ssize_t getline (char **lineptr, size_t *n, FILE *stream) { return getdelim (lineptr, n, '\n', stream); } blame-1.3.1/lib/mbchar.c0000644000076400007640000000227410527555557011720 00000000000000/* Copyright (C) 2001, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "mbchar.h" #if IS_BASIC_ASCII /* Bit table of characters in the ISO C "basic character set". */ const unsigned int is_basic_table [UCHAR_MAX / 32 + 1] = { 0x00001a00, /* '\t' '\v' '\f' */ 0xffffffef, /* ' '...'#' '%'...'?' */ 0xfffffffe, /* 'A'...'Z' '[' '\\' ']' '^' '_' */ 0x7ffffffe /* 'a'...'z' '{' '|' '}' '~' */ /* The remaining bits are 0. */ }; #endif /* IS_BASIC_ASCII */ blame-1.3.1/lib/xstrndup.c0000644000076400007640000000231710527555557012351 00000000000000/* Duplicate a bounded initial segment of a string, with out-of-memory checking. Copyright (C) 2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Specification. */ #include "xstrndup.h" #include "strndup.h" #include "xalloc.h" /* Return a newly allocated copy of at most N bytes of STRING. In other words, return a copy of the initial segment of length N of STRING. */ char * xstrndup (const char *string, size_t n) { char *s = strndup (string, n); if (! s) xalloc_die (); return s; } blame-1.3.1/lib/strdup.c0000644000076400007640000000262310527555560011775 00000000000000/* Copyright (C) 1991, 1996, 1997, 1998, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LIBC # include /* Get specification. */ # include "strdup.h" #endif #include #include #undef __strdup #ifdef _LIBC # undef strdup #endif #ifndef weak_alias # define __strdup strdup #endif /* Duplicate S, returning an identical malloc'd string. */ char * __strdup (const char *s) { size_t len = strlen (s) + 1; void *new = malloc (len); if (new == NULL) return NULL; return (char *) memcpy (new, s, len); } #ifdef libc_hidden_def libc_hidden_def (__strdup) #endif #ifdef weak_alias weak_alias (__strdup, strdup) #endif blame-1.3.1/lib/unlocked-io.h0000644000076400007640000000702110254677264012672 00000000000000/* Prefer faster, non-thread-safe stdio functions if available. Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Jim Meyering. */ #ifndef UNLOCKED_IO_H # define UNLOCKED_IO_H 1 /* These are wrappers for functions/macros from the GNU C library, and from other C libraries supporting POSIX's optional thread-safe functions. The standard I/O functions are thread-safe. These *_unlocked ones are more efficient but not thread-safe. That they're not thread-safe is fine since all of the applications in this package are single threaded. Also, some code that is shared with the GNU C library may invoke the *_unlocked functions directly. On hosts that lack those functions, invoke the non-thread-safe versions instead. */ # include # if HAVE_DECL_CLEARERR_UNLOCKED # undef clearerr # define clearerr(x) clearerr_unlocked (x) # else # define clearerr_unlocked(x) clearerr (x) # endif # if HAVE_DECL_FEOF_UNLOCKED # undef feof # define feof(x) feof_unlocked (x) # else # define feof_unlocked(x) feof (x) # endif # if HAVE_DECL_FERROR_UNLOCKED # undef ferror # define ferror(x) ferror_unlocked (x) # else # define ferror_unlocked(x) ferror (x) # endif # if HAVE_DECL_FFLUSH_UNLOCKED # undef fflush # define fflush(x) fflush_unlocked (x) # else # define fflush_unlocked(x) fflush (x) # endif # if HAVE_DECL_FGETS_UNLOCKED # undef fgets # define fgets(x,y,z) fgets_unlocked (x,y,z) # else # define fgets_unlocked(x,y,z) fgets (x,y,z) # endif # if HAVE_DECL_FPUTC_UNLOCKED # undef fputc # define fputc(x,y) fputc_unlocked (x,y) # else # define fputc_unlocked(x,y) fputc (x,y) # endif # if HAVE_DECL_FPUTS_UNLOCKED # undef fputs # define fputs(x,y) fputs_unlocked (x,y) # else # define fputs_unlocked(x,y) fputs (x,y) # endif # if HAVE_DECL_FREAD_UNLOCKED # undef fread # define fread(w,x,y,z) fread_unlocked (w,x,y,z) # else # define fread_unlocked(w,x,y,z) fread (w,x,y,z) # endif # if HAVE_DECL_FWRITE_UNLOCKED # undef fwrite # define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z) # else # define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z) # endif # if HAVE_DECL_GETC_UNLOCKED # undef getc # define getc(x) getc_unlocked (x) # else # define getc_unlocked(x) getc (x) # endif # if HAVE_DECL_GETCHAR_UNLOCKED # undef getchar # define getchar() getchar_unlocked () # else # define getchar_unlocked() getchar () # endif # if HAVE_DECL_PUTC_UNLOCKED # undef putc # define putc(x,y) putc_unlocked (x,y) # else # define putc_unlocked(x,y) putc (x,y) # endif # if HAVE_DECL_PUTCHAR_UNLOCKED # undef putchar # define putchar(x) putchar_unlocked (x) # else # define putchar_unlocked(x) putchar (x) # endif # undef flockfile # define flockfile(x) ((void) 0) # undef ftrylockfile # define ftrylockfile(x) 0 # undef funlockfile # define funlockfile(x) ((void) 0) #endif /* UNLOCKED_IO_H */ blame-1.3.1/lib/cycle-check.h0000644000076400007640000000323010527555557012634 00000000000000/* help detect directory cycles efficiently Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Jim Meyering */ #ifndef CYCLE_CHECK_H # define CYCLE_CHECK_H 1 # include # include # include "dev-ino.h" # include "same-inode.h" struct cycle_check_state { struct dev_ino dev_ino; uintmax_t chdir_counter; int magic; }; void cycle_check_init (struct cycle_check_state *state); bool cycle_check (struct cycle_check_state *state, struct stat const *sb); # define CYCLE_CHECK_REFLECT_CHDIR_UP(State, SB_dir, SB_subdir) \ do \ { \ /* You must call cycle_check at least once before using this macro. */ \ if ((State)->chdir_counter == 0) \ abort (); \ if (SAME_INODE ((State)->dev_ino, SB_subdir)) \ { \ (State)->dev_ino.st_dev = (SB_dir).st_dev; \ (State)->dev_ino.st_ino = (SB_dir).st_ino; \ } \ } \ while (0) #endif blame-1.3.1/lib/strndup.h0000644000076400007640000000237710527555560012166 00000000000000/* Duplicate a size-bounded string. Copyright (C) 2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Get size_t. */ #include /* If HAVE_STRNDUP, get the strndup declaration. If !HAVE_STRNDUP, include now so that it doesn't cause trouble if included later. */ #include #if !HAVE_STRNDUP # undef strndup # define strndup rpl_strndup # if !HAVE_DECL_STRNDUP /* Don't risk conflicting declarations. */ /* Return a newly allocated copy of at most N bytes of STRING. */ extern char *strndup (const char *string, size_t n); # endif #endif blame-1.3.1/lib/cycle-check.c0000644000076400007640000000526210527555557012636 00000000000000/* help detect directory cycles efficiently Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Jim Meyering */ #include #include #include #include #include #include #include #include "cycle-check.h" #define CC_MAGIC 9827862 /* Return true if I is a power of 2, or is zero. */ static inline bool is_zero_or_power_of_two (uintmax_t i) { return (i & (i - 1)) == 0; } void cycle_check_init (struct cycle_check_state *state) { state->chdir_counter = 0; state->magic = CC_MAGIC; } /* In traversing a directory hierarchy, call this function once for each descending chdir call, with SB corresponding to the chdir operand. If SB corresponds to a directory that has already been seen, return true to indicate that there is a directory cycle. Note that this is done `lazily', which means that some of the directories in the cycle may be processed twice before the cycle is detected. */ bool cycle_check (struct cycle_check_state *state, struct stat const *sb) { assert (state->magic == CC_MAGIC); /* If the current directory ever happens to be the same as the one we last recorded for the cycle detection, then it's obviously part of a cycle. */ if (state->chdir_counter && SAME_INODE (*sb, state->dev_ino)) return true; /* If the number of `descending' chdir calls is a power of two, record the dev/ino of the current directory. */ if (is_zero_or_power_of_two (++(state->chdir_counter))) { /* On all architectures that we know about, if the counter overflows then there is a directory cycle here somewhere, even if we haven't detected it yet. Typically this happens only after the counter is incremented 2**64 times, so it's a fairly theoretical point. */ if (state->chdir_counter == 0) return true; state->dev_ino.st_dev = sb->st_dev; state->dev_ino.st_ino = sb->st_ino; } return false; } blame-1.3.1/lib/argp-fs-xinl.c0000644000076400007640000000317110337302606012750 00000000000000/* Real definitions for extern inline functions in argp-fmtstream.h Copyright (C) 1997, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #define ARGP_FS_EI #undef __OPTIMIZE__ #define __OPTIMIZE__ 1 #include "argp-fmtstream.h" #if 0 /* Not exported. */ /* Add weak aliases. */ #if _LIBC - 0 && !defined (ARGP_FMTSTREAM_USE_LINEWRAP) && defined (weak_alias) weak_alias (__argp_fmtstream_putc, argp_fmtstream_putc) weak_alias (__argp_fmtstream_puts, argp_fmtstream_puts) weak_alias (__argp_fmtstream_write, argp_fmtstream_write) weak_alias (__argp_fmtstream_set_lmargin, argp_fmtstream_set_lmargin) weak_alias (__argp_fmtstream_set_rmargin, argp_fmtstream_set_rmargin) weak_alias (__argp_fmtstream_set_wmargin, argp_fmtstream_set_wmargin) weak_alias (__argp_fmtstream_point, argp_fmtstream_point) #endif #endif blame-1.3.1/lib/getopt_.h0000644000076400007640000001760210527555557012133 00000000000000/* Declarations for getopt. Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif /* Standalone applications should #define __GETOPT_PREFIX to an identifier that prefixes the external functions and variables defined in this header. When this happens, include the headers that might declare getopt so that they will not cause confusion if included after this file. Then systematically rename identifiers so that they do not collide with the system functions and variables. Renaming avoids problems with some compilers and linkers. */ #if defined __GETOPT_PREFIX && !defined __need_getopt # include # include # include # undef __need_getopt # undef getopt # undef getopt_long # undef getopt_long_only # undef optarg # undef opterr # undef optind # undef optopt # define __GETOPT_CONCAT(x, y) x ## y # define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) # define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y) # define getopt __GETOPT_ID (getopt) # define getopt_long __GETOPT_ID (getopt_long) # define getopt_long_only __GETOPT_ID (getopt_long_only) # define optarg __GETOPT_ID (optarg) # define opterr __GETOPT_ID (opterr) # define optind __GETOPT_ID (optind) # define optopt __GETOPT_ID (optopt) #endif /* Standalone applications get correct prototypes for getopt_long and getopt_long_only; they declare "char **argv". libc uses prototypes with "char *const *argv" that are incorrect because getopt_long and getopt_long_only can permute argv; this is required for backward compatibility (e.g., for LSB 2.0.1). This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt', but it caused redefinition warnings if both unistd.h and getopt.h were included, since unistd.h includes getopt.h having previously defined __need_getopt. The only place where __getopt_argv_const is used is in definitions of getopt_long and getopt_long_only below, but these are visible only if __need_getopt is not defined, so it is quite safe to rewrite the conditional as follows: */ #if !defined __need_getopt # if defined __GETOPT_PREFIX # define __getopt_argv_const /* empty */ # else # define __getopt_argv_const const # endif #endif /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include #endif #ifndef __THROW # ifndef __GNUC_PREREQ # define __GNUC_PREREQ(maj, min) (0) # endif # if defined __cplusplus && __GNUC_PREREQ (2,8) # define __THROW throw () # else # define __THROW # endif #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `-', then non-option arguments are treated as arguments to the option '\1'. This behavior is specific to the GNU `getopt'. If OPTS begins with `+', or POSIXLY_CORRECT is set in the environment, then do not permute arguments. */ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) __THROW; #ifndef __need_getopt extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; #endif #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ blame-1.3.1/lib/getdelim.h0000664000076400007640000000213310337302571012240 00000000000000/* getdelim.h --- Prototype for replacement getdelim function. Copyright (C) 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Simon Josefsson. */ /* Get size_t, FILE, ssize_t. And getdelim, if available. */ # include # include # include #if !HAVE_DECL_GETDELIM ssize_t getdelim (char **lineptr, size_t *n, int delimiter, FILE *stream); #endif /* !HAVE_GETDELIM */ blame-1.3.1/lib/error.c0000644000076400007640000001757210527555557011624 00000000000000/* Error handler for noninteractive utilities Copyright (C) 1990-1998, 2000-2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by David MacKenzie . */ #if !_LIBC # include #endif #include "error.h" #include #include #include #include #if !_LIBC && ENABLE_NLS # include "gettext.h" #endif #ifdef _LIBC # include # include # include # include # define mbsrtowcs __mbsrtowcs #endif #if USE_UNLOCKED_IO # include "unlocked-io.h" #endif #ifndef _ # define _(String) String #endif /* If NULL, error will flush stdout, then print on stderr the program name, a colon and a space. Otherwise, error will call this function without parameters instead. */ void (*error_print_progname) (void); /* This variable is incremented each time `error' is called. */ unsigned int error_message_count; #ifdef _LIBC /* In the GNU C library, there is a predefined variable for this. */ # define program_name program_invocation_name # include # include # include /* In GNU libc we want do not want to use the common name `error' directly. Instead make it a weak alias. */ extern void __error (int status, int errnum, const char *message, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern void __error_at_line (int status, int errnum, const char *file_name, unsigned int line_number, const char *message, ...) __attribute__ ((__format__ (__printf__, 5, 6)));; # define error __error # define error_at_line __error_at_line # include # define fflush(s) INTUSE(_IO_fflush) (s) # undef putc # define putc(c, fp) INTUSE(_IO_putc) (c, fp) # include #else /* not _LIBC */ # if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P # ifndef HAVE_DECL_STRERROR_R "this configure-time declaration test was not run" # endif char *strerror_r (); # endif /* The calling program should define program_name and set it to the name of the executing program. */ extern char *program_name; # if HAVE_STRERROR_R || defined strerror_r # define __strerror_r strerror_r # endif /* HAVE_STRERROR_R || defined strerror_r */ #endif /* not _LIBC */ static void print_errno_message (int errnum) { char const *s; #if defined HAVE_STRERROR_R || _LIBC char errbuf[1024]; # if STRERROR_R_CHAR_P || _LIBC s = __strerror_r (errnum, errbuf, sizeof errbuf); # else if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0) s = errbuf; else s = 0; # endif #else s = strerror (errnum); #endif #if !_LIBC if (! s) s = _("Unknown system error"); #endif #if _LIBC __fxprintf (NULL, ": %s", s); #else fprintf (stderr, ": %s", s); #endif } static void error_tail (int status, int errnum, const char *message, va_list args) { #if _LIBC if (_IO_fwide (stderr, 0) > 0) { # define ALLOCA_LIMIT 2000 size_t len = strlen (message) + 1; wchar_t *wmessage = NULL; mbstate_t st; size_t res; const char *tmp; bool use_malloc = false; while (1) { if (__libc_use_alloca (len * sizeof (wchar_t))) wmessage = (wchar_t *) alloca (len * sizeof (wchar_t)); else { if (!use_malloc) wmessage = NULL; wchar_t *p = (wchar_t *) realloc (wmessage, len * sizeof (wchar_t)); if (p == NULL) { free (wmessage); fputws_unlocked (L"out of memory\n", stderr); return; } wmessage = p; use_malloc = true; } memset (&st, '\0', sizeof (st)); tmp = message; res = mbsrtowcs (wmessage, &tmp, len, &st); if (res != len) break; if (__builtin_expect (len >= SIZE_MAX / 2, 0)) { /* This really should not happen if everything is fine. */ res = (size_t) -1; break; } len *= 2; } if (res == (size_t) -1) { /* The string cannot be converted. */ if (use_malloc) { free (wmessage); use_malloc = false; } wmessage = (wchar_t *) L"???"; } __vfwprintf (stderr, wmessage, args); if (use_malloc) free (wmessage); } else #endif vfprintf (stderr, message, args); va_end (args); ++error_message_count; if (errnum) print_errno_message (errnum); #if _LIBC __fxprintf (NULL, "\n"); #else putc ('\n', stderr); #endif fflush (stderr); if (status) exit (status); } /* Print the program name and error message MESSAGE, which is a printf-style format string with optional args. If ERRNUM is nonzero, print its corresponding system error message. Exit with status STATUS if it is nonzero. */ void error (int status, int errnum, const char *message, ...) { va_list args; #if defined _LIBC && defined __libc_ptf_call /* We do not want this call to be cut short by a thread cancellation. Therefore disable cancellation for now. */ int state = PTHREAD_CANCEL_ENABLE; __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state), 0); #endif fflush (stdout); #ifdef _LIBC _IO_flockfile (stderr); #endif if (error_print_progname) (*error_print_progname) (); else { #if _LIBC __fxprintf (NULL, "%s: ", program_name); #else fprintf (stderr, "%s: ", program_name); #endif } va_start (args, message); error_tail (status, errnum, message, args); #ifdef _LIBC _IO_funlockfile (stderr); # ifdef __libc_ptf_call __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0); # endif #endif } /* Sometimes we want to have at most one error per line. This variable controls whether this mode is selected or not. */ int error_one_per_line; void error_at_line (int status, int errnum, const char *file_name, unsigned int line_number, const char *message, ...) { va_list args; if (error_one_per_line) { static const char *old_file_name; static unsigned int old_line_number; if (old_line_number == line_number && (file_name == old_file_name || strcmp (old_file_name, file_name) == 0)) /* Simply return and print nothing. */ return; old_file_name = file_name; old_line_number = line_number; } #if defined _LIBC && defined __libc_ptf_call /* We do not want this call to be cut short by a thread cancellation. Therefore disable cancellation for now. */ int state = PTHREAD_CANCEL_ENABLE; __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state), 0); #endif fflush (stdout); #ifdef _LIBC _IO_flockfile (stderr); #endif if (error_print_progname) (*error_print_progname) (); else { #if _LIBC __fxprintf (NULL, "%s:", program_name); #else fprintf (stderr, "%s:", program_name); #endif } #if _LIBC __fxprintf (NULL, file_name != NULL ? "%s:%d: " : " ", file_name, line_number); #else fprintf (stderr, file_name != NULL ? "%s:%d: " : " ", file_name, line_number); #endif va_start (args, message); error_tail (status, errnum, message, args); #ifdef _LIBC _IO_funlockfile (stderr); # ifdef __libc_ptf_call __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0); # endif #endif } #ifdef _LIBC /* Make the weak alias. */ # undef error # undef error_at_line weak_alias (__error, error) weak_alias (__error_at_line, error_at_line) #endif blame-1.3.1/lib/printf-args.c0000644000076400007640000001005510527555557012714 00000000000000/* Decomposed printf argument list. Copyright (C) 1999, 2002-2003, 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Specification. */ #include "printf-args.h" #ifdef STATIC STATIC #endif int printf_fetchargs (va_list args, arguments *a) { size_t i; argument *ap; for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++) switch (ap->type) { case TYPE_SCHAR: ap->a.a_schar = va_arg (args, /*signed char*/ int); break; case TYPE_UCHAR: ap->a.a_uchar = va_arg (args, /*unsigned char*/ int); break; case TYPE_SHORT: ap->a.a_short = va_arg (args, /*short*/ int); break; case TYPE_USHORT: ap->a.a_ushort = va_arg (args, /*unsigned short*/ int); break; case TYPE_INT: ap->a.a_int = va_arg (args, int); break; case TYPE_UINT: ap->a.a_uint = va_arg (args, unsigned int); break; case TYPE_LONGINT: ap->a.a_longint = va_arg (args, long int); break; case TYPE_ULONGINT: ap->a.a_ulongint = va_arg (args, unsigned long int); break; #ifdef HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: ap->a.a_longlongint = va_arg (args, long long int); break; case TYPE_ULONGLONGINT: ap->a.a_ulonglongint = va_arg (args, unsigned long long int); break; #endif case TYPE_DOUBLE: ap->a.a_double = va_arg (args, double); break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: ap->a.a_longdouble = va_arg (args, long double); break; #endif case TYPE_CHAR: ap->a.a_char = va_arg (args, int); break; #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by default argument promotions", this is not the case in mingw32, where wint_t is 'unsigned short'. */ ap->a.a_wide_char = (sizeof (wint_t) < sizeof (int) ? va_arg (args, int) : va_arg (args, wint_t)); break; #endif case TYPE_STRING: ap->a.a_string = va_arg (args, const char *); /* A null pointer is an invalid argument for "%s", but in practice it occurs quite frequently in printf statements that produce debug output. Use a fallback in this case. */ if (ap->a.a_string == NULL) ap->a.a_string = "(NULL)"; break; #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: ap->a.a_wide_string = va_arg (args, const wchar_t *); /* A null pointer is an invalid argument for "%ls", but in practice it occurs quite frequently in printf statements that produce debug output. Use a fallback in this case. */ if (ap->a.a_wide_string == NULL) { static const wchar_t wide_null_string[] = { (wchar_t)'(', (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L', (wchar_t)')', (wchar_t)0 }; ap->a.a_wide_string = wide_null_string; } break; #endif case TYPE_POINTER: ap->a.a_pointer = va_arg (args, void *); break; case TYPE_COUNT_SCHAR_POINTER: ap->a.a_count_schar_pointer = va_arg (args, signed char *); break; case TYPE_COUNT_SHORT_POINTER: ap->a.a_count_short_pointer = va_arg (args, short *); break; case TYPE_COUNT_INT_POINTER: ap->a.a_count_int_pointer = va_arg (args, int *); break; case TYPE_COUNT_LONGINT_POINTER: ap->a.a_count_longint_pointer = va_arg (args, long int *); break; #ifdef HAVE_LONG_LONG_INT case TYPE_COUNT_LONGLONGINT_POINTER: ap->a.a_count_longlongint_pointer = va_arg (args, long long int *); break; #endif default: /* Unknown type. */ return -1; } return 0; } blame-1.3.1/lib/unsetenv.c0000644000076400007640000000412110527555560012316 00000000000000/* Copyright (C) 1992,1995-1999,2000-2002,2005-2006 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #if !_LIBC # define __set_errno(ev) ((errno) = (ev)) #endif #include #include #include #if !_LIBC # define __environ environ # ifndef HAVE_ENVIRON_DECL extern char **environ; # endif #endif #if _LIBC /* This lock protects against simultaneous modifications of `environ'. */ # include __libc_lock_define_initialized (static, envlock) # define LOCK __libc_lock_lock (envlock) # define UNLOCK __libc_lock_unlock (envlock) #else # define LOCK # define UNLOCK #endif /* In the GNU C library we must keep the namespace clean. */ #ifdef _LIBC # define unsetenv __unsetenv #endif int unsetenv (const char *name) { size_t len; char **ep; if (name == NULL || *name == '\0' || strchr (name, '=') != NULL) { __set_errno (EINVAL); return -1; } len = strlen (name); LOCK; ep = __environ; while (*ep != NULL) if (!strncmp (*ep, name, len) && (*ep)[len] == '=') { /* Found it. Remove this pointer by moving later ones back. */ char **dp = ep; do dp[0] = dp[1]; while (*dp++); /* Continue the loop in case NAME appears again. */ } else ++ep; UNLOCK; return 0; } #ifdef _LIBC # undef unsetenv weak_alias (__unsetenv, unsetenv) #endif blame-1.3.1/lib/vasnprintf.c0000644000076400007640000005351510527555560012654 00000000000000/* vsprintf with automatic memory allocation. Copyright (C) 1999, 2002-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Tell glibc's to provide a prototype for snprintf(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #include #ifndef IN_LIBINTL # include #endif /* Specification. */ #if WIDE_CHAR_VERSION # include "vasnwprintf.h" #else # include "vasnprintf.h" #endif #include /* snprintf(), sprintf() */ #include /* abort(), malloc(), realloc(), free() */ #include /* memcpy(), strlen() */ #include /* errno */ #include /* CHAR_BIT */ #include /* DBL_MAX_EXP, LDBL_MAX_EXP */ #if WIDE_CHAR_VERSION # include "wprintf-parse.h" #else # include "printf-parse.h" #endif /* Checked size_t computations. */ #include "xsize.h" #ifdef HAVE_WCHAR_T # ifdef HAVE_WCSLEN # define local_wcslen wcslen # else /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid a dependency towards this library, here is a local substitute. Define this substitute only once, even if this file is included twice in the same compilation unit. */ # ifndef local_wcslen_defined # define local_wcslen_defined 1 static size_t local_wcslen (const wchar_t *s) { const wchar_t *ptr; for (ptr = s; *ptr != (wchar_t) 0; ptr++) ; return ptr - s; } # endif # endif #endif #if WIDE_CHAR_VERSION # define VASNPRINTF vasnwprintf # define CHAR_T wchar_t # define DIRECTIVE wchar_t_directive # define DIRECTIVES wchar_t_directives # define PRINTF_PARSE wprintf_parse # define USE_SNPRINTF 1 # if HAVE_DECL__SNWPRINTF /* On Windows, the function swprintf() has a different signature than on Unix; we use the _snwprintf() function instead. */ # define SNPRINTF _snwprintf # else /* Unix. */ # define SNPRINTF swprintf # endif #else # define VASNPRINTF vasnprintf # define CHAR_T char # define DIRECTIVE char_directive # define DIRECTIVES char_directives # define PRINTF_PARSE printf_parse # define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) # if HAVE_DECL__SNPRINTF /* Windows. */ # define SNPRINTF _snprintf # else /* Unix. */ # define SNPRINTF snprintf # endif #endif CHAR_T * VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args) { DIRECTIVES d; arguments a; if (PRINTF_PARSE (format, &d, &a) < 0) { errno = EINVAL; return NULL; } #define CLEANUP() \ free (d.dir); \ if (a.arg) \ free (a.arg); if (printf_fetchargs (args, &a) < 0) { CLEANUP (); errno = EINVAL; return NULL; } { size_t buf_neededlength; CHAR_T *buf; CHAR_T *buf_malloced; const CHAR_T *cp; size_t i; DIRECTIVE *dp; /* Output string accumulator. */ CHAR_T *result; size_t allocated; size_t length; /* Allocate a small buffer that will hold a directive passed to sprintf or snprintf. */ buf_neededlength = xsum4 (7, d.max_width_length, d.max_precision_length, 6); #if HAVE_ALLOCA if (buf_neededlength < 4000 / sizeof (CHAR_T)) { buf = (CHAR_T *) alloca (buf_neededlength * sizeof (CHAR_T)); buf_malloced = NULL; } else #endif { size_t buf_memsize = xtimes (buf_neededlength, sizeof (CHAR_T)); if (size_overflow_p (buf_memsize)) goto out_of_memory_1; buf = (CHAR_T *) malloc (buf_memsize); if (buf == NULL) goto out_of_memory_1; buf_malloced = buf; } if (resultbuf != NULL) { result = resultbuf; allocated = *lengthp; } else { result = NULL; allocated = 0; } length = 0; /* Invariants: result is either == resultbuf or == NULL or malloc-allocated. If length > 0, then result != NULL. */ /* Ensures that allocated >= needed. Aborts through a jump to out_of_memory if needed is SIZE_MAX or otherwise too big. */ #define ENSURE_ALLOCATION(needed) \ if ((needed) > allocated) \ { \ size_t memory_size; \ CHAR_T *memory; \ \ allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \ if ((needed) > allocated) \ allocated = (needed); \ memory_size = xtimes (allocated, sizeof (CHAR_T)); \ if (size_overflow_p (memory_size)) \ goto out_of_memory; \ if (result == resultbuf || result == NULL) \ memory = (CHAR_T *) malloc (memory_size); \ else \ memory = (CHAR_T *) realloc (result, memory_size); \ if (memory == NULL) \ goto out_of_memory; \ if (result == resultbuf && length > 0) \ memcpy (memory, result, length * sizeof (CHAR_T)); \ result = memory; \ } for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++) { if (cp != dp->dir_start) { size_t n = dp->dir_start - cp; size_t augmented_length = xsum (length, n); ENSURE_ALLOCATION (augmented_length); memcpy (result + length, cp, n * sizeof (CHAR_T)); length = augmented_length; } if (i == d.count) break; /* Execute a single directive. */ if (dp->conversion == '%') { size_t augmented_length; if (!(dp->arg_index == ARG_NONE)) abort (); augmented_length = xsum (length, 1); ENSURE_ALLOCATION (augmented_length); result[length] = '%'; length = augmented_length; } else { if (!(dp->arg_index != ARG_NONE)) abort (); if (dp->conversion == 'n') { switch (a.arg[dp->arg_index].type) { case TYPE_COUNT_SCHAR_POINTER: *a.arg[dp->arg_index].a.a_count_schar_pointer = length; break; case TYPE_COUNT_SHORT_POINTER: *a.arg[dp->arg_index].a.a_count_short_pointer = length; break; case TYPE_COUNT_INT_POINTER: *a.arg[dp->arg_index].a.a_count_int_pointer = length; break; case TYPE_COUNT_LONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longint_pointer = length; break; #ifdef HAVE_LONG_LONG_INT case TYPE_COUNT_LONGLONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length; break; #endif default: abort (); } } else { arg_type type = a.arg[dp->arg_index].type; CHAR_T *p; unsigned int prefix_count; int prefixes[2]; #if !USE_SNPRINTF size_t tmp_length; CHAR_T tmpbuf[700]; CHAR_T *tmp; /* Allocate a temporary buffer of sufficient size for calling sprintf. */ { size_t width; size_t precision; width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->width_arg_index].a.a_int; width = (arg < 0 ? (unsigned int) (-arg) : arg); } else { const CHAR_T *digitp = dp->width_start; do width = xsum (xtimes (width, 10), *digitp++ - '0'); while (digitp != dp->width_end); } } precision = 6; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->precision_arg_index].a.a_int; precision = (arg < 0 ? 0 : arg); } else { const CHAR_T *digitp = dp->precision_start + 1; precision = 0; while (digitp != dp->precision_end) precision = xsum (xtimes (precision, 10), *digitp++ - '0'); } } switch (dp->conversion) { case 'd': case 'i': case 'u': # ifdef HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.30103 /* binary -> decimal */ ) + 1; /* turn floor into ceil */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.30103 /* binary -> decimal */ ) + 1; /* turn floor into ceil */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.30103 /* binary -> decimal */ ) + 1; /* turn floor into ceil */ if (tmp_length < precision) tmp_length = precision; /* Multiply by 2, as an estimate for FLAG_GROUP. */ tmp_length = xsum (tmp_length, tmp_length); /* Add 1, to account for a leading sign. */ tmp_length = xsum (tmp_length, 1); break; case 'o': # ifdef HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1; /* turn floor into ceil */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1; /* turn floor into ceil */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1; /* turn floor into ceil */ if (tmp_length < precision) tmp_length = precision; /* Add 1, to account for a leading sign. */ tmp_length = xsum (tmp_length, 1); break; case 'x': case 'X': # ifdef HAVE_LONG_LONG_INT if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1; /* turn floor into ceil */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1; /* turn floor into ceil */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1; /* turn floor into ceil */ if (tmp_length < precision) tmp_length = precision; /* Add 2, to account for a leading sign or alternate form. */ tmp_length = xsum (tmp_length, 2); break; case 'f': case 'F': # ifdef HAVE_LONG_DOUBLE if (type == TYPE_LONGDOUBLE) tmp_length = (unsigned int) (LDBL_MAX_EXP * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 10; /* sign, decimal point etc. */ else # endif tmp_length = (unsigned int) (DBL_MAX_EXP * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 10; /* sign, decimal point etc. */ tmp_length = xsum (tmp_length, precision); break; case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': tmp_length = 12; /* sign, decimal point, exponent etc. */ tmp_length = xsum (tmp_length, precision); break; case 'c': # if defined HAVE_WINT_T && !WIDE_CHAR_VERSION if (type == TYPE_WIDE_CHAR) tmp_length = MB_CUR_MAX; else # endif tmp_length = 1; break; case 's': # ifdef HAVE_WCHAR_T if (type == TYPE_WIDE_STRING) { tmp_length = local_wcslen (a.arg[dp->arg_index].a.a_wide_string); # if !WIDE_CHAR_VERSION tmp_length = xtimes (tmp_length, MB_CUR_MAX); # endif } else # endif tmp_length = strlen (a.arg[dp->arg_index].a.a_string); break; case 'p': tmp_length = (unsigned int) (sizeof (void *) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading 0x */ break; default: abort (); } if (tmp_length < width) tmp_length = width; tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ } if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T)) tmp = tmpbuf; else { size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T)); if (size_overflow_p (tmp_memsize)) /* Overflow, would lead to out of memory. */ goto out_of_memory; tmp = (CHAR_T *) malloc (tmp_memsize); if (tmp == NULL) /* Out of memory. */ goto out_of_memory; } #endif /* Construct the format string for calling snprintf or sprintf. */ p = buf; *p++ = '%'; if (dp->flags & FLAG_GROUP) *p++ = '\''; if (dp->flags & FLAG_LEFT) *p++ = '-'; if (dp->flags & FLAG_SHOWSIGN) *p++ = '+'; if (dp->flags & FLAG_SPACE) *p++ = ' '; if (dp->flags & FLAG_ALT) *p++ = '#'; if (dp->flags & FLAG_ZERO) *p++ = '0'; if (dp->width_start != dp->width_end) { size_t n = dp->width_end - dp->width_start; memcpy (p, dp->width_start, n * sizeof (CHAR_T)); p += n; } if (dp->precision_start != dp->precision_end) { size_t n = dp->precision_end - dp->precision_start; memcpy (p, dp->precision_start, n * sizeof (CHAR_T)); p += n; } switch (type) { #ifdef HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: case TYPE_ULONGLONGINT: *p++ = 'l'; /*FALLTHROUGH*/ #endif case TYPE_LONGINT: case TYPE_ULONGINT: #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: #endif #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: #endif *p++ = 'l'; break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: *p++ = 'L'; break; #endif default: break; } *p = dp->conversion; #if USE_SNPRINTF p[1] = '%'; p[2] = 'n'; p[3] = '\0'; #else p[1] = '\0'; #endif /* Construct the arguments for calling snprintf or sprintf. */ prefix_count = 0; if (dp->width_arg_index != ARG_NONE) { if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int; } if (dp->precision_arg_index != ARG_NONE) { if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int; } #if USE_SNPRINTF /* Prepare checking whether snprintf returns the count via %n. */ ENSURE_ALLOCATION (xsum (length, 1)); result[length] = '\0'; #endif for (;;) { size_t maxlen; int count; int retcount; maxlen = allocated - length; count = -1; retcount = 0; #if USE_SNPRINTF # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ { \ case 0: \ retcount = SNPRINTF (result + length, maxlen, buf, \ arg, &count); \ break; \ case 1: \ retcount = SNPRINTF (result + length, maxlen, buf, \ prefixes[0], arg, &count); \ break; \ case 2: \ retcount = SNPRINTF (result + length, maxlen, buf, \ prefixes[0], prefixes[1], arg, \ &count); \ break; \ default: \ abort (); \ } #else # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ { \ case 0: \ count = sprintf (tmp, buf, arg); \ break; \ case 1: \ count = sprintf (tmp, buf, prefixes[0], arg); \ break; \ case 2: \ count = sprintf (tmp, buf, prefixes[0], prefixes[1],\ arg); \ break; \ default: \ abort (); \ } #endif switch (type) { case TYPE_SCHAR: { int arg = a.arg[dp->arg_index].a.a_schar; SNPRINTF_BUF (arg); } break; case TYPE_UCHAR: { unsigned int arg = a.arg[dp->arg_index].a.a_uchar; SNPRINTF_BUF (arg); } break; case TYPE_SHORT: { int arg = a.arg[dp->arg_index].a.a_short; SNPRINTF_BUF (arg); } break; case TYPE_USHORT: { unsigned int arg = a.arg[dp->arg_index].a.a_ushort; SNPRINTF_BUF (arg); } break; case TYPE_INT: { int arg = a.arg[dp->arg_index].a.a_int; SNPRINTF_BUF (arg); } break; case TYPE_UINT: { unsigned int arg = a.arg[dp->arg_index].a.a_uint; SNPRINTF_BUF (arg); } break; case TYPE_LONGINT: { long int arg = a.arg[dp->arg_index].a.a_longint; SNPRINTF_BUF (arg); } break; case TYPE_ULONGINT: { unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint; SNPRINTF_BUF (arg); } break; #ifdef HAVE_LONG_LONG_INT case TYPE_LONGLONGINT: { long long int arg = a.arg[dp->arg_index].a.a_longlongint; SNPRINTF_BUF (arg); } break; case TYPE_ULONGLONGINT: { unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint; SNPRINTF_BUF (arg); } break; #endif case TYPE_DOUBLE: { double arg = a.arg[dp->arg_index].a.a_double; SNPRINTF_BUF (arg); } break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: { long double arg = a.arg[dp->arg_index].a.a_longdouble; SNPRINTF_BUF (arg); } break; #endif case TYPE_CHAR: { int arg = a.arg[dp->arg_index].a.a_char; SNPRINTF_BUF (arg); } break; #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: { wint_t arg = a.arg[dp->arg_index].a.a_wide_char; SNPRINTF_BUF (arg); } break; #endif case TYPE_STRING: { const char *arg = a.arg[dp->arg_index].a.a_string; SNPRINTF_BUF (arg); } break; #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: { const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; SNPRINTF_BUF (arg); } break; #endif case TYPE_POINTER: { void *arg = a.arg[dp->arg_index].a.a_pointer; SNPRINTF_BUF (arg); } break; default: abort (); } #if USE_SNPRINTF /* Portability: Not all implementations of snprintf() are ISO C 99 compliant. Determine the number of bytes that snprintf() has produced or would have produced. */ if (count >= 0) { /* Verify that snprintf() has NUL-terminated its result. */ if (count < maxlen && result[length + count] != '\0') abort (); /* Portability hack. */ if (retcount > count) count = retcount; } else { /* snprintf() doesn't understand the '%n' directive. */ if (p[1] != '\0') { /* Don't use the '%n' directive; instead, look at the snprintf() return value. */ p[1] = '\0'; continue; } else { /* Look at the snprintf() return value. */ if (retcount < 0) { /* HP-UX 10.20 snprintf() is doubly deficient: It doesn't understand the '%n' directive, *and* it returns -1 (rather than the length that would have been required) when the buffer is too small. */ size_t bigger_need = xsum (xtimes (allocated, 2), 12); ENSURE_ALLOCATION (bigger_need); continue; } else count = retcount; } } #endif /* Attempt to handle failure. */ if (count < 0) { if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = EINVAL; return NULL; } #if !USE_SNPRINTF if (count >= tmp_length) /* tmp_length was incorrectly calculated - fix the code above! */ abort (); #endif /* Make room for the result. */ if (count >= maxlen) { /* Need at least count bytes. But allocate proportionally, to avoid looping eternally if snprintf() reports a too small count. */ size_t n = xmax (xsum (length, count), xtimes (allocated, 2)); ENSURE_ALLOCATION (n); #if USE_SNPRINTF continue; #endif } #if USE_SNPRINTF /* The snprintf() result did fit. */ #else /* Append the sprintf() result. */ memcpy (result + length, tmp, count * sizeof (CHAR_T)); if (tmp != tmpbuf) free (tmp); #endif length += count; break; } } } } /* Add the final NUL. */ ENSURE_ALLOCATION (xsum (length, 1)); result[length] = '\0'; if (result != resultbuf && length + 1 < allocated) { /* Shrink the allocated memory if possible. */ CHAR_T *memory; memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T)); if (memory != NULL) result = memory; } if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); *lengthp = length; /* Note that we can produce a big string of a length > INT_MAX. POSIX says that snprintf() fails with errno = EOVERFLOW in this case, but that's only because snprintf() returns an 'int'. This function does not have this limitation. */ return result; out_of_memory: if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); out_of_memory_1: CLEANUP (); errno = ENOMEM; return NULL; } } #undef SNPRINTF #undef USE_SNPRINTF #undef PRINTF_PARSE #undef DIRECTIVES #undef DIRECTIVE #undef CHAR_T #undef VASNPRINTF blame-1.3.1/lib/xgetcwd.h0000644000076400007640000000147010241344124012106 00000000000000/* prototype for xgetcwd Copyright (C) 1995, 2001, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ extern char *xgetcwd (void); blame-1.3.1/lib/xalloc.h0000644000076400007640000001662010527555560011745 00000000000000/* xalloc.h -- malloc with out-of-memory checking Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef XALLOC_H_ # define XALLOC_H_ # include # ifdef __cplusplus extern "C" { # endif # ifndef __attribute__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ # define __attribute__(x) # endif # endif # ifndef ATTRIBUTE_NORETURN # define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) # endif /* This function is always triggered when memory is exhausted. It must be defined by the application, either explicitly or by using gnulib's xalloc-die module. This is the function to call when one wants the program to die because of a memory allocation failure. */ extern void xalloc_die (void) ATTRIBUTE_NORETURN; void *xmalloc (size_t s); void *xzalloc (size_t s); void *xcalloc (size_t n, size_t s); void *xrealloc (void *p, size_t s); void *x2realloc (void *p, size_t *pn); void *xmemdup (void const *p, size_t s); char *xstrdup (char const *str); /* Return 1 if an array of N objects, each of size S, cannot exist due to size arithmetic overflow. S must be positive and N must be nonnegative. This is a macro, not an inline function, so that it works correctly even when SIZE_MAX < N. By gnulib convention, SIZE_MAX represents overflow in size calculations, so the conservative dividend to use here is SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value. However, malloc (SIZE_MAX) fails on all known hosts where sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for exactly-SIZE_MAX allocations on such hosts; this avoids a test and branch when S is known to be 1. */ # define xalloc_oversized(n, s) \ ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n)) /* In the following macros, T must be an elementary or structure/union or typedef'ed type, or a pointer to such a type. To apply one of the following macros to a function pointer or array type, you need to typedef it first and use the typedef name. */ /* Allocate an object of type T dynamically, with error checking. */ /* extern t *XMALLOC (typename t); */ # define XMALLOC(t) ((t *) xmalloc (sizeof (t))) /* Allocate memory for N elements of type T, with error checking. */ /* extern t *XNMALLOC (size_t n, typename t); */ # define XNMALLOC(n, t) \ ((t *) (sizeof (t) == 1 ? xmalloc (n) : xnmalloc (n, sizeof (t)))) /* Allocate an object of type T dynamically, with error checking, and zero it. */ /* extern t *XZALLOC (typename t); */ # define XZALLOC(t) ((t *) xzalloc (sizeof (t))) /* Allocate memory for N elements of type T, with error checking, and zero it. */ /* extern t *XCALLOC (size_t n, typename t); */ # define XCALLOC(n, t) \ ((t *) (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t)))) # if HAVE_INLINE # define static_inline static inline # else void *xnmalloc (size_t n, size_t s); void *xnrealloc (void *p, size_t n, size_t s); void *x2nrealloc (void *p, size_t *pn, size_t s); char *xcharalloc (size_t n); # endif # ifdef static_inline /* Allocate an array of N objects, each with S bytes of memory, dynamically, with error checking. S must be nonzero. */ static_inline void * xnmalloc (size_t n, size_t s) { if (xalloc_oversized (n, s)) xalloc_die (); return xmalloc (n * s); } /* Change the size of an allocated block of memory P to an array of N objects each of S bytes, with error checking. S must be nonzero. */ static_inline void * xnrealloc (void *p, size_t n, size_t s) { if (xalloc_oversized (n, s)) xalloc_die (); return xrealloc (p, n * s); } /* If P is null, allocate a block of at least *PN such objects; otherwise, reallocate P so that it contains more than *PN objects each of S bytes. *PN must be nonzero unless P is null, and S must be nonzero. Set *PN to the new number of objects, and return the pointer to the new block. *PN is never set to zero, and the returned pointer is never null. Repeated reallocations are guaranteed to make progress, either by allocating an initial block with a nonzero size, or by allocating a larger block. In the following implementation, nonzero sizes are doubled so that repeated reallocations have O(N log N) overall cost rather than O(N**2) cost, but the specification for this function does not guarantee that sizes are doubled. Here is an example of use: int *p = NULL; size_t used = 0; size_t allocated = 0; void append_int (int value) { if (used == allocated) p = x2nrealloc (p, &allocated, sizeof *p); p[used++] = value; } This causes x2nrealloc to allocate a block of some nonzero size the first time it is called. To have finer-grained control over the initial size, set *PN to a nonzero value before calling this function with P == NULL. For example: int *p = NULL; size_t used = 0; size_t allocated = 0; size_t allocated1 = 1000; void append_int (int value) { if (used == allocated) { p = x2nrealloc (p, &allocated1, sizeof *p); allocated = allocated1; } p[used++] = value; } */ static_inline void * x2nrealloc (void *p, size_t *pn, size_t s) { size_t n = *pn; if (! p) { if (! n) { /* The approximate size to use for initial small allocation requests, when the invoking code specifies an old size of zero. 64 bytes is the largest "small" request for the GNU C library malloc. */ enum { DEFAULT_MXFAST = 64 }; n = DEFAULT_MXFAST / s; n += !n; } } else { if (((size_t) -1) / 2 / s < n) xalloc_die (); n *= 2; } *pn = n; return xrealloc (p, n * s); } /* Return a pointer to a new buffer of N bytes. This is like xmalloc, except it returns char *. */ static_inline char * xcharalloc (size_t n) { return XNMALLOC (n, char); } # endif # ifdef __cplusplus } /* C++ does not allow conversions from void * to other pointer types without a cast. Use templates to work around the problem when possible. */ template inline T * xrealloc (T *p, size_t s) { return (T *) xrealloc ((void *) p, s); } template inline T * xnrealloc (T *p, size_t n, size_t s) { return (T *) xnrealloc ((void *) p, n, s); } template inline T * x2realloc (T *p, size_t *pn) { return (T *) x2realloc ((void *) p, pn); } template inline T * x2nrealloc (T *p, size_t *pn, size_t s) { return (T *) x2nrealloc ((void *) p, pn, s); } template inline T * xmemdup (T const *p, size_t s) { return (T *) xmemdup ((void const *) p, s); } # endif #endif /* !XALLOC_H_ */ blame-1.3.1/lib/mbuiter.h0000664000076400007640000001521210337302571012117 00000000000000/* Iterating through multibyte strings: macros for multi-byte encodings. Copyright (C) 2001, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Written by Bruno Haible . */ /* The macros in this file implement forward iteration through a multi-byte string, without knowing its length a-priori. With these macros, an iteration loop that looks like char *iter; for (iter = buf; *iter != '\0'; iter++) { do_something (*iter); } becomes mbui_iterator_t iter; for (mbui_init (iter, buf); mbui_avail (iter); mbui_advance (iter)) { do_something (mbui_cur_ptr (iter), mb_len (mbui_cur (iter))); } The benefit of these macros over plain use of mbrtowc is: - Handling of invalid multibyte sequences is possible without making the code more complicated, while still preserving the invalid multibyte sequences. Compared to mbiter.h, the macros here don't need to know the string's length a-priori. The downside is that at each step, the look-ahead that guards against overrunning the terminating '\0' is more expensive. The mbui_* macros are therefore suitable when there is a high probability that only the first few multibyte characters need to be inspected. Whereas the mbi_* macros are better if usually the iteration runs through the entire string. mbui_iterator_t is a type usable for variable declarations. mbui_init (iter, startptr) initializes the iterator, starting at startptr. mbui_avail (iter) returns true if there are more multibyte chracters available before the end of string is reached. In this case, mbui_cur (iter) is initialized to the next multibyte chracter. mbui_advance (iter) advances the iterator by one multibyte character. mbui_cur (iter) returns the current multibyte character, of type mbchar_t. All the macros defined in mbchar.h can be used on it. mbui_cur_ptr (iter) return a pointer to the beginning of the current multibyte character. mbui_reloc (iter, ptrdiff) relocates iterator when the string is moved by ptrdiff bytes. Here are the function prototypes of the macros. extern void mbui_init (mbui_iterator_t iter, const char *startptr); extern bool mbui_avail (mbui_iterator_t iter); extern void mbui_advance (mbui_iterator_t iter); extern mbchar_t mbui_cur (mbui_iterator_t iter); extern const char * mbui_cur_ptr (mbui_iterator_t iter); extern void mbui_reloc (mbui_iterator_t iter, ptrdiff_t ptrdiff); */ #ifndef _MBUITER_H #define _MBUITER_H 1 #include #include #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.1 has a bug: and must be included before . */ #include #include #include #include "mbchar.h" #include "strnlen1.h" struct mbuiter_multi { bool in_shift; /* true if next byte may not be interpreted as ASCII */ mbstate_t state; /* if in_shift: current shift state */ bool next_done; /* true if mbui_avail has already filled the following */ struct mbchar cur; /* the current character: const char *cur.ptr pointer to current character The following are only valid after mbui_avail. size_t cur.bytes number of bytes of current character bool cur.wc_valid true if wc is a valid wide character wchar_t cur.wc if wc_valid: the current character */ }; static inline void mbuiter_multi_next (struct mbuiter_multi *iter) { if (iter->next_done) return; if (iter->in_shift) goto with_shift; /* Handle most ASCII characters quickly, without calling mbrtowc(). */ if (is_basic (*iter->cur.ptr)) { /* These characters are part of the basic character set. ISO C 99 guarantees that their wide character code is identical to their char code. */ iter->cur.bytes = 1; iter->cur.wc = *iter->cur.ptr; iter->cur.wc_valid = true; } else { assert (mbsinit (&iter->state)); iter->in_shift = true; with_shift: iter->cur.bytes = mbrtowc (&iter->cur.wc, iter->cur.ptr, strnlen1 (iter->cur.ptr, MB_CUR_MAX), &iter->state); if (iter->cur.bytes == (size_t) -1) { /* An invalid multibyte sequence was encountered. */ iter->cur.bytes = 1; iter->cur.wc_valid = false; /* Whether to set iter->in_shift = false and reset iter->state or not is not very important; the string is bogus anyway. */ } else if (iter->cur.bytes == (size_t) -2) { /* An incomplete multibyte character at the end. */ iter->cur.bytes = strlen (iter->cur.ptr); iter->cur.wc_valid = false; /* Whether to set iter->in_shift = false and reset iter->state or not is not important; the string end is reached anyway. */ } else { if (iter->cur.bytes == 0) { /* A null wide character was encountered. */ iter->cur.bytes = 1; assert (*iter->cur.ptr == '\0'); assert (iter->cur.wc == 0); } iter->cur.wc_valid = true; /* When in the initial state, we can go back treating ASCII characters more quickly. */ if (mbsinit (&iter->state)) iter->in_shift = false; } } iter->next_done = true; } static inline void mbuiter_multi_reloc (struct mbuiter_multi *iter, ptrdiff_t ptrdiff) { iter->cur.ptr += ptrdiff; } /* Iteration macros. */ typedef struct mbuiter_multi mbui_iterator_t; #define mbui_init(iter, startptr) \ ((iter).cur.ptr = (startptr), \ (iter).in_shift = false, memset (&(iter).state, '\0', sizeof (mbstate_t)), \ (iter).next_done = false) #define mbui_avail(iter) \ (mbuiter_multi_next (&(iter)), !mb_isnul ((iter).cur)) #define mbui_advance(iter) \ ((iter).cur.ptr += (iter).cur.bytes, (iter).next_done = false) /* Access to the current character. */ #define mbui_cur(iter) (iter).cur #define mbui_cur_ptr(iter) (iter).cur.ptr /* Relocation. */ #define mbui_reloc(iter, ptrdiff) mbuiter_multi_reloc (&iter, ptrdiff) #endif /* _MBUITER_H */ blame-1.3.1/lib/sysexit_.h0000644000076400007640000000245410527555560012332 00000000000000/* exit() exit codes for some BSD system programs. Copyright (C) 2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Simon Josefsson based on sysexits(3) man page */ #ifndef _SYSEXITS_H #define _SYSEXITS_H #define EX_OK 0 /* same value as EXIT_SUCCESS */ #define EX_USAGE 64 #define EX_DATAERR 65 #define EX_NOINPUT 66 #define EX_NOUSER 67 #define EX_NOHOST 68 #define EX_UNAVAILABLE 69 #define EX_SOFTWARE 70 #define EX_OSERR 71 #define EX_OSFILE 72 #define EX_CANTCREAT 73 #define EX_IOERR 74 #define EX_TEMPFAIL 75 #define EX_PROTOCOL 76 #define EX_NOPERM 77 #define EX_CONFIG 78 #endif /* _SYSEXITS_H */ blame-1.3.1/lib/exit.h0000644000076400007640000000205710527555557011441 00000000000000/* exit() function. Copyright (C) 1995, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _EXIT_H #define _EXIT_H /* Get exit() declaration. */ #include /* Some systems do not define EXIT_*, despite otherwise supporting C89. */ #ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 #endif #ifndef EXIT_FAILURE # define EXIT_FAILURE 1 #endif #endif /* _EXIT_H */ blame-1.3.1/lib/getopt.c0000644000076400007640000007656510527555557012004 00000000000000/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LIBC # include #endif #include "getopt.h" #include #include #include #include #ifdef __VMS # include #endif #ifdef _LIBC # include #else # include "gettext.h" # define _(msgid) gettext (msgid) #endif #if defined _LIBC && defined USE_IN_LIBIO # include #endif #ifndef attribute_hidden # define attribute_hidden #endif /* Unlike standard Unix `getopt', functions like `getopt_long' let the user intersperse the options with the other arguments. As `getopt_long' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Using `getopt' or setting the environment variable POSIXLY_CORRECT disables permutation. Then the application's behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt_int.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Keep a global copy of all internal members of getopt_data. */ static struct _getopt_data getopt_data; #if defined HAVE_DECL_GETENV && !HAVE_DECL_GETENV extern char *getenv (); #endif #ifdef _LIBC /* Stored original parameters. XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ extern int __libc_argc; extern char **__libc_argv; /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ # ifdef USE_NONOPTION_FLAGS /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; # endif # ifdef USE_NONOPTION_FLAGS # define SWAP_FLAGS(ch1, ch2) \ if (d->__nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } # else # define SWAP_FLAGS(ch1, ch2) # endif #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ static void exchange (char **argv, struct _getopt_data *d) { int bottom = d->__first_nonopt; int middle = d->__last_nonopt; int top = d->optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, d->__nonoption_flags_max_len), '\0', top + 1 - d->__nonoption_flags_max_len); d->__nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ d->__first_nonopt += (d->optind - d->__last_nonopt); d->__last_nonopt = d->optind; } /* Initialize the internal data when the first call is made. */ static const char * _getopt_initialize (int argc, char **argv, const char *optstring, int posixly_correct, struct _getopt_data *d) { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ d->__first_nonopt = d->__last_nonopt = d->optind; d->__nextchar = NULL; d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { d->__ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { d->__ordering = REQUIRE_ORDER; ++optstring; } else if (d->__posixly_correct) d->__ordering = REQUIRE_ORDER; else d->__ordering = PERMUTE; #if defined _LIBC && defined USE_NONOPTION_FLAGS if (!d->__posixly_correct && argc == __libc_argc && argv == __libc_argv) { if (d->__nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') d->__nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = d->__nonoption_flags_max_len = strlen (orig_str); if (d->__nonoption_flags_max_len < argc) d->__nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (d->__nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) d->__nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', d->__nonoption_flags_max_len - len); } } d->__nonoption_flags_len = d->__nonoption_flags_max_len; } else d->__nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. If POSIXLY_CORRECT is nonzero, behave as if the POSIXLY_CORRECT environment variable were set. */ int _getopt_internal_r (int argc, char **argv, const char *optstring, const struct option *longopts, int *longind, int long_only, int posixly_correct, struct _getopt_data *d) { int print_errors = d->opterr; if (optstring[0] == ':') print_errors = 0; if (argc < 1) return -1; d->optarg = NULL; if (d->optind == 0 || !d->__initialized) { if (d->optind == 0) d->optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring, posixly_correct, d); d->__initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \ || (d->optind < d->__nonoption_flags_len \ && __getopt_nonoption_flags[d->optind] == '1')) #else # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0') #endif if (d->__nextchar == NULL || *d->__nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (d->__last_nonopt > d->optind) d->__last_nonopt = d->optind; if (d->__first_nonopt > d->optind) d->__first_nonopt = d->optind; if (d->__ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (d->__first_nonopt != d->__last_nonopt && d->__last_nonopt != d->optind) exchange ((char **) argv, d); else if (d->__last_nonopt != d->optind) d->__first_nonopt = d->optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (d->optind < argc && NONOPTION_P) d->optind++; d->__last_nonopt = d->optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (d->optind != argc && !strcmp (argv[d->optind], "--")) { d->optind++; if (d->__first_nonopt != d->__last_nonopt && d->__last_nonopt != d->optind) exchange ((char **) argv, d); else if (d->__first_nonopt == d->__last_nonopt) d->__first_nonopt = d->optind; d->__last_nonopt = argc; d->optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (d->optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (d->__first_nonopt != d->__last_nonopt) d->optind = d->__first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (d->__ordering == REQUIRE_ORDER) return -1; d->optarg = argv[d->optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ d->__nextchar = (argv[d->optind] + 1 + (longopts != NULL && argv[d->optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[d->optind][1] == '-' || (long_only && (argv[d->optind][2] || !strchr (optstring, argv[d->optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) { if ((unsigned int) (nameend - d->__nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), argv[0], argv[d->optind]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[d->optind]); #endif } d->__nextchar += strlen (d->__nextchar); d->optind++; d->optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; d->optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) d->optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (argv[d->optind - 1][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #else fprintf (stderr, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[d->optind - 1][0], pfound->name); #else fprintf (stderr, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[d->optind - 1][0], pfound->name); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->__nextchar += strlen (d->__nextchar); d->optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (d->optind < argc) d->optarg = argv[d->optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]); #endif } d->__nextchar += strlen (d->__nextchar); d->optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } d->__nextchar += strlen (d->__nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[d->optind][1] == '-' || strchr (optstring, *d->__nextchar) == NULL) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (argv[d->optind][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), argv[0], d->__nextchar); #else fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], d->__nextchar); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[d->optind][0], d->__nextchar); #else fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[d->optind][0], d->__nextchar); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->__nextchar = (char *) ""; d->optind++; d->optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *d->__nextchar++; char *temp = strchr (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*d->__nextchar == '\0') ++d->optind; if (temp == NULL || c == ':') { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (d->__posixly_correct) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: illegal option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); #endif } else { #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: invalid option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ d->optind++; } else if (d->optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option requires an argument -- %c\n"), argv[0], c) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } d->optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `d->optind' once; increment it again when taking next ARGV-elt as argument. */ d->optarg = argv[d->optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) { if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[d->optind]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[d->optind]); #endif } d->__nextchar += strlen (d->__nextchar); d->optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) d->optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } d->__nextchar += strlen (d->__nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (d->optind < argc) d->optarg = argv[d->optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]); #endif } d->__nextchar += strlen (d->__nextchar); return optstring[0] == ':' ? ':' : '?'; } } d->__nextchar += strlen (d->__nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } d->__nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; d->optind++; } else d->optarg = NULL; d->__nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ d->optind++; } else if (d->optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option requires an argument -- %c\n"), argv[0], c) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; __fxprintf (NULL, "%s", buf); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } d->optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ d->optarg = argv[d->optind++]; d->__nextchar = NULL; } } return c; } } int _getopt_internal (int argc, char **argv, const char *optstring, const struct option *longopts, int *longind, int long_only, int posixly_correct) { int result; getopt_data.optind = optind; getopt_data.opterr = opterr; result = _getopt_internal_r (argc, argv, optstring, longopts, longind, long_only, posixly_correct, &getopt_data); optind = getopt_data.optind; optarg = getopt_data.optarg; optopt = getopt_data.optopt; return result; } /* glibc gets a LSB-compliant getopt. Standalone applications get a POSIX-compliant getopt. */ #if _LIBC enum { POSIXLY_CORRECT = 0 }; #else enum { POSIXLY_CORRECT = 1 }; #endif int getopt (int argc, char *const *argv, const char *optstring) { return _getopt_internal (argc, (char **) argv, optstring, NULL, NULL, 0, POSIXLY_CORRECT); } #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (int argc, char **argv) { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ blame-1.3.1/lib/argp-pv.c0000644000076400007640000000232610527555557012036 00000000000000/* Default definition for ARGP_PROGRAM_VERSION. Copyright (C) 1996, 1997, 1999, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* If set by the user program to a non-zero value, then a default option --version is added (unless the ARGP_NO_HELP flag is used), which will print this string followed by a newline and exit (unless the ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */ const char *argp_program_version; blame-1.3.1/lib/canonicalize.h0000644000076400007640000000372610527555557013133 00000000000000/* Return the canonical absolute name of a given file. Copyright (C) 1996-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CANONICALIZE_H_ # define CANONICALIZE_H_ # ifdef PROVIDE_CANONICALIZE_FILENAME_MODE enum canonicalize_mode_t { /* All components must exist. */ CAN_EXISTING = 0, /* All components excluding last one must exist. */ CAN_ALL_BUT_LAST = 1, /* No requirements on components existence. */ CAN_MISSING = 2 }; typedef enum canonicalize_mode_t canonicalize_mode_t; /* Return a malloc'd string containing the canonical absolute name of the named file. This acts like canonicalize_file_name, except that whether components must exist depends on the canonicalize_mode_t argument. */ char *canonicalize_filename_mode (const char *, canonicalize_mode_t); # endif # if HAVE_DECL_CANONICALIZE_FILE_NAME # include # else /* Return a malloc'd string containing the canonical absolute name of the named file. If any file name component does not exist or is a symlink to a nonexistent file, return NULL. A canonical name does not contain any `.', `..' components nor any repeated file name separators ('/') or symlinks. */ char *canonicalize_file_name (const char *); # endif #endif /* !CANONICALIZE_H_ */ blame-1.3.1/lib/memchr.c0000644000076400007640000001431110527555557011732 00000000000000/* Copyright (C) 1991, 1993, 1996, 1997, 1999, 2000, 2003, 2004, 2006 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), with help from Dan Sahlin (dan@sics.se) and commentary by Jim Blandy (jimb@ai.mit.edu); adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu), and implemented by Roland McGrath (roland@ai.mit.edu). NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LIBC # include #endif #include #include #if defined _LIBC # include #else # define reg_char char #endif #include #if HAVE_BP_SYM_H || defined _LIBC # include #else # define BP_SYM(sym) sym #endif #undef memchr #undef __memchr /* Search no more than N bytes of S for C. */ void * __memchr (void const *s, int c_in, size_t n) { const unsigned char *char_ptr; const unsigned long int *longword_ptr; unsigned long int longword, magic_bits, charmask; unsigned reg_char c; int i; c = (unsigned char) c_in; /* Handle the first few characters by reading one character at a time. Do this until CHAR_PTR is aligned on a longword boundary. */ for (char_ptr = (const unsigned char *) s; n > 0 && (size_t) char_ptr % sizeof longword != 0; --n, ++char_ptr) if (*char_ptr == c) return (void *) char_ptr; /* All these elucidatory comments refer to 4-byte longwords, but the theory applies equally well to any size longwords. */ longword_ptr = (const unsigned long int *) char_ptr; /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits the "holes." Note that there is a hole just to the left of each byte, with an extra at the end: bits: 01111110 11111110 11111110 11111111 bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD The 1-bits make sure that carries propagate to the next 0-bit. The 0-bits provide holes for carries to fall into. */ /* Set MAGIC_BITS to be this pattern of 1 and 0 bits. Set CHARMASK to be a longword, each of whose bytes is C. */ magic_bits = 0xfefefefe; charmask = c | (c << 8); charmask |= charmask << 16; #if 0xffffffffU < ULONG_MAX magic_bits |= magic_bits << 32; charmask |= charmask << 32; if (8 < sizeof longword) for (i = 64; i < sizeof longword * 8; i *= 2) { magic_bits |= magic_bits << i; charmask |= charmask << i; } #endif magic_bits = (ULONG_MAX >> 1) & (magic_bits | 1); /* Instead of the traditional loop which tests each character, we will test a longword at a time. The tricky part is testing if *any of the four* bytes in the longword in question are zero. */ while (n >= sizeof longword) { /* We tentatively exit the loop if adding MAGIC_BITS to LONGWORD fails to change any of the hole bits of LONGWORD. 1) Is this safe? Will it catch all the zero bytes? Suppose there is a byte with all zeros. Any carry bits propagating from its left will fall into the hole at its least significant bit and stop. Since there will be no carry from its most significant bit, the LSB of the byte to the left will be unchanged, and the zero will be detected. 2) Is this worthwhile? Will it ignore everything except zero bytes? Suppose every byte of LONGWORD has a bit set somewhere. There will be a carry into bit 8. If bit 8 is set, this will carry into bit 16. If bit 8 is clear, one of bits 9-15 must be set, so there will be a carry into bit 16. Similarly, there will be a carry into bit 24. If one of bits 24-30 is set, there will be a carry into bit 31, so all of the hole bits will be changed. The one misfire occurs when bits 24-30 are clear and bit 31 is set; in this case, the hole at bit 31 is not changed. If we had access to the processor carry flag, we could close this loophole by putting the fourth hole at bit 32! So it ignores everything except 128's, when they're aligned properly. 3) But wait! Aren't we looking for C, not zero? Good point. So what we do is XOR LONGWORD with a longword, each of whose bytes is C. This turns each byte that is C into a zero. */ longword = *longword_ptr++ ^ charmask; /* Add MAGIC_BITS to LONGWORD. */ if ((((longword + magic_bits) /* Set those bits that were unchanged by the addition. */ ^ ~longword) /* Look at only the hole bits. If any of the hole bits are unchanged, most likely one of the bytes was a zero. */ & ~magic_bits) != 0) { /* Which of the bytes was C? If none of them were, it was a misfire; continue the search. */ const unsigned char *cp = (const unsigned char *) (longword_ptr - 1); if (cp[0] == c) return (void *) cp; if (cp[1] == c) return (void *) &cp[1]; if (cp[2] == c) return (void *) &cp[2]; if (cp[3] == c) return (void *) &cp[3]; if (4 < sizeof longword && cp[4] == c) return (void *) &cp[4]; if (5 < sizeof longword && cp[5] == c) return (void *) &cp[5]; if (6 < sizeof longword && cp[6] == c) return (void *) &cp[6]; if (7 < sizeof longword && cp[7] == c) return (void *) &cp[7]; if (8 < sizeof longword) for (i = 8; i < sizeof longword; i++) if (cp[i] == c) return (void *) &cp[i]; } n -= sizeof longword; } char_ptr = (const unsigned char *) longword_ptr; while (n-- > 0) { if (*char_ptr == c) return (void *) char_ptr; else ++char_ptr; } return 0; } #ifdef weak_alias weak_alias (__memchr, BP_SYM (memchr)) #endif blame-1.3.1/lib/argp-pin.c0000644000076400007640000000200310527555557012167 00000000000000/* Full and short program names for argp module Copyright (C) 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME char *program_invocation_short_name = 0; #endif #ifndef HAVE_PROGRAM_INVOCATION_NAME char *program_invocation_name = 0; #endif blame-1.3.1/lib/getopt_int.h0000644000076400007640000001127410241344114012617 00000000000000/* Internal declarations for getopt. Copyright (C) 1989-1994,1996-1999,2001,2003,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GETOPT_INT_H #define _GETOPT_INT_H 1 extern int _getopt_internal (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only, int __posixly_correct); /* Reentrant versions which can handle parsing multiple argument vectors at the same time. */ /* Data type for reentrant functions. */ struct _getopt_data { /* These have exactly the same meaning as the corresponding global variables, except that they are used for the reentrant versions of getopt. */ int optind; int opterr; int optopt; char *optarg; /* Internal members. */ /* True if the internal members have been initialized. */ int __initialized; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ char *__nextchar; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters, or by calling getopt. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } __ordering; /* If the POSIXLY_CORRECT environment variable is set or getopt was called. */ int __posixly_correct; /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ int __first_nonopt; int __last_nonopt; #if defined _LIBC && defined USE_NONOPTION_FLAGS int __nonoption_flags_max_len; int __nonoption_flags_len; # endif }; /* The initializer is necessary to set OPTIND and OPTERR to their default values and to clear the initialization flag. */ #define _GETOPT_DATA_INITIALIZER { 1, 1 } extern int _getopt_internal_r (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only, int __posixly_correct, struct _getopt_data *__data); extern int _getopt_long_r (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, struct _getopt_data *__data); extern int _getopt_long_only_r (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, struct _getopt_data *__data); #endif /* getopt_int.h */ blame-1.3.1/lib/dev-ino.h0000664000076400007640000000022410104544062012001 00000000000000#ifndef DEV_INO_H # define DEV_INO_H 1 # include # include struct dev_ino { ino_t st_ino; dev_t st_dev; }; #endif blame-1.3.1/lib/strftime.c0000644000076400007640000011063710527555560012316 00000000000000/* Copyright (C) 1991-1999, 2000, 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef _LIBC # define HAVE_MBLEN 1 # define HAVE_MBRLEN 1 # define HAVE_STRUCT_ERA_ENTRY 1 # define HAVE_TM_GMTOFF 1 # define HAVE_TM_ZONE 1 # define HAVE_TZNAME 1 # define HAVE_TZSET 1 # define MULTIBYTE_IS_FORMAT_SAFE 1 # include "../locale/localeinfo.h" #else # include # if FPRINTFTIME # include "fprintftime.h" # endif #endif #include #include /* Some systems define `time_t' here. */ #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #if HAVE_TZNAME && ! defined tzname extern char *tzname[]; #endif /* Do multibyte processing if multibytes are supported, unless multibyte sequences are safe in formats. Multibyte sequences are safe if they cannot contain byte sequences that look like format conversion specifications. The GNU C Library uses UTF8 multibyte encoding, which is safe for formats, but strftime.c can be used with other C libraries that use unsafe encodings. */ #define DO_MULTIBYTE (HAVE_MBLEN && HAVE_WCHAR_H && ! MULTIBYTE_IS_FORMAT_SAFE) #if DO_MULTIBYTE # if HAVE_MBRLEN # include # else /* Simulate mbrlen with mblen as best we can. */ # define mbstate_t int # define mbrlen(s, n, ps) mblen (s, n) # define mbsinit(ps) (*(ps) == 0) # endif static const mbstate_t mbstate_zero; #endif #include #include #include #include #include #ifdef COMPILE_WIDE # include # define CHAR_T wchar_t # define UCHAR_T unsigned int # define L_(Str) L##Str # define NLW(Sym) _NL_W##Sym # define MEMCPY(d, s, n) __wmemcpy (d, s, n) # define STRLEN(s) __wcslen (s) #else # define CHAR_T char # define UCHAR_T unsigned char # define L_(Str) Str # define NLW(Sym) Sym # define MEMCPY(d, s, n) memcpy (d, s, n) # define STRLEN(s) strlen (s) # ifdef _LIBC # define MEMPCPY(d, s, n) __mempcpy (d, s, n) # else # ifndef HAVE_MEMPCPY # define MEMPCPY(d, s, n) ((void *) ((char *) memcpy (d, s, n) + (n))) # endif # endif #endif /* Shift A right by B bits portably, by dividing A by 2**B and truncating towards minus infinity. A and B should be free of side effects, and B should be in the range 0 <= B <= INT_BITS - 2, where INT_BITS is the number of useful bits in an int. GNU code can assume that INT_BITS is at least 32. ISO C99 says that A >> B is implementation-defined if A < 0. Some implementations (e.g., UNICOS 9.0 on a Cray Y-MP EL) don't shift right in the usual way when A < 0, so SHR falls back on division if ordinary A >> B doesn't seem to be the usual signed shift. */ #define SHR(a, b) \ (-1 >> 1 == -1 \ ? (a) >> (b) \ : (a) / (1 << (b)) - ((a) % (1 << (b)) < 0)) /* Bound on length of the string representing an integer type or expression T. Subtract 1 for the sign bit if t is signed; log10 (2.0) < 146/485; add 1 for integer division truncation; add 1 more for a minus sign if needed. */ #define INT_STRLEN_BOUND(t) \ ((sizeof (t) * CHAR_BIT - 1) * 146 / 485 + 2) #define TM_YEAR_BASE 1900 #ifndef __isleap /* Nonzero if YEAR is a leap year (every 4 years, except every 100th isn't, and every 400th is). */ # define __isleap(year) \ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) #endif #ifdef _LIBC # define tzname __tzname # define tzset __tzset #endif #if !HAVE_TM_GMTOFF /* Portable standalone applications should supply a "time_r.h" that declares a POSIX-compliant localtime_r, for the benefit of older implementations that lack localtime_r or have a nonstandard one. See the gnulib time_r module for one way to implement this. */ # include "time_r.h" # undef __gmtime_r # undef __localtime_r # define __gmtime_r gmtime_r # define __localtime_r localtime_r #endif #ifndef FPRINTFTIME # define FPRINTFTIME 0 #endif #if FPRINTFTIME # define STREAM_OR_CHAR_T FILE # define STRFTIME_ARG(x) /* empty */ #else # define STREAM_OR_CHAR_T CHAR_T # define STRFTIME_ARG(x) x, #endif #if FPRINTFTIME # define memset_byte(P, Len, Byte) \ do { size_t _i; for (_i = 0; _i < Len; _i++) fputc (Byte, P); } while (0) # define memset_space(P, Len) memset_byte (P, Len, ' ') # define memset_zero(P, Len) memset_byte (P, Len, '0') #elif defined COMPILE_WIDE # define memset_space(P, Len) (wmemset (P, L' ', Len), (P) += (Len)) # define memset_zero(P, Len) (wmemset (P, L'0', Len), (P) += (Len)) #else # define memset_space(P, Len) (memset (P, ' ', Len), (P) += (Len)) # define memset_zero(P, Len) (memset (P, '0', Len), (P) += (Len)) #endif #if FPRINTFTIME # define advance(P, N) #else # define advance(P, N) ((P) += (N)) #endif #define add(n, f) \ do \ { \ int _n = (n); \ int _delta = width - _n; \ int _incr = _n + (_delta > 0 ? _delta : 0); \ if ((size_t) _incr >= maxsize - i) \ return 0; \ if (p) \ { \ if (digits == 0 && _delta > 0) \ { \ if (pad == L_('0')) \ memset_zero (p, _delta); \ else \ memset_space (p, _delta); \ } \ f; \ advance (p, _n); \ } \ i += _incr; \ } while (0) #if FPRINTFTIME # define add1(C) add (1, fputc (C, p)) #else # define add1(C) add (1, *p = C) #endif #if FPRINTFTIME # define cpy(n, s) \ add ((n), \ if (to_lowcase) \ fwrite_lowcase (p, (s), _n); \ else if (to_uppcase) \ fwrite_uppcase (p, (s), _n); \ else \ fwrite ((s), _n, 1, p)) #else # define cpy(n, s) \ add ((n), \ if (to_lowcase) \ memcpy_lowcase (p, (s), _n LOCALE_ARG); \ else if (to_uppcase) \ memcpy_uppcase (p, (s), _n LOCALE_ARG); \ else \ MEMCPY ((void *) p, (void const *) (s), _n)) #endif #ifdef COMPILE_WIDE # ifndef USE_IN_EXTENDED_LOCALE_MODEL # undef __mbsrtowcs_l # define __mbsrtowcs_l(d, s, l, st, loc) __mbsrtowcs (d, s, l, st) # endif # define widen(os, ws, l) \ { \ mbstate_t __st; \ const char *__s = os; \ memset (&__st, '\0', sizeof (__st)); \ l = __mbsrtowcs_l (NULL, &__s, 0, &__st, loc); \ ws = (wchar_t *) alloca ((l + 1) * sizeof (wchar_t)); \ (void) __mbsrtowcs_l (ws, &__s, l, &__st, loc); \ } #endif #if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL /* We use this code also for the extended locale handling where the function gets as an additional argument the locale which has to be used. To access the values we have to redefine the _NL_CURRENT macro. */ # define strftime __strftime_l # define wcsftime __wcsftime_l # undef _NL_CURRENT # define _NL_CURRENT(category, item) \ (current->values[_NL_ITEM_INDEX (item)].string) # define LOCALE_ARG , loc # define LOCALE_PARAM_PROTO , __locale_t loc # define HELPER_LOCALE_ARG , current #else # define LOCALE_PARAM_PROTO # define LOCALE_ARG # ifdef _LIBC # define HELPER_LOCALE_ARG , _NL_CURRENT_DATA (LC_TIME) # else # define HELPER_LOCALE_ARG # endif #endif #ifdef COMPILE_WIDE # ifdef USE_IN_EXTENDED_LOCALE_MODEL # define TOUPPER(Ch, L) __towupper_l (Ch, L) # define TOLOWER(Ch, L) __towlower_l (Ch, L) # else # define TOUPPER(Ch, L) towupper (Ch) # define TOLOWER(Ch, L) towlower (Ch) # endif #else # ifdef USE_IN_EXTENDED_LOCALE_MODEL # define TOUPPER(Ch, L) __toupper_l (Ch, L) # define TOLOWER(Ch, L) __tolower_l (Ch, L) # else # define TOUPPER(Ch, L) toupper (Ch) # define TOLOWER(Ch, L) tolower (Ch) # endif #endif /* We don't use `isdigit' here since the locale dependent interpretation is not what we want here. We only need to accept the arabic digits in the ASCII range. One day there is perhaps a more reliable way to accept other sets of digits. */ #define ISDIGIT(Ch) ((unsigned int) (Ch) - L_('0') <= 9) #if FPRINTFTIME static void fwrite_lowcase (FILE *fp, const CHAR_T *src, size_t len) { while (len-- > 0) { fputc (TOLOWER ((UCHAR_T) *src, loc), fp); ++src; } } static void fwrite_uppcase (FILE *fp, const CHAR_T *src, size_t len) { while (len-- > 0) { fputc (TOUPPER ((UCHAR_T) *src, loc), fp); ++src; } } #else static CHAR_T * memcpy_lowcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM_PROTO) { while (len-- > 0) dest[len] = TOLOWER ((UCHAR_T) src[len], loc); return dest; } static CHAR_T * memcpy_uppcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM_PROTO) { while (len-- > 0) dest[len] = TOUPPER ((UCHAR_T) src[len], loc); return dest; } #endif #if ! HAVE_TM_GMTOFF /* Yield the difference between *A and *B, measured in seconds, ignoring leap seconds. */ # define tm_diff ftime_tm_diff static int tm_diff (const struct tm *a, const struct tm *b) { /* Compute intervening leap days correctly even if year is negative. Take care to avoid int overflow in leap day calculations, but it's OK to assume that A and B are close to each other. */ int a4 = SHR (a->tm_year, 2) + SHR (TM_YEAR_BASE, 2) - ! (a->tm_year & 3); int b4 = SHR (b->tm_year, 2) + SHR (TM_YEAR_BASE, 2) - ! (b->tm_year & 3); int a100 = a4 / 25 - (a4 % 25 < 0); int b100 = b4 / 25 - (b4 % 25 < 0); int a400 = SHR (a100, 2); int b400 = SHR (b100, 2); int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); int years = a->tm_year - b->tm_year; int days = (365 * years + intervening_leap_days + (a->tm_yday - b->tm_yday)); return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour)) + (a->tm_min - b->tm_min)) + (a->tm_sec - b->tm_sec)); } #endif /* ! HAVE_TM_GMTOFF */ /* The number of days from the first day of the first ISO week of this year to the year day YDAY with week day WDAY. ISO weeks start on Monday; the first ISO week has the year's first Thursday. YDAY may be as small as YDAY_MINIMUM. */ #define ISO_WEEK_START_WDAY 1 /* Monday */ #define ISO_WEEK1_WDAY 4 /* Thursday */ #define YDAY_MINIMUM (-366) #ifdef __GNUC__ __inline__ #endif static int iso_week_days (int yday, int wday) { /* Add enough to the first operand of % to make it nonnegative. */ int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7; return (yday - (yday - wday + ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7 + ISO_WEEK1_WDAY - ISO_WEEK_START_WDAY); } /* When compiling this file, GNU applications can #define my_strftime to a symbol (typically nstrftime) to get an extended strftime with extra arguments UT and NS. Emacs is a special case for now, but this Emacs-specific code can be removed once Emacs's config.h defines my_strftime. */ #if defined emacs && !defined my_strftime # define my_strftime nstrftime #endif #if FPRINTFTIME # undef my_strftime # define my_strftime fprintftime #endif #ifdef my_strftime # define extra_args , ut, ns # define extra_args_spec , int ut, int ns #else # if defined COMPILE_WIDE # define my_strftime wcsftime # define nl_get_alt_digit _nl_get_walt_digit # else # define my_strftime strftime # define nl_get_alt_digit _nl_get_alt_digit # endif # define extra_args # define extra_args_spec /* We don't have this information in general. */ # define ut 0 # define ns 0 #endif /* Just like my_strftime, below, but with one more parameter, UPCASE, to indicate that the result should be converted to upper case. */ static size_t strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) const CHAR_T *format, const struct tm *tp extra_args_spec LOCALE_PARAM_PROTO) { #if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL struct locale_data *const current = loc->__locales[LC_TIME]; #endif #if FPRINTFTIME size_t maxsize = (size_t) -1; #endif int hour12 = tp->tm_hour; #ifdef _NL_CURRENT /* We cannot make the following values variables since we must delay the evaluation of these values until really needed since some expressions might not be valid in every situation. The `struct tm' might be generated by a strptime() call that initialized only a few elements. Dereference the pointers only if the format requires this. Then it is ok to fail if the pointers are invalid. */ # define a_wkday \ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ABDAY_1) + tp->tm_wday)) # define f_wkday \ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(DAY_1) + tp->tm_wday)) # define a_month \ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ABMON_1) + tp->tm_mon)) # define f_month \ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon)) # define ampm \ ((const CHAR_T *) _NL_CURRENT (LC_TIME, tp->tm_hour > 11 \ ? NLW(PM_STR) : NLW(AM_STR))) # define aw_len STRLEN (a_wkday) # define am_len STRLEN (a_month) # define ap_len STRLEN (ampm) #endif const char *zone; size_t i = 0; STREAM_OR_CHAR_T *p = s; const CHAR_T *f; #if DO_MULTIBYTE && !defined COMPILE_WIDE const char *format_end = NULL; #endif #if ! defined _LIBC && ! HAVE_RUN_TZSET_TEST /* Solaris 2.5.x and 2.6 tzset sometimes modify the storage returned by localtime. On such systems, we must either use the tzset and localtime wrappers to work around the bug (which sets HAVE_RUN_TZSET_TEST) or make a copy of the structure. */ struct tm copy = *tp; tp = © #endif zone = NULL; #if HAVE_TM_ZONE /* The POSIX test suite assumes that setting the environment variable TZ to a new value before calling strftime() will influence the result (the %Z format) even if the information in TP is computed with a totally different time zone. This is bogus: though POSIX allows bad behavior like this, POSIX does not require it. Do the right thing instead. */ zone = (const char *) tp->tm_zone; #endif #if HAVE_TZNAME if (ut) { if (! (zone && *zone)) zone = "GMT"; } else { /* POSIX.1 requires that local time zone information be used as though strftime called tzset. */ # if HAVE_TZSET tzset (); # endif } #endif if (hour12 > 12) hour12 -= 12; else if (hour12 == 0) hour12 = 12; for (f = format; *f != '\0'; ++f) { int pad = 0; /* Padding for number ('-', '_', or 0). */ int modifier; /* Field modifier ('E', 'O', or 0). */ int digits = 0; /* Max digits for numeric format. */ int number_value; /* Numeric value to be printed. */ unsigned int u_number_value; /* (unsigned int) number_value. */ bool negative_number; /* The number is negative. */ bool always_output_a_sign; /* +/- should always be output. */ int tz_colon_mask; /* Bitmask of where ':' should appear. */ const CHAR_T *subfmt; CHAR_T sign_char; CHAR_T *bufp; CHAR_T buf[1 + 2 /* for the two colons in a %::z or %:::z time zone */ + (sizeof (int) < sizeof (time_t) ? INT_STRLEN_BOUND (time_t) : INT_STRLEN_BOUND (int))]; int width = -1; bool to_lowcase = false; bool to_uppcase = upcase; size_t colons; bool change_case = false; int format_char; #if DO_MULTIBYTE && !defined COMPILE_WIDE switch (*f) { case L_('%'): break; case L_('\b'): case L_('\t'): case L_('\n'): case L_('\v'): case L_('\f'): case L_('\r'): case L_(' '): case L_('!'): case L_('"'): case L_('#'): case L_('&'): case L_('\''): case L_('('): case L_(')'): case L_('*'): case L_('+'): case L_(','): case L_('-'): case L_('.'): case L_('/'): case L_('0'): case L_('1'): case L_('2'): case L_('3'): case L_('4'): case L_('5'): case L_('6'): case L_('7'): case L_('8'): case L_('9'): case L_(':'): case L_(';'): case L_('<'): case L_('='): case L_('>'): case L_('?'): case L_('A'): case L_('B'): case L_('C'): case L_('D'): case L_('E'): case L_('F'): case L_('G'): case L_('H'): case L_('I'): case L_('J'): case L_('K'): case L_('L'): case L_('M'): case L_('N'): case L_('O'): case L_('P'): case L_('Q'): case L_('R'): case L_('S'): case L_('T'): case L_('U'): case L_('V'): case L_('W'): case L_('X'): case L_('Y'): case L_('Z'): case L_('['): case L_('\\'): case L_(']'): case L_('^'): case L_('_'): case L_('a'): case L_('b'): case L_('c'): case L_('d'): case L_('e'): case L_('f'): case L_('g'): case L_('h'): case L_('i'): case L_('j'): case L_('k'): case L_('l'): case L_('m'): case L_('n'): case L_('o'): case L_('p'): case L_('q'): case L_('r'): case L_('s'): case L_('t'): case L_('u'): case L_('v'): case L_('w'): case L_('x'): case L_('y'): case L_('z'): case L_('{'): case L_('|'): case L_('}'): case L_('~'): /* The C Standard requires these 98 characters (plus '%') to be in the basic execution character set. None of these characters can start a multibyte sequence, so they need not be analyzed further. */ add1 (*f); continue; default: /* Copy this multibyte sequence until we reach its end, find an error, or come back to the initial shift state. */ { mbstate_t mbstate = mbstate_zero; size_t len = 0; size_t fsize; if (! format_end) format_end = f + strlen (f) + 1; fsize = format_end - f; do { size_t bytes = mbrlen (f + len, fsize - len, &mbstate); if (bytes == 0) break; if (bytes == (size_t) -2) { len += strlen (f + len); break; } if (bytes == (size_t) -1) { len++; break; } len += bytes; } while (! mbsinit (&mbstate)); cpy (len, f); f += len - 1; continue; } } #else /* ! DO_MULTIBYTE */ /* Either multibyte encodings are not supported, they are safe for formats, so any non-'%' byte can be copied through, or this is the wide character version. */ if (*f != L_('%')) { add1 (*f); continue; } #endif /* ! DO_MULTIBYTE */ /* Check for flags that can modify a format. */ while (1) { switch (*++f) { /* This influences the number formats. */ case L_('_'): case L_('-'): case L_('0'): pad = *f; continue; /* This changes textual output. */ case L_('^'): to_uppcase = true; continue; case L_('#'): change_case = true; continue; default: break; } break; } /* As a GNU extension we allow to specify the field width. */ if (ISDIGIT (*f)) { width = 0; do { if (width > INT_MAX / 10 || (width == INT_MAX / 10 && *f - L_('0') > INT_MAX % 10)) /* Avoid overflow. */ width = INT_MAX; else { width *= 10; width += *f - L_('0'); } ++f; } while (ISDIGIT (*f)); } /* Check for modifiers. */ switch (*f) { case L_('E'): case L_('O'): modifier = *f++; break; default: modifier = 0; break; } /* Now do the specified format. */ format_char = *f; switch (format_char) { #define DO_NUMBER(d, v) \ digits = d; \ number_value = v; goto do_number #define DO_SIGNED_NUMBER(d, negative, v) \ digits = d; \ negative_number = negative; \ u_number_value = v; goto do_signed_number /* The mask is not what you might think. When the ordinal i'th bit is set, insert a colon before the i'th digit of the time zone representation. */ #define DO_TZ_OFFSET(d, negative, mask, v) \ digits = d; \ negative_number = negative; \ tz_colon_mask = mask; \ u_number_value = v; goto do_tz_offset #define DO_NUMBER_SPACEPAD(d, v) \ digits = d; \ number_value = v; goto do_number_spacepad case L_('%'): if (modifier != 0) goto bad_format; add1 (*f); break; case L_('a'): if (modifier != 0) goto bad_format; if (change_case) { to_uppcase = true; to_lowcase = false; } #ifdef _NL_CURRENT cpy (aw_len, a_wkday); break; #else goto underlying_strftime; #endif case 'A': if (modifier != 0) goto bad_format; if (change_case) { to_uppcase = true; to_lowcase = false; } #ifdef _NL_CURRENT cpy (STRLEN (f_wkday), f_wkday); break; #else goto underlying_strftime; #endif case L_('b'): case L_('h'): if (change_case) { to_uppcase = true; to_lowcase = false; } if (modifier != 0) goto bad_format; #ifdef _NL_CURRENT cpy (am_len, a_month); break; #else goto underlying_strftime; #endif case L_('B'): if (modifier != 0) goto bad_format; if (change_case) { to_uppcase = true; to_lowcase = false; } #ifdef _NL_CURRENT cpy (STRLEN (f_month), f_month); break; #else goto underlying_strftime; #endif case L_('c'): if (modifier == L_('O')) goto bad_format; #ifdef _NL_CURRENT if (! (modifier == 'E' && (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ERA_D_T_FMT))) != '\0'))) subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT)); #else goto underlying_strftime; #endif subformat: { size_t len = strftime_case_ (to_uppcase, NULL, STRFTIME_ARG ((size_t) -1) subfmt, tp extra_args LOCALE_ARG); add (len, strftime_case_ (to_uppcase, p, STRFTIME_ARG (maxsize - i) subfmt, tp extra_args LOCALE_ARG)); } break; #if !(defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY) underlying_strftime: { /* The relevant information is available only via the underlying strftime implementation, so use that. */ char ufmt[5]; char *u = ufmt; char ubuf[1024]; /* enough for any single format in practice */ size_t len; /* Make sure we're calling the actual underlying strftime. In some cases, config.h contains something like "#define strftime rpl_strftime". */ # ifdef strftime # undef strftime size_t strftime (); # endif /* The space helps distinguish strftime failure from empty output. */ *u++ = ' '; *u++ = '%'; if (modifier != 0) *u++ = modifier; *u++ = format_char; *u = '\0'; len = strftime (ubuf, sizeof ubuf, ufmt, tp); if (len != 0) cpy (len - 1, ubuf + 1); } break; #endif case L_('C'): if (modifier == L_('O')) goto bad_format; if (modifier == L_('E')) { #if HAVE_STRUCT_ERA_ENTRY struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); if (era) { # ifdef COMPILE_WIDE size_t len = __wcslen (era->era_wname); cpy (len, era->era_wname); # else size_t len = strlen (era->era_name); cpy (len, era->era_name); # endif break; } #else goto underlying_strftime; #endif } { int century = tp->tm_year / 100 + TM_YEAR_BASE / 100; century -= tp->tm_year % 100 < 0 && 0 < century; DO_SIGNED_NUMBER (2, tp->tm_year < - TM_YEAR_BASE, century); } case L_('x'): if (modifier == L_('O')) goto bad_format; #ifdef _NL_CURRENT if (! (modifier == L_('E') && (*(subfmt = (const CHAR_T *)_NL_CURRENT (LC_TIME, NLW(ERA_D_FMT))) != L_('\0')))) subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT)); goto subformat; #else goto underlying_strftime; #endif case L_('D'): if (modifier != 0) goto bad_format; subfmt = L_("%m/%d/%y"); goto subformat; case L_('d'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (2, tp->tm_mday); case L_('e'): if (modifier == L_('E')) goto bad_format; DO_NUMBER_SPACEPAD (2, tp->tm_mday); /* All numeric formats set DIGITS and NUMBER_VALUE (or U_NUMBER_VALUE) and then jump to one of these labels. */ do_tz_offset: always_output_a_sign = true; goto do_number_body; do_number_spacepad: /* Force `_' flag unless overridden by `0' or `-' flag. */ if (pad != L_('0') && pad != L_('-')) pad = L_('_'); do_number: /* Format NUMBER_VALUE according to the MODIFIER flag. */ negative_number = number_value < 0; u_number_value = number_value; do_signed_number: always_output_a_sign = false; tz_colon_mask = 0; do_number_body: /* Format U_NUMBER_VALUE according to the MODIFIER flag. NEGATIVE_NUMBER is nonzero if the original number was negative; in this case it was converted directly to unsigned int (i.e., modulo (UINT_MAX + 1)) without negating it. */ if (modifier == L_('O') && !negative_number) { #ifdef _NL_CURRENT /* Get the locale specific alternate representation of the number. If none exist NULL is returned. */ const CHAR_T *cp = nl_get_alt_digit (u_number_value HELPER_LOCALE_ARG); if (cp != NULL) { size_t digitlen = STRLEN (cp); if (digitlen != 0) { cpy (digitlen, cp); break; } } #else goto underlying_strftime; #endif } bufp = buf + sizeof (buf) / sizeof (buf[0]); if (negative_number) u_number_value = - u_number_value; do { if (tz_colon_mask & 1) *--bufp = ':'; tz_colon_mask >>= 1; *--bufp = u_number_value % 10 + L_('0'); u_number_value /= 10; } while (u_number_value != 0 || tz_colon_mask != 0); do_number_sign_and_padding: if (digits < width) digits = width; sign_char = (negative_number ? L_('-') : always_output_a_sign ? L_('+') : 0); if (pad == L_('-')) { if (sign_char) add1 (sign_char); } else { int padding = digits - (buf + (sizeof (buf) / sizeof (buf[0])) - bufp) - !!sign_char; if (padding > 0) { if (pad == L_('_')) { if ((size_t) padding >= maxsize - i) return 0; if (p) memset_space (p, padding); i += padding; width = width > padding ? width - padding : 0; if (sign_char) add1 (sign_char); } else { if ((size_t) digits >= maxsize - i) return 0; if (sign_char) add1 (sign_char); if (p) memset_zero (p, padding); i += padding; width = 0; } } else { if (sign_char) add1 (sign_char); } } cpy (buf + sizeof (buf) / sizeof (buf[0]) - bufp, bufp); break; case L_('F'): if (modifier != 0) goto bad_format; subfmt = L_("%Y-%m-%d"); goto subformat; case L_('H'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (2, tp->tm_hour); case L_('I'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (2, hour12); case L_('k'): /* GNU extension. */ if (modifier == L_('E')) goto bad_format; DO_NUMBER_SPACEPAD (2, tp->tm_hour); case L_('l'): /* GNU extension. */ if (modifier == L_('E')) goto bad_format; DO_NUMBER_SPACEPAD (2, hour12); case L_('j'): if (modifier == L_('E')) goto bad_format; DO_SIGNED_NUMBER (3, tp->tm_yday < -1, tp->tm_yday + 1U); case L_('M'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (2, tp->tm_min); case L_('m'): if (modifier == L_('E')) goto bad_format; DO_SIGNED_NUMBER (2, tp->tm_mon < -1, tp->tm_mon + 1U); #ifndef _LIBC case L_('N'): /* GNU extension. */ if (modifier == L_('E')) goto bad_format; number_value = ns; if (width == -1) width = 9; else { /* Take an explicit width less than 9 as a precision. */ int j; for (j = width; j < 9; j++) number_value /= 10; } DO_NUMBER (width, number_value); #endif case L_('n'): add1 (L_('\n')); break; case L_('P'): to_lowcase = true; #ifndef _NL_CURRENT format_char = L_('p'); #endif /* FALLTHROUGH */ case L_('p'): if (change_case) { to_uppcase = false; to_lowcase = true; } #ifdef _NL_CURRENT cpy (ap_len, ampm); break; #else goto underlying_strftime; #endif case L_('R'): subfmt = L_("%H:%M"); goto subformat; case L_('r'): #ifdef _NL_CURRENT if (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT_AMPM))) == L_('\0')) subfmt = L_("%I:%M:%S %p"); goto subformat; #else goto underlying_strftime; #endif case L_('S'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (2, tp->tm_sec); case L_('s'): /* GNU extension. */ { struct tm ltm; time_t t; ltm = *tp; t = mktime (<m); /* Generate string value for T using time_t arithmetic; this works even if sizeof (long) < sizeof (time_t). */ bufp = buf + sizeof (buf) / sizeof (buf[0]); negative_number = t < 0; do { int d = t % 10; t /= 10; *--bufp = (negative_number ? -d : d) + L_('0'); } while (t != 0); digits = 1; always_output_a_sign = false; goto do_number_sign_and_padding; } case L_('X'): if (modifier == L_('O')) goto bad_format; #ifdef _NL_CURRENT if (! (modifier == L_('E') && (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ERA_T_FMT))) != L_('\0')))) subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT)); goto subformat; #else goto underlying_strftime; #endif case L_('T'): subfmt = L_("%H:%M:%S"); goto subformat; case L_('t'): add1 (L_('\t')); break; case L_('u'): DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1); case L_('U'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7); case L_('V'): case L_('g'): case L_('G'): if (modifier == L_('E')) goto bad_format; { /* YEAR is a leap year if and only if (tp->tm_year + TM_YEAR_BASE) is a leap year, except that YEAR and YEAR - 1 both work correctly even when (tp->tm_year + TM_YEAR_BASE) would overflow. */ int year = (tp->tm_year + (tp->tm_year < 0 ? TM_YEAR_BASE % 400 : TM_YEAR_BASE % 400 - 400)); int year_adjust = 0; int days = iso_week_days (tp->tm_yday, tp->tm_wday); if (days < 0) { /* This ISO week belongs to the previous year. */ year_adjust = -1; days = iso_week_days (tp->tm_yday + (365 + __isleap (year - 1)), tp->tm_wday); } else { int d = iso_week_days (tp->tm_yday - (365 + __isleap (year)), tp->tm_wday); if (0 <= d) { /* This ISO week belongs to the next year. */ year_adjust = 1; days = d; } } switch (*f) { case L_('g'): { int yy = (tp->tm_year % 100 + year_adjust) % 100; DO_NUMBER (2, (0 <= yy ? yy : tp->tm_year < -TM_YEAR_BASE - year_adjust ? -yy : yy + 100)); } case L_('G'): DO_SIGNED_NUMBER (4, tp->tm_year < -TM_YEAR_BASE - year_adjust, (tp->tm_year + (unsigned int) TM_YEAR_BASE + year_adjust)); default: DO_NUMBER (2, days / 7 + 1); } } case L_('W'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (2, (tp->tm_yday - (tp->tm_wday - 1 + 7) % 7 + 7) / 7); case L_('w'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (1, tp->tm_wday); case L_('Y'): if (modifier == 'E') { #if HAVE_STRUCT_ERA_ENTRY struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); if (era) { # ifdef COMPILE_WIDE subfmt = era->era_wformat; # else subfmt = era->era_format; # endif goto subformat; } #else goto underlying_strftime; #endif } if (modifier == L_('O')) goto bad_format; else DO_SIGNED_NUMBER (4, tp->tm_year < -TM_YEAR_BASE, tp->tm_year + (unsigned int) TM_YEAR_BASE); case L_('y'): if (modifier == L_('E')) { #if HAVE_STRUCT_ERA_ENTRY struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); if (era) { int delta = tp->tm_year - era->start_date[0]; DO_NUMBER (1, (era->offset + delta * era->absolute_direction)); } #else goto underlying_strftime; #endif } { int yy = tp->tm_year % 100; if (yy < 0) yy = tp->tm_year < - TM_YEAR_BASE ? -yy : yy + 100; DO_NUMBER (2, yy); } case L_('Z'): if (change_case) { to_uppcase = false; to_lowcase = true; } #if HAVE_TZNAME /* The tzset() call might have changed the value. */ if (!(zone && *zone) && tp->tm_isdst >= 0) zone = tzname[tp->tm_isdst != 0]; #endif if (! zone) zone = ""; #ifdef COMPILE_WIDE { /* The zone string is always given in multibyte form. We have to transform it first. */ wchar_t *wczone; size_t len; widen (zone, wczone, len); cpy (len, wczone); } #else cpy (strlen (zone), zone); #endif break; case L_(':'): /* :, ::, and ::: are valid only just before 'z'. :::: etc. are rejected later. */ for (colons = 1; f[colons] == L_(':'); colons++) continue; if (f[colons] != L_('z')) goto bad_format; f += colons; goto do_z_conversion; case L_('z'): colons = 0; do_z_conversion: if (tp->tm_isdst < 0) break; { int diff; int hour_diff; int min_diff; int sec_diff; #if HAVE_TM_GMTOFF diff = tp->tm_gmtoff; #else if (ut) diff = 0; else { struct tm gtm; struct tm ltm; time_t lt; ltm = *tp; lt = mktime (<m); if (lt == (time_t) -1) { /* mktime returns -1 for errors, but -1 is also a valid time_t value. Check whether an error really occurred. */ struct tm tm; if (! __localtime_r (<, &tm) || ((ltm.tm_sec ^ tm.tm_sec) | (ltm.tm_min ^ tm.tm_min) | (ltm.tm_hour ^ tm.tm_hour) | (ltm.tm_mday ^ tm.tm_mday) | (ltm.tm_mon ^ tm.tm_mon) | (ltm.tm_year ^ tm.tm_year))) break; } if (! __gmtime_r (<, >m)) break; diff = tm_diff (<m, >m); } #endif hour_diff = diff / 60 / 60; min_diff = diff / 60 % 60; sec_diff = diff % 60; switch (colons) { case 0: /* +hhmm */ DO_TZ_OFFSET (5, diff < 0, 0, hour_diff * 100 + min_diff); case 1: tz_hh_mm: /* +hh:mm */ DO_TZ_OFFSET (6, diff < 0, 04, hour_diff * 100 + min_diff); case 2: tz_hh_mm_ss: /* +hh:mm:ss */ DO_TZ_OFFSET (9, diff < 0, 024, hour_diff * 10000 + min_diff * 100 + sec_diff); case 3: /* +hh if possible, else +hh:mm, else +hh:mm:ss */ if (sec_diff != 0) goto tz_hh_mm_ss; if (min_diff != 0) goto tz_hh_mm; DO_TZ_OFFSET (3, diff < 0, 0, hour_diff); default: goto bad_format; } } case L_('\0'): /* GNU extension: % at end of format. */ --f; /* Fall through. */ default: /* Unknown format; output the format, including the '%', since this is most likely the right thing to do if a multibyte string has been misparsed. */ bad_format: { int flen; for (flen = 1; f[1 - flen] != L_('%'); flen++) continue; cpy (flen, &f[1 - flen]); } break; } } #if ! FPRINTFTIME if (p && maxsize != 0) *p = L_('\0'); #endif return i; } /* Write information from TP into S according to the format string FORMAT, writing no more that MAXSIZE characters (including the terminating '\0') and returning number of characters written. If S is NULL, nothing will be written anywhere, so to determine how many characters would be written, use NULL for S and (size_t) -1 for MAXSIZE. */ size_t my_strftime (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) const CHAR_T *format, const struct tm *tp extra_args_spec LOCALE_PARAM_PROTO) { return strftime_case_ (false, s, STRFTIME_ARG (maxsize) format, tp extra_args LOCALE_ARG); } #if defined _LIBC && ! FPRINTFTIME libc_hidden_def (my_strftime) #endif #if defined emacs && ! FPRINTFTIME /* For Emacs we have a separate interface which corresponds to the normal strftime function plus the ut argument, but without the ns argument. */ size_t emacs_strftimeu (char *s, size_t maxsize, const char *format, const struct tm *tp, int ut) { return my_strftime (s, maxsize, format, tp, ut, 0); } #endif blame-1.3.1/lib/allocsa.c0000644000076400007640000001135610527555557012103 00000000000000/* Safe automatic memory allocation. Copyright (C) 2003, 2006 Free Software Foundation, Inc. Written by Bruno Haible , 2003. 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Specification. */ #include "allocsa.h" /* The speed critical point in this file is freesa() applied to an alloca() result: it must be fast, to match the speed of alloca(). The speed of mallocsa() and freesa() in the other case are not critical, because they are only invoked for big memory sizes. */ #if HAVE_ALLOCA /* Store the mallocsa() results in a hash table. This is needed to reliably distinguish a mallocsa() result and an alloca() result. Although it is possible that the same pointer is returned by alloca() and by mallocsa() at different times in the same application, it does not lead to a bug in freesa(), because: - Before a pointer returned by alloca() can point into malloc()ed memory, the function must return, and once this has happened the programmer must not call freesa() on it anyway. - Before a pointer returned by mallocsa() can point into the stack, it must be freed. The only function that can free it is freesa(), and when freesa() frees it, it also removes it from the hash table. */ #define MAGIC_NUMBER 0x1415fb4a #define MAGIC_SIZE sizeof (int) /* This is how the header info would look like without any alignment considerations. */ struct preliminary_header { void *next; char room[MAGIC_SIZE]; }; /* But the header's size must be a multiple of sa_alignment_max. */ #define HEADER_SIZE \ (((sizeof (struct preliminary_header) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max) struct header { void *next; char room[HEADER_SIZE - sizeof (struct preliminary_header) + MAGIC_SIZE]; }; /* Verify that HEADER_SIZE == sizeof (struct header). */ typedef int verify1[2 * (HEADER_SIZE == sizeof (struct header)) - 1]; /* We make the hash table quite big, so that during lookups the probability of empty hash buckets is quite high. There is no need to make the hash table resizable, because when the hash table gets filled so much that the lookup becomes slow, it means that the application has memory leaks. */ #define HASH_TABLE_SIZE 257 static void * mallocsa_results[HASH_TABLE_SIZE]; #endif void * mallocsa (size_t n) { #if HAVE_ALLOCA /* Allocate one more word, that serves as an indicator for malloc()ed memory, so that freesa() of an alloca() result is fast. */ size_t nplus = n + HEADER_SIZE; if (nplus >= n) { char *p = (char *) malloc (nplus); if (p != NULL) { size_t slot; p += HEADER_SIZE; /* Put a magic number into the indicator word. */ ((int *) p)[-1] = MAGIC_NUMBER; /* Enter p into the hash table. */ slot = (unsigned long) p % HASH_TABLE_SIZE; ((struct header *) (p - HEADER_SIZE))->next = mallocsa_results[slot]; mallocsa_results[slot] = p; return p; } } /* Out of memory. */ return NULL; #else # if !MALLOC_0_IS_NONNULL if (n == 0) n = 1; # endif return malloc (n); #endif } #if HAVE_ALLOCA void freesa (void *p) { /* mallocsa() may have returned NULL. */ if (p != NULL) { /* Attempt to quickly distinguish the mallocsa() result - which has a magic indicator word - and the alloca() result - which has an uninitialized indicator word. It is for this test that sa_increment additional bytes are allocated in the alloca() case. */ if (((int *) p)[-1] == MAGIC_NUMBER) { /* Looks like a mallocsa() result. To see whether it really is one, perform a lookup in the hash table. */ size_t slot = (unsigned long) p % HASH_TABLE_SIZE; void **chain = &mallocsa_results[slot]; for (; *chain != NULL;) { if (*chain == p) { /* Found it. Remove it from the hash table and free it. */ char *p_begin = (char *) p - HEADER_SIZE; *chain = ((struct header *) p_begin)->next; free (p_begin); return; } chain = &((struct header *) ((char *) *chain - HEADER_SIZE))->next; } } /* At this point, we know it was not a mallocsa() result. */ } } #endif blame-1.3.1/lib/allocsa.h0000644000076400007640000001037310527555557012106 00000000000000/* Safe automatic memory allocation. Copyright (C) 2003-2006 Free Software Foundation, Inc. Written by Bruno Haible , 2003. 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _ALLOCSA_H #define _ALLOCSA_H #include #include #include #ifdef __cplusplus extern "C" { #endif /* safe_alloca(N) is equivalent to alloca(N) when it is safe to call alloca(N); otherwise it returns NULL. It either returns N bytes of memory allocated on the stack, that lasts until the function returns, or NULL. Use of safe_alloca should be avoided: - inside arguments of function calls - undefined behaviour, - in inline functions - the allocation may actually last until the calling function returns. */ #if HAVE_ALLOCA /* The OS usually guarantees only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely allocate anything larger than 4096 bytes. Also care for the possibility of a few compiler-allocated temporary stack slots. This must be a macro, not an inline function. */ # define safe_alloca(N) ((N) < 4032 ? alloca (N) : NULL) #else # define safe_alloca(N) ((N), NULL) #endif /* allocsa(N) is a safe variant of alloca(N). It allocates N bytes of memory allocated on the stack, that must be freed using freesa() before the function returns. Upon failure, it returns NULL. */ #if HAVE_ALLOCA # define allocsa(N) \ ((N) < 4032 - sa_increment \ ? (void *) ((char *) alloca ((N) + sa_increment) + sa_increment) \ : mallocsa (N)) #else # define allocsa(N) \ mallocsa (N) #endif extern void * mallocsa (size_t n); /* Free a block of memory allocated through allocsa(). */ #if HAVE_ALLOCA extern void freesa (void *p); #else # define freesa free #endif /* Maybe we should also define a variant nallocsa (size_t n, size_t s) - behaves like allocsa (n * s) If this would be useful in your application. please speak up. */ #ifdef __cplusplus } #endif /* ------------------- Auxiliary, non-public definitions ------------------- */ /* Determine the alignment of a type at compile time. */ #if defined __GNUC__ # define sa_alignof __alignof__ #elif defined __cplusplus template struct sa_alignof_helper { char __slot1; type __slot2; }; # define sa_alignof(type) offsetof (sa_alignof_helper, __slot2) #elif defined __hpux /* Work around a HP-UX 10.20 cc bug with enums constants defined as offsetof values. */ # define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8) #elif defined _AIX /* Work around an AIX 3.2.5 xlc bug with enums constants defined as offsetof values. */ # define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8) #else # define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2) #endif enum { /* The desired alignment of memory allocations is the maximum alignment among all elementary types. */ sa_alignment_long = sa_alignof (long), sa_alignment_double = sa_alignof (double), #ifdef HAVE_LONG_LONG_INT sa_alignment_longlong = sa_alignof (long long), #endif #ifdef HAVE_LONG_DOUBLE sa_alignment_longdouble = sa_alignof (long double), #endif sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1) #ifdef HAVE_LONG_LONG_INT | (sa_alignment_longlong - 1) #endif #ifdef HAVE_LONG_DOUBLE | (sa_alignment_longdouble - 1) #endif ) + 1, /* The increment that guarantees room for a magic word must be >= sizeof (int) and a multiple of sa_alignment_max. */ sa_increment = ((sizeof (int) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max }; #endif /* _ALLOCSA_H */ blame-1.3.1/lib/argp-parse.c0000644000076400007640000007152710527574562012531 00000000000000/* Hierarchial argument parsing, layered over getopt Copyright (C) 1995-2000, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #ifdef _LIBC # include # undef dgettext # define dgettext(domain, msgid) \ INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES) #else # include "gettext.h" #endif #define N_(msgid) msgid #include "argp.h" #include "argp-namefrob.h" #define alignof(type) offsetof (struct { char c; type x; }, x) #define alignto(n, d) ((((n) + (d) - 1) / (d)) * (d)) /* Getopt return values. */ #define KEY_END (-1) /* The end of the options. */ #define KEY_ARG 1 /* A non-option argument. */ #define KEY_ERR '?' /* An error parsing the options. */ /* The meta-argument used to prevent any further arguments being interpreted as options. */ #define QUOTE "--" /* The number of bits we steal in a long-option value for our own use. */ #define GROUP_BITS CHAR_BIT /* The number of bits available for the user value. */ #define USER_BITS ((sizeof ((struct option *)0)->val * CHAR_BIT) - GROUP_BITS) #define USER_MASK ((1 << USER_BITS) - 1) /* EZ alias for ARGP_ERR_UNKNOWN. */ #define EBADKEY ARGP_ERR_UNKNOWN /* Default options. */ /* When argp is given the --HANG switch, _ARGP_HANG is set and argp will sleep for one second intervals, decrementing _ARGP_HANG until it's zero. Thus you can force the program to continue by attaching a debugger and setting it to 0 yourself. */ static volatile int _argp_hang; #define OPT_PROGNAME -2 #define OPT_USAGE -3 #define OPT_HANG -4 static const struct argp_option argp_default_options[] = { {"help", '?', 0, 0, N_("give this help list"), -1}, {"usage", OPT_USAGE, 0, 0, N_("give a short usage message"), 0}, {"program-name",OPT_PROGNAME,N_("NAME"), OPTION_HIDDEN, N_("set the program name"), 0}, {"HANG", OPT_HANG, N_("SECS"), OPTION_ARG_OPTIONAL | OPTION_HIDDEN, N_("hang for SECS seconds (default 3600)"), 0}, {NULL, 0, 0, 0, NULL, 0} }; static error_t argp_default_parser (int key, char *arg, struct argp_state *state) { switch (key) { case '?': __argp_state_help (state, state->out_stream, ARGP_HELP_STD_HELP); break; case OPT_USAGE: __argp_state_help (state, state->out_stream, ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK); break; case OPT_PROGNAME: /* Set the program name. */ #if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_NAME program_invocation_name = arg; #endif /* [Note that some systems only have PROGRAM_INVOCATION_SHORT_NAME (aka __PROGNAME), in which case, PROGRAM_INVOCATION_NAME is just defined to be that, so we have to be a bit careful here.] */ /* Update what we use for messages. */ state->name = __argp_base_name (arg); #if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME program_invocation_short_name = state->name; #endif if ((state->flags & (ARGP_PARSE_ARGV0 | ARGP_NO_ERRS)) == ARGP_PARSE_ARGV0) /* Update what getopt uses too. */ state->argv[0] = arg; break; case OPT_HANG: _argp_hang = atoi (arg ? arg : "3600"); while (_argp_hang-- > 0) __sleep (1); break; default: return EBADKEY; } return 0; } static const struct argp argp_default_argp = {argp_default_options, &argp_default_parser, NULL, NULL, NULL, NULL, "libc"}; static const struct argp_option argp_version_options[] = { {"version", 'V', 0, 0, N_("print program version"), -1}, {NULL, 0, 0, 0, NULL, 0} }; static error_t argp_version_parser (int key, char *arg, struct argp_state *state) { switch (key) { case 'V': if (argp_program_version_hook) (*argp_program_version_hook) (state->out_stream, state); else if (argp_program_version) fprintf (state->out_stream, "%s\n", argp_program_version); else __argp_error (state, dgettext (state->root_argp->argp_domain, "(PROGRAM ERROR) No version known!?")); if (! (state->flags & ARGP_NO_EXIT)) exit (0); break; default: return EBADKEY; } return 0; } static const struct argp argp_version_argp = {argp_version_options, &argp_version_parser, NULL, NULL, NULL, NULL, "libc"}; /* Returns the offset into the getopt long options array LONG_OPTIONS of a long option with called NAME, or -1 if none is found. Passing NULL as NAME will return the number of options. */ static int find_long_option (struct option *long_options, const char *name) { struct option *l = long_options; while (l->name != NULL) if (name != NULL && strcmp (l->name, name) == 0) return l - long_options; else l++; if (name == NULL) return l - long_options; else return -1; } /* The state of a `group' during parsing. Each group corresponds to a particular argp structure from the tree of such descending from the top level argp passed to argp_parse. */ struct group { /* This group's parsing function. */ argp_parser_t parser; /* Which argp this group is from. */ const struct argp *argp; /* Points to the point in SHORT_OPTS corresponding to the end of the short options for this group. We use it to determine from which group a particular short options is from. */ char *short_end; /* The number of non-option args sucessfully handled by this parser. */ unsigned args_processed; /* This group's parser's parent's group. */ struct group *parent; unsigned parent_index; /* And the our position in the parent. */ /* These fields are swapped into and out of the state structure when calling this group's parser. */ void *input, **child_inputs; void *hook; }; /* Call GROUP's parser with KEY and ARG, swapping any group-specific info from STATE before calling, and back into state afterwards. If GROUP has no parser, EBADKEY is returned. */ static error_t group_parse (struct group *group, struct argp_state *state, int key, char *arg) { if (group->parser) { error_t err; state->hook = group->hook; state->input = group->input; state->child_inputs = group->child_inputs; state->arg_num = group->args_processed; err = (*group->parser)(key, arg, state); group->hook = state->hook; return err; } else return EBADKEY; } struct parser { const struct argp *argp; /* SHORT_OPTS is the getopt short options string for the union of all the groups of options. */ char *short_opts; /* LONG_OPTS is the array of getop long option structures for the union of all the groups of options. */ struct option *long_opts; /* OPT_DATA is the getopt data used for the re-entrant getopt. */ struct _getopt_data opt_data; /* States of the various parsing groups. */ struct group *groups; /* The end of the GROUPS array. */ struct group *egroup; /* An vector containing storage for the CHILD_INPUTS field in all groups. */ void **child_inputs; /* True if we think using getopt is still useful; if false, then remaining arguments are just passed verbatim with ARGP_KEY_ARG. This is cleared whenever getopt returns KEY_END, but may be set again if the user moves the next argument pointer backwards. */ int try_getopt; /* State block supplied to parsing routines. */ struct argp_state state; /* Memory used by this parser. */ void *storage; }; /* The next usable entries in the various parser tables being filled in by convert_options. */ struct parser_convert_state { struct parser *parser; char *short_end; struct option *long_end; void **child_inputs_end; }; /* Converts all options in ARGP (which is put in GROUP) and ancestors into getopt options stored in SHORT_OPTS and LONG_OPTS; SHORT_END and CVT->LONG_END are the points at which new options are added. Returns the next unused group entry. CVT holds state used during the conversion. */ static struct group * convert_options (const struct argp *argp, struct group *parent, unsigned parent_index, struct group *group, struct parser_convert_state *cvt) { /* REAL is the most recent non-alias value of OPT. */ const struct argp_option *real = argp->options; const struct argp_child *children = argp->children; if (real || argp->parser) { const struct argp_option *opt; if (real) for (opt = real; !__option_is_end (opt); opt++) { if (! (opt->flags & OPTION_ALIAS)) /* OPT isn't an alias, so we can use values from it. */ real = opt; if (! (real->flags & OPTION_DOC)) /* A real option (not just documentation). */ { if (__option_is_short (opt)) /* OPT can be used as a short option. */ { *cvt->short_end++ = opt->key; if (real->arg) { *cvt->short_end++ = ':'; if (real->flags & OPTION_ARG_OPTIONAL) *cvt->short_end++ = ':'; } *cvt->short_end = '\0'; /* keep 0 terminated */ } if (opt->name && find_long_option (cvt->parser->long_opts, opt->name) < 0) /* OPT can be used as a long option. */ { cvt->long_end->name = opt->name; cvt->long_end->has_arg = (real->arg ? (real->flags & OPTION_ARG_OPTIONAL ? optional_argument : required_argument) : no_argument); cvt->long_end->flag = 0; /* we add a disambiguating code to all the user's values (which is removed before we actually call the function to parse the value); this means that the user loses use of the high 8 bits in all his values (the sign of the lower bits is preserved however)... */ cvt->long_end->val = ((opt->key | real->key) & USER_MASK) + (((group - cvt->parser->groups) + 1) << USER_BITS); /* Keep the LONG_OPTS list terminated. */ (++cvt->long_end)->name = NULL; } } } group->parser = argp->parser; group->argp = argp; group->short_end = cvt->short_end; group->args_processed = 0; group->parent = parent; group->parent_index = parent_index; group->input = 0; group->hook = 0; group->child_inputs = 0; if (children) /* Assign GROUP's CHILD_INPUTS field some space from CVT->child_inputs_end.*/ { unsigned num_children = 0; while (children[num_children].argp) num_children++; group->child_inputs = cvt->child_inputs_end; cvt->child_inputs_end += num_children; } parent = group++; } else parent = 0; if (children) { unsigned index = 0; while (children->argp) group = convert_options (children++->argp, parent, index++, group, cvt); } return group; } /* Find the merged set of getopt options, with keys appropiately prefixed. */ static void parser_convert (struct parser *parser, const struct argp *argp, int flags) { struct parser_convert_state cvt; cvt.parser = parser; cvt.short_end = parser->short_opts; cvt.long_end = parser->long_opts; cvt.child_inputs_end = parser->child_inputs; if (flags & ARGP_IN_ORDER) *cvt.short_end++ = '-'; else if (flags & ARGP_NO_ARGS) *cvt.short_end++ = '+'; *cvt.short_end = '\0'; cvt.long_end->name = NULL; parser->argp = argp; if (argp) parser->egroup = convert_options (argp, 0, 0, parser->groups, &cvt); else parser->egroup = parser->groups; /* No parsers at all! */ } /* Lengths of various parser fields which we will allocated. */ struct parser_sizes { size_t short_len; /* Getopt short options string. */ size_t long_len; /* Getopt long options vector. */ size_t num_groups; /* Group structures we allocate. */ size_t num_child_inputs; /* Child input slots. */ }; /* For ARGP, increments the NUM_GROUPS field in SZS by the total number of argp structures descended from it, and the SHORT_LEN & LONG_LEN fields by the maximum lengths of the resulting merged getopt short options string and long-options array, respectively. */ static void calc_sizes (const struct argp *argp, struct parser_sizes *szs) { const struct argp_child *child = argp->children; const struct argp_option *opt = argp->options; if (opt || argp->parser) { szs->num_groups++; if (opt) { int num_opts = 0; while (!__option_is_end (opt++)) num_opts++; szs->short_len += num_opts * 3; /* opt + up to 2 `:'s */ szs->long_len += num_opts; } } if (child) while (child->argp) { calc_sizes ((child++)->argp, szs); szs->num_child_inputs++; } } /* Initializes PARSER to parse ARGP in a manner described by FLAGS. */ static error_t parser_init (struct parser *parser, const struct argp *argp, int argc, char **argv, int flags, void *input) { error_t err = 0; struct group *group; struct parser_sizes szs; struct _getopt_data opt_data = _GETOPT_DATA_INITIALIZER; char *storage; size_t glen, gsum; size_t clen, csum; size_t llen, lsum; size_t slen, ssum; szs.short_len = (flags & ARGP_NO_ARGS) ? 0 : 1; szs.long_len = 0; szs.num_groups = 0; szs.num_child_inputs = 0; if (argp) calc_sizes (argp, &szs); /* Lengths of the various bits of storage used by PARSER. */ glen = (szs.num_groups + 1) * sizeof (struct group); clen = szs.num_child_inputs * sizeof (void *); llen = (szs.long_len + 1) * sizeof (struct option); slen = szs.short_len + 1; /* Sums of previous lengths, properly aligned. There's no need to align gsum, since struct group is aligned at least as strictly as void * (since it contains a void * member). And there's no need to align lsum, since struct option is aligned at least as strictly as char. */ gsum = glen; csum = alignto (gsum + clen, alignof (struct option)); lsum = csum + llen; ssum = lsum + slen; parser->storage = malloc (ssum); if (! parser->storage) return ENOMEM; storage = parser->storage; parser->groups = parser->storage; parser->child_inputs = (void **) (storage + gsum); parser->long_opts = (struct option *) (storage + csum); parser->short_opts = storage + lsum; parser->opt_data = opt_data; memset (parser->child_inputs, 0, clen); parser_convert (parser, argp, flags); memset (&parser->state, 0, sizeof (struct argp_state)); parser->state.root_argp = parser->argp; parser->state.argc = argc; parser->state.argv = argv; parser->state.flags = flags; parser->state.err_stream = stderr; parser->state.out_stream = stdout; parser->state.next = 0; /* Tell getopt to initialize. */ parser->state.pstate = parser; parser->try_getopt = 1; /* Call each parser for the first time, giving it a chance to propagate values to child parsers. */ if (parser->groups < parser->egroup) parser->groups->input = input; for (group = parser->groups; group < parser->egroup && (!err || err == EBADKEY); group++) { if (group->parent) /* If a child parser, get the initial input value from the parent. */ group->input = group->parent->child_inputs[group->parent_index]; if (!group->parser && group->argp->children && group->argp->children->argp) /* For the special case where no parsing function is supplied for an argp, propagate its input to its first child, if any (this just makes very simple wrapper argps more convenient). */ group->child_inputs[0] = group->input; err = group_parse (group, &parser->state, ARGP_KEY_INIT, 0); } if (err == EBADKEY) err = 0; /* Some parser didn't understand. */ if (err) return err; if (parser->state.flags & ARGP_NO_ERRS) { parser->opt_data.opterr = 0; if (parser->state.flags & ARGP_PARSE_ARGV0) /* getopt always skips ARGV[0], so we have to fake it out. As long as OPTERR is 0, then it shouldn't actually try to access it. */ parser->state.argv--, parser->state.argc++; } else parser->opt_data.opterr = 1; /* Print error messages. */ if (parser->state.argv == argv && argv[0]) /* There's an argv[0]; use it for messages. */ parser->state.name = __argp_base_name (argv[0]); else parser->state.name = __argp_short_program_name (); return 0; } /* Free any storage consumed by PARSER (but not PARSER itself). */ static error_t parser_finalize (struct parser *parser, error_t err, int arg_ebadkey, int *end_index) { struct group *group; if (err == EBADKEY && arg_ebadkey) /* Suppress errors generated by unparsed arguments. */ err = 0; if (! err) { if (parser->state.next == parser->state.argc) /* We successfully parsed all arguments! Call all the parsers again, just a few more times... */ { for (group = parser->groups; group < parser->egroup && (!err || err==EBADKEY); group++) if (group->args_processed == 0) err = group_parse (group, &parser->state, ARGP_KEY_NO_ARGS, 0); for (group = parser->egroup - 1; group >= parser->groups && (!err || err==EBADKEY); group--) err = group_parse (group, &parser->state, ARGP_KEY_END, 0); if (err == EBADKEY) err = 0; /* Some parser didn't understand. */ /* Tell the user that all arguments are parsed. */ if (end_index) *end_index = parser->state.next; } else if (end_index) /* Return any remaining arguments to the user. */ *end_index = parser->state.next; else /* No way to return the remaining arguments, they must be bogus. */ { if (!(parser->state.flags & ARGP_NO_ERRS) && parser->state.err_stream) fprintf (parser->state.err_stream, dgettext (parser->argp->argp_domain, "%s: Too many arguments\n"), parser->state.name); err = EBADKEY; } } /* Okay, we're all done, with either an error or success; call the parsers to indicate which one. */ if (err) { /* Maybe print an error message. */ if (err == EBADKEY) /* An appropriate message describing what the error was should have been printed earlier. */ __argp_state_help (&parser->state, parser->state.err_stream, ARGP_HELP_STD_ERR); /* Since we didn't exit, give each parser an error indication. */ for (group = parser->groups; group < parser->egroup; group++) group_parse (group, &parser->state, ARGP_KEY_ERROR, 0); } else /* Notify parsers of success, and propagate back values from parsers. */ { /* We pass over the groups in reverse order so that child groups are given a chance to do there processing before passing back a value to the parent. */ for (group = parser->egroup - 1 ; group >= parser->groups && (!err || err == EBADKEY) ; group--) err = group_parse (group, &parser->state, ARGP_KEY_SUCCESS, 0); if (err == EBADKEY) err = 0; /* Some parser didn't understand. */ } /* Call parsers once more, to do any final cleanup. Errors are ignored. */ for (group = parser->egroup - 1; group >= parser->groups; group--) group_parse (group, &parser->state, ARGP_KEY_FINI, 0); if (err == EBADKEY) err = EINVAL; free (parser->storage); return err; } /* Call the user parsers to parse the non-option argument VAL, at the current position, returning any error. The state NEXT pointer is assumed to have been adjusted (by getopt) to point after this argument; this function will adjust it correctly to reflect however many args actually end up being consumed. */ static error_t parser_parse_arg (struct parser *parser, char *val) { /* Save the starting value of NEXT, first adjusting it so that the arg we're parsing is again the front of the arg vector. */ int index = --parser->state.next; error_t err = EBADKEY; struct group *group; int key = 0; /* Which of ARGP_KEY_ARG[S] we used. */ /* Try to parse the argument in each parser. */ for (group = parser->groups ; group < parser->egroup && err == EBADKEY ; group++) { parser->state.next++; /* For ARGP_KEY_ARG, consume the arg. */ key = ARGP_KEY_ARG; err = group_parse (group, &parser->state, key, val); if (err == EBADKEY) /* This parser doesn't like ARGP_KEY_ARG; try ARGP_KEY_ARGS instead. */ { parser->state.next--; /* For ARGP_KEY_ARGS, put back the arg. */ key = ARGP_KEY_ARGS; err = group_parse (group, &parser->state, key, 0); } } if (! err) { if (key == ARGP_KEY_ARGS) /* The default for ARGP_KEY_ARGS is to assume that if NEXT isn't changed by the user, *all* arguments should be considered consumed. */ parser->state.next = parser->state.argc; if (parser->state.next > index) /* Remember that we successfully processed a non-option argument -- but only if the user hasn't gotten tricky and set the clock back. */ (--group)->args_processed += (parser->state.next - index); else /* The user wants to reparse some args, give getopt another try. */ parser->try_getopt = 1; } return err; } /* Call the user parsers to parse the option OPT, with argument VAL, at the current position, returning any error. */ static error_t parser_parse_opt (struct parser *parser, int opt, char *val) { /* The group key encoded in the high bits; 0 for short opts or group_number + 1 for long opts. */ int group_key = opt >> USER_BITS; error_t err = EBADKEY; if (group_key == 0) /* A short option. By comparing OPT's position in SHORT_OPTS to the various starting positions in each group's SHORT_END field, we can determine which group OPT came from. */ { struct group *group; char *short_index = strchr (parser->short_opts, opt); if (short_index) for (group = parser->groups; group < parser->egroup; group++) if (group->short_end > short_index) { err = group_parse (group, &parser->state, opt, parser->opt_data.optarg); break; } } else /* A long option. We use shifts instead of masking for extracting the user value in order to preserve the sign. */ err = group_parse (&parser->groups[group_key - 1], &parser->state, (opt << GROUP_BITS) >> GROUP_BITS, parser->opt_data.optarg); if (err == EBADKEY) /* At least currently, an option not recognized is an error in the parser, because we pre-compute which parser is supposed to deal with each option. */ { static const char bad_key_err[] = N_("(PROGRAM ERROR) Option should have been recognized!?"); if (group_key == 0) __argp_error (&parser->state, "-%c: %s", opt, dgettext (parser->argp->argp_domain, bad_key_err)); else { struct option *long_opt = parser->long_opts; while (long_opt->val != opt && long_opt->name) long_opt++; __argp_error (&parser->state, "--%s: %s", long_opt->name ? long_opt->name : "???", dgettext (parser->argp->argp_domain, bad_key_err)); } } return err; } /* Parse the next argument in PARSER (as indicated by PARSER->state.next). Any error from the parsers is returned, and *ARGP_EBADKEY indicates whether a value of EBADKEY is due to an unrecognized argument (which is generally not fatal). */ static error_t parser_parse_next (struct parser *parser, int *arg_ebadkey) { int opt; error_t err = 0; if (parser->state.quoted && parser->state.next < parser->state.quoted) /* The next argument pointer has been moved to before the quoted region, so pretend we never saw the quoting `--', and give getopt another chance. If the user hasn't removed it, getopt will just process it again. */ parser->state.quoted = 0; if (parser->try_getopt && !parser->state.quoted) /* Give getopt a chance to parse this. */ { /* Put it back in OPTIND for getopt. */ parser->opt_data.optind = parser->state.next; /* Distinguish KEY_ERR from a real option. */ parser->opt_data.optopt = KEY_END; if (parser->state.flags & ARGP_LONG_ONLY) opt = _getopt_long_only_r (parser->state.argc, parser->state.argv, parser->short_opts, parser->long_opts, 0, &parser->opt_data); else opt = _getopt_long_r (parser->state.argc, parser->state.argv, parser->short_opts, parser->long_opts, 0, &parser->opt_data); /* And see what getopt did. */ parser->state.next = parser->opt_data.optind; if (opt == KEY_END) /* Getopt says there are no more options, so stop using getopt; we'll continue if necessary on our own. */ { parser->try_getopt = 0; if (parser->state.next > 1 && strcmp (parser->state.argv[parser->state.next - 1], QUOTE) == 0) /* Not only is this the end of the options, but it's a `quoted' region, which may have args that *look* like options, so we definitely shouldn't try to use getopt past here, whatever happens. */ parser->state.quoted = parser->state.next; } else if (opt == KEY_ERR && parser->opt_data.optopt != KEY_END) /* KEY_ERR can have the same value as a valid user short option, but in the case of a real error, getopt sets OPTOPT to the offending character, which can never be KEY_END. */ { *arg_ebadkey = 0; return EBADKEY; } } else opt = KEY_END; if (opt == KEY_END) { /* We're past what getopt considers the options. */ if (parser->state.next >= parser->state.argc || (parser->state.flags & ARGP_NO_ARGS)) /* Indicate that we're done. */ { *arg_ebadkey = 1; return EBADKEY; } else /* A non-option arg; simulate what getopt might have done. */ { opt = KEY_ARG; parser->opt_data.optarg = parser->state.argv[parser->state.next++]; } } if (opt == KEY_ARG) /* A non-option argument; try each parser in turn. */ err = parser_parse_arg (parser, parser->opt_data.optarg); else err = parser_parse_opt (parser, opt, parser->opt_data.optarg); if (err == EBADKEY) *arg_ebadkey = (opt == KEY_END || opt == KEY_ARG); return err; } /* Parse the options strings in ARGC & ARGV according to the argp in ARGP. FLAGS is one of the ARGP_ flags above. If END_INDEX is non-NULL, the index in ARGV of the first unparsed option is returned in it. If an unknown option is present, EINVAL is returned; if some parser routine returned a non-zero value, it is returned; otherwise 0 is returned. */ error_t __argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags, int *end_index, void *input) { error_t err; struct parser parser; /* If true, then err == EBADKEY is a result of a non-option argument failing to be parsed (which in some cases isn't actually an error). */ int arg_ebadkey = 0; #ifndef _LIBC if (!(flags & ARGP_PARSE_ARGV0)) { #ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME if (!program_invocation_name) program_invocation_name = argv[0]; #endif #ifdef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME if (!program_invocation_short_name) program_invocation_short_name = __argp_base_name (argv[0]); #endif } #endif if (! (flags & ARGP_NO_HELP)) /* Add our own options. */ { struct argp_child *child = alloca (4 * sizeof (struct argp_child)); struct argp *top_argp = alloca (sizeof (struct argp)); /* TOP_ARGP has no options, it just serves to group the user & default argps. */ memset (top_argp, 0, sizeof (*top_argp)); top_argp->children = child; memset (child, 0, 4 * sizeof (struct argp_child)); if (argp) (child++)->argp = argp; (child++)->argp = &argp_default_argp; if (argp_program_version || argp_program_version_hook) (child++)->argp = &argp_version_argp; child->argp = 0; argp = top_argp; } /* Construct a parser for these arguments. */ err = parser_init (&parser, argp, argc, argv, flags, input); if (! err) /* Parse! */ { while (! err) err = parser_parse_next (&parser, &arg_ebadkey); err = parser_finalize (&parser, err, arg_ebadkey, end_index); } return err; } #ifdef weak_alias weak_alias (__argp_parse, argp_parse) #endif /* Return the input field for ARGP in the parser corresponding to STATE; used by the help routines. */ void * __argp_input (const struct argp *argp, const struct argp_state *state) { if (state) { struct group *group; struct parser *parser = state->pstate; for (group = parser->groups; group < parser->egroup; group++) if (group->argp == argp) return group->input; } return 0; } #ifdef weak_alias weak_alias (__argp_input, _argp_input) #endif blame-1.3.1/lib/printf-args.h0000644000076400007640000000550110527555557012721 00000000000000/* Decomposed printf argument list. Copyright (C) 1999, 2002-2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PRINTF_ARGS_H #define _PRINTF_ARGS_H /* Get size_t. */ #include /* Get wchar_t. */ #ifdef HAVE_WCHAR_T # include #endif /* Get wint_t. */ #ifdef HAVE_WINT_T # include #endif /* Get va_list. */ #include /* Argument types */ typedef enum { TYPE_NONE, TYPE_SCHAR, TYPE_UCHAR, TYPE_SHORT, TYPE_USHORT, TYPE_INT, TYPE_UINT, TYPE_LONGINT, TYPE_ULONGINT, #ifdef HAVE_LONG_LONG_INT TYPE_LONGLONGINT, TYPE_ULONGLONGINT, #endif TYPE_DOUBLE, #ifdef HAVE_LONG_DOUBLE TYPE_LONGDOUBLE, #endif TYPE_CHAR, #ifdef HAVE_WINT_T TYPE_WIDE_CHAR, #endif TYPE_STRING, #ifdef HAVE_WCHAR_T TYPE_WIDE_STRING, #endif TYPE_POINTER, TYPE_COUNT_SCHAR_POINTER, TYPE_COUNT_SHORT_POINTER, TYPE_COUNT_INT_POINTER, TYPE_COUNT_LONGINT_POINTER #ifdef HAVE_LONG_LONG_INT , TYPE_COUNT_LONGLONGINT_POINTER #endif } arg_type; /* Polymorphic argument */ typedef struct { arg_type type; union { signed char a_schar; unsigned char a_uchar; short a_short; unsigned short a_ushort; int a_int; unsigned int a_uint; long int a_longint; unsigned long int a_ulongint; #ifdef HAVE_LONG_LONG_INT long long int a_longlongint; unsigned long long int a_ulonglongint; #endif float a_float; double a_double; #ifdef HAVE_LONG_DOUBLE long double a_longdouble; #endif int a_char; #ifdef HAVE_WINT_T wint_t a_wide_char; #endif const char* a_string; #ifdef HAVE_WCHAR_T const wchar_t* a_wide_string; #endif void* a_pointer; signed char * a_count_schar_pointer; short * a_count_short_pointer; int * a_count_int_pointer; long int * a_count_longint_pointer; #ifdef HAVE_LONG_LONG_INT long long int * a_count_longlongint_pointer; #endif } a; } argument; typedef struct { size_t count; argument *arg; } arguments; /* Fetch the arguments, putting them into a. */ #ifdef STATIC STATIC #else extern #endif int printf_fetchargs (va_list args, arguments *a); #endif /* _PRINTF_ARGS_H */ blame-1.3.1/lib/strpbrk.c0000644000076400007640000000237710527555560012151 00000000000000/* Copyright (C) 1991, 1994, 2000, 2002-2003, 2006 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #undef strpbrk /* Find the first occurrence in S of any character in ACCEPT. */ char * strpbrk (const char *s, const char *accept) { while (*s != '\0') { const char *a = accept; while (*a != '\0') if (*a++ == *s) return (char *) s; ++s; } return NULL; } blame-1.3.1/lib/strstr.h0000644000076400007640000000246110337302610012003 00000000000000/* Searching in a string. Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Include string.h: on glibc systems, it contains a macro definition of strstr() that would collide with our definition if included afterwards. */ #include #ifdef __cplusplus extern "C" { #endif /* No known system has a strstr() function that works correctly in multibyte locales. Therefore we use our version always. */ #undef strstr #define strstr rpl_strstr /* Find the first occurrence of NEEDLE in HAYSTACK. */ extern char *strstr (const char *haystack, const char *needle); #ifdef __cplusplus } #endif blame-1.3.1/lib/strcase.h0000644000076400007640000000404010527555560012120 00000000000000/* Case-insensitive string comparison functions. Copyright (C) 1995-1996, 2001, 2003, 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _STRCASE_H #define _STRCASE_H #include /* Include header files with a possibly conflicting declarations of strcasecmp before we define it as a macro, so that they will be no-ops if included after strcasecmp is defined as a macro. */ #include #ifdef __cplusplus extern "C" { #endif /* No known system has a strcasecmp() function that works correctly in multibyte locales. Therefore we use our version always. */ #define strcasecmp rpl_strcasecmp /* Compare strings S1 and S2, ignoring case, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. Note: This function may, in multibyte locales, return 0 for strings of different lengths! */ extern int strcasecmp (const char *s1, const char *s2); /* Compare no more than N characters of strings S1 and S2, ignoring case, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. Note: This function can not work correctly in multibyte locales. */ #if ! HAVE_DECL_STRNCASECMP extern int strncasecmp (const char *s1, const char *s2, size_t n); #endif #ifdef __cplusplus } #endif #endif /* _STRCASE_H */ blame-1.3.1/lib/stat_.h0000644000076400007640000001273510527555557011606 00000000000000/* Provide a more complete sys/stat header file. Copyright (C) 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Eric Blake, Paul Eggert, and Jim Meyering. */ #ifndef _gl_SYS_STAT_H #define _gl_SYS_STAT_H /* This file is supposed to be used on platforms where is incomplete. It is intended to provide definitions and prototypes needed by an application. Start with what the system provides. */ #include @ABSOLUTE_SYS_STAT_H@ #ifndef S_IFMT # define S_IFMT 0170000 #endif #if STAT_MACROS_BROKEN # undef S_ISBLK # undef S_ISCHR # undef S_ISDIR # undef S_ISFIFO # undef S_ISLNK # undef S_ISNAM # undef S_ISMPB # undef S_ISMPC # undef S_ISNWK # undef S_ISREG # undef S_ISSOCK #endif #ifndef S_ISBLK # ifdef S_IFBLK # define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) # else # define S_ISBLK(m) 0 # endif #endif #ifndef S_ISCHR # ifdef S_IFCHR # define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) # else # define S_ISCHR(m) 0 # endif #endif #ifndef S_ISDIR # ifdef S_IFDIR # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) # else # define S_ISDIR(m) 0 # endif #endif #ifndef S_ISDOOR /* Solaris 2.5 and up */ # define S_ISDOOR(m) 0 #endif #ifndef S_ISFIFO # ifdef S_IFIFO # define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) # else # define S_ISFIFO(m) 0 # endif #endif #ifndef S_ISLNK # ifdef S_IFLNK # define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) # else # define S_ISLNK(m) 0 # endif #endif #ifndef S_ISMPB /* V7 */ # ifdef S_IFMPB # define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) # define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) # else # define S_ISMPB(m) 0 # define S_ISMPC(m) 0 # endif #endif #ifndef S_ISNAM /* Xenix */ # ifdef S_IFNAM # define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM) # else # define S_ISNAM(m) 0 # endif #endif #ifndef S_ISNWK /* HP/UX */ # ifdef S_IFNWK # define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) # else # define S_ISNWK(m) 0 # endif #endif #ifndef S_ISPORT /* Solaris 10 and up */ # define S_ISPORT(m) 0 #endif #ifndef S_ISREG # ifdef S_IFREG # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) # else # define S_ISREG(m) 0 # endif #endif #ifndef S_ISSOCK # ifdef S_IFSOCK # define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) # else # define S_ISSOCK(m) 0 # endif #endif #ifndef S_TYPEISMQ # define S_TYPEISMQ(p) 0 #endif #ifndef S_TYPEISTMO # define S_TYPEISTMO(p) 0 #endif #ifndef S_TYPEISSEM # ifdef S_INSEM # define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM) # else # define S_TYPEISSEM(p) 0 # endif #endif #ifndef S_TYPEISSHM # ifdef S_INSHD # define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD) # else # define S_TYPEISSHM(p) 0 # endif #endif /* high performance ("contiguous data") */ #ifndef S_ISCTG # define S_ISCTG(p) 0 #endif /* Cray DMF (data migration facility): off line, with data */ #ifndef S_ISOFD # define S_ISOFD(p) 0 #endif /* Cray DMF (data migration facility): off line, with no data */ #ifndef S_ISOFL # define S_ISOFL(p) 0 #endif /* 4.4BSD whiteout */ #ifndef S_ISWHT # define S_ISWHT(m) 0 #endif /* If any of the following are undefined, define them to their de facto standard values. */ #if !S_ISUID # define S_ISUID 04000 #endif #if !S_ISGID # define S_ISGID 02000 #endif /* S_ISVTX is a common extension to POSIX. */ #ifndef S_ISVTX # define S_ISVTX 01000 #endif #if !S_IRUSR && S_IREAD # define S_IRUSR S_IREAD #endif #if !S_IRUSR # define S_IRUSR 00400 #endif #if !S_IRGRP # define S_IRGRP (S_IRUSR >> 3) #endif #if !S_IROTH # define S_IROTH (S_IRUSR >> 6) #endif #if !S_IWUSR && S_IWRITE # define S_IWUSR S_IWRITE #endif #if !S_IWUSR # define S_IWUSR 00200 #endif #if !S_IWGRP # define S_IWGRP (S_IWUSR >> 3) #endif #if !S_IWOTH # define S_IWOTH (S_IWUSR >> 6) #endif #if !S_IXUSR && S_IEXEC # define S_IXUSR S_IEXEC #endif #if !S_IXUSR # define S_IXUSR 00100 #endif #if !S_IXGRP # define S_IXGRP (S_IXUSR >> 3) #endif #if !S_IXOTH # define S_IXOTH (S_IXUSR >> 6) #endif #if !S_IRWXU # define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) #endif #if !S_IRWXG # define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) #endif #if !S_IRWXO # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) #endif /* S_IXUGO is a common extension to POSIX. */ #if !S_IXUGO # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) #endif #ifndef S_IRWXUGO # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) #endif /* mingw does not support symlinks, therefore it does not have lstat. But without links, stat does just fine. */ #if ! HAVE_LSTAT # define lstat stat #endif /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. Additionally, it declares _mkdir (and depending on compile flags, an alias mkdir), only in the nonstandard io.h. */ #if ! HAVE_DECL_MKDIR && HAVE_IO_H # include static inline int rpl_mkdir (char const *name, mode_t mode) { return _mkdir (name); } # define mkdir rpl_mkdir #endif #endif /* _gl_SYS_STAT_H */ blame-1.3.1/lib/gettimeofday.c0000644000076400007640000000631510527555557013145 00000000000000/* Work around the bug in some systems whereby gettimeofday clobbers the static buffer that localtime uses for it's return value. The gettimeofday function from Mac OS X 10.0.4, i.e. Darwin 1.3.7 has this problem. The tzset replacement is necessary for at least Solaris 2.5, 2.5.1, and 2.6. Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* written by Jim Meyering */ #include /* Disable the definitions of these functions (from config.h) so we can use the library versions here. */ #undef gettimeofday #undef gmtime #undef localtime #undef tzset #include #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #include static struct tm *localtime_buffer_addr; /* This is a wrapper for localtime. It is used only on systems for which gettimeofday clobbers the static buffer used for localtime's result. On the first call, record the address of the static buffer that localtime uses for its result. */ struct tm * rpl_localtime (const time_t *timep) { struct tm *tm = localtime (timep); if (! localtime_buffer_addr) localtime_buffer_addr = tm; return tm; } /* Same as above, since gmtime and localtime use the same buffer. */ struct tm * rpl_gmtime (const time_t *timep) { struct tm *tm = gmtime (timep); if (! localtime_buffer_addr) localtime_buffer_addr = tm; return tm; } /* This is a wrapper for gettimeofday. It is used only on systems for which gettimeofday clobbers the static buffer used for localtime's result. Save and restore the contents of the buffer used for localtime's result around the call to gettimeofday. */ int rpl_gettimeofday (struct timeval *tv, struct timezone *tz) { struct tm save; int result; if (! localtime_buffer_addr) { time_t t = 0; localtime_buffer_addr = localtime (&t); } save = *localtime_buffer_addr; result = gettimeofday (tv, tz); *localtime_buffer_addr = save; return result; } /* This is a wrapper for tzset. It is used only on systems for which tzset may clobber the static buffer used for localtime's result. Save and restore the contents of the buffer used for localtime's result around the call to tzset. */ void rpl_tzset (void) { struct tm save; if (! localtime_buffer_addr) { time_t t = 0; localtime_buffer_addr = localtime (&t); } save = *localtime_buffer_addr; tzset (); *localtime_buffer_addr = save; } blame-1.3.1/lib/strnlen.h0000664000076400007640000000235010337302571012134 00000000000000/* Find the length of STRING, but scan at most MAXLEN characters. Copyright (C) 2005 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef STRNLEN_H #define STRNLEN_H /* Get strnlen declaration, if available. */ #include #if defined HAVE_DECL_STRNLEN && !HAVE_DECL_STRNLEN /* Find the length (number of bytes) of STRING, but scan at most MAXLEN bytes. If no '\0' terminator is found in that many bytes, return MAXLEN. */ extern size_t strnlen(const char *string, size_t maxlen); #endif #endif /* STRNLEN_H */ blame-1.3.1/lib/printf-parse.c0000644000076400007640000003035710527555557013101 00000000000000/* Formatted output to strings. Copyright (C) 1999-2000, 2002-2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Specification. */ #if WIDE_CHAR_VERSION # include "wprintf-parse.h" #else # include "printf-parse.h" #endif /* Get size_t, NULL. */ #include /* Get intmax_t. */ #if HAVE_STDINT_H_WITH_UINTMAX # include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX # include #endif /* malloc(), realloc(), free(). */ #include /* Checked size_t computations. */ #include "xsize.h" #if WIDE_CHAR_VERSION # define PRINTF_PARSE wprintf_parse # define CHAR_T wchar_t # define DIRECTIVE wchar_t_directive # define DIRECTIVES wchar_t_directives #else # define PRINTF_PARSE printf_parse # define CHAR_T char # define DIRECTIVE char_directive # define DIRECTIVES char_directives #endif #ifdef STATIC STATIC #endif int PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) { const CHAR_T *cp = format; /* pointer into format */ size_t arg_posn = 0; /* number of regular arguments consumed */ size_t d_allocated; /* allocated elements of d->dir */ size_t a_allocated; /* allocated elements of a->arg */ size_t max_width_length = 0; size_t max_precision_length = 0; d->count = 0; d_allocated = 1; d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE)); if (d->dir == NULL) /* Out of memory. */ return -1; a->count = 0; a_allocated = 0; a->arg = NULL; #define REGISTER_ARG(_index_,_type_) \ { \ size_t n = (_index_); \ if (n >= a_allocated) \ { \ size_t memory_size; \ argument *memory; \ \ a_allocated = xtimes (a_allocated, 2); \ if (a_allocated <= n) \ a_allocated = xsum (n, 1); \ memory_size = xtimes (a_allocated, sizeof (argument)); \ if (size_overflow_p (memory_size)) \ /* Overflow, would lead to out of memory. */ \ goto error; \ memory = (argument *) (a->arg \ ? realloc (a->arg, memory_size) \ : malloc (memory_size)); \ if (memory == NULL) \ /* Out of memory. */ \ goto error; \ a->arg = memory; \ } \ while (a->count <= n) \ a->arg[a->count++].type = TYPE_NONE; \ if (a->arg[n].type == TYPE_NONE) \ a->arg[n].type = (_type_); \ else if (a->arg[n].type != (_type_)) \ /* Ambiguous type for positional argument. */ \ goto error; \ } while (*cp != '\0') { CHAR_T c = *cp++; if (c == '%') { size_t arg_index = ARG_NONE; DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */ /* Initialize the next directive. */ dp->dir_start = cp - 1; dp->flags = 0; dp->width_start = NULL; dp->width_end = NULL; dp->width_arg_index = ARG_NONE; dp->precision_start = NULL; dp->precision_end = NULL; dp->precision_arg_index = ARG_NONE; dp->arg_index = ARG_NONE; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; arg_index = n - 1; cp = np + 1; } } /* Read the flags. */ for (;;) { if (*cp == '\'') { dp->flags |= FLAG_GROUP; cp++; } else if (*cp == '-') { dp->flags |= FLAG_LEFT; cp++; } else if (*cp == '+') { dp->flags |= FLAG_SHOWSIGN; cp++; } else if (*cp == ' ') { dp->flags |= FLAG_SPACE; cp++; } else if (*cp == '#') { dp->flags |= FLAG_ALT; cp++; } else if (*cp == '0') { dp->flags |= FLAG_ZERO; cp++; } else break; } /* Parse the field width. */ if (*cp == '*') { dp->width_start = cp; cp++; dp->width_end = cp; if (max_width_length < 1) max_width_length = 1; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; dp->width_arg_index = n - 1; cp = np + 1; } } if (dp->width_arg_index == ARG_NONE) { dp->width_arg_index = arg_posn++; if (dp->width_arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->width_arg_index, TYPE_INT); } else if (*cp >= '0' && *cp <= '9') { size_t width_length; dp->width_start = cp; for (; *cp >= '0' && *cp <= '9'; cp++) ; dp->width_end = cp; width_length = dp->width_end - dp->width_start; if (max_width_length < width_length) max_width_length = width_length; } /* Parse the precision. */ if (*cp == '.') { cp++; if (*cp == '*') { dp->precision_start = cp - 1; cp++; dp->precision_end = cp; if (max_precision_length < 2) max_precision_length = 2; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; dp->precision_arg_index = n - 1; cp = np + 1; } } if (dp->precision_arg_index == ARG_NONE) { dp->precision_arg_index = arg_posn++; if (dp->precision_arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->precision_arg_index, TYPE_INT); } else { size_t precision_length; dp->precision_start = cp - 1; for (; *cp >= '0' && *cp <= '9'; cp++) ; dp->precision_end = cp; precision_length = dp->precision_end - dp->precision_start; if (max_precision_length < precision_length) max_precision_length = precision_length; } } { arg_type type; /* Parse argument type/size specifiers. */ { int flags = 0; for (;;) { if (*cp == 'h') { flags |= (1 << (flags & 1)); cp++; } else if (*cp == 'L') { flags |= 4; cp++; } else if (*cp == 'l') { flags += 8; cp++; } #ifdef HAVE_INTMAX_T else if (*cp == 'j') { if (sizeof (intmax_t) > sizeof (long)) { /* intmax_t = long long */ flags += 16; } else if (sizeof (intmax_t) > sizeof (int)) { /* intmax_t = long */ flags += 8; } cp++; } #endif else if (*cp == 'z' || *cp == 'Z') { /* 'z' is standardized in ISO C 99, but glibc uses 'Z' because the warning facility in gcc-2.95.2 understands only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */ if (sizeof (size_t) > sizeof (long)) { /* size_t = long long */ flags += 16; } else if (sizeof (size_t) > sizeof (int)) { /* size_t = long */ flags += 8; } cp++; } else if (*cp == 't') { if (sizeof (ptrdiff_t) > sizeof (long)) { /* ptrdiff_t = long long */ flags += 16; } else if (sizeof (ptrdiff_t) > sizeof (int)) { /* ptrdiff_t = long */ flags += 8; } cp++; } else break; } /* Read the conversion character. */ c = *cp++; switch (c) { case 'd': case 'i': #ifdef HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_LONGLONGINT; else #endif /* If 'long long' exists and is the same as 'long', we parse "lld" into TYPE_LONGINT. */ if (flags >= 8) type = TYPE_LONGINT; else if (flags & 2) type = TYPE_SCHAR; else if (flags & 1) type = TYPE_SHORT; else type = TYPE_INT; break; case 'o': case 'u': case 'x': case 'X': #ifdef HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_ULONGLONGINT; else #endif /* If 'unsigned long long' exists and is the same as 'unsigned long', we parse "llu" into TYPE_ULONGINT. */ if (flags >= 8) type = TYPE_ULONGINT; else if (flags & 2) type = TYPE_UCHAR; else if (flags & 1) type = TYPE_USHORT; else type = TYPE_UINT; break; case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': #ifdef HAVE_LONG_DOUBLE if (flags >= 16 || (flags & 4)) type = TYPE_LONGDOUBLE; else #endif type = TYPE_DOUBLE; break; case 'c': if (flags >= 8) #ifdef HAVE_WINT_T type = TYPE_WIDE_CHAR; #else goto error; #endif else type = TYPE_CHAR; break; #ifdef HAVE_WINT_T case 'C': type = TYPE_WIDE_CHAR; c = 'c'; break; #endif case 's': if (flags >= 8) #ifdef HAVE_WCHAR_T type = TYPE_WIDE_STRING; #else goto error; #endif else type = TYPE_STRING; break; #ifdef HAVE_WCHAR_T case 'S': type = TYPE_WIDE_STRING; c = 's'; break; #endif case 'p': type = TYPE_POINTER; break; case 'n': #ifdef HAVE_LONG_LONG_INT /* If 'long long' exists and is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_COUNT_LONGLONGINT_POINTER; else #endif /* If 'long long' exists and is the same as 'long', we parse "lln" into TYPE_COUNT_LONGINT_POINTER. */ if (flags >= 8) type = TYPE_COUNT_LONGINT_POINTER; else if (flags & 2) type = TYPE_COUNT_SCHAR_POINTER; else if (flags & 1) type = TYPE_COUNT_SHORT_POINTER; else type = TYPE_COUNT_INT_POINTER; break; case '%': type = TYPE_NONE; break; default: /* Unknown conversion character. */ goto error; } } if (type != TYPE_NONE) { dp->arg_index = arg_index; if (dp->arg_index == ARG_NONE) { dp->arg_index = arg_posn++; if (dp->arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->arg_index, type); } dp->conversion = c; dp->dir_end = cp; } d->count++; if (d->count >= d_allocated) { size_t memory_size; DIRECTIVE *memory; d_allocated = xtimes (d_allocated, 2); memory_size = xtimes (d_allocated, sizeof (DIRECTIVE)); if (size_overflow_p (memory_size)) /* Overflow, would lead to out of memory. */ goto error; memory = (DIRECTIVE *) realloc (d->dir, memory_size); if (memory == NULL) /* Out of memory. */ goto error; d->dir = memory; } } } d->dir[d->count].dir_start = cp; d->max_width_length = max_width_length; d->max_precision_length = max_precision_length; return 0; error: if (a->arg) free (a->arg); if (d->dir) free (d->dir); return -1; } #undef DIRECTIVES #undef DIRECTIVE #undef CHAR_T #undef PRINTF_PARSE blame-1.3.1/lib/mbchar.h0000644000076400007640000003626010527555557011727 00000000000000/* Multibyte character data type. Copyright (C) 2001, 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Written by Bruno Haible . */ /* A multibyte character is a short subsequence of a char* string, representing a single wide character. We use multibyte characters instead of wide characters because of the following goals: 1) correct multibyte handling, i.e. operate according to the LC_CTYPE locale, 2) ease of maintenance, i.e. the maintainer needs not know all details of the ISO C 99 standard, 3) don't fail grossly if the input is not in the encoding set by the locale, because often different encodings are in use in the same countries (ISO-8859-1/UTF-8, EUC-JP/Shift_JIS, ...), 4) fast in the case of ASCII characters, 5) portability, i.e. don't make unportable assumptions about wchar_t. Multibyte characters are only accessed through the mb* macros. mb_ptr (mbc) return a pointer to the beginning of the multibyte sequence. mb_len (mbc) returns the number of bytes occupied by the multibyte sequence. Always > 0. mb_iseq (mbc, sc) returns true if mbc is the standard ASCII character sc. mb_isnul (mbc) returns true if mbc is the nul character. mb_cmp (mbc1, mbc2) returns a positive, zero, or negative value depending on whether mbc1 sorts after, same or before mbc2. mb_casecmp (mbc1, mbc2) returns a positive, zero, or negative value depending on whether mbc1 sorts after, same or before mbc2, modulo upper/lowercase conversion. mb_equal (mbc1, mbc2) returns true if mbc1 and mbc2 are equal. mb_caseequal (mbc1, mbc2) returns true if mbc1 and mbc2 are equal modulo upper/lowercase conversion. mb_isalnum (mbc) returns true if mbc is alphanumeric. mb_isalpha (mbc) returns true if mbc is alphabetic. mb_isascii(mbc) returns true if mbc is plain ASCII. mb_isblank (mbc) returns true if mbc is a blank. mb_iscntrl (mbc) returns true if mbc is a control character. mb_isdigit (mbc) returns true if mbc is a decimal digit. mb_isgraph (mbc) returns true if mbc is a graphic character. mb_islower (mbc) returns true if mbc is lowercase. mb_isprint (mbc) returns true if mbc is a printable character. mb_ispunct (mbc) returns true if mbc is a punctuation character. mb_isspace (mbc) returns true if mbc is a space character. mb_isupper (mbc) returns true if mbc is uppercase. mb_isxdigit (mbc) returns true if mbc is a hexadecimal digit. mb_width (mbc) returns the number of columns on the output device occupied by mbc. Always >= 0. mb_putc (mbc, stream) outputs mbc on stream, a byte oriented FILE stream opened for output. mb_setascii (&mbc, sc) assigns the standard ASCII character sc to mbc. mb_copy (&destmbc, &srcmbc) copies srcmbc to destmbc. Here are the function prototypes of the macros. extern const char * mb_ptr (const mbchar_t mbc); extern size_t mb_len (const mbchar_t mbc); extern bool mb_iseq (const mbchar_t mbc, char sc); extern bool mb_isnul (const mbchar_t mbc); extern int mb_cmp (const mbchar_t mbc1, const mbchar_t mbc2); extern int mb_casecmp (const mbchar_t mbc1, const mbchar_t mbc2); extern bool mb_equal (const mbchar_t mbc1, const mbchar_t mbc2); extern bool mb_caseequal (const mbchar_t mbc1, const mbchar_t mbc2); extern bool mb_isalnum (const mbchar_t mbc); extern bool mb_isalpha (const mbchar_t mbc); extern bool mb_isascii (const mbchar_t mbc); extern bool mb_isblank (const mbchar_t mbc); extern bool mb_iscntrl (const mbchar_t mbc); extern bool mb_isdigit (const mbchar_t mbc); extern bool mb_isgraph (const mbchar_t mbc); extern bool mb_islower (const mbchar_t mbc); extern bool mb_isprint (const mbchar_t mbc); extern bool mb_ispunct (const mbchar_t mbc); extern bool mb_isspace (const mbchar_t mbc); extern bool mb_isupper (const mbchar_t mbc); extern bool mb_isxdigit (const mbchar_t mbc); extern int mb_width (const mbchar_t mbc); extern void mb_putc (const mbchar_t mbc, FILE *stream); extern void mb_setascii (mbchar_t *new, char sc); extern void mb_copy (mbchar_t *new, const mbchar_t *old); */ #ifndef _MBCHAR_H #define _MBCHAR_H 1 #include #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.1 has a bug: and must be included before . */ #include #include #include /* BeOS 5 has the functions but no . */ #if HAVE_WCTYPE_H # include #endif /* FreeBSD 4.4 to 4.11 has but lacks the functions. Assume all 12 functions are implemented the same way, or not at all. */ #if !defined iswalnum && !HAVE_ISWCNTRL static inline int iswalnum (wint_t wc) { return (wc >= 0 && wc < 128 ? (wc >= '0' && wc <= '9') || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z') : 0); } # define iswalnum iswalnum #endif #if !defined iswalpha && !HAVE_ISWCNTRL static inline int iswalpha (wint_t wc) { return (wc >= 0 && wc < 128 ? (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z' : 0); } # define iswalpha iswalpha #endif #if !defined iswblank && !HAVE_ISWCNTRL static inline int iswblank (wint_t wc) { return (wc >= 0 && wc < 128 ? wc == ' ' || wc == '\t' : 0); } # define iswblank iswblank #endif #if !defined iswcntrl && !HAVE_ISWCNTRL static inline int iswcntrl (wint_t wc) { return (wc >= 0 && wc < 128 ? (wc & ~0x1f) == 0 || wc == 0x7f : 0); } # define iswcntrl iswcntrl #endif #if !defined iswdigit && !HAVE_ISWCNTRL static inline int iswdigit (wint_t wc) { return (wc >= '0' && wc <= '9'); } # define iswdigit iswdigit #endif #if !defined iswgraph && !HAVE_ISWCNTRL static inline int iswgraph (wint_t wc) { return (wc >= 0 && wc < 128 ? wc >= '!' && wc <= '~' : 1); } # define iswgraph iswgraph #endif #if !defined iswlower && !HAVE_ISWCNTRL static inline int iswlower (wint_t wc) { return (wc >= 0 && wc < 128 ? wc >= 'a' && wc <= 'z' : 0); } # define iswlower iswlower #endif #if !defined iswprint && !HAVE_ISWCNTRL static inline int iswprint (wint_t wc) { return (wc >= 0 && wc < 128 ? wc >= ' ' && wc <= '~' : 1); } # define iswprint iswprint #endif #if !defined iswpunct && !HAVE_ISWCNTRL static inline int iswpunct (wint_t wc) { return (wc >= 0 && wc < 128 ? wc >= '!' && wc <= '~' && !((wc >= '0' && wc <= '9') || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')) : 1); } # define iswpunct iswpunct #endif #if !defined iswspace && !HAVE_ISWCNTRL static inline int iswspace (wint_t wc) { return (wc >= 0 && wc < 128 ? wc == ' ' || wc == '\t' || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r' : 0); } # define iswspace iswspace #endif #if !defined iswupper && !HAVE_ISWCNTRL static inline int iswupper (wint_t wc) { return (wc >= 0 && wc < 128 ? wc >= 'A' && wc <= 'Z' : 0); } # define iswupper iswupper #endif #if !defined iswxdigit && !HAVE_ISWCNTRL static inline int iswxdigit (wint_t wc) { return (wc >= '0' && wc <= '9') || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'); } # define iswxdigit iswxdigit #endif #include "wcwidth.h" #define MBCHAR_BUF_SIZE 24 struct mbchar { const char *ptr; /* pointer to current character */ size_t bytes; /* number of bytes of current character, > 0 */ bool wc_valid; /* true if wc is a valid wide character */ wchar_t wc; /* if wc_valid: the current character */ char buf[MBCHAR_BUF_SIZE]; /* room for the bytes, used for file input only */ }; /* EOF (not a real character) is represented with bytes = 0 and wc_valid = false. */ typedef struct mbchar mbchar_t; /* Access the current character. */ #define mb_ptr(mbc) ((mbc).ptr) #define mb_len(mbc) ((mbc).bytes) /* Comparison of characters. */ #define mb_iseq(mbc, sc) ((mbc).wc_valid && (mbc).wc == (sc)) #define mb_isnul(mbc) ((mbc).wc_valid && (mbc).wc == 0) #define mb_cmp(mbc1, mbc2) \ ((mbc1).wc_valid \ ? ((mbc2).wc_valid \ ? (int) (mbc1).wc - (int) (mbc2).wc \ : -1) \ : ((mbc2).wc_valid \ ? 1 \ : (mbc1).bytes == (mbc2).bytes \ ? memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) \ : (mbc1).bytes < (mbc2).bytes \ ? (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) > 0 ? 1 : -1) \ : (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc2).bytes) >= 0 ? 1 : -1))) #define mb_casecmp(mbc1, mbc2) \ ((mbc1).wc_valid \ ? ((mbc2).wc_valid \ ? (int) towlower ((mbc1).wc) - (int) towlower ((mbc2).wc) \ : -1) \ : ((mbc2).wc_valid \ ? 1 \ : (mbc1).bytes == (mbc2).bytes \ ? memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) \ : (mbc1).bytes < (mbc2).bytes \ ? (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) > 0 ? 1 : -1) \ : (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc2).bytes) >= 0 ? 1 : -1))) #define mb_equal(mbc1, mbc2) \ ((mbc1).wc_valid && (mbc2).wc_valid \ ? (mbc1).wc == (mbc2).wc \ : (mbc1).bytes == (mbc2).bytes \ && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0) #define mb_caseequal(mbc1, mbc2) \ ((mbc1).wc_valid && (mbc2).wc_valid \ ? towlower ((mbc1).wc) == towlower ((mbc2).wc) \ : (mbc1).bytes == (mbc2).bytes \ && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0) /* , classification. */ #define mb_isascii(mbc) \ ((mbc).wc_valid && (mbc).wc >= 0 && (mbc).wc <= 127) #define mb_isalnum(mbc) ((mbc).wc_valid && iswalnum ((mbc).wc)) #define mb_isalpha(mbc) ((mbc).wc_valid && iswalpha ((mbc).wc)) #define mb_isblank(mbc) ((mbc).wc_valid && iswblank ((mbc).wc)) #define mb_iscntrl(mbc) ((mbc).wc_valid && iswcntrl ((mbc).wc)) #define mb_isdigit(mbc) ((mbc).wc_valid && iswdigit ((mbc).wc)) #define mb_isgraph(mbc) ((mbc).wc_valid && iswgraph ((mbc).wc)) #define mb_islower(mbc) ((mbc).wc_valid && iswlower ((mbc).wc)) #define mb_isprint(mbc) ((mbc).wc_valid && iswprint ((mbc).wc)) #define mb_ispunct(mbc) ((mbc).wc_valid && iswpunct ((mbc).wc)) #define mb_isspace(mbc) ((mbc).wc_valid && iswspace ((mbc).wc)) #define mb_isupper(mbc) ((mbc).wc_valid && iswupper ((mbc).wc)) #define mb_isxdigit(mbc) ((mbc).wc_valid && iswxdigit ((mbc).wc)) /* Extra function. */ /* Unprintable characters appear as a small box of width 1. */ #define MB_UNPRINTABLE_WIDTH 1 static inline int mb_width_aux (wint_t wc) { int w = wcwidth (wc); /* For unprintable characters, arbitrarily return 0 for control characters and MB_UNPRINTABLE_WIDTH otherwise. */ return (w >= 0 ? w : iswcntrl (wc) ? 0 : MB_UNPRINTABLE_WIDTH); } #define mb_width(mbc) \ ((mbc).wc_valid ? mb_width_aux ((mbc).wc) : MB_UNPRINTABLE_WIDTH) /* Output. */ #define mb_putc(mbc, stream) fwrite ((mbc).ptr, 1, (mbc).bytes, (stream)) /* Assignment. */ #define mb_setascii(mbc, sc) \ ((mbc)->ptr = (mbc)->buf, (mbc)->bytes = 1, (mbc)->wc_valid = 1, \ (mbc)->wc = (mbc)->buf[0] = (sc)) /* Copying a character. */ static inline void mb_copy (mbchar_t *new_mbc, const mbchar_t *old_mbc) { if (old_mbc->ptr == &old_mbc->buf[0]) { memcpy (&new_mbc->buf[0], &old_mbc->buf[0], old_mbc->bytes); new_mbc->ptr = &new_mbc->buf[0]; } else new_mbc->ptr = old_mbc->ptr; new_mbc->bytes = old_mbc->bytes; if ((new_mbc->wc_valid = old_mbc->wc_valid)) new_mbc->wc = old_mbc->wc; } /* is_basic(c) tests whether the single-byte character c is in the ISO C "basic character set". This is a convenience function, and is in this file only to share code between mbiter_multi.h and mbfile_multi.h. */ #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 ISO-646, not EBCDIC. */ # define IS_BASIC_ASCII 1 extern const unsigned int is_basic_table[]; static inline bool is_basic (char c) { return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31)) & 1; } #else static inline bool is_basic (char c) { switch (c) { case '\t': case '\v': case '\f': case ' ': case '!': case '"': case '#': case '%': case '&': case '\'': case '(': case ')': case '*': case '+': case ',': case '-': case '.': case '/': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case ':': case ';': case '<': case '=': case '>': case '?': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': case '[': case '\\': case ']': case '^': case '_': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': case '{': case '|': case '}': case '~': return 1; default: return 0; } } #endif #endif /* _MBCHAR_H */ blame-1.3.1/lib/canonicalize.c0000644000076400007640000001524210527555557013122 00000000000000/* Return the canonical absolute name of a given file. Copyright (C) 1996-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "canonicalize.h" #include #include #if HAVE_SYS_PARAM_H # include #endif #include #include #include #include #include "cycle-check.h" #include "filenamecat.h" #include "xalloc.h" #include "xgetcwd.h" #ifndef ELOOP # define ELOOP 0 #endif #ifndef __set_errno # define __set_errno(Val) errno = (Val) #endif #include "pathmax.h" #include "xreadlink.h" #if !HAVE_CANONICALIZE_FILE_NAME /* Return the canonical absolute name of file NAME. A canonical name does not contain any `.', `..' components nor any repeated file name separators ('/') or symlinks. All components must exist. The result is malloc'd. */ char * canonicalize_file_name (const char *name) { # if HAVE_RESOLVEPATH char *resolved, *extra_buf = NULL; size_t resolved_size; ssize_t resolved_len; if (name == NULL) { __set_errno (EINVAL); return NULL; } if (name[0] == '\0') { __set_errno (ENOENT); return NULL; } /* All known hosts with resolvepath (e.g. Solaris 7) don't turn relative names into absolute ones, so prepend the working directory if the file name is not absolute. */ if (name[0] != '/') { char *wd; if (!(wd = xgetcwd ())) return NULL; extra_buf = file_name_concat (wd, name, NULL); name = extra_buf; free (wd); } resolved_size = strlen (name); while (1) { resolved_size = 2 * resolved_size + 1; resolved = xmalloc (resolved_size); resolved_len = resolvepath (name, resolved, resolved_size); if (resolved_len < 0) { free (resolved); free (extra_buf); return NULL; } if (resolved_len < resolved_size) break; free (resolved); } free (extra_buf); /* NUL-terminate the resulting name. */ resolved[resolved_len] = '\0'; return resolved; # else return canonicalize_filename_mode (name, CAN_EXISTING); # endif /* !HAVE_RESOLVEPATH */ } #endif /* !HAVE_CANONICALIZE_FILE_NAME */ /* Return the canonical absolute name of file NAME. A canonical name does not contain any `.', `..' components nor any repeated file name separators ('/') or symlinks. Whether components must exist or not depends on canonicalize mode. The result is malloc'd. */ char * canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode) { char *rname, *dest, *extra_buf = NULL; char const *start; char const *end; char const *rname_limit; size_t extra_len = 0; struct cycle_check_state cycle_state; if (name == NULL) { __set_errno (EINVAL); return NULL; } if (name[0] == '\0') { __set_errno (ENOENT); return NULL; } if (name[0] != '/') { rname = xgetcwd (); if (!rname) return NULL; dest = strchr (rname, '\0'); if (dest - rname < PATH_MAX) { char *p = xrealloc (rname, PATH_MAX); dest = p + (dest - rname); rname = p; rname_limit = rname + PATH_MAX; } else { rname_limit = dest; } } else { rname = xmalloc (PATH_MAX); rname_limit = rname + PATH_MAX; rname[0] = '/'; dest = rname + 1; } cycle_check_init (&cycle_state); for (start = end = name; *start; start = end) { /* Skip sequence of multiple file name separators. */ while (*start == '/') ++start; /* Find end of component. */ for (end = start; *end && *end != '/'; ++end) /* Nothing. */; if (end - start == 0) break; else if (end - start == 1 && start[0] == '.') /* nothing */; else if (end - start == 2 && start[0] == '.' && start[1] == '.') { /* Back up to previous component, ignore if at root already. */ if (dest > rname + 1) while ((--dest)[-1] != '/'); } else { struct stat st; if (dest[-1] != '/') *dest++ = '/'; if (dest + (end - start) >= rname_limit) { ptrdiff_t dest_offset = dest - rname; size_t new_size = rname_limit - rname; if (end - start + 1 > PATH_MAX) new_size += end - start + 1; else new_size += PATH_MAX; rname = xrealloc (rname, new_size); rname_limit = rname + new_size; dest = rname + dest_offset; } dest = memcpy (dest, start, end - start); dest += end - start; *dest = '\0'; if (lstat (rname, &st) != 0) { if (can_mode == CAN_EXISTING) goto error; if (can_mode == CAN_ALL_BUT_LAST && *end) goto error; st.st_mode = 0; } if (S_ISLNK (st.st_mode)) { char *buf; size_t n, len; if (cycle_check (&cycle_state, &st)) { __set_errno (ELOOP); if (can_mode == CAN_MISSING) continue; else goto error; } buf = xreadlink (rname, st.st_size); if (!buf) { if (can_mode == CAN_MISSING) continue; else goto error; } n = strlen (buf); len = strlen (end); if (!extra_len) { extra_len = ((n + len + 1) > PATH_MAX) ? (n + len + 1) : PATH_MAX; extra_buf = xmalloc (extra_len); } else if ((n + len + 1) > extra_len) { extra_len = n + len + 1; extra_buf = xrealloc (extra_buf, extra_len); } /* Careful here, end may be a pointer into extra_buf... */ memmove (&extra_buf[n], end, len + 1); name = end = memcpy (extra_buf, buf, n); if (buf[0] == '/') dest = rname + 1; /* It's an absolute symlink */ else /* Back up to previous component, ignore if at root already: */ if (dest > rname + 1) while ((--dest)[-1] != '/'); free (buf); } else { if (!S_ISDIR (st.st_mode) && *end && (can_mode != CAN_MISSING)) { errno = ENOTDIR; goto error; } } } } if (dest > rname + 1 && dest[-1] == '/') --dest; *dest = '\0'; free (extra_buf); return rname; error: free (extra_buf); free (rname); return NULL; } blame-1.3.1/lib/strnlen1.c0000644000076400007640000000244310527555560012222 00000000000000/* Find the length of STRING + 1, but scan at most MAXLEN bytes. Copyright (C) 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Specification. */ #include "strnlen1.h" #include /* Find the length of STRING + 1, but scan at most MAXLEN bytes. If no '\0' terminator is found in that many characters, return MAXLEN. */ /* This is the same as strnlen (string, maxlen - 1) + 1. */ size_t strnlen1 (const char *string, size_t maxlen) { const char *end = (const char *) memchr (string, '\0', maxlen); if (end != NULL) return end - string + 1; else return maxlen; } blame-1.3.1/lib/xsize.h0000644000076400007640000000667310241344125011616 00000000000000/* xsize.h -- Checked size_t computations. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _XSIZE_H #define _XSIZE_H /* Get size_t. */ #include /* Get SIZE_MAX. */ #include #if HAVE_STDINT_H # include #endif /* The size of memory objects is often computed through expressions of type size_t. Example: void* p = malloc (header_size + n * element_size). These computations can lead to overflow. When this happens, malloc() returns a piece of memory that is way too small, and the program then crashes while attempting to fill the memory. To avoid this, the functions and macros in this file check for overflow. The convention is that SIZE_MAX represents overflow. malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc implementation that uses mmap --, it's recommended to use size_overflow_p() or size_in_bounds_p() before invoking malloc(). The example thus becomes: size_t size = xsum (header_size, xtimes (n, element_size)); void *p = (size_in_bounds_p (size) ? malloc (size) : NULL); */ /* Convert an arbitrary value >= 0 to type size_t. */ #define xcast_size_t(N) \ ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX) /* Sum of two sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum (size_t size1, size_t size2) { size_t sum = size1 + size2; return (sum >= size1 ? sum : SIZE_MAX); } /* Sum of three sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum3 (size_t size1, size_t size2, size_t size3) { return xsum (xsum (size1, size2), size3); } /* Sum of four sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum4 (size_t size1, size_t size2, size_t size3, size_t size4) { return xsum (xsum (xsum (size1, size2), size3), size4); } /* Maximum of two sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xmax (size_t size1, size_t size2) { /* No explicit check is needed here, because for any n: max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */ return (size1 >= size2 ? size1 : size2); } /* Multiplication of a count with an element size, with overflow check. The count must be >= 0 and the element size must be > 0. This is a macro, not an inline function, so that it works correctly even when N is of a wider tupe and N > SIZE_MAX. */ #define xtimes(N, ELSIZE) \ ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX) /* Check for overflow. */ #define size_overflow_p(SIZE) \ ((SIZE) == SIZE_MAX) /* Check against overflow. */ #define size_in_bounds_p(SIZE) \ ((SIZE) != SIZE_MAX) #endif /* _XSIZE_H */ blame-1.3.1/lib/alloca.c0000644000076400007640000003320410527555557011714 00000000000000/* alloca.c -- allocate automatically reclaimed memory (Mostly) portable public-domain implementation -- D A Gwyn This implementation of the PWB library alloca function, which is used to allocate space off the run-time stack so that it is automatically reclaimed upon procedure exit, was inspired by discussions with J. Q. Johnson of Cornell. J.Otto Tennant contributed the Cray support. There are some preprocessor constants that can be defined when compiling for your specific system, for improved efficiency; however, the defaults should be okay. The general concept of this implementation is to keep track of all alloca-allocated blocks, and reclaim any that are found to be deeper in the stack than the current invocation. This heuristic does not reclaim storage as soon as it becomes invalid, but it will do so eventually. As a special case, alloca(0) reclaims storage without allocating any. It is a good idea to use alloca(0) in your main control loop, etc. to force garbage collection. */ #include #include #include #include #ifdef emacs # include "lisp.h" # include "blockinput.h" # ifdef EMACS_FREE # undef free # define free EMACS_FREE # endif #else # define memory_full() abort () #endif /* If compiling with GCC 2, this file's not needed. */ #if !defined (__GNUC__) || __GNUC__ < 2 /* If someone has defined alloca as a macro, there must be some other way alloca is supposed to work. */ # ifndef alloca # ifdef emacs # ifdef static /* actually, only want this if static is defined as "" -- this is for usg, in which emacs must undefine static in order to make unexec workable */ # ifndef STACK_DIRECTION you lose -- must know STACK_DIRECTION at compile-time /* Using #error here is not wise since this file should work for old and obscure compilers. */ # endif /* STACK_DIRECTION undefined */ # endif /* static */ # endif /* emacs */ /* If your stack is a linked list of frames, you have to provide an "address metric" ADDRESS_FUNCTION macro. */ # if defined (CRAY) && defined (CRAY_STACKSEG_END) long i00afunc (); # define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) # else # define ADDRESS_FUNCTION(arg) &(arg) # endif /* Define STACK_DIRECTION if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ # ifndef STACK_DIRECTION # define STACK_DIRECTION 0 /* Direction unknown. */ # endif # if STACK_DIRECTION != 0 # define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ # else /* STACK_DIRECTION == 0; need run-time code. */ static int stack_dir; /* 1 or -1 once known. */ # define STACK_DIR stack_dir static void find_stack_direction (void) { static char *addr = NULL; /* Address of first `dummy', once known. */ auto char dummy; /* To get stack address. */ if (addr == NULL) { /* Initial entry. */ addr = ADDRESS_FUNCTION (dummy); find_stack_direction (); /* Recurse once. */ } else { /* Second entry. */ if (ADDRESS_FUNCTION (dummy) > addr) stack_dir = 1; /* Stack grew upward. */ else stack_dir = -1; /* Stack grew downward. */ } } # endif /* STACK_DIRECTION == 0 */ /* An "alloca header" is used to: (a) chain together all alloca'ed blocks; (b) keep track of stack depth. It is very important that sizeof(header) agree with malloc alignment chunk size. The following default should work okay. */ # ifndef ALIGN_SIZE # define ALIGN_SIZE sizeof(double) # endif typedef union hdr { char align[ALIGN_SIZE]; /* To force sizeof(header). */ struct { union hdr *next; /* For chaining headers. */ char *deep; /* For stack depth measure. */ } h; } header; static header *last_alloca_header = NULL; /* -> last alloca header. */ /* Return a pointer to at least SIZE bytes of storage, which will be automatically reclaimed upon exit from the procedure that called alloca. Originally, this space was supposed to be taken from the current stack frame of the caller, but that method cannot be made to work for some implementations of C, for example under Gould's UTX/32. */ void * alloca (size_t size) { auto char probe; /* Probes stack depth: */ register char *depth = ADDRESS_FUNCTION (probe); # if STACK_DIRECTION == 0 if (STACK_DIR == 0) /* Unknown growth direction. */ find_stack_direction (); # endif /* Reclaim garbage, defined as all alloca'd storage that was allocated from deeper in the stack than currently. */ { register header *hp; /* Traverses linked list. */ # ifdef emacs BLOCK_INPUT; # endif for (hp = last_alloca_header; hp != NULL;) if ((STACK_DIR > 0 && hp->h.deep > depth) || (STACK_DIR < 0 && hp->h.deep < depth)) { register header *np = hp->h.next; free (hp); /* Collect garbage. */ hp = np; /* -> next header. */ } else break; /* Rest are not deeper. */ last_alloca_header = hp; /* -> last valid storage. */ # ifdef emacs UNBLOCK_INPUT; # endif } if (size == 0) return NULL; /* No allocation required. */ /* Allocate combined header + user data storage. */ { /* Address of header. */ register header *new; size_t combined_size = sizeof (header) + size; if (combined_size < sizeof (header)) memory_full (); new = malloc (combined_size); if (! new) memory_full (); new->h.next = last_alloca_header; new->h.deep = depth; last_alloca_header = new; /* User storage begins just after header. */ return (void *) (new + 1); } } # if defined (CRAY) && defined (CRAY_STACKSEG_END) # ifdef DEBUG_I00AFUNC # include # endif # ifndef CRAY_STACK # define CRAY_STACK # ifndef CRAY2 /* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ struct stack_control_header { long shgrow:32; /* Number of times stack has grown. */ long shaseg:32; /* Size of increments to stack. */ long shhwm:32; /* High water mark of stack. */ long shsize:32; /* Current size of stack (all segments). */ }; /* The stack segment linkage control information occurs at the high-address end of a stack segment. (The stack grows from low addresses to high addresses.) The initial part of the stack segment linkage control information is 0200 (octal) words. This provides for register storage for the routine which overflows the stack. */ struct stack_segment_linkage { long ss[0200]; /* 0200 overflow words. */ long sssize:32; /* Number of words in this segment. */ long ssbase:32; /* Offset to stack base. */ long:32; long sspseg:32; /* Offset to linkage control of previous segment of stack. */ long:32; long sstcpt:32; /* Pointer to task common address block. */ long sscsnm; /* Private control structure number for microtasking. */ long ssusr1; /* Reserved for user. */ long ssusr2; /* Reserved for user. */ long sstpid; /* Process ID for pid based multi-tasking. */ long ssgvup; /* Pointer to multitasking thread giveup. */ long sscray[7]; /* Reserved for Cray Research. */ long ssa0; long ssa1; long ssa2; long ssa3; long ssa4; long ssa5; long ssa6; long ssa7; long sss0; long sss1; long sss2; long sss3; long sss4; long sss5; long sss6; long sss7; }; # else /* CRAY2 */ /* The following structure defines the vector of words returned by the STKSTAT library routine. */ struct stk_stat { long now; /* Current total stack size. */ long maxc; /* Amount of contiguous space which would be required to satisfy the maximum stack demand to date. */ long high_water; /* Stack high-water mark. */ long overflows; /* Number of stack overflow ($STKOFEN) calls. */ long hits; /* Number of internal buffer hits. */ long extends; /* Number of block extensions. */ long stko_mallocs; /* Block allocations by $STKOFEN. */ long underflows; /* Number of stack underflow calls ($STKRETN). */ long stko_free; /* Number of deallocations by $STKRETN. */ long stkm_free; /* Number of deallocations by $STKMRET. */ long segments; /* Current number of stack segments. */ long maxs; /* Maximum number of stack segments so far. */ long pad_size; /* Stack pad size. */ long current_address; /* Current stack segment address. */ long current_size; /* Current stack segment size. This number is actually corrupted by STKSTAT to include the fifteen word trailer area. */ long initial_address; /* Address of initial segment. */ long initial_size; /* Size of initial segment. */ }; /* The following structure describes the data structure which trails any stack segment. I think that the description in 'asdef' is out of date. I only describe the parts that I am sure about. */ struct stk_trailer { long this_address; /* Address of this block. */ long this_size; /* Size of this block (does not include this trailer). */ long unknown2; long unknown3; long link; /* Address of trailer block of previous segment. */ long unknown5; long unknown6; long unknown7; long unknown8; long unknown9; long unknown10; long unknown11; long unknown12; long unknown13; long unknown14; }; # endif /* CRAY2 */ # endif /* not CRAY_STACK */ # ifdef CRAY2 /* Determine a "stack measure" for an arbitrary ADDRESS. I doubt that "lint" will like this much. */ static long i00afunc (long *address) { struct stk_stat status; struct stk_trailer *trailer; long *block, size; long result = 0; /* We want to iterate through all of the segments. The first step is to get the stack status structure. We could do this more quickly and more directly, perhaps, by referencing the $LM00 common block, but I know that this works. */ STKSTAT (&status); /* Set up the iteration. */ trailer = (struct stk_trailer *) (status.current_address + status.current_size - 15); /* There must be at least one stack segment. Therefore it is a fatal error if "trailer" is null. */ if (trailer == 0) abort (); /* Discard segments that do not contain our argument address. */ while (trailer != 0) { block = (long *) trailer->this_address; size = trailer->this_size; if (block == 0 || size == 0) abort (); trailer = (struct stk_trailer *) trailer->link; if ((block <= address) && (address < (block + size))) break; } /* Set the result to the offset in this segment and add the sizes of all predecessor segments. */ result = address - block; if (trailer == 0) { return result; } do { if (trailer->this_size <= 0) abort (); result += trailer->this_size; trailer = (struct stk_trailer *) trailer->link; } while (trailer != 0); /* We are done. Note that if you present a bogus address (one not in any segment), you will get a different number back, formed from subtracting the address of the first block. This is probably not what you want. */ return (result); } # else /* not CRAY2 */ /* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. Determine the number of the cell within the stack, given the address of the cell. The purpose of this routine is to linearize, in some sense, stack addresses for alloca. */ static long i00afunc (long address) { long stkl = 0; long size, pseg, this_segment, stack; long result = 0; struct stack_segment_linkage *ssptr; /* Register B67 contains the address of the end of the current stack segment. If you (as a subprogram) store your registers on the stack and find that you are past the contents of B67, you have overflowed the segment. B67 also points to the stack segment linkage control area, which is what we are really interested in. */ stkl = CRAY_STACKSEG_END (); ssptr = (struct stack_segment_linkage *) stkl; /* If one subtracts 'size' from the end of the segment, one has the address of the first word of the segment. If this is not the first segment, 'pseg' will be nonzero. */ pseg = ssptr->sspseg; size = ssptr->sssize; this_segment = stkl - size; /* It is possible that calling this routine itself caused a stack overflow. Discard stack segments which do not contain the target address. */ while (!(this_segment <= address && address <= stkl)) { # ifdef DEBUG_I00AFUNC fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); # endif if (pseg == 0) break; stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; this_segment = stkl - size; } result = address - this_segment; /* If you subtract pseg from the current end of the stack, you get the address of the previous stack segment's end. This seems a little convoluted to me, but I'll bet you save a cycle somewhere. */ while (pseg != 0) { # ifdef DEBUG_I00AFUNC fprintf (stderr, "%011o %011o\n", pseg, size); # endif stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; result += size; } return (result); } # endif /* not CRAY2 */ # endif /* CRAY */ # endif /* no alloca */ #endif /* not GCC version 2 */ blame-1.3.1/lib/calloc.c0000644000076400007640000000255210527555557011720 00000000000000/* calloc() function that is glibc compatible. This wrapper function is required at least on Tru64 UNIX 5.1. Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* written by Jim Meyering */ #include #undef calloc #include /* Allocate and zero-fill an NxS-byte block of memory from the heap. If N or S is zero, allocate and zero-fill a 1-byte block. */ void * rpl_calloc (size_t n, size_t s) { size_t bytes; if (n == 0 || s == 0) return calloc (1, 1); /* Defend against buggy calloc implementations that mishandle size_t overflow. */ bytes = n * s; if (bytes / s != n) return NULL; return calloc (n, s); } blame-1.3.1/lib/free.c0000644000076400007640000000171510527555557011404 00000000000000/* Work around incompatibility on older systems where free (NULL) fails. Copyright (C) 2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* written by Paul Eggert */ #include #undef free #include void rpl_free (void *p) { if (p) free (p); } blame-1.3.1/lib/strdup.h0000644000076400007640000000210410241344123011754 00000000000000/* strdup.h -- duplicate a string Copyright (C) 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef STRDUP_H_ #define STRDUP_H_ /* Get strdup declaration, if available. */ #include #if defined HAVE_DECL_STRDUP && !HAVE_DECL_STRDUP && !defined strdup /* Duplicate S, returning an identical malloc'd string. */ extern char *strdup (const char *s); #endif #endif /* STRDUP_H_ */ blame-1.3.1/lib/getline.h0000644000076400007640000000210610337302606012072 00000000000000/* getline.h --- Prototype for replacement getline function. Copyright (C) 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Simon Josefsson. */ /* Get size_t, FILE, ssize_t. And getline, if available. */ # include # include # include #if !HAVE_DECL_GETLINE ssize_t getline (char **lineptr, size_t *n, FILE *stream); #endif /* !HAVE_GETLINE */ blame-1.3.1/lib/strchrnul.c0000644000076400007640000000177110241344123012463 00000000000000/* Searching in a string. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Specification. */ #include "strchrnul.h" /* Find the first occurrence of C in S or the final NUL byte. */ char * strchrnul (const char *s, int c_in) { char c = c_in; while (*s && (*s != c)) s++; return (char *) s; } blame-1.3.1/lib/xmalloc.c0000644000076400007640000000646210527555560012120 00000000000000/* xmalloc.c -- malloc with out of memory checking Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #if ! HAVE_INLINE # define static_inline #endif #include "xalloc.h" #undef static_inline #include #include #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif /* 1 if calloc is known to be compatible with GNU calloc. This matters if we are not also using the calloc module, which defines HAVE_CALLOC and supports the GNU API even on non-GNU platforms. */ #if defined HAVE_CALLOC || defined __GLIBC__ enum { HAVE_GNU_CALLOC = 1 }; #else enum { HAVE_GNU_CALLOC = 0 }; #endif /* Allocate N bytes of memory dynamically, with error checking. */ void * xmalloc (size_t n) { void *p = malloc (n); if (!p && n != 0) xalloc_die (); return p; } /* Change the size of an allocated block of memory P to N bytes, with error checking. */ void * xrealloc (void *p, size_t n) { p = realloc (p, n); if (!p && n != 0) xalloc_die (); return p; } /* If P is null, allocate a block of at least *PN bytes; otherwise, reallocate P so that it contains more than *PN bytes. *PN must be nonzero unless P is null. Set *PN to the new block's size, and return the pointer to the new block. *PN is never set to zero, and the returned pointer is never null. */ void * x2realloc (void *p, size_t *pn) { return x2nrealloc (p, pn, 1); } /* Allocate S bytes of zeroed memory dynamically, with error checking. There's no need for xnzalloc (N, S), since it would be equivalent to xcalloc (N, S). */ void * xzalloc (size_t s) { return memset (xmalloc (s), 0, s); } /* Allocate zeroed memory for N elements of S bytes, with error checking. S must be nonzero. */ void * xcalloc (size_t n, size_t s) { void *p; /* Test for overflow, since some calloc implementations don't have proper overflow checks. But omit overflow and size-zero tests if HAVE_GNU_CALLOC, since GNU calloc catches overflow and never returns NULL if successful. */ if ((! HAVE_GNU_CALLOC && xalloc_oversized (n, s)) || (! (p = calloc (n, s)) && (HAVE_GNU_CALLOC || n != 0))) xalloc_die (); return p; } /* Clone an object P of size S, with error checking. There's no need for xnmemdup (P, N, S), since xmemdup (P, N * S) works without any need for an arithmetic overflow check. */ void * xmemdup (void const *p, size_t s) { return memcpy (xmalloc (s), p, s); } /* Clone STRING. */ char * xstrdup (char const *string) { return xmemdup (string, strlen (string) + 1); } blame-1.3.1/lib/argp-namefrob.h0000644000076400007640000001275610527555557013217 00000000000000/* Name frobnication for compiling argp outside of glibc Copyright (C) 1997, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !_LIBC /* This code is written for inclusion in gnu-libc, and uses names in the namespace reserved for libc. If we're not compiling in libc, define those names to be the normal ones instead. */ /* argp-parse functions */ #undef __argp_parse #define __argp_parse argp_parse #undef __option_is_end #define __option_is_end _option_is_end #undef __option_is_short #define __option_is_short _option_is_short #undef __argp_input #define __argp_input _argp_input /* argp-help functions */ #undef __argp_help #define __argp_help argp_help #undef __argp_error #define __argp_error argp_error #undef __argp_failure #define __argp_failure argp_failure #undef __argp_state_help #define __argp_state_help argp_state_help #undef __argp_usage #define __argp_usage argp_usage /* argp-fmtstream functions */ #undef __argp_make_fmtstream #define __argp_make_fmtstream argp_make_fmtstream #undef __argp_fmtstream_free #define __argp_fmtstream_free argp_fmtstream_free #undef __argp_fmtstream_putc #define __argp_fmtstream_putc argp_fmtstream_putc #undef __argp_fmtstream_puts #define __argp_fmtstream_puts argp_fmtstream_puts #undef __argp_fmtstream_write #define __argp_fmtstream_write argp_fmtstream_write #undef __argp_fmtstream_printf #define __argp_fmtstream_printf argp_fmtstream_printf #undef __argp_fmtstream_set_lmargin #define __argp_fmtstream_set_lmargin argp_fmtstream_set_lmargin #undef __argp_fmtstream_set_rmargin #define __argp_fmtstream_set_rmargin argp_fmtstream_set_rmargin #undef __argp_fmtstream_set_wmargin #define __argp_fmtstream_set_wmargin argp_fmtstream_set_wmargin #undef __argp_fmtstream_point #define __argp_fmtstream_point argp_fmtstream_point #undef __argp_fmtstream_update #define __argp_fmtstream_update _argp_fmtstream_update #undef __argp_fmtstream_ensure #define __argp_fmtstream_ensure _argp_fmtstream_ensure #undef __argp_fmtstream_lmargin #define __argp_fmtstream_lmargin argp_fmtstream_lmargin #undef __argp_fmtstream_rmargin #define __argp_fmtstream_rmargin argp_fmtstream_rmargin #undef __argp_fmtstream_wmargin #define __argp_fmtstream_wmargin argp_fmtstream_wmargin #include "mempcpy.h" #include "strcase.h" #include "strchrnul.h" #include "strndup.h" /* normal libc functions we call */ #undef __flockfile #define __flockfile flockfile #undef __funlockfile #define __funlockfile funlockfile #undef __mempcpy #define __mempcpy mempcpy #undef __sleep #define __sleep sleep #undef __strcasecmp #define __strcasecmp strcasecmp #undef __strchrnul #define __strchrnul strchrnul #undef __strerror_r #define __strerror_r strerror_r #undef __strndup #define __strndup strndup #undef __vsnprintf #define __vsnprintf vsnprintf #if defined(HAVE_DECL_CLEARERR_UNLOCKED) && !HAVE_DECL_CLEARERR_UNLOCKED # define clearerr_unlocked(x) clearerr (x) #endif #if defined(HAVE_DECL_FEOF_UNLOCKED) && !HAVE_DECL_FEOF_UNLOCKED # define feof_unlocked(x) feof (x) # endif #if defined(HAVE_DECL_FERROR_UNLOCKED) && !HAVE_DECL_FERROR_UNLOCKED # define ferror_unlocked(x) ferror (x) # endif #if defined(HAVE_DECL_FFLUSH_UNLOCKED) && !HAVE_DECL_FFLUSH_UNLOCKED # define fflush_unlocked(x) fflush (x) # endif #if defined(HAVE_DECL_FGETS_UNLOCKED) && !HAVE_DECL_FGETS_UNLOCKED # define fgets_unlocked(x,y,z) fgets (x,y,z) # endif #if defined(HAVE_DECL_FPUTC_UNLOCKED) && !HAVE_DECL_FPUTC_UNLOCKED # define fputc_unlocked(x,y) fputc (x,y) # endif #if defined(HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED # define fputs_unlocked(x,y) fputs (x,y) # endif #if defined(HAVE_DECL_FREAD_UNLOCKED) && !HAVE_DECL_FREAD_UNLOCKED # define fread_unlocked(w,x,y,z) fread (w,x,y,z) # endif #if defined(HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED # define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z) # endif #if defined(HAVE_DECL_GETC_UNLOCKED) && !HAVE_DECL_GETC_UNLOCKED # define getc_unlocked(x) getc (x) # endif #if defined(HAVE_DECL_GETCHAR_UNLOCKED) && !HAVE_DECL_GETCHAR_UNLOCKED # define getchar_unlocked() getchar () # endif #if defined(HAVE_DECL_PUTC_UNLOCKED) && !HAVE_DECL_PUTC_UNLOCKED # define putc_unlocked(x,y) putc (x,y) # endif #if defined(HAVE_DECL_PUTCHAR_UNLOCKED) && !HAVE_DECL_PUTCHAR_UNLOCKED # define putchar_unlocked(x) putchar (x) # endif #endif /* !_LIBC */ #ifndef __set_errno #define __set_errno(e) (errno = (e)) #endif #if defined GNULIB_ARGP_DISABLE_DIRNAME # define __argp_base_name(arg) arg #elif defined GNULIB_ARGP_EXTERN_BASENAME extern char *__argp_base_name(const char *arg); #else # include "dirname.h" # define __argp_base_name base_name #endif #if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME # define __argp_short_program_name() (program_invocation_short_name) #else extern char *__argp_short_program_name (void); #endif blame-1.3.1/lib/getdelim.c0000644000076400007640000000562210527555557012256 00000000000000/* getdelim.c --- Implementation of replacement getdelim function. Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Ported from glibc by Simon Josefsson. */ #include #include "getdelim.h" #include #include #include #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif #ifndef SSIZE_MAX # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) #endif #if !HAVE_FLOCKFILE # undef flockfile # define flockfile(x) ((void) 0) #endif #if !HAVE_FUNLOCKFILE # undef funlockfile # define funlockfile(x) ((void) 0) #endif /* Read up to (and including) a DELIMITER from FP into *LINEPTR (and NUL-terminate it). *LINEPTR is a pointer returned from malloc (or NULL), pointing to *N characters of space. It is realloc'ed as necessary. Returns the number of characters read (not including the null terminator), or -1 on error or EOF. */ ssize_t getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp) { ssize_t result; size_t cur_len = 0; if (lineptr == NULL || n == NULL || fp == NULL) { errno = EINVAL; return -1; } flockfile (fp); if (*lineptr == NULL || *n == 0) { *n = 120; *lineptr = (char *) malloc (*n); if (*lineptr == NULL) { result = -1; goto unlock_return; } } for (;;) { int i; i = getc (fp); if (i == EOF) { result = -1; break; } /* Make enough space for len+1 (for final NUL) bytes. */ if (cur_len + 1 >= *n) { size_t needed_max = SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX; size_t needed = 2 * *n + 1; /* Be generous. */ char *new_lineptr; if (needed_max < needed) needed = needed_max; if (cur_len + 1 >= needed) { result = -1; goto unlock_return; } new_lineptr = (char *) realloc (*lineptr, needed); if (new_lineptr == NULL) { result = -1; goto unlock_return; } *lineptr = new_lineptr; *n = needed; } (*lineptr)[cur_len] = i; cur_len++; if (i == delimiter) break; } (*lineptr)[cur_len] = '\0'; result = cur_len ? cur_len : result; unlock_return: funlockfile (fp); return result; } blame-1.3.1/aclocal.m40000664000076400007640000010775010531540104011372 00000000000000# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # uintmax_t.m4 serial 9 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. AC_PREREQ(2.13) # Define uintmax_t to 'unsigned long' or 'unsigned long long' # if it is not already defined in or . AC_DEFUN([gl_AC_TYPE_UINTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG]) test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, [Define to unsigned long or unsigned long long if and don't define.]) else AC_DEFINE(HAVE_UINTMAX_T, 1, [Define if you have the 'uintmax_t' type in or .]) fi ]) # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ(2.50)dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 AC_DEFUN([AM_C_PROTOTYPES], [AC_REQUIRE([AC_C_PROTOTYPES]) if test "$ac_cv_prog_cc_stdc" != no; then U= ANSI2KNR= else U=_ ANSI2KNR=./ansi2knr fi # Ensure some checks needed by ansi2knr itself. AC_REQUIRE([AC_HEADER_STDC]) AC_CHECK_HEADERS(string.h) AC_SUBST(U)dnl AC_SUBST(ANSI2KNR)dnl ]) AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/absolute-header.m4]) m4_include([m4/alloca.m4]) m4_include([m4/allocsa.m4]) m4_include([m4/argp.m4]) m4_include([m4/calloc.m4]) m4_include([m4/canonicalize.m4]) m4_include([m4/cycle-check.m4]) m4_include([m4/d-ino.m4]) m4_include([m4/dirname.m4]) m4_include([m4/dos.m4]) m4_include([m4/double-slash-root.m4]) m4_include([m4/eealloc.m4]) m4_include([m4/eoverflow.m4]) m4_include([m4/error.m4]) m4_include([m4/exitfail.m4]) m4_include([m4/extensions.m4]) m4_include([m4/filenamecat.m4]) m4_include([m4/free.m4]) m4_include([m4/getcwd-abort-bug.m4]) m4_include([m4/getcwd-path-max.m4]) m4_include([m4/getcwd.m4]) m4_include([m4/getdelim.m4]) m4_include([m4/getline.m4]) m4_include([m4/getopt.m4]) m4_include([m4/gettimeofday.m4]) m4_include([m4/gnulib-comp.m4]) m4_include([m4/inline.m4]) m4_include([m4/intmax_t.m4]) m4_include([m4/inttypes_h.m4]) m4_include([m4/langinfo.m4]) m4_include([m4/longdouble.m4]) m4_include([m4/longlong.m4]) m4_include([m4/lstat.m4]) m4_include([m4/mbchar.m4]) m4_include([m4/mbiter.m4]) m4_include([m4/mbrtowc.m4]) m4_include([m4/mbstate_t.m4]) m4_include([m4/memchr.m4]) m4_include([m4/memcmp.m4]) m4_include([m4/memcpy.m4]) m4_include([m4/memmove.m4]) m4_include([m4/mempcpy.m4]) m4_include([m4/memset.m4]) m4_include([m4/minmax.m4]) m4_include([m4/mktime.m4]) m4_include([m4/onceonly_2_57.m4]) m4_include([m4/pathmax.m4]) m4_include([m4/readlink.m4]) m4_include([m4/setenv.m4]) m4_include([m4/size_max.m4]) m4_include([m4/ssize_t.m4]) m4_include([m4/stdbool.m4]) m4_include([m4/stdint.m4]) m4_include([m4/stdint_h.m4]) m4_include([m4/strcase.m4]) m4_include([m4/strchrnul.m4]) m4_include([m4/strdup.m4]) m4_include([m4/strftime.m4]) m4_include([m4/strndup.m4]) m4_include([m4/strnlen.m4]) m4_include([m4/strpbrk.m4]) m4_include([m4/strstr.m4]) m4_include([m4/strtol.m4]) m4_include([m4/strtoul.m4]) m4_include([m4/sys_stat_h.m4]) m4_include([m4/sysexits.m4]) m4_include([m4/time_r.m4]) m4_include([m4/tm_gmtoff.m4]) m4_include([m4/tzset.m4]) m4_include([m4/ulonglong.m4]) m4_include([m4/unistd_h.m4]) m4_include([m4/unlocked-io.m4]) m4_include([m4/vasnprintf.m4]) m4_include([m4/vsnprintf.m4]) m4_include([m4/wchar_t.m4]) m4_include([m4/wcwidth.m4]) m4_include([m4/wint_t.m4]) m4_include([m4/xalloc.m4]) m4_include([m4/xgetcwd.m4]) m4_include([m4/xreadlink.m4]) m4_include([m4/xsize.m4]) m4_include([m4/xstrndup.m4]) blame-1.3.1/Makefile.in0000644000076400007640000005644710531540111011601 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Process this file with automake to produce a Makefile. srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = README $(am__configure_deps) $(dist_noinst_DATA) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/blame.spec.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ config.guess config.rpath config.sub depcomp install-sh \ missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/allocsa.m4 \ $(top_srcdir)/m4/argp.m4 $(top_srcdir)/m4/calloc.m4 \ $(top_srcdir)/m4/canonicalize.m4 \ $(top_srcdir)/m4/cycle-check.m4 $(top_srcdir)/m4/d-ino.m4 \ $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ $(top_srcdir)/m4/double-slash-root.m4 \ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/eoverflow.m4 \ $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exitfail.m4 \ $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/filenamecat.m4 \ $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/getcwd-abort-bug.m4 \ $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ $(top_srcdir)/m4/getdelim.m4 $(top_srcdir)/m4/getline.m4 \ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/inline.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ $(top_srcdir)/m4/langinfo.m4 $(top_srcdir)/m4/longdouble.m4 \ $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memcmp.m4 \ $(top_srcdir)/m4/memcpy.m4 $(top_srcdir)/m4/memmove.m4 \ $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memset.m4 \ $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mktime.m4 \ $(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/pathmax.m4 \ $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/setenv.m4 \ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/ssize_t.m4 \ $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stdint.m4 \ $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcase.m4 \ $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \ $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strpbrk.m4 \ $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtol.m4 \ $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ $(top_srcdir)/m4/sysexits.m4 $(top_srcdir)/m4/time_r.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/tzset.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/unistd_h.m4 \ $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vsnprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \ $(top_srcdir)/m4/xreadlink.m4 $(top_srcdir)/m4/xsize.m4 \ $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = blame.spec SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive DATA = $(dist_noinst_DATA) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ FASTEXIT = @FASTEXIT@ FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR = @FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR@ GCC_FALSE = @GCC_FALSE@ GCC_TRUE = @GCC_TRUE@ GETOPT_H = @GETOPT_H@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ 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_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE__BOOL = @HAVE__BOOL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBMISC_LIBDEPS = @LIBMISC_LIBDEPS@ LIBMISC_LTLIBDEPS = @LIBMISC_LTLIBDEPS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYSEXITS_H = @SYSEXITS_H@ SYS_STAT_H = @SYS_STAT_H@ U = @U@ UNISTD_H = @UNISTD_H@ VERSION = @VERSION@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = doc lib src tests AM_ETAGSFLAGS = --c-kinds=+lx ACLOCAL_AMFLAGS = -I m4 dist_noinst_DATA = blame.spec RPMBUILD_FLAGS = all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 blame.spec: $(top_builddir)/config.status $(srcdir)/blame.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/. $(distdir)/m4 $(distdir)/tests @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-recursive ctags \ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ dist-tarZ dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-recursive distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-recursive pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-info-am rpm: $(PACKAGE).spec dist rpmbuild $(RPMBUILD_FLAGS) -ta $(distdir).tar.gz mock: mock-fc6 mock-fc5 mock-fc4 mock-fc6: $(PACKAGE).spec dist-gzip TOPDIR="`rpm -E %_topdir`" || exit 1 && \ rpmbuild --define='fedora 6' --define='dist .fc6' --nodeps -ts $(distdir).tar.gz && \ mock -r fedora-6-i386-core.cfg --debug "$$TOPDIR/SRPMS/$(PACKAGE)-$(VERSION)-$(RELEASE).fc6.src.rpm" mock-fc5: $(PACKAGE).spec dist-gzip TOPDIR="`rpm -E %_topdir`" || exit 1 && \ rpmbuild --define='fedora 5' --define='dist .fc5' --nodeps -ts $(distdir).tar.gz && \ mock -r fedora-5-i386-core.cfg --debug "$$TOPDIR/SRPMS/$(PACKAGE)-$(VERSION)-$(RELEASE).fc5.src.rpm" mock-fc4: $(PACKAGE).spec dist-gzip TOPDIR="`rpm -E %_topdir`" || exit 1 && \ rpmbuild --define='fedora 4' --define='dist .fc4' --nodeps -ts $(distdir).tar.gz && \ mock -r fedora-4-i386-core.cfg --debug "$$TOPDIR/SRPMS/$(PACKAGE)-$(VERSION)-$(RELEASE).fc4.src.rpm" $(PACKAGE).spec: NEWS # 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. .NOEXPORT: blame-1.3.1/m4/0000777000076400007640000000000010531540135010126 500000000000000blame-1.3.1/m4/minmax.m40000644000076400007640000000233510337302611011577 00000000000000# minmax.m4 serial 2 dnl Copyright (C) 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_PREREQ(2.52) AC_DEFUN([gl_MINMAX], [ AC_REQUIRE([gl_PREREQ_MINMAX]) ]) # Prerequisites of lib/minmax.h. AC_DEFUN([gl_PREREQ_MINMAX], [ gl_MINMAX_IN_HEADER([limits.h]) gl_MINMAX_IN_HEADER([sys/param.h]) ]) dnl gl_MINMAX_IN_HEADER(HEADER) dnl The parameter has to be a literal header name; it cannot be macro, dnl nor a shell variable. (Because autoheader collects only AC_DEFINE dnl invocations with a literal macro name.) AC_DEFUN([gl_MINMAX_IN_HEADER], [ m4_pushdef([header], AS_TR_SH([$1])) m4_pushdef([HEADER], AS_TR_CPP([$1])) AC_CACHE_CHECK([whether <$1> defines MIN and MAX], [gl_cv_minmax_in_]header, [AC_TRY_COMPILE([#include <$1> int x = MIN (42, 17);], [], [gl_cv_minmax_in_]header[=yes], [gl_cv_minmax_in_]header[=no])]) if test $gl_cv_minmax_in_[]header = yes; then AC_DEFINE([HAVE_MINMAX_IN_]HEADER, 1, [Define to 1 if <$1> defines the MIN and MAX macros.]) fi m4_popdef([HEADER]) m4_popdef([header]) ]) blame-1.3.1/m4/vsnprintf.m40000644000076400007640000000073710203114524012337 00000000000000# vsnprintf.m4 serial 2 dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_VSNPRINTF], [ AC_REPLACE_FUNCS(vsnprintf) AC_CHECK_DECLS_ONCE(vsnprintf) gl_PREREQ_VSNPRINTF ]) # Prerequisites of lib/vsnprintf.c. AC_DEFUN([gl_PREREQ_VSNPRINTF], [:]) blame-1.3.1/m4/unistd_h.m40000644000076400007640000000074110527555557012146 00000000000000# unistd_h.m4 serial 2 dnl Copyright (C) 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Simon Josefsson AC_DEFUN([gl_HEADER_UNISTD], [ dnl Prerequisites of lib/unistd.h. AC_CHECK_HEADERS([unistd.h], [ UNISTD_H='' ], [ UNISTD_H='unistd.h' ]) AC_SUBST(UNISTD_H) ]) blame-1.3.1/m4/strtoul.m40000644000076400007640000000052210527555560012034 00000000000000# strtoul.m4 serial 3 dnl Copyright (C) 2002, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRTOUL], [ AC_REPLACE_FUNCS(strtoul) ]) blame-1.3.1/m4/gnulib-comp.m40000644000076400007640000001677610527555571012560 00000000000000# DO NOT EDIT! GENERATED AUTOMATICALLY! # Copyright (C) 2004-2006 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # # This file represents the compiled summary of the specification in # gnulib-cache.m4. It lists the computed macro invocations that need # to be invoked from configure.ac. # In projects using CVS, this file can be treated like other built files. # This macro should be invoked from ./configure.ac, in the section # "Checks for programs", right after AC_PROG_CC, and certainly before # any checks for libraries, header files, types and library functions. AC_DEFUN([gl_EARLY], [ m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace m4_pattern_allow([^gl_ES$])dnl a valid locale name m4_pattern_allow([^gl_LIBOBJS$])dnl a variable m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable AC_REQUIRE([AC_PROG_RANLIB]) AC_REQUIRE([AC_GNU_SOURCE]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) ]) # This macro should be invoked from ./configure.ac, in the section # "Check for header files, types and library functions". AC_DEFUN([gl_INIT], [ m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ])) m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS])) m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES])) AM_CONDITIONAL([GL_COND_LIBTOOL], [false]) gl_cond_libtool=false gl_libdeps= gl_ltlibdeps= gl_source_base='lib' gl_FUNC_ALLOCA gl_ALLOCSA gl_ARGP AC_FUNC_CALLOC AC_FUNC_CANONICALIZE_FILE_NAME gl_CYCLE_CHECK gl_CHECK_TYPE_STRUCT_DIRENT_D_INO gl_DIRNAME gl_ERROR gl_EXITFAIL dnl gl_USE_SYSTEM_EXTENSIONS must be added quite early to configure.ac. gl_FILE_NAME_CONCAT gl_FUNC_FREE gl_FUNC_GETCWD gl_FUNC_GETDELIM gl_FUNC_GETLINE gl_GETOPT AC_FUNC_GETTIMEOFDAY_CLOBBER gl_INLINE gl_FUNC_LSTAT AC_FUNC_MALLOC gl_MBCHAR gl_MBITER gl_FUNC_MEMCHR gl_FUNC_MEMCMP gl_FUNC_MEMCPY gl_FUNC_MEMMOVE gl_FUNC_MEMPCPY gl_FUNC_MEMSET gl_MINMAX gl_FUNC_MKTIME AC_FUNC_OBSTACK dnl Note: AC_FUNC_OBSTACK does AC_LIBSOURCES([obstack.h, obstack.c]). gl_PATHMAX gl_FUNC_READLINK AC_FUNC_REALLOC gt_FUNC_SETENV gl_SIZE_MAX gt_TYPE_SSIZE_T AM_STDBOOL_H gl_STDINT_H gl_STRCASE gl_FUNC_STRCHRNUL gl_FUNC_STRDUP gl_FUNC_GNU_STRFTIME gl_FUNC_STRNDUP gl_FUNC_STRNLEN gl_FUNC_STRPBRK gl_FUNC_STRSTR gl_FUNC_STRTOL gl_FUNC_STRTOUL gl_HEADER_SYS_STAT_H gl_SYSEXITS gl_TIME_R gl_FUNC_TZSET_CLOBBER gl_HEADER_UNISTD gl_FUNC_GLIBC_UNLOCKED_IO gl_FUNC_VASNPRINTF gl_FUNC_VSNPRINTF gl_FUNC_WCWIDTH gl_XALLOC gl_XGETCWD gl_XREADLINK gl_XSIZE gl_XSTRNDUP LIBMISC_LIBDEPS="$gl_libdeps" AC_SUBST([LIBMISC_LIBDEPS]) LIBMISC_LTLIBDEPS="$gl_ltlibdeps" AC_SUBST([LIBMISC_LTLIBDEPS]) m4_popdef([AC_LIBSOURCES]) m4_popdef([AC_REPLACE_FUNCS]) m4_popdef([AC_LIBOBJ]) AC_CONFIG_COMMANDS_PRE([ gl_libobjs= gl_ltlibobjs= if test -n "$gl_LIBOBJS"; then # Remove the extension. sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do gl_libobjs="$gl_libobjs $i.$ac_objext" gl_ltlibobjs="$gl_ltlibobjs $i.lo" done fi AC_SUBST([gl_LIBOBJS], [$gl_libobjs]) AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs]) ]) ]) # Like AC_LIBOBJ, except that the module name goes # into gl_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gl_LIBOBJ], [gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"]) # Like AC_REPLACE_FUNCS, except that the module name goes # into gl_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gl_REPLACE_FUNCS], [AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])]) # Like AC_LIBSOURCES, except that it does nothing. # We rely on EXTRA_lib..._SOURCES instead. AC_DEFUN([gl_LIBSOURCES], []) # This macro records the list of files which have been installed by # gnulib-tool and may be removed by future gnulib-tool invocations. AC_DEFUN([gl_FILE_LIST], [ lib/alloca.c lib/alloca_.h lib/allocsa.c lib/allocsa.h lib/allocsa.valgrind lib/argp-ba.c lib/argp-eexst.c lib/argp-fmtstream.c lib/argp-fmtstream.h lib/argp-fs-xinl.c lib/argp-help.c lib/argp-namefrob.h lib/argp-parse.c lib/argp-pin.c lib/argp-pv.c lib/argp-pvh.c lib/argp-xinl.c lib/argp.h lib/asnprintf.c lib/basename.c lib/calloc.c lib/canonicalize.c lib/canonicalize.h lib/cycle-check.c lib/cycle-check.h lib/dev-ino.h lib/dirname.c lib/dirname.h lib/error.c lib/error.h lib/exit.h lib/exitfail.c lib/exitfail.h lib/filenamecat.c lib/filenamecat.h lib/free.c lib/getcwd.c lib/getcwd.h lib/getdelim.c lib/getdelim.h lib/getline.c lib/getline.h lib/getopt.c lib/getopt1.c lib/getopt_.h lib/getopt_int.h lib/gettext.h lib/gettimeofday.c lib/lstat.c lib/lstat.h lib/malloc.c lib/mbchar.c lib/mbchar.h lib/mbuiter.h lib/memchr.c lib/memcmp.c lib/memcpy.c lib/memmove.c lib/mempcpy.c lib/mempcpy.h lib/memset.c lib/minmax.h lib/mktime.c lib/obstack.c lib/obstack.h lib/pathmax.h lib/printf-args.c lib/printf-args.h lib/printf-parse.c lib/printf-parse.h lib/progname.c lib/progname.h lib/readlink.c lib/realloc.c lib/same-inode.h lib/setenv.c lib/setenv.h lib/size_max.h lib/stat_.h lib/stdbool_.h lib/stdint_.h lib/strcase.h lib/strcasecmp.c lib/strchrnul.c lib/strchrnul.h lib/strdup.c lib/strdup.h lib/strftime.c lib/strftime.h lib/stripslash.c lib/strncasecmp.c lib/strndup.c lib/strndup.h lib/strnlen.c lib/strnlen.h lib/strnlen1.c lib/strnlen1.h lib/strpbrk.c lib/strpbrk.h lib/strstr.c lib/strstr.h lib/strtol.c lib/strtoul.c lib/sysexit_.h lib/time_r.c lib/time_r.h lib/unlocked-io.h lib/unsetenv.c lib/vasnprintf.c lib/vasnprintf.h lib/vsnprintf.c lib/vsnprintf.h lib/wcwidth.h lib/xalloc-die.c lib/xalloc.h lib/xgetcwd.c lib/xgetcwd.h lib/xmalloc.c lib/xreadlink.c lib/xreadlink.h lib/xsize.h lib/xstrndup.c lib/xstrndup.h m4/absolute-header.m4 m4/alloca.m4 m4/allocsa.m4 m4/argp.m4 m4/calloc.m4 m4/canonicalize.m4 m4/cycle-check.m4 m4/d-ino.m4 m4/dirname.m4 m4/dos.m4 m4/double-slash-root.m4 m4/eealloc.m4 m4/eoverflow.m4 m4/error.m4 m4/exitfail.m4 m4/extensions.m4 m4/filenamecat.m4 m4/free.m4 m4/getcwd-abort-bug.m4 m4/getcwd-path-max.m4 m4/getcwd.m4 m4/getdelim.m4 m4/getline.m4 m4/getopt.m4 m4/gettimeofday.m4 m4/inline.m4 m4/intmax_t.m4 m4/inttypes_h.m4 m4/longdouble.m4 m4/longlong.m4 m4/lstat.m4 m4/mbchar.m4 m4/mbiter.m4 m4/mbrtowc.m4 m4/mbstate_t.m4 m4/memchr.m4 m4/memcmp.m4 m4/memcpy.m4 m4/memmove.m4 m4/mempcpy.m4 m4/memset.m4 m4/minmax.m4 m4/mktime.m4 m4/onceonly_2_57.m4 m4/pathmax.m4 m4/readlink.m4 m4/setenv.m4 m4/size_max.m4 m4/ssize_t.m4 m4/stdbool.m4 m4/stdint.m4 m4/stdint_h.m4 m4/strcase.m4 m4/strchrnul.m4 m4/strdup.m4 m4/strftime.m4 m4/strndup.m4 m4/strnlen.m4 m4/strpbrk.m4 m4/strstr.m4 m4/strtol.m4 m4/strtoul.m4 m4/sys_stat_h.m4 m4/sysexits.m4 m4/time_r.m4 m4/tm_gmtoff.m4 m4/tzset.m4 m4/ulonglong.m4 m4/unistd_h.m4 m4/unlocked-io.m4 m4/vasnprintf.m4 m4/vsnprintf.m4 m4/wchar_t.m4 m4/wcwidth.m4 m4/wint_t.m4 m4/xalloc.m4 m4/xgetcwd.m4 m4/xreadlink.m4 m4/xsize.m4 m4/xstrndup.m4 ]) blame-1.3.1/m4/ssize_t.m40000644000076400007640000000136210527555560012003 00000000000000# ssize_t.m4 serial 4 (gettext-0.15) dnl Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether ssize_t is defined. AC_DEFUN([gt_TYPE_SSIZE_T], [ AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t], [AC_TRY_COMPILE([#include ], [int x = sizeof (ssize_t *) + sizeof (ssize_t); return !x;], [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])]) if test $gt_cv_ssize_t = no; then AC_DEFINE([ssize_t], [int], [Define as a signed type of the same size as size_t.]) fi ]) blame-1.3.1/m4/sysexits.m40000644000076400007640000000063210203114523012172 00000000000000# sysexits.m4 serial 2 dnl Copyright (C) 2003,2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_SYSEXITS], [ AC_CHECK_HEADERS(sysexits.h, [SYSEXITS_H=], [SYSEXITS_H=sysexits.h]) AC_SUBST([SYSEXITS_H]) ]) blame-1.3.1/m4/memchr.m40000644000076400007640000000077010203114520011552 00000000000000# memchr.m4 serial 4 dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_MEMCHR], [ AC_REPLACE_FUNCS(memchr) if test $ac_cv_func_memchr = no; then gl_PREREQ_MEMCHR fi ]) # Prerequisites of lib/memchr.c. AC_DEFUN([gl_PREREQ_MEMCHR], [ AC_CHECK_HEADERS(bp-sym.h) ]) blame-1.3.1/m4/extensions.m40000644000076400007640000000365310527555560012527 00000000000000# serial 4 -*- Autoconf -*- # Enable extensions on systems that normally disable them. # Copyright (C) 2003, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS # Autoconf. Perhaps we can remove this once we can assume Autoconf # 2.61 or later everywhere, but since CVS Autoconf mutates rapidly # enough in this area it's likely we'll need to redefine # AC_USE_SYSTEM_EXTENSIONS for quite some time. # AC_USE_SYSTEM_EXTENSIONS # ------------------------ # Enable extensions on systems that normally disable them, # typically due to standards-conformance issues. AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], [ AC_BEFORE([$0], [AC_COMPILE_IFELSE]) AC_BEFORE([$0], [AC_RUN_IFELSE]) AC_REQUIRE([AC_GNU_SOURCE]) AC_REQUIRE([AC_AIX]) AC_REQUIRE([AC_MINIX]) AH_VERBATIM([__EXTENSIONS__], [/* Enable extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif]) AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], [ac_cv_safe_to_define___extensions__], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([ # define __EXTENSIONS__ 1 AC_INCLUDES_DEFAULT])], [ac_cv_safe_to_define___extensions__=yes], [ac_cv_safe_to_define___extensions__=no])]) test $ac_cv_safe_to_define___extensions__ = yes && AC_DEFINE([__EXTENSIONS__]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) AC_DEFINE([_TANDEM_SOURCE]) ]) # gl_USE_SYSTEM_EXTENSIONS # ------------------------ # Enable extensions on systems that normally disable them, # typically due to standards-conformance issues. AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])]) blame-1.3.1/m4/vasnprintf.m40000644000076400007640000000276310527555560012523 00000000000000# vasnprintf.m4 serial 7 dnl Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_VASNPRINTF], [ AC_REQUIRE([gl_EOVERFLOW]) AC_REPLACE_FUNCS(vasnprintf) if test $ac_cv_func_vasnprintf = no; then AC_LIBOBJ(printf-args) AC_LIBOBJ(printf-parse) AC_LIBOBJ(asnprintf) gl_PREREQ_PRINTF_ARGS gl_PREREQ_PRINTF_PARSE gl_PREREQ_VASNPRINTF gl_PREREQ_ASNPRINTF fi ]) # Prequisites of lib/printf-args.h, lib/printf-args.c. AC_DEFUN([gl_PREREQ_PRINTF_ARGS], [ AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_LONGDOUBLE]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) ]) # Prequisites of lib/printf-parse.h, lib/printf-parse.c. AC_DEFUN([gl_PREREQ_PRINTF_PARSE], [ AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_LONGDOUBLE]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_REQUIRE([AC_TYPE_SIZE_T]) AC_CHECK_TYPES(ptrdiff_t) AC_REQUIRE([gt_AC_TYPE_INTMAX_T]) ]) # Prerequisites of lib/vasnprintf.c. AC_DEFUN([gl_PREREQ_VASNPRINTF], [ AC_REQUIRE([AC_FUNC_ALLOCA]) AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_LONGDOUBLE]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_CHECK_FUNCS(snprintf wcslen) ]) # Prerequisites of lib/asnprintf.c. AC_DEFUN([gl_PREREQ_ASNPRINTF], [ ]) blame-1.3.1/m4/wint_t.m40000644000076400007640000000130410203114524011601 00000000000000# wint_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wint_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, [AC_TRY_COMPILE([#include wint_t foo = (wchar_t)'\0';], , gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) if test $gt_cv_c_wint_t = yes; then AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) fi ]) blame-1.3.1/m4/mbiter.m40000664000076400007640000000105310337302572011574 00000000000000# mbiter.m4 serial 2 dnl Copyright (C) 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl autoconf tests required for use of mbiter.h dnl From Bruno Haible. AC_DEFUN([gl_MBITER], [ AC_REQUIRE([AC_TYPE_MBSTATE_T]) dnl The following line is that so the user can test HAVE_MBRTOWC before dnl #include "mbiter.h" or "mbuiter.h". AC_REQUIRE([gl_FUNC_MBRTOWC]) : ]) blame-1.3.1/m4/getopt.m40000644000076400007640000000471610527555560011633 00000000000000# getopt.m4 serial 13 dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # The getopt module assume you want GNU getopt, with getopt_long etc, # rather than vanilla POSIX getopt. This means your code should # always include for the getopt prototypes. AC_DEFUN([gl_GETOPT_SUBSTITUTE], [ AC_LIBOBJ([getopt]) AC_LIBOBJ([getopt1]) gl_GETOPT_SUBSTITUTE_HEADER gl_PREREQ_GETOPT ]) AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], [ GETOPT_H=getopt.h AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], [Define to rpl_ if the getopt replacement functions and variables should be used.]) AC_SUBST([GETOPT_H]) ]) AC_DEFUN([gl_GETOPT_CHECK_HEADERS], [ if test -z "$GETOPT_H"; then AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h]) fi if test -z "$GETOPT_H"; then AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h]) fi dnl BSD getopt_long uses an incompatible method to reset option processing, dnl and (as of 2004-10-15) mishandles optional option-arguments. if test -z "$GETOPT_H"; then AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include ]) fi dnl Solaris 10 getopt doesn't handle `+' as a leading character in an dnl option string (as of 2005-05-05). if test -z "$GETOPT_H"; then AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt], [AC_RUN_IFELSE( [AC_LANG_PROGRAM([#include ], [[ char *myargv[3]; myargv[0] = "conftest"; myargv[1] = "-+"; myargv[2] = 0; return getopt (2, myargv, "+a") != '?'; ]])], [gl_cv_func_gnu_getopt=yes], [gl_cv_func_gnu_getopt=no], [dnl cross compiling - pessimistically guess based on decls dnl Solaris 10 getopt doesn't handle `+' as a leading character in an dnl option string (as of 2005-05-05). AC_CHECK_DECL([getopt_clip], [gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes], [#include ])])]) if test "$gl_cv_func_gnu_getopt" = "no"; then GETOPT_H=getopt.h fi fi ]) AC_DEFUN([gl_GETOPT_IFELSE], [ AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) AS_IF([test -n "$GETOPT_H"], [$1], [$2]) ]) AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])]) # Prerequisites of lib/getopt*. AC_DEFUN([gl_PREREQ_GETOPT], [ AC_CHECK_DECLS_ONCE([getenv]) ]) blame-1.3.1/m4/wcwidth.m40000644000076400007640000000165310527555557012005 00000000000000# wcwidth.m4 serial 6 dnl Copyright (C) 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_WCWIDTH], [ dnl Persuade glibc to declare wcwidth(). AC_REQUIRE([AC_GNU_SOURCE]) AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_CHECK_HEADERS_ONCE([wchar.h wctype.h]) AC_CHECK_FUNCS_ONCE([iswprint wcwidth]) AC_CHECK_DECLS([wcwidth], [], [], [ /* AIX 3.2.5 declares wcwidth in . */ #include #if HAVE_WCHAR_H /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.1 has a bug: and must be included before . */ # include # include # include #endif ])]) blame-1.3.1/m4/filenamecat.m40000644000076400007640000000066510527555560012600 00000000000000# filenamecat.m4 serial 8 dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FILE_NAME_CONCAT], [ AC_LIBOBJ([filenamecat]) dnl Prerequisites of lib/filenamecat.c. AC_CHECK_FUNCS_ONCE(mempcpy) ]) blame-1.3.1/m4/memcmp.m40000644000076400007640000000112410203114520011547 00000000000000# memcmp.m4 serial 11 dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_MEMCMP], [ AC_REQUIRE([AC_FUNC_MEMCMP]) if test $ac_cv_func_memcmp_working = no; then AC_DEFINE(memcmp, rpl_memcmp, [Define to rpl_memcmp if the replacement function should be used.]) gl_PREREQ_MEMCMP fi ]) # Prerequisites of lib/memcmp.c. AC_DEFUN([gl_PREREQ_MEMCMP], [:]) blame-1.3.1/m4/getcwd-abort-bug.m40000644000076400007640000000555710527555557013500 00000000000000#serial 1 # Determine whether getcwd aborts when the length of the working directory # name is unusually large. Any length between 4k and 16k trigger the bug # when using glibc-2.4.90-9 or older. # Copyright (C) 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # From Jim Meyering # gl_FUNC_GETCWD_ABORT_BUG([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) AC_DEFUN([gl_FUNC_GETCWD_ABORT_BUG], [ AC_CHECK_DECLS_ONCE(getcwd) AC_CHECK_FUNCS(getpagesize) AC_CACHE_CHECK([whether getcwd aborts when 4k < cwd_length < 16k], gl_cv_func_getcwd_abort_bug, [# Remove any remnants of a previous test. rm -rf confdir-14B--- # Arrange for deletion of the temporary directory this test creates. ac_clean_files="$ac_clean_files confdir-14B---" AC_RUN_IFELSE( [AC_LANG_SOURCE( [[ #include #include #include #include #include /* Don't get link errors because mkdir is redefined to rpl_mkdir. */ #undef mkdir #ifndef S_IRWXU # define S_IRWXU 0700 #endif /* FIXME: skip the run-test altogether on systems without getpagesize. */ #if ! HAVE_GETPAGESIZE # define getpagesize() 0 #endif /* This size is chosen to be larger than PATH_MAX (4k), yet smaller than the 16kB pagesize on ia64 linux. Those conditions make the code below trigger a bug in glibc's getcwd implementation before 2.4.90-10. */ #define TARGET_LEN (5 * 1024) int main () { char const *dir_name = "confdir-14B---"; char *cwd; size_t initial_cwd_len; int fail = 0; size_t desired_depth; size_t d; /* The bug is triggered when PATH_MAX < getpagesize (), so skip this relative expensive and invasive test if that's not true. */ if (getpagesize () <= PATH_MAX) return 0; cwd = getcwd (NULL, 0); if (cwd == NULL) return 0; initial_cwd_len = strlen (cwd); free (cwd); desired_depth = ((TARGET_LEN - 1 - initial_cwd_len) / (1 + strlen (dir_name))); for (d = 0; d < desired_depth; d++) { if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0) { fail = 3; /* Unable to construct deep hierarchy. */ break; } } /* If libc has the bug in question, this invocation of getcwd results in a failed assertion. */ cwd = getcwd (NULL, 0); if (cwd == NULL) fail = 4; /* getcwd failed. This is ok, and expected. */ free (cwd); /* Call rmdir first, in case the above chdir failed. */ rmdir (dir_name); while (0 < d--) { if (chdir ("..") < 0) break; rmdir (dir_name); } return 0; } ]])], [gl_cv_func_getcwd_abort_bug=no], [gl_cv_func_getcwd_abort_bug=yes], [gl_cv_func_getcwd_abort_bug=yes]) ]) AS_IF([test $gl_cv_func_getcwd_abort_bug = yes], [$1], [$2]) ]) blame-1.3.1/m4/getdelim.m40000644000076400007640000000123610527555560012115 00000000000000# getdelim.m4 serial 2 dnl Copyright (C) 2005, 2006 Free Software dnl Foundation, Inc. dnl dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_PREREQ(2.52) AC_DEFUN([gl_FUNC_GETDELIM], [ dnl Persuade glibc to declare getdelim(). AC_REQUIRE([AC_GNU_SOURCE]) AC_REPLACE_FUNCS(getdelim) AC_CHECK_DECLS_ONCE(getdelim) if test $ac_cv_func_getdelim = no; then gl_PREREQ_GETDELIM fi ]) # Prerequisites of lib/getdelim.c. AC_DEFUN([gl_PREREQ_GETDELIM], [ AC_CHECK_FUNCS([flockfile funlockfile]) ]) blame-1.3.1/m4/xgetcwd.m40000644000076400007640000000055610527555566012002 00000000000000#serial 6 dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_XGETCWD], [ AC_LIBOBJ([xgetcwd]) AC_REQUIRE([gl_FUNC_GETCWD]) ]) blame-1.3.1/m4/inline.m40000644000076400007640000000313710527555557011611 00000000000000# inline.m4 serial 3 dnl Copyright (C) 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Test for the 'inline' keyword or equivalent. dnl Define 'inline' to a supported equivalent, or to nothing if not supported, dnl like AC_C_INLINE does. Also, define HAVE_INLINE if 'inline' or an dnl equivalent is effectively supported, i.e. if the compiler is likely to dnl drop unused 'static inline' functions. AC_DEFUN([gl_INLINE], [ AC_REQUIRE([AC_C_INLINE]) AC_CACHE_CHECK([whether the compiler generally respects inline], [gl_cv_c_inline_effective], [if test $ac_cv_c_inline = no; then gl_cv_c_inline_effective=no else dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is dnl specified. dnl Use AC_COMPILE_IFELSE here, not AC_EGREP_CPP, because the result dnl depends on optimization flags, which can be in CFLAGS. dnl (AC_EGREP_CPP looks only at the CPPFLAGS.) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[]], [[#ifdef __NO_INLINE__ #error "inline is not effective" #endif]])], [gl_cv_c_inline_effective=yes], [gl_cv_c_inline_effective=no]) fi ]) if test $gl_cv_c_inline_effective = yes; then AC_DEFINE([HAVE_INLINE], 1, [Define to 1 if the compiler supports one of the keywords 'inline', '__inline__', '__inline' and effectively inlines functions marked as such.]) fi ]) blame-1.3.1/m4/eoverflow.m40000644000076400007640000000413610203114517012315 00000000000000# eoverflow.m4 serial 1 dnl Copyright (C) 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. # The EOVERFLOW errno value ought to be defined in , according to # POSIX. But some systems (like AIX 3) don't define it, and some systems # (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined. # Define EOVERFLOW as a C macro and as a substituted macro in such a way that # 1. on all systems, after inclusion of , EOVERFLOW is usable, # 2. on systems where EOVERFLOW is defined elsewhere, we use the same numeric # value. AC_DEFUN([gl_EOVERFLOW], [ AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for EOVERFLOW], ac_cv_decl_EOVERFLOW, [ AC_EGREP_CPP(yes,[ #include #ifdef EOVERFLOW yes #endif ], have_eoverflow=1) if test -n "$have_eoverflow"; then dnl EOVERFLOW exists in . Don't need to define EOVERFLOW ourselves. ac_cv_decl_EOVERFLOW=yes else AC_EGREP_CPP(yes,[ #define _XOPEN_SOURCE_EXTENDED 1 #include #ifdef EOVERFLOW yes #endif ], have_eoverflow=1) if test -n "$have_eoverflow"; then dnl EOVERFLOW exists but is hidden. dnl Define it to the same value. _AC_COMPUTE_INT([EOVERFLOW], ac_cv_decl_EOVERFLOW, [ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include ]) else dnl EOVERFLOW isn't defined by the system. Define EOVERFLOW ourselves, but dnl don't define it as EINVAL, because snprintf() callers want to dnl distinguish EINVAL and EOVERFLOW. ac_cv_decl_EOVERFLOW=E2BIG fi fi ]) if test "$ac_cv_decl_EOVERFLOW" != yes; then AC_DEFINE_UNQUOTED([EOVERFLOW], [$ac_cv_decl_EOVERFLOW], [Define as good substitute value for EOVERFLOW.]) EOVERFLOW="$ac_cv_decl_EOVERFLOW" AC_SUBST(EOVERFLOW) fi ]) blame-1.3.1/m4/mbrtowc.m40000664000076400007640000000212510337302572011770 00000000000000# mbrtowc.m4 serial 8 dnl Copyright (C) 2001-2002, 2004-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert dnl This file can be removed, and gl_FUNC_MBRTOWC replaced with dnl AC_FUNC_MBRTOWC, when autoconf 2.60 can be assumed everywhere. AC_DEFUN([gl_FUNC_MBRTOWC], [ dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60. AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], gl_cv_func_mbrtowc, [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[wchar_t wc; char const s[] = ""; size_t n = 1; mbstate_t state; return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])], gl_cv_func_mbrtowc=yes, gl_cv_func_mbrtowc=no)]) if test $gl_cv_func_mbrtowc = yes; then AC_DEFINE([HAVE_MBRTOWC], 1, [Define to 1 if mbrtowc and mbstate_t are properly declared.]) fi ]) blame-1.3.1/m4/cycle-check.m40000644000076400007640000000050410527555557012500 00000000000000#serial 4 dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_CYCLE_CHECK], [ AC_LIBOBJ([cycle-check]) ]) blame-1.3.1/m4/memmove.m40000644000076400007640000000073210203114520011742 00000000000000# memmove.m4 serial 2 dnl Copyright (C) 2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_MEMMOVE], [ AC_REPLACE_FUNCS(memmove) if test $ac_cv_func_memmove = no; then gl_PREREQ_MEMMOVE fi ]) # Prerequisites of lib/memmove.c. AC_DEFUN([gl_PREREQ_MEMMOVE], [ : ]) blame-1.3.1/m4/stdint_h.m40000644000076400007640000000161410527555560012137 00000000000000# stdint_h.m4 serial 6 dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_STDINT_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1; return !i;], gl_cv_header_stdint_h=yes, gl_cv_header_stdint_h=no)]) if test $gl_cv_header_stdint_h = yes; then AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) blame-1.3.1/m4/argp.m40000644000076400007640000000545210527555560011260 00000000000000# argp.m4 serial 7 dnl Copyright (C) 2003-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_ARGP], [ AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_GETOPT_SUBSTITUTE]) AC_CHECK_DECL([program_invocation_name], [AC_DEFINE(HAVE_DECL_PROGRAM_INVOCATION_NAME, 1, [Define if program_invocation_name is declared])], [AC_DEFINE(GNULIB_PROGRAM_INVOCATION_NAME, 1, [Define to 1 to add extern declaration of program_invocation_name to argp.h])], [#include ]) AC_CHECK_DECL([program_invocation_short_name], [AC_DEFINE(HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME, 1, [Define if program_invocation_short_name is declared])], [AC_DEFINE(GNULIB_PROGRAM_INVOCATION_SHORT_NAME, 1, [Define to 1 to add extern declaration of program_invocation_short_name to argp.h])], [#include ]) # Check if program_invocation_name and program_invocation_short_name # are defined elsewhere. It is improbable that only one of them will # be defined and other not, I prefer to stay on the safe side and to # test each one separately. AC_MSG_CHECKING(whether program_invocation_name is defined) AC_TRY_COMPILE([#include ], [ program_invocation_name = "test"; ], [ AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME,1, [Define if program_invocation_name is defined]) AC_MSG_RESULT(yes)], [ AC_MSG_RESULT(no)] ) AC_MSG_CHECKING(whether program_invocation_short_name is defined) AC_TRY_COMPILE([#include ], [ program_invocation_short_name = "test"; ], [ AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME,1, [Define if program_invocation_short_name is defined]) AC_MSG_RESULT(yes)], [ AC_MSG_RESULT(no)] ) AC_CHECK_DECLS_ONCE([clearerr_unlocked]) AC_CHECK_DECLS_ONCE([feof_unlocked]) AC_CHECK_DECLS_ONCE([ferror_unlocked]) AC_CHECK_DECLS_ONCE([fflush_unlocked]) AC_CHECK_DECLS_ONCE([fgets_unlocked]) AC_CHECK_DECLS_ONCE([fputc_unlocked]) AC_CHECK_DECLS_ONCE([fputs_unlocked]) AC_CHECK_DECLS_ONCE([fread_unlocked]) AC_CHECK_DECLS_ONCE([fwrite_unlocked]) AC_CHECK_DECLS_ONCE([getc_unlocked]) AC_CHECK_DECLS_ONCE([getchar_unlocked]) AC_CHECK_DECLS_ONCE([putc_unlocked]) AC_CHECK_DECLS_ONCE([putchar_unlocked]) AC_CHECK_FUNCS_ONCE([flockfile funlockfile]) AC_CHECK_HEADERS_ONCE([features.h linewrap.h]) ]) blame-1.3.1/m4/memset.m40000644000076400007640000000072310203114520011567 00000000000000# memset.m4 serial 2 dnl Copyright (C) 2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_MEMSET], [ AC_REPLACE_FUNCS(memset) if test $ac_cv_func_memset = no; then gl_PREREQ_MEMSET fi ]) # Prerequisites of lib/memset.c. AC_DEFUN([gl_PREREQ_MEMSET], [ : ]) blame-1.3.1/m4/ulonglong.m40000644000076400007640000000353210527555560012330 00000000000000# ulonglong.m4 serial 6 dnl Copyright (C) 1999-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. # This fixes a bug in Autoconf 2.60, but can be removed once we # assume 2.61 everywhere. # Note: If the type 'unsigned long long int' exists but is only 32 bits # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT # will not be defined. In this case you can treat 'unsigned long long int' # like 'unsigned long int'. AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ AC_CACHE_CHECK([for unsigned long long int], [ac_cv_type_unsigned_long_long_int], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[unsigned long long int ull = 18446744073709551615ULL; typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63;]], [[unsigned long long int ullmax = 18446744073709551615ull; return (ull << 63 | ull >> 63 | ull << i | ull >> i | ullmax / ull | ullmax % ull);]])], [ac_cv_type_unsigned_long_long_int=yes], [ac_cv_type_unsigned_long_long_int=no])]) if test $ac_cv_type_unsigned_long_long_int = yes; then AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, [Define to 1 if the system has the type `unsigned long long int'.]) fi ]) # This macro is obsolescent and should go away soon. AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], [ AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) ac_cv_type_unsigned_long_long=$ac_cv_type_unsigned_long_long_int if test $ac_cv_type_unsigned_long_long = yes; then AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, [Define if you have the 'unsigned long long' type.]) fi ]) blame-1.3.1/m4/gettimeofday.m40000644000076400007640000000407310254677266013013 00000000000000#serial 7 # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. dnl From Jim Meyering. dnl dnl See if gettimeofday clobbers the static buffer that localtime uses dnl for its return value. The gettimeofday function from Mac OS X 10.0.4 dnl (i.e., Darwin 1.3.7) has this problem. dnl dnl If it does, then arrange to use gettimeofday and localtime only via dnl the wrapper functions that work around the problem. AC_DEFUN([AC_FUNC_GETTIMEOFDAY_CLOBBER], [ AC_REQUIRE([AC_HEADER_TIME]) AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer], jm_cv_func_gettimeofday_clobber, [AC_TRY_RUN([ #include #include #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #include int main () { time_t t = 0; struct tm *lt; struct tm saved_lt; struct timeval tv; lt = localtime (&t); saved_lt = *lt; gettimeofday (&tv, NULL); if (memcmp (lt, &saved_lt, sizeof (struct tm)) != 0) exit (1); exit (0); } ], jm_cv_func_gettimeofday_clobber=no, jm_cv_func_gettimeofday_clobber=yes, dnl When crosscompiling, assume it is broken. jm_cv_func_gettimeofday_clobber=yes) ]) if test $jm_cv_func_gettimeofday_clobber = yes; then gl_GETTIMEOFDAY_REPLACE_LOCALTIME AC_DEFINE(gettimeofday, rpl_gettimeofday, [Define to rpl_gettimeofday if the replacement function should be used.]) gl_PREREQ_GETTIMEOFDAY fi ]) AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ AC_LIBOBJ(gettimeofday) AC_DEFINE(gmtime, rpl_gmtime, [Define to rpl_gmtime if the replacement function should be used.]) AC_DEFINE(localtime, rpl_localtime, [Define to rpl_localtime if the replacement function should be used.]) ]) # Prerequisites of lib/gettimeofday.c. AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [ AC_REQUIRE([AC_HEADER_TIME]) ]) blame-1.3.1/m4/strchrnul.m40000644000076400007640000000107310203114522012322 00000000000000# strchrnul.m4 serial 3 dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRCHRNUL], [ dnl Persuade glibc to declare strchrnul(). AC_REQUIRE([AC_GNU_SOURCE]) AC_REPLACE_FUNCS(strchrnul) if test $ac_cv_func_strchrnul = no; then gl_PREREQ_STRCHRNUL fi ]) # Prerequisites of lib/strchrnul.c. AC_DEFUN([gl_PREREQ_STRCHRNUL], [:]) blame-1.3.1/m4/getline.m40000644000076400007640000000464610527555560011762 00000000000000# getline.m4 serial 15 dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software dnl Foundation, Inc. dnl dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_PREREQ(2.52) dnl See if there's a working, system-supplied version of the getline function. dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems dnl have a function by that name in -linet that doesn't have anything dnl to do with the function we need. AC_DEFUN([gl_FUNC_GETLINE], [ dnl Persuade glibc to declare getline(). AC_REQUIRE([AC_GNU_SOURCE]) AC_CHECK_DECLS([getline]) gl_getline_needs_run_time_check=no AC_CHECK_FUNC(getline, dnl Found it in some library. Verify that it works. gl_getline_needs_run_time_check=yes, am_cv_func_working_getline=no) if test $gl_getline_needs_run_time_check = yes; then AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline, [echo fooN |tr -d '\012'|tr N '\012' > conftest.data AC_TRY_RUN([ # include # include # include int main () { /* Based on a test program from Karl Heuer. */ char *line = NULL; size_t siz = 0; int len; FILE *in = fopen ("./conftest.data", "r"); if (!in) return 1; len = getline (&line, &siz, in); exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1); } ], am_cv_func_working_getline=yes dnl The library version works. , am_cv_func_working_getline=no dnl The library version does NOT work. , dnl We're cross compiling. Assume it works on glibc2 systems. [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ >= 2) Lucky GNU user #endif #endif ], [am_cv_func_working_getline=yes], [am_cv_func_working_getline=no])] )]) fi if test $am_cv_func_working_getline = no; then dnl We must choose a different name for our function, since on ELF systems dnl a broken getline() in libc.so would override our getline() in dnl libgettextlib.so. AC_DEFINE([getline], [gnu_getline], [Define to a replacement function name for getline().]) AC_LIBOBJ(getline) gl_PREREQ_GETLINE fi ]) # Prerequisites of lib/getline.c. AC_DEFUN([gl_PREREQ_GETLINE], [ gl_FUNC_GETDELIM ]) blame-1.3.1/m4/mbchar.m40000644000076400007640000000141010527555560011551 00000000000000# mbchar.m4 serial 4 dnl Copyright (C) 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl autoconf tests required for use of mbchar.m4 dnl From Bruno Haible. AC_DEFUN([gl_MBCHAR], [ AC_REQUIRE([AC_GNU_SOURCE]) dnl The following line is that so the user can test HAVE_WCHAR_H dnl before #include "mbchar.h". AC_CHECK_HEADERS_ONCE([wchar.h]) dnl Compile mbchar.c only if HAVE_WCHAR_H. if test $ac_cv_header_wchar_h = yes; then AC_LIBOBJ([mbchar]) dnl Prerequisites of mbchar.h and mbchar.c. AC_CHECK_HEADERS_ONCE([wctype.h]) AC_CHECK_FUNCS([iswcntrl]) fi ]) blame-1.3.1/m4/intmax_t.m40000644000076400007640000000375710527555560012160 00000000000000# intmax_t.m4 serial 5 dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. AC_PREREQ(2.13) # Define intmax_t to 'long' or 'long long' # if it is not already defined in or . AC_DEFUN([gl_AC_TYPE_INTMAX_T], [ dnl For simplicity, we assume that a header file defines 'intmax_t' if and dnl only if it defines 'uintmax_t'. AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then AC_REQUIRE([gl_AC_TYPE_LONG_LONG]) test $ac_cv_type_long_long = yes \ && ac_type='long long' \ || ac_type='long' AC_DEFINE_UNQUOTED(intmax_t, $ac_type, [Define to long or long long if and don't define.]) else AC_DEFINE(HAVE_INTMAX_T, 1, [Define if you have the 'intmax_t' type in or .]) fi ]) dnl An alternative would be to explicitly test for 'intmax_t'. AC_DEFUN([gt_AC_TYPE_INTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, [AC_TRY_COMPILE([ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif ], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) if test $gt_cv_c_intmax_t = yes; then AC_DEFINE(HAVE_INTMAX_T, 1, [Define if you have the 'intmax_t' type in or .]) else AC_REQUIRE([gl_AC_TYPE_LONG_LONG]) test $ac_cv_type_long_long = yes \ && ac_type='long long' \ || ac_type='long' AC_DEFINE_UNQUOTED(intmax_t, $ac_type, [Define to long or long long if and don't define.]) fi ]) blame-1.3.1/m4/absolute-header.m40000644000076400007640000000433510527555557013400 00000000000000# absolute-header.m4 serial 6 dnl Copyright (C) 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Derek Price. # gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...) # --------------------------------------- # Find the absolute name of a header file, assuming the header exists. # If the header were sys/inttypes.h, this macro would define # ABSOLUTE_SYS_INTTYPES_H to the `""' quoted absolute name of sys/inttypes.h # in config.h # (e.g. `#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"'). # The three "///" are to pacify Sun C 5.8, which otherwise would say # "warning: #include of /usr/include/... may be non-portable". # Use `""', not `<>', so that the /// cannot be confused with a C99 comment. AC_DEFUN([gl_ABSOLUTE_HEADER], [AC_LANG_PREPROC_REQUIRE()dnl AC_FOREACH([gl_HEADER_NAME], [$1], [AS_VAR_PUSHDEF([gl_absolute_header], [gl_cv_absolute_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl AC_CACHE_CHECK([absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>], m4_quote(m4_defn([gl_absolute_header])), [AS_VAR_PUSHDEF([ac_header_exists], [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl AC_CHECK_HEADERS_ONCE(m4_quote(m4_defn([gl_HEADER_NAME])))dnl if test AS_VAR_GET(ac_header_exists) = yes; then AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]])]) dnl eval is necessary to expand ac_cpp. dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. AS_VAR_SET(gl_absolute_header, [`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#;s#^/[^/]#//&#;p;q;}'`]) fi AS_VAR_POPDEF([ac_header_exists])dnl ])dnl AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_quote(m4_defn([gl_HEADER_NAME]))), ["AS_VAR_GET(gl_absolute_header)"], [Define this to an absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>.]) AS_VAR_POPDEF([gl_absolute_header])dnl ])dnl ])# gl_ABSOLUTE_HEADER blame-1.3.1/m4/dirname.m40000644000076400007640000000106210527555560011737 00000000000000#serial 7 -*- autoconf -*- dnl Copyright (C) 2002-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_DIRNAME], [ AC_LIBOBJ([basename]) AC_LIBOBJ([dirname]) AC_LIBOBJ([stripslash]) dnl Prerequisites of lib/dirname.h. AC_REQUIRE([gl_AC_DOS]) AC_REQUIRE([gl_DOUBLE_SLASH_ROOT]) dnl No prerequisites of lib/basename.c, lib/dirname.c, lib/stripslash.c. ]) blame-1.3.1/m4/calloc.m40000644000076400007640000000322210527555560011555 00000000000000# calloc.m4 serial 6 # Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Written by Jim Meyering. # Determine whether calloc (N, S) returns non-NULL when N*S is zero, # and returns NULL when N*S overflows. # If so, define HAVE_CALLOC. Otherwise, define calloc to rpl_calloc # and arrange to use a calloc wrapper function that does work in that case. # _AC_FUNC_CALLOC_IF(IF-WORKS, IF-NOT) # ------------------------------------- # If `calloc (0, 0)' is properly handled, run IF-WORKS, otherwise, IF-NOT. AC_DEFUN([_AC_FUNC_CALLOC_IF], [AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_CACHE_CHECK([for GNU libc compatible calloc], ac_cv_func_calloc_0_nonnull, [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [exit (!calloc (0, 0) || calloc ((size_t) -1 / 8 + 1, 8));])], [ac_cv_func_calloc_0_nonnull=yes], [ac_cv_func_calloc_0_nonnull=no], [ac_cv_func_calloc_0_nonnull=no])]) AS_IF([test $ac_cv_func_calloc_0_nonnull = yes], [$1], [$2]) ])# AC_FUNC_CALLOC # AC_FUNC_CALLOC # --------------- # Report whether `calloc (0, 0)' is properly handled, and replace calloc if # needed. AC_DEFUN([AC_FUNC_CALLOC], [_AC_FUNC_CALLOC_IF( [AC_DEFINE([HAVE_CALLOC], 1, [Define to 1 if your system has a GNU libc compatible `calloc' function, and to 0 otherwise.])], [AC_DEFINE([HAVE_CALLOC], 0) AC_LIBOBJ([calloc]) AC_DEFINE([calloc], [rpl_calloc], [Define to rpl_calloc if the replacement function should be used.])]) ])# AC_FUNC_CALLOC blame-1.3.1/m4/setenv.m40000644000076400007640000000357710527555560011641 00000000000000# setenv.m4 serial 6 dnl Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gt_FUNC_SETENV], [ AC_REPLACE_FUNCS(setenv unsetenv) if test $ac_cv_func_setenv = no; then gl_PREREQ_SETENV fi if test $ac_cv_func_unsetenv = no; then gl_PREREQ_UNSETENV else AC_CACHE_CHECK([for unsetenv() return type], gt_cv_func_unsetenv_ret, [AC_TRY_COMPILE([#include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) int unsetenv (const char *name); #else int unsetenv(); #endif ], , gt_cv_func_unsetenv_ret='int', gt_cv_func_unsetenv_ret='void')]) if test $gt_cv_func_unsetenv_ret = 'void'; then AC_DEFINE(VOID_UNSETENV, 1, [Define if unsetenv() returns void, not int.]) fi fi ]) # Check if a variable is properly declared. # gt_CHECK_VAR_DECL(includes,variable) AC_DEFUN([gt_CHECK_VAR_DECL], [ define([gt_cv_var], [gt_cv_var_]$2[_declaration]) AC_MSG_CHECKING([if $2 is properly declared]) AC_CACHE_VAL(gt_cv_var, [ AC_TRY_COMPILE([$1 extern struct { int foo; } $2;], [$2.foo = 1;], gt_cv_var=no, gt_cv_var=yes)]) AC_MSG_RESULT($gt_cv_var) if test $gt_cv_var = yes; then AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z])[_DECL], 1, [Define if you have the declaration of $2.]) fi ]) # Prerequisites of lib/setenv.c. AC_DEFUN([gl_PREREQ_SETENV], [ AC_REQUIRE([AC_FUNC_ALLOCA]) AC_CHECK_HEADERS_ONCE(unistd.h) AC_CHECK_HEADERS(search.h) AC_CHECK_FUNCS(tsearch) gt_CHECK_VAR_DECL([#include ], environ) ]) # Prerequisites of lib/unsetenv.c. AC_DEFUN([gl_PREREQ_UNSETENV], [ AC_CHECK_HEADERS_ONCE(unistd.h) gt_CHECK_VAR_DECL([#include ], environ) ]) blame-1.3.1/m4/strndup.m40000644000076400007640000000267510527555560012032 00000000000000# strndup.m4 serial 11 dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRNDUP], [ dnl Persuade glibc to declare strndup(). AC_REQUIRE([AC_GNU_SOURCE]) AC_CHECK_DECLS_ONCE([strndup]) # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. AC_CACHE_CHECK([for working strndup], gl_cv_func_strndup, [AC_RUN_IFELSE([ AC_LANG_PROGRAM([#include #include ], [[ #ifndef HAVE_DECL_STRNDUP extern char *strndup (const char *, size_t); #endif char *s; s = strndup ("some longer string", 15); free (s); s = strndup ("shorter string", 13); return s[13] != '\0';]])], [gl_cv_func_strndup=yes], [gl_cv_func_strndup=no], [AC_CHECK_FUNC([strndup], [AC_EGREP_CPP([too risky], [ #ifdef _AIX too risky #endif ], [gl_cv_func_strndup=no], [gl_cv_func_strndup=yes])], [gl_cv_func_strndup=no])])]) if test $gl_cv_func_strndup = yes; then AC_DEFINE([HAVE_STRNDUP], 1, [Define if you have the strndup() function and it works.]) else AC_LIBOBJ([strndup]) gl_PREREQ_STRNDUP fi ]) # Prerequisites of lib/strndup.c. AC_DEFUN([gl_PREREQ_STRNDUP], [:]) blame-1.3.1/m4/strtol.m40000644000076400007640000000052510527555560011652 00000000000000# strtol.m4 serial 4 dnl Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRTOL], [ AC_REPLACE_FUNCS(strtol) ]) blame-1.3.1/m4/xstrndup.m40000644000076400007640000000061610527555557012221 00000000000000# xstrndup.m4 serial 2 dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_XSTRNDUP], [ gl_PREREQ_XSTRNDUP ]) # Prerequisites of lib/xstrndup.c. AC_DEFUN([gl_PREREQ_XSTRNDUP], [ : ]) blame-1.3.1/m4/time_r.m40000644000076400007640000000232610527555560011603 00000000000000dnl Reentrant time functions like localtime_r. dnl Copyright (C) 2003, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Paul Eggert. AC_DEFUN([gl_TIME_R], [ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([AC_C_RESTRICT]) AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature], [gl_cv_time_r_posix], [AC_TRY_COMPILE( [#include ], [/* We don't need to append 'restrict's to the argument types, even though the POSIX signature has the 'restrict's, since C99 says they can't affect type compatibility. */ struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; if (ptr) return 0;], [gl_cv_time_r_posix=yes], [gl_cv_time_r_posix=no])]) if test $gl_cv_time_r_posix = yes; then AC_DEFINE([HAVE_TIME_R_POSIX], 1, [Define to 1 if localtime_r, etc. have the type signatures that POSIX requires.]) else AC_LIBOBJ([time_r]) gl_PREREQ_TIME_R fi ]) # Prerequisites of lib/time_r.c. AC_DEFUN([gl_PREREQ_TIME_R], [ : ]) blame-1.3.1/m4/tm_gmtoff.m40000644000076400007640000000101610203114523012256 00000000000000# tm_gmtoff.m4 serial 2 dnl Copyright (C) 2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_TM_GMTOFF], [ AC_CHECK_MEMBER([struct tm.tm_gmtoff], [AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has the tm_gmtoff member.])], , [#include ]) ]) blame-1.3.1/m4/xreadlink.m40000644000076400007640000000062510527555566012313 00000000000000#serial 8 dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_XREADLINK], [ AC_LIBOBJ([xreadlink]) dnl Prerequisites of lib/xreadlink.c. AC_REQUIRE([gt_TYPE_SSIZE_T]) ]) blame-1.3.1/m4/longdouble.m40000644000076400007640000000227710527555560012463 00000000000000# longdouble.m4 serial 2 (gettext-0.15) dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether the compiler supports the 'long double' type. dnl Prerequisite: AC_PROG_CC dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics. AC_DEFUN([gt_TYPE_LONGDOUBLE], [ AC_CACHE_CHECK([for long double], gt_cv_c_long_double, [if test "$GCC" = yes; then gt_cv_c_long_double=yes else AC_TRY_COMPILE([ /* The Stardent Vistra knows sizeof(long double), but does not support it. */ long double foo = 0.0; /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ int array [2*(sizeof(long double) >= sizeof(double)) - 1]; ], , gt_cv_c_long_double=yes, gt_cv_c_long_double=no) fi]) if test $gt_cv_c_long_double = yes; then AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) fi ]) blame-1.3.1/m4/tzset.m40000644000076400007640000000345310203114523011454 00000000000000#serial 2 # Copyright (C) 2003 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # See if we have a working tzset function. # If so, arrange to compile the wrapper function. # For at least Solaris 2.5.1 and 2.6, this is necessary # because tzset can clobber the contents of the buffer # used by localtime. # Written by Paul Eggert and Jim Meyering. AC_DEFUN([gl_FUNC_TZSET_CLOBBER], [ AC_REQUIRE([AC_HEADER_TIME]) AC_CACHE_CHECK([whether tzset clobbers localtime buffer], gl_cv_func_tzset_clobber, [ AC_RUN_IFELSE([AC_LANG_SOURCE([[ #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #include int main () { time_t t1 = 853958121; struct tm *p, s; putenv ("TZ=GMT0"); p = localtime (&t1); s = *p; putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"); tzset (); exit (p->tm_year != s.tm_year || p->tm_mon != s.tm_mon || p->tm_mday != s.tm_mday || p->tm_hour != s.tm_hour || p->tm_min != s.tm_min || p->tm_sec != s.tm_sec); } ]])], [gl_cv_func_tzset_clobber=no], [gl_cv_func_tzset_clobber=yes], [gl_cv_func_tzset_clobber=yes])]) AC_DEFINE(HAVE_RUN_TZSET_TEST, 1, [Define to 1 if you have run the test for working tzset.]) if test $gl_cv_func_tzset_clobber = yes; then gl_GETTIMEOFDAY_REPLACE_LOCALTIME AC_DEFINE(tzset, rpl_tzset, [Define to rpl_tzset if the wrapper function should be used.]) AC_DEFINE(TZSET_CLOBBERS_LOCALTIME_BUFFER, 1, [Define if tzset clobbers localtime's static buffer.]) fi ]) blame-1.3.1/m4/langinfo.m40000664000076400007640000000356610125542443012120 00000000000000# langinfo.m4 dnl Copyright (C) 2004 Michael Chapman dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. AC_DEFUN([mac_HAVE_NL_LANGINFO], [ AC_CHECK_HEADERS_ONCE([langinfo.h]) m4_pattern_allow(AM_STR) if test "$ac_cv_header_langinfo_h" = yes; then AC_CACHE_CHECK([for nl_langinfo in langinfo.h], mac_cv_have_nl_langinfo, [ AC_LINK_IFELSE(AC_LANG_PROGRAM([[ #include ]], [[ char* am = nl_langinfo(AM_STR); char* pm = nl_langinfo(PM_STR); char* m1 = nl_langinfo(MON_1); char* am1 = nl_langinfo(ABMON_1); char* d1 = nl_langinfo(DAY_1); char* ad1 = nl_langinfo(ABDAY_1); ]]), mac_cv_have_nl_langinfo=yes, mac_cv_have_nl_langinfo=no ) ]) if test "$mac_cv_have_nl_langinfo" = yes; then AC_CACHE_CHECK([for decimal point constant for nl_langinfo], mac_cv_nl_langinfo_dp, [ AC_LINK_IFELSE(AC_LANG_PROGRAM([[ #include ]], [[ char* dp = nl_langinfo(DECIMAL_POINT); ]]), mac_cv_nl_langinfo_dp=DECIMAL_POINT, [AC_LINK_IFELSE(AC_LANG_PROGRAM([[ #include ]], [[ char* dp = nl_langinfo(RADIXCHAR); ]]), mac_cv_nl_langinfo_dp=RADIXCHAR, mac_cv_have_nl_langinfo=unknown )]) ]) else mac_cv_nl_langinfo_dp=unknown fi if test "$mac_cv_have_nl_langinfo" != no; then AC_DEFINE(HAVE_NL_LANGINFO, 1, [Define if you have the `nl_langinfo' function.] ) fi if test "$mac_cv_nl_langinfo_dp" != unknown; then AC_DEFINE_UNQUOTED(NL_LANGINFO_DP, $mac_cv_nl_langinfo_dp, [Define to the decimal point constant for use in the `nl_langinfo' function. Do not define if no constant is available.] ) fi fi ]) blame-1.3.1/m4/pathmax.m40000644000076400007640000000061010527555560011760 00000000000000# pathmax.m4 serial 6 dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_PATHMAX], [ dnl Prerequisites of lib/pathmax.h. AC_CHECK_HEADERS_ONCE(sys/param.h) ]) blame-1.3.1/m4/mempcpy.m40000644000076400007640000000107410527555560011775 00000000000000# mempcpy.m4 serial 4 dnl Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_MEMPCPY], [ dnl Persuade glibc to declare mempcpy(). AC_REQUIRE([AC_GNU_SOURCE]) AC_REPLACE_FUNCS(mempcpy) if test $ac_cv_func_mempcpy = no; then gl_PREREQ_MEMPCPY fi ]) # Prerequisites of lib/mempcpy.c. AC_DEFUN([gl_PREREQ_MEMPCPY], [ : ]) blame-1.3.1/m4/dos.m40000644000076400007640000000454610527555560011117 00000000000000#serial 10 -*- autoconf -*- # Define some macros required for proper operation of code in lib/*.c # on MSDOS/Windows systems. # Copyright (C) 2000, 2001, 2004, 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # From Jim Meyering. AC_DEFUN([gl_AC_DOS], [ AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos], [ AC_TRY_COMPILE([], [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__ neither MSDOS nor Windows #endif], [ac_cv_win_or_dos=yes], [ac_cv_win_or_dos=no]) ]) if test x"$ac_cv_win_or_dos" = xyes; then ac_fs_accepts_drive_letter_prefix=1 ac_fs_backslash_is_file_name_separator=1 AC_CACHE_CHECK([whether drive letter can start relative path], [ac_cv_drive_letter_can_be_relative], [ AC_TRY_COMPILE([], [#if defined __CYGWIN__ drive letters are always absolute #endif], [ac_cv_drive_letter_can_be_relative=yes], [ac_cv_drive_letter_can_be_relative=no]) ]) if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then ac_fs_drive_letter_can_be_relative=1 else ac_fs_drive_letter_can_be_relative=0 fi else ac_fs_accepts_drive_letter_prefix=0 ac_fs_backslash_is_file_name_separator=0 ac_fs_drive_letter_can_be_relative=0 fi AC_DEFINE_UNQUOTED([FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX], $ac_fs_accepts_drive_letter_prefix, [Define on systems for which file names may have a so-called `drive letter' prefix, define this to compute the length of that prefix, including the colon.]) AH_VERBATIM(ISSLASH, [#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR # define ISSLASH(C) ((C) == '/' || (C) == '\\') #else # define ISSLASH(C) ((C) == '/') #endif]) AC_DEFINE_UNQUOTED([FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR], $ac_fs_backslash_is_file_name_separator, [Define if the backslash character may also serve as a file name component separator.]) AC_DEFINE_UNQUOTED([FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE], $ac_fs_drive_letter_can_be_relative, [Define if a drive letter prefix denotes a relative path if it is not followed by a file name component separator.]) ]) blame-1.3.1/m4/free.m40000644000076400007640000000253110337302611011225 00000000000000# Check whether free (NULL) is supposed to work. # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Written by Paul Eggert. # We can't test for free (NULL) even at runtime, since it might # happen to "work" for our test program, but not in general. So, be # conservative and use feature tests for relatively modern hosts, # where free (NULL) is known to work. This costs a bit of # performance on some older hosts, but we can fix that later if # needed. AC_DEFUN([gl_FUNC_FREE], [ AC_CACHE_CHECK([whether free (NULL) is known to work], [gl_cv_func_free], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[@%:@include ]], [[@%:@if _POSIX_VERSION < 199009L && \ (defined unix || defined _unix || defined _unix_ \ || defined __unix || defined __unix__) @%:@error "'free (NULL)' is not known to work" @%:@endif]])], [gl_cv_func_free=yes], [gl_cv_func_free=no])]) if test $gl_cv_func_free = no; then AC_LIBOBJ(free) AC_DEFINE(free, rpl_free, [Define to rpl_free if the replacement function should be used.]) fi ]) # Prerequisites of lib/free.c. AC_DEFUN([gl_PREREQ_FREE], [:]) blame-1.3.1/m4/size_max.m40000644000076400007640000000461010527555560012141 00000000000000# size_max.m4 serial 5 dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gl_SIZE_MAX], [ AC_CHECK_HEADERS(stdint.h) dnl First test whether the system already has SIZE_MAX. AC_MSG_CHECKING([for SIZE_MAX]) AC_CACHE_VAL([gl_cv_size_max], [ gl_cv_size_max= AC_EGREP_CPP([Found it], [ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif ], gl_cv_size_max=yes) if test -z "$gl_cv_size_max"; then dnl Define it ourselves. Here we assume that the type 'size_t' is not wider dnl than the type 'unsigned long'. Try hard to find a definition that can dnl be used in a preprocessor #if, i.e. doesn't contain a cast. _AC_COMPUTE_INT([sizeof (size_t) * CHAR_BIT - 1], size_t_bits_minus_1, [#include #include ], size_t_bits_minus_1=) _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, [#include ], fits_in_uint=) if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then if test $fits_in_uint = 1; then dnl Even though SIZE_MAX fits in an unsigned int, it must be of type dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. AC_TRY_COMPILE([#include extern size_t foo; extern unsigned long foo; ], [], fits_in_uint=0) fi dnl We cannot use 'expr' to simplify this expression, because 'expr' dnl works only with 'long' integers in the host environment, while we dnl might be cross-compiling from a 32-bit platform to a 64-bit platform. if test $fits_in_uint = 1; then gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" else gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" fi else dnl Shouldn't happen, but who knows... gl_cv_size_max='((size_t)~(size_t)0)' fi fi ]) AC_MSG_RESULT([$gl_cv_size_max]) if test "$gl_cv_size_max" != yes; then AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max], [Define as the maximum value of type 'size_t', if the system doesn't define it.]) fi ]) blame-1.3.1/m4/onceonly_2_57.m40000644000076400007640000000701310527555560012704 00000000000000# onceonly_2_57.m4 serial 4 dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl This file defines some "once only" variants of standard autoconf macros. dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS dnl AC_REQUIRE([AC_FUNC_STRCOLL]) like AC_FUNC_STRCOLL dnl The advantage is that the check for each of the headers/functions/decls dnl will be put only once into the 'configure' file. It keeps the size of dnl the 'configure' file down, and avoids redundant output when 'configure' dnl is run. dnl The drawback is that the checks cannot be conditionalized. If you write dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to dnl empty, and the check will be inserted before the body of the AC_DEFUNed dnl function. dnl This is like onceonly.m4, except that it uses diversions to named sections dnl DEFAULTS and INIT_PREPARE in order to check all requested headers at once, dnl thus reducing the size of 'configure'. Works with autoconf-2.57. The dnl size reduction is ca. 9%. dnl Autoconf version 2.57 or newer is recommended. AC_PREREQ(2.57) # AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of # AC_CHECK_HEADERS(HEADER1 HEADER2 ...). AC_DEFUN([AC_CHECK_HEADERS_ONCE], [ : AC_FOREACH([gl_HEADER_NAME], [$1], [ AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, [./-], [___])), [ m4_divert_text([INIT_PREPARE], [gl_header_list="$gl_header_list gl_HEADER_NAME"]) gl_HEADERS_EXPANSION AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])), [Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.]) ]) AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, [./-], [___]))) ]) ]) m4_define([gl_HEADERS_EXPANSION], [ m4_divert_text([DEFAULTS], [gl_header_list=]) AC_CHECK_HEADERS([$gl_header_list]) m4_define([gl_HEADERS_EXPANSION], []) ]) # AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of # AC_CHECK_FUNCS(FUNC1 FUNC2 ...). AC_DEFUN([AC_CHECK_FUNCS_ONCE], [ : AC_FOREACH([gl_FUNC_NAME], [$1], [ AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [ m4_divert_text([INIT_PREPARE], [gl_func_list="$gl_func_list gl_FUNC_NAME"]) gl_FUNCS_EXPANSION AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_FUNC_NAME])), [Define to 1 if you have the `]m4_defn([gl_FUNC_NAME])[' function.]) ]) AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME])) ]) ]) m4_define([gl_FUNCS_EXPANSION], [ m4_divert_text([DEFAULTS], [gl_func_list=]) AC_CHECK_FUNCS([$gl_func_list]) m4_define([gl_FUNCS_EXPANSION], []) ]) # AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of # AC_CHECK_DECLS(DECL1, DECL2, ...). AC_DEFUN([AC_CHECK_DECLS_ONCE], [ : AC_FOREACH([gl_DECL_NAME], [$1], [ AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [ AC_CHECK_DECLS(m4_defn([gl_DECL_NAME])) ]) AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME])) ]) ]) blame-1.3.1/m4/strpbrk.m40000644000076400007640000000073310203114523011770 00000000000000# strpbrk.m4 serial 2 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRPBRK], [ AC_REPLACE_FUNCS(strpbrk) if test $ac_cv_func_strpbrk = no; then gl_PREREQ_STRPBRK fi ]) # Prerequisites of lib/strpbrk.c. AC_DEFUN([gl_PREREQ_STRPBRK], [:]) blame-1.3.1/m4/longlong.m40000644000076400007640000000464010527555560012144 00000000000000# longlong.m4 serial 10 dnl Copyright (C) 1999-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_LONG_LONG_INT if 'long long int' works. # This fixes a bug in Autoconf 2.60, but can be removed once we # assume 2.61 everywhere. # Note: If the type 'long long int' exists but is only 32 bits large # (as on some very old compilers), HAVE_LONG_LONG_INT will not be # defined. In this case you can treat 'long long int' like 'long int'. AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; int i = 63;]], [[long long int llmax = 9223372036854775807ll; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll));]])], [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. dnl If cross compiling, assume the bug isn't important, since dnl nobody cross compiles for this platform as far as we know. AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[@%:@include @%:@ifndef LLONG_MAX @%:@ define HALF \ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) @%:@ define LLONG_MAX (HALF - 1 + HALF) @%:@endif]], [[long long int n = 1; int i; for (i = 0; ; i++) { long long int m = n << i; if (m >> i != n) return 1; if (LLONG_MAX / 2 < m) break; } return 0;]])], [ac_cv_type_long_long_int=yes], [ac_cv_type_long_long_int=no], [ac_cv_type_long_long_int=yes])], [ac_cv_type_long_long_int=no])]) if test $ac_cv_type_long_long_int = yes; then AC_DEFINE([HAVE_LONG_LONG_INT], 1, [Define to 1 if the system has the type `long long int'.]) fi ]) # This macro is obsolescent and should go away soon. AC_DEFUN([gl_AC_TYPE_LONG_LONG], [ AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) ac_cv_type_long_long=$ac_cv_type_long_long_int if test $ac_cv_type_long_long = yes; then AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have the 'long long' type.]) fi ]) blame-1.3.1/m4/lstat.m40000644000076400007640000000075310527555560011455 00000000000000#serial 15 # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. dnl From Jim Meyering. AC_DEFUN([gl_FUNC_LSTAT], [ AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ(lstat). : ]) blame-1.3.1/m4/alloca.m40000644000076400007640000000331510527555560011556 00000000000000# alloca.m4 serial 7 dnl Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_ALLOCA], [ dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57. AC_REQUIRE([AC_PROG_CPP]) AC_REQUIRE([AC_PROG_EGREP]) AC_REQUIRE([AC_FUNC_ALLOCA]) if test $ac_cv_func_alloca_works = no; then gl_PREREQ_ALLOCA fi # Define an additional variable used in the Makefile substitution. if test $ac_cv_working_alloca_h = yes; then AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [ AC_EGREP_CPP([Need own alloca], [ #if defined __GNUC__ || defined _AIX || defined _MSC_VER Need own alloca #endif ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no]) ]) if test $gl_cv_rpl_alloca = yes; then dnl OK, alloca can be implemented through a compiler built-in. AC_DEFINE([HAVE_ALLOCA], 1, [Define to 1 if you have 'alloca' after including , a header that may be supplied by this distribution.]) ALLOCA_H=alloca.h else dnl alloca exists as a library function, i.e. it is slow and probably dnl a memory leak. Don't define HAVE_ALLOCA in this case. ALLOCA_H= fi else ALLOCA_H=alloca.h fi AC_SUBST([ALLOCA_H]) AC_DEFINE(HAVE_ALLOCA_H, 1, [Define HAVE_ALLOCA_H for backward compatibility with older code that includes only if HAVE_ALLOCA_H is defined.]) ]) # Prerequisites of lib/alloca.c. # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. AC_DEFUN([gl_PREREQ_ALLOCA], [:]) blame-1.3.1/m4/inttypes_h.m40000644000076400007640000000164410527555560012514 00000000000000# inttypes_h.m4 serial 7 dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1; return !i;], gl_cv_header_inttypes_h=yes, gl_cv_header_inttypes_h=no)]) if test $gl_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) blame-1.3.1/m4/eealloc.m40000644000076400007640000000170410203114517011707 00000000000000# eealloc.m4 serial 1 dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_EEALLOC], [ AC_REQUIRE([gl_EEMALLOC]) AC_REQUIRE([gl_EEREALLOC]) AC_REQUIRE([AC_C_INLINE]) ]) AC_DEFUN([gl_EEMALLOC], [ _AC_FUNC_MALLOC_IF( [gl_cv_func_malloc_0_nonnull=1], [gl_cv_func_malloc_0_nonnull=0]) AC_DEFINE_UNQUOTED([MALLOC_0_IS_NONNULL], $gl_cv_func_malloc_0_nonnull, [If malloc(0) is != NULL, define this to 1. Otherwise define this to 0.]) ]) AC_DEFUN([gl_EEREALLOC], [ _AC_FUNC_REALLOC_IF( [gl_cv_func_realloc_0_nonnull=1], [gl_cv_func_realloc_0_nonnull=0]) AC_DEFINE_UNQUOTED([REALLOC_0_IS_NONNULL], $gl_cv_func_realloc_0_nonnull, [If realloc(NULL,0) is != NULL, define this to 1. Otherwise define this to 0.]) ]) blame-1.3.1/m4/getcwd-path-max.m40000644000076400007640000001156610527555560013324 00000000000000#serial 12 # Check for several getcwd bugs with long file names. # If so, arrange to compile the wrapper function. # This is necessary for at least GNU libc on linux-2.4.19 and 2.4.20. # I've heard that this is due to a Linux kernel bug, and that it has # been fixed between 2.4.21-pre3 and 2.4.21-pre4. */ # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # From Jim Meyering AC_DEFUN([gl_FUNC_GETCWD_PATH_MAX], [ AC_CHECK_DECLS_ONCE(getcwd) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CACHE_CHECK([whether getcwd handles long file names properly], gl_cv_func_getcwd_path_max, [# Arrange for deletion of the temporary directory this test creates. ac_clean_files="$ac_clean_files confdir3" AC_RUN_IFELSE( [AC_LANG_SOURCE( [[ #include #include #include #include #include #include #include #include #ifndef AT_FDCWD # define AT_FDCWD 0 #endif #ifdef ENAMETOOLONG # define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG) #else # define is_ENAMETOOLONG(x) 0 #endif /* Don't get link errors because mkdir is redefined to rpl_mkdir. */ #undef mkdir #ifndef S_IRWXU # define S_IRWXU 0700 #endif /* The length of this name must be 8. */ #define DIR_NAME "confdir3" #define DIR_NAME_LEN 8 #define DIR_NAME_SIZE (DIR_NAME_LEN + 1) /* The length of "../". */ #define DOTDOTSLASH_LEN 3 /* Leftover bytes in the buffer, to work around library or OS bugs. */ #define BUF_SLOP 20 int main () { #ifndef PATH_MAX /* The Hurd doesn't define this, so getcwd can't exhibit the bug -- at least not on a local file system. And if we were to start worrying about remote file systems, we'd have to enable the wrapper function all of the time, just to be safe. That's not worth the cost. */ exit (0); #elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \ - DIR_NAME_SIZE - BUF_SLOP) \ <= PATH_MAX) /* FIXME: Assuming there's a system for which this is true, this should be done in a compile test. */ exit (0); #else char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) + DIR_NAME_SIZE + BUF_SLOP]; char *cwd = getcwd (buf, PATH_MAX); size_t initial_cwd_len; size_t cwd_len; int fail = 0; size_t n_chdirs = 0; if (cwd == NULL) exit (1); cwd_len = initial_cwd_len = strlen (cwd); while (1) { size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN); char *c = NULL; cwd_len += DIR_NAME_SIZE; /* If mkdir or chdir fails, it could be that this system cannot create any file with an absolute name longer than PATH_MAX, such as cygwin. If so, leave fail as 0, because the current working directory can't be too long for getcwd if it can't even be created. For other errors, be pessimistic and consider that as a failure, too. */ if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0) { if (! (errno == ERANGE || is_ENAMETOOLONG (errno))) fail = 2; break; } if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE) { c = getcwd (buf, PATH_MAX); if (!c && errno == ENOENT) { fail = 1; break; } if (c || ! (errno == ERANGE || is_ENAMETOOLONG (errno))) { fail = 2; break; } } if (dotdot_max <= cwd_len - initial_cwd_len) { if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len) break; c = getcwd (buf, cwd_len + 1); if (!c) { if (! (errno == ERANGE || errno == ENOENT || is_ENAMETOOLONG (errno))) { fail = 2; break; } if (AT_FDCWD || errno == ERANGE || errno == ENOENT) { fail = 1; break; } } } if (c && strlen (c) != cwd_len) { fail = 2; break; } ++n_chdirs; } /* Leaving behind such a deep directory is not polite. So clean up here, right away, even though the driving shell script would also clean up. */ { size_t i; /* Try rmdir first, in case the chdir failed. */ rmdir (DIR_NAME); for (i = 0; i <= n_chdirs; i++) { if (chdir ("..") < 0) break; rmdir (DIR_NAME); } } exit (fail); #endif } ]])], [gl_cv_func_getcwd_path_max=yes], [case $? in 1) gl_cv_func_getcwd_path_max='no, but it is partly working';; *) gl_cv_func_getcwd_path_max=no;; esac], [gl_cv_func_getcwd_path_max=no]) ]) case $gl_cv_func_getcwd_path_max in no,*) AC_DEFINE([HAVE_PARTLY_WORKING_GETCWD], 1, [Define to 1 if getcwd works, except it sometimes fails when it shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT. If __GETCWD_PREFIX is not defined, it doesn't matter whether HAVE_PARTLY_WORKING_GETCWD is defined.]);; esac ]) blame-1.3.1/m4/stdbool.m40000644000076400007640000000722210527555560011772 00000000000000# Check for stdbool.h that conforms to C99. dnl Copyright (C) 2002-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Prepare for substituting if it is not supported. AC_DEFUN([AM_STDBOOL_H], [ AC_REQUIRE([AC_HEADER_STDBOOL]) # Define two additional variables used in the Makefile substitution. if test "$ac_cv_header_stdbool_h" = yes; then STDBOOL_H='' else STDBOOL_H='stdbool.h' fi AC_SUBST([STDBOOL_H]) if test "$ac_cv_type__Bool" = yes; then HAVE__BOOL=1 else HAVE__BOOL=0 fi AC_SUBST([HAVE__BOOL]) ]) # AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future. AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H]) # This macro is only needed in autoconf <= 2.59. Newer versions of autoconf # have this macro built-in. AC_DEFUN([AC_HEADER_STDBOOL], [AC_CACHE_CHECK([for stdbool.h that conforms to C99], [ac_cv_header_stdbool_h], [AC_TRY_COMPILE( [ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; #if defined __xlc__ || defined __GNUC__ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 reported by James Lemley on 2005-10-05; see http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html This test is not quite right, since xlc is allowed to reject this program, as the initializer for xlcbug is not one of the forms that C requires support for. However, doing the test right would require a run-time test, and that would make cross-compilation harder. Let us hope that IBM fixes the xlc bug, and also adds support for this kind of constant expression. In the meantime, this test will reject xlc, which is OK, since our stdbool.h substitute should suffice. We also test this with GCC, where it should work, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); #endif /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; ], [ *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ], [ac_cv_header_stdbool_h=yes], [ac_cv_header_stdbool_h=no])]) AC_CHECK_TYPES([_Bool]) if test $ac_cv_header_stdbool_h = yes; then AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) fi]) blame-1.3.1/m4/error.m40000644000076400007640000000103410203114517011430 00000000000000#serial 11 # Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2004 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_ERROR], [ AC_FUNC_ERROR_AT_LINE dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]). gl_PREREQ_ERROR ]) # Prerequisites of lib/error.c. AC_DEFUN([gl_PREREQ_ERROR], [ AC_REQUIRE([AC_FUNC_STRERROR_R]) : ]) blame-1.3.1/m4/mbstate_t.m40000644000076400007640000000177610203114520012270 00000000000000# mbstate_t.m4 serial 9 dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # From Paul Eggert. # BeOS 5 has but does not define mbstate_t, # so you can't declare an object of that type. # Check for this incompatibility with Standard C. # AC_TYPE_MBSTATE_T # ----------------- AC_DEFUN([AC_TYPE_MBSTATE_T], [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT # include ], [mbstate_t x; return sizeof x;])], [ac_cv_type_mbstate_t=yes], [ac_cv_type_mbstate_t=no])]) if test $ac_cv_type_mbstate_t = yes; then AC_DEFINE([HAVE_MBSTATE_T], 1, [Define to 1 if declares mbstate_t.]) else AC_DEFINE([mbstate_t], int, [Define to a type if does not define.]) fi]) blame-1.3.1/m4/getcwd.m40000644000076400007640000000300410527555560011573 00000000000000# getcwd.m4 - check for working getcwd that is compatible with glibc # Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Written by Paul Eggert. AC_DEFUN([gl_FUNC_GETCWD_NULL], [ AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result], [gl_cv_func_getcwd_null], [AC_TRY_RUN( [ # include # include # ifndef getcwd char *getcwd (); # endif int main () { if (chdir ("/") != 0) exit (1); else { char *f = getcwd (NULL, 0); exit (! (f && f[0] == '/' && !f[1])); } }], [gl_cv_func_getcwd_null=yes], [gl_cv_func_getcwd_null=no], [gl_cv_func_getcwd_null=no])]) ]) AC_DEFUN([gl_FUNC_GETCWD], [ AC_REQUIRE([gl_FUNC_GETCWD_NULL]) gl_abort_bug=no case $gl_cv_func_getcwd_null in yes) gl_FUNC_GETCWD_PATH_MAX gl_FUNC_GETCWD_ABORT_BUG([gl_abort_bug=yes]);; esac case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_path_max,$gl_abort_bug in yes,yes,no) ;; *) AC_LIBOBJ([getcwd]) AC_DEFINE([__GETCWD_PREFIX], [[rpl_]], [Define to rpl_ if the getcwd replacement function should be used.]) gl_PREREQ_GETCWD;; esac ]) # Prerequisites of lib/getcwd.c. AC_DEFUN([gl_PREREQ_GETCWD], [ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO]) : ]) blame-1.3.1/m4/canonicalize.m40000644000076400007640000000121210527555560012754 00000000000000#serial 11 # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Written by Jim Meyering. AC_DEFUN([AC_FUNC_CANONICALIZE_FILE_NAME], [ AC_LIBOBJ([canonicalize]) AC_CHECK_HEADERS_ONCE([sys/param.h]) AC_CHECK_DECLS_ONCE([canonicalize_file_name]) AC_CHECK_FUNCS_ONCE([canonicalize_file_name resolvepath]) AC_DEFINE([PROVIDE_CANONICALIZE_FILENAME_MODE], 1, [Define to 1 to provide canonicalize_filename_mode.]) ]) blame-1.3.1/m4/xalloc.m40000644000076400007640000000105510527555560011604 00000000000000# xalloc.m4 serial 16 dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_XALLOC], [ AC_LIBOBJ([xmalloc]) gl_PREREQ_XALLOC gl_PREREQ_XMALLOC ]) # Prerequisites of lib/xalloc.h. AC_DEFUN([gl_PREREQ_XALLOC], [ AC_REQUIRE([gl_INLINE]) : ]) # Prerequisites of lib/xmalloc.c. AC_DEFUN([gl_PREREQ_XMALLOC], [ : ]) blame-1.3.1/m4/exitfail.m40000644000076400007640000000060610527555560012130 00000000000000# exitfail.m4 serial 6 dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_EXITFAIL], [ AC_LIBOBJ([exitfail]) dnl No prerequisites of lib/exitfail.c. : ]) blame-1.3.1/m4/strdup.m40000644000076400007640000000072610527555560011647 00000000000000# strdup.m4 serial 7 dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRDUP], [ AC_REPLACE_FUNCS(strdup) AC_CHECK_DECLS_ONCE(strdup) gl_PREREQ_STRDUP ]) # Prerequisites of lib/strdup.c. AC_DEFUN([gl_PREREQ_STRDUP], [:]) blame-1.3.1/m4/readlink.m40000644000076400007640000000076710203114521012077 00000000000000# readlink.m4 serial 2 dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_READLINK], [ AC_CHECK_FUNCS(readlink) if test $ac_cv_func_readlink = no; then AC_LIBOBJ(readlink) gl_PREREQ_READLINK fi ]) # Prerequisites of lib/readlink.c. AC_DEFUN([gl_PREREQ_READLINK], [ : ]) blame-1.3.1/m4/wchar_t.m40000644000076400007640000000132610203114524011730 00000000000000# wchar_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wchar_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WCHAR_T], [ AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, [AC_TRY_COMPILE([#include wchar_t foo = (wchar_t)'\0';], , gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) if test $gt_cv_c_wchar_t = yes; then AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) fi ]) blame-1.3.1/m4/mktime.m40000644000076400007640000001351310527555560011612 00000000000000#serial 8 dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Jim Meyering. # Redefine AC_FUNC_MKTIME, to fix a bug in Autoconf 2.60a and earlier. # This redefinition can be removed once a new version of Autoconf is assumed. # The redefinition is taken from # . # AC_FUNC_MKTIME # -------------- AC_DEFUN([AC_FUNC_MKTIME], [AC_REQUIRE([AC_HEADER_TIME])dnl AC_CHECK_HEADERS_ONCE(sys/time.h unistd.h) AC_CHECK_FUNCS_ONCE(alarm) AC_CACHE_CHECK([for working mktime], ac_cv_func_working_mktime, [AC_RUN_IFELSE([AC_LANG_SOURCE( [[/* Test program from Paul Eggert and Tony Leneis. */ #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include #ifdef HAVE_UNISTD_H # include #endif #ifndef HAVE_ALARM # define alarm(X) /* empty */ #endif /* Work around redefinition to rpl_putenv by other config tests. */ #undef putenv static time_t time_t_max; static time_t time_t_min; /* Values we'll use to set the TZ environment variable. */ static char *tz_strings[] = { (char *) 0, "TZ=GMT0", "TZ=JST-9", "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) /* Return 0 if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ static int spring_forward_gap () { /* glibc (up to about 1998-10-07) failed this test. */ struct tm tm; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); tm.tm_year = 98; tm.tm_mon = 3; tm.tm_mday = 5; tm.tm_hour = 2; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; return mktime (&tm) != (time_t) -1; } static int mktime_test1 (now) time_t now; { struct tm *lt; return ! (lt = localtime (&now)) || mktime (lt) == now; } static int mktime_test (now) time_t now; { return (mktime_test1 (now) && mktime_test1 ((time_t) (time_t_max - now)) && mktime_test1 ((time_t) (time_t_min + now))); } static int irix_6_4_bug () { /* Based on code from Ariel Faigon. */ struct tm tm; tm.tm_year = 96; tm.tm_mon = 3; tm.tm_mday = 0; tm.tm_hour = 0; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; mktime (&tm); return tm.tm_mon == 2 && tm.tm_mday == 31; } static int bigtime_test (j) int j; { struct tm tm; time_t now; tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; now = mktime (&tm); if (now != (time_t) -1) { struct tm *lt = localtime (&now); if (! (lt && lt->tm_year == tm.tm_year && lt->tm_mon == tm.tm_mon && lt->tm_mday == tm.tm_mday && lt->tm_hour == tm.tm_hour && lt->tm_min == tm.tm_min && lt->tm_sec == tm.tm_sec && lt->tm_yday == tm.tm_yday && lt->tm_wday == tm.tm_wday && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) return 0; } return 1; } static int year_2050_test () { /* The correct answer for 2050-02-01 00:00:00 in Pacific time, ignoring leap seconds. */ unsigned long int answer = 2527315200UL; struct tm tm; time_t t; tm.tm_year = 2050 - 1900; tm.tm_mon = 2 - 1; tm.tm_mday = 1; tm.tm_hour = tm.tm_min = tm.tm_sec = 0; tm.tm_isdst = -1; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); t = mktime (&tm); /* Check that the result is either a failure, or close enough to the correct answer that we can assume the discrepancy is due to leap seconds. */ return (t == (time_t) -1 || (0 < t && answer - 120 <= t && t <= answer + 120)); } int main () { time_t t, delta; int i, j; /* This test makes some buggy mktime implementations loop. Give up after 60 seconds; a mktime slower than that isn't worth using anyway. */ alarm (60); for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2) continue; time_t_max--; if ((time_t) -1 < 0) for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2) continue; delta = time_t_max / 997; /* a suitable prime number */ for (i = 0; i < N_STRINGS; i++) { if (tz_strings[i]) putenv (tz_strings[i]); for (t = 0; t <= time_t_max - delta; t += delta) if (! mktime_test (t)) return 1; if (! (mktime_test ((time_t) 1) && mktime_test ((time_t) (60 * 60)) && mktime_test ((time_t) (60 * 60 * 24)))) return 1; for (j = 1; 0 < j; j *= 2) if (! bigtime_test (j)) return 1; if (! bigtime_test (j - 1)) return 1; } return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); }]])], [ac_cv_func_working_mktime=yes], [ac_cv_func_working_mktime=no], [ac_cv_func_working_mktime=no])]) if test $ac_cv_func_working_mktime = no; then AC_LIBOBJ([mktime]) fi ])# AC_FUNC_MKTIME AC_DEFUN([gl_FUNC_MKTIME], [ AC_REQUIRE([AC_FUNC_MKTIME]) if test $ac_cv_func_working_mktime = no; then AC_DEFINE(mktime, rpl_mktime, [Define to rpl_mktime if the replacement function should be used.]) gl_PREREQ_MKTIME fi ]) # Prerequisites of lib/mktime.c. AC_DEFUN([gl_PREREQ_MKTIME], [:]) blame-1.3.1/m4/unlocked-io.m40000644000076400007640000000306710527555560012540 00000000000000# unlocked-io.m4 serial 14 # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. dnl From Jim Meyering. dnl dnl See if the glibc *_unlocked I/O macros or functions are available. dnl Use only those *_unlocked macros or functions that are declared dnl (because some of them were declared in Solaris 2.5.1 but were removed dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run dnl on Solaris 2.6). AC_DEFUN([gl_FUNC_GLIBC_UNLOCKED_IO], [ AC_DEFINE([USE_UNLOCKED_IO], 1, [Define to 1 if you want getc etc. to use unlocked I/O if available. Unlocked I/O can improve performance in unithreaded apps, but it is not safe for multithreaded apps.]) dnl Persuade glibc and Solaris to declare dnl fgets_unlocked(), fputs_unlocked() etc. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CHECK_DECLS_ONCE([clearerr_unlocked]) AC_CHECK_DECLS_ONCE([feof_unlocked]) AC_CHECK_DECLS_ONCE([ferror_unlocked]) AC_CHECK_DECLS_ONCE([fflush_unlocked]) AC_CHECK_DECLS_ONCE([fgets_unlocked]) AC_CHECK_DECLS_ONCE([fputc_unlocked]) AC_CHECK_DECLS_ONCE([fputs_unlocked]) AC_CHECK_DECLS_ONCE([fread_unlocked]) AC_CHECK_DECLS_ONCE([fwrite_unlocked]) AC_CHECK_DECLS_ONCE([getc_unlocked]) AC_CHECK_DECLS_ONCE([getchar_unlocked]) AC_CHECK_DECLS_ONCE([putc_unlocked]) AC_CHECK_DECLS_ONCE([putchar_unlocked]) ]) blame-1.3.1/m4/sys_stat_h.m40000644000076400007640000000203210527555557012504 00000000000000# sys_stat_h.m4 serial 4 -*- Autoconf -*- dnl Copyright (C) 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Eric Blake. dnl Test whether contains lstat and mkdir or must be substituted. AC_DEFUN([gl_HEADER_SYS_STAT_H], [ dnl Check for lstat. Systems that lack it (mingw) also lack symlinks, so dnl stat is a good replacement. AC_CHECK_FUNCS_ONCE([lstat]) dnl Check for mkdir. Mingw has _mkdir(name) in the nonstandard dnl instead. AC_CHECK_DECLS([mkdir], [], [AC_CHECK_HEADERS([io.h])], [#include ]) AC_REQUIRE([AC_C_INLINE]) dnl Check for broken stat macros. AC_REQUIRE([AC_HEADER_STAT]) gl_ABSOLUTE_HEADER([sys/stat.h]) ABSOLUTE_SYS_STAT_H=\"$gl_cv_absolute_sys_stat_h\" AC_SUBST([ABSOLUTE_SYS_STAT_H]) SYS_STAT_H='sys/stat.h' AC_SUBST([SYS_STAT_H]) ]) # gl_HEADER_SYS_STAT_H blame-1.3.1/m4/strstr.m40000644000076400007640000000111410337302611011641 00000000000000# strstr.m4 serial 5 dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRSTR], [ dnl No known system has a strstr() function that works correctly in dnl multibyte locales. Therefore we use our version always. AC_LIBOBJ(strstr) gl_PREREQ_STRSTR ]) # Prerequisites of lib/strstr.c. AC_DEFUN([gl_PREREQ_STRSTR], [ AC_REQUIRE([gl_FUNC_MBRTOWC]) : ]) blame-1.3.1/m4/stdint.m40000644000076400007640000003036210527555557011640 00000000000000# stdint.m4 serial 19 dnl Copyright (C) 2001-2002, 2004-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert and Bruno Haible. dnl Test whether is supported or must be substituted. AC_DEFUN([gl_STDINT_H], [ AC_PREREQ(2.59)dnl dnl Check for long long int and unsigned long long int. AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) if test $ac_cv_type_long_long_int = yes; then HAVE_LONG_LONG_INT=1 else HAVE_LONG_LONG_INT=0 fi AC_SUBST([HAVE_LONG_LONG_INT]) AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) if test $ac_cv_type_unsigned_long_long_int = yes; then HAVE_UNSIGNED_LONG_LONG_INT=1 else HAVE_UNSIGNED_LONG_LONG_INT=0 fi AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) dnl Check for . AC_CHECK_HEADERS_ONCE([wchar.h]) if test $ac_cv_header_wchar_h = yes; then HAVE_WCHAR_H=1 else HAVE_WCHAR_H=0 fi AC_SUBST([HAVE_WCHAR_H]) dnl Check for . dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. if test $ac_cv_header_inttypes_h = yes; then HAVE_INTTYPES_H=1 else HAVE_INTTYPES_H=0 fi AC_SUBST([HAVE_INTTYPES_H]) dnl Check for . dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h. if test $ac_cv_header_sys_types_h = yes; then HAVE_SYS_TYPES_H=1 else HAVE_SYS_TYPES_H=0 fi AC_SUBST([HAVE_SYS_TYPES_H]) dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_stdint_h. if test $ac_cv_header_stdint_h = yes; then gl_ABSOLUTE_HEADER([stdint.h]) ABSOLUTE_STDINT_H=\"$gl_cv_absolute_stdint_h\" HAVE_STDINT_H=1 else ABSOLUTE_STDINT_H=\"no/such/file/stdint.h\" HAVE_STDINT_H=0 fi AC_SUBST([ABSOLUTE_STDINT_H]) AC_SUBST([HAVE_STDINT_H]) dnl Now see whether we need a substitute . Use dnl ABSOLUTE_STDINT_H, not , so that it also works during dnl a "config.status --recheck" if a stdint.h has been dnl created in the build directory. if test $ac_cv_header_stdint_h = yes; then AC_CACHE_CHECK([whether stdint.h conforms to C99], [gl_cv_header_working_stdint_h], [gl_cv_header_working_stdint_h=no AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ #include ABSOLUTE_STDINT_H #ifdef INT8_MAX int8_t a1 = INT8_MAX; int8_t a1min = INT8_MIN; #endif #ifdef INT16_MAX int16_t a2 = INT16_MAX; int16_t a2min = INT16_MIN; #endif #ifdef INT32_MAX int32_t a3 = INT32_MAX; int32_t a3min = INT32_MIN; #endif #ifdef INT64_MAX int64_t a4 = INT64_MAX; int64_t a4min = INT64_MIN; #endif #ifdef UINT8_MAX uint8_t b1 = UINT8_MAX; #else typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; #endif #ifdef UINT16_MAX uint16_t b2 = UINT16_MAX; #endif #ifdef UINT32_MAX uint32_t b3 = UINT32_MAX; #endif #ifdef UINT64_MAX uint64_t b4 = UINT64_MAX; #endif int_least8_t c1 = INT8_C (0x7f); int_least8_t c1max = INT_LEAST8_MAX; int_least8_t c1min = INT_LEAST8_MIN; int_least16_t c2 = INT16_C (0x7fff); int_least16_t c2max = INT_LEAST16_MAX; int_least16_t c2min = INT_LEAST16_MIN; int_least32_t c3 = INT32_C (0x7fffffff); int_least32_t c3max = INT_LEAST32_MAX; int_least32_t c3min = INT_LEAST32_MIN; int_least64_t c4 = INT64_C (0x7fffffffffffffff); int_least64_t c4max = INT_LEAST64_MAX; int_least64_t c4min = INT_LEAST64_MIN; uint_least8_t d1 = UINT8_C (0xff); uint_least8_t d1max = UINT_LEAST8_MAX; uint_least16_t d2 = UINT16_C (0xffff); uint_least16_t d2max = UINT_LEAST16_MAX; uint_least32_t d3 = UINT32_C (0xffffffff); uint_least32_t d3max = UINT_LEAST32_MAX; uint_least64_t d4 = UINT64_C (0xffffffffffffffff); uint_least64_t d4max = UINT_LEAST64_MAX; int_fast8_t e1 = INT_FAST8_MAX; int_fast8_t e1min = INT_FAST8_MIN; int_fast16_t e2 = INT_FAST16_MAX; int_fast16_t e2min = INT_FAST16_MIN; int_fast32_t e3 = INT_FAST32_MAX; int_fast32_t e3min = INT_FAST32_MIN; int_fast64_t e4 = INT_FAST64_MAX; int_fast64_t e4min = INT_FAST64_MIN; uint_fast8_t f1 = UINT_FAST8_MAX; uint_fast16_t f2 = UINT_FAST16_MAX; uint_fast32_t f3 = UINT_FAST32_MAX; uint_fast64_t f4 = UINT_FAST64_MAX; #ifdef INTPTR_MAX intptr_t g = INTPTR_MAX; intptr_t gmin = INTPTR_MIN; #endif #ifdef UINTPTR_MAX uintptr_t h = UINTPTR_MAX; #endif intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; struct s { int check_PTRDIFF: PTRDIFF_MIN < 0 && 0 < PTRDIFF_MAX ? 1 : -1; int check_SIG_ATOMIC: SIG_ATOMIC_MIN <= 0 && 0 < SIG_ATOMIC_MAX ? 1 : -1; int check_SIZE: 0 < SIZE_MAX ? 1 : -1; int check_WCHAR: WCHAR_MIN <= 0 && 0 < WCHAR_MAX ? 1 : -1; int check_WINT: WINT_MIN <= 0 && 0 < WINT_MAX ? 1 : -1; /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ int check_UINT8_C: (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; int check_UINT16_C: (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; /* Detect bugs in OpenBSD 3.9 stdint.h. */ #ifdef UINT8_MAX int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; #endif #ifdef UINT16_MAX int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; #endif #ifdef UINT32_MAX int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; #endif #ifdef UINT64_MAX int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; #endif int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; }; ]])], [gl_cv_header_working_stdint_h=yes])]) fi if test "$gl_cv_header_working_stdint_h" != yes; then dnl Check for , and for dnl (used in Linux libc4 >= 4.6.7 and libc5). AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) if test $ac_cv_header_sys_inttypes_h = yes; then HAVE_SYS_INTTYPES_H=1 else HAVE_SYS_INTTYPES_H=0 fi AC_SUBST([HAVE_SYS_INTTYPES_H]) if test $ac_cv_header_sys_bitypes_h = yes; then HAVE_SYS_BITYPES_H=1 else HAVE_SYS_BITYPES_H=0 fi AC_SUBST([HAVE_SYS_BITYPES_H]) gl_STDINT_TYPE_PROPERTIES STDINT_H=stdint.h fi AC_SUBST(STDINT_H) ]) dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) dnl Determine the size of each of the given types in bits. AC_DEFUN([gl_STDINT_BITSIZEOF], [ dnl Use a shell loop, to avoid bloating configure, and dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. AC_FOREACH([gltype], [$1], [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), [Define to the number of bits in type ']gltype['.])]) for gltype in $1 ; do AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}], [_AC_COMPUTE_INT([sizeof ($gltype) * CHAR_BIT], result, [$2 #include ], [result=unknown]) eval gl_cv_bitsizeof_${gltype}=\$result ]) eval result=\$gl_cv_bitsizeof_${gltype} if test $result = unknown; then dnl Use a nonempty default, because some compilers, such as IRIX 5 cc, dnl do a syntax check even on unused #if conditions and give an error dnl on valid C code like this: dnl #if 0 dnl # if > 32 dnl # endif dnl #endif result=0 fi GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result]) eval BITSIZEOF_${GLTYPE}=\$result done AC_FOREACH([gltype], [$1], [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) ]) dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES) dnl Determine the signedness of each of the given types. dnl Define HAVE_SIGNED_TYPE if type is signed. AC_DEFUN([gl_CHECK_TYPES_SIGNED], [ dnl Use a shell loop, to avoid bloating configure, and dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. AC_FOREACH([gltype], [$1], [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), [Define to 1 if ']gltype[' is a signed integer type.])]) for gltype in $1 ; do AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([$2[ int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])], result=yes, result=no) eval gl_cv_type_${gltype}_signed=\$result ]) eval result=\$gl_cv_type_${gltype}_signed GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` if test "$result" = yes; then AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], 1) eval HAVE_SIGNED_${GLTYPE}=1 else eval HAVE_SIGNED_${GLTYPE}=0 fi done AC_FOREACH([gltype], [$1], [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) ]) dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES) dnl Determine the suffix to use for integer constants of the given types. dnl Define t_SUFFIX for each such type. AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], [ dnl Use a shell loop, to avoid bloating configure, and dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. AC_FOREACH([gltype], [$1], [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX], [Define to l, ll, u, ul, ull, etc., as suitable for constants of type ']gltype['.])]) for gltype in $1 ; do AC_CACHE_CHECK([for $gltype integer literal suffix], [gl_cv_type_${gltype}_suffix], [eval gl_cv_type_${gltype}_suffix=no eval result=\$gl_cv_type_${gltype}_signed if test "$result" = yes; then glsufu= else glsufu=u fi for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do case $glsuf in '') gltype1='int';; l) gltype1='long int';; ll) gltype1='long long int';; i64) gltype1='__int64';; u) gltype1='unsigned int';; ul) gltype1='unsigned long int';; ull) gltype1='unsigned long long int';; ui64)gltype1='unsigned __int64';; esac AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([$2 extern $gltype foo; extern $gltype1 foo;])], [eval gl_cv_type_${gltype}_suffix=\$glsuf]) eval result=\$gl_cv_type_${gltype}_suffix test "$result" != no && break done]) GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` eval result=\$gl_cv_type_${gltype}_suffix test "$result" = no && result= eval ${GLTYPE}_SUFFIX=\$result AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result) done AC_FOREACH([gltype], [$1], [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) ]) dnl gl_STDINT_INCLUDES AC_DEFUN([gl_STDINT_INCLUDES], [[ #include #include #if HAVE_WCHAR_H /* BSD/OS 4.1 has a bug: and must be included before . */ # include # include # include #endif ]]) dnl gl_STDINT_TYPE_PROPERTIES dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t dnl of interest to stdint_.h. AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], [ gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], [gl_STDINT_INCLUDES]) gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t], [gl_STDINT_INCLUDES]) gl_cv_type_ptrdiff_t_signed=yes gl_cv_type_size_t_signed=no gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], [gl_STDINT_INCLUDES]) ]) blame-1.3.1/m4/double-slash-root.m40000644000076400007640000000266510527555557013703 00000000000000#serial 1 -*- autoconf -*- dnl Copyright (C) 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_DOUBLE_SLASH_ROOT], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether // is distinct from /], [ac_cv_double_slash_root], [ if test x"$cross_compiling" = xyes ; then # When cross-compiling, there is no way to tell whether // is special # short of a list of hosts. However, the only known hosts to date # that have a distinct // are Apollo DomainOS (too old to port to) # and Cygwin. If anyone knows of another system for which // has # special semantics and is distinct from /, please report it to # . case $host in *-cygwin) ac_cv_double_slash_root=yes ;; *) # Be optimistic and assume that / and // are the same when we # don't know. ac_cv_double_slash_root='unknown, assuming no' ;; esac else set x `ls -di / //` if test $[2] = $[4]; then ac_cv_double_slash_root=no else ac_cv_double_slash_root=yes fi fi]) if test x"$ac_cv_double_slash_root" = xyes; then ac_double_slash_root=1 else ac_double_slash_root=0 fi AC_DEFINE_UNQUOTED([DOUBLE_SLASH_IS_DISTINCT_ROOT], $ac_double_slash_root, [Define to 1 if // is a file system root distinct from /.]) ]) blame-1.3.1/m4/allocsa.m40000644000076400007640000000112010527555560011731 00000000000000# allocsa.m4 serial 6 dnl Copyright (C) 2003-2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_ALLOCSA], [ dnl Use the autoconf tests for alloca(), but not the AC_SUBSTed variables dnl @ALLOCA@ and @LTALLOCA@. dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies. AC_REQUIRE([gl_EEMALLOC]) AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_LONGDOUBLE]) ]) blame-1.3.1/m4/xsize.m40000644000076400007640000000064510203114524011446 00000000000000# xsize.m4 serial 3 dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_XSIZE], [ dnl Prerequisites of lib/xsize.h. AC_REQUIRE([gl_SIZE_MAX]) AC_REQUIRE([AC_C_INLINE]) AC_CHECK_HEADERS(stdint.h) ]) blame-1.3.1/m4/strnlen.m40000644000076400007640000000157410527555560012015 00000000000000# strnlen.m4 serial 6 dnl Copyright (C) 2002-2003, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRNLEN], [ dnl Persuade glibc to declare strnlen(). AC_REQUIRE([AC_GNU_SOURCE]) AC_FUNC_STRNLEN if test $ac_cv_func_strnlen_working = no; then # This is necessary because automake-1.6.1 doens't understand # that the above use of AC_FUNC_STRNLEN means we may have to use # lib/strnlen.c. #AC_LIBOBJ(strnlen) AC_DEFINE(strnlen, rpl_strnlen, [Define to rpl_strnlen if the replacement function should be used.]) gl_PREREQ_STRNLEN fi ]) # Prerequisites of lib/strnlen.c. AC_DEFUN([gl_PREREQ_STRNLEN], [ AC_CHECK_DECLS_ONCE(strnlen) ]) blame-1.3.1/m4/memcpy.m40000644000076400007640000000072310203114520011567 00000000000000# memcpy.m4 serial 2 dnl Copyright (C) 2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_MEMCPY], [ AC_REPLACE_FUNCS(memcpy) if test $ac_cv_func_memcpy = no; then gl_PREREQ_MEMCPY fi ]) # Prerequisites of lib/memcpy.c. AC_DEFUN([gl_PREREQ_MEMCPY], [ : ]) blame-1.3.1/m4/strftime.m40000644000076400007640000000164410527555560012163 00000000000000#serial 28 # Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Written by Jim Meyering and Paul Eggert. AC_DEFUN([gl_FUNC_GNU_STRFTIME], [AC_REQUIRE([gl_FUNC_STRFTIME])dnl ]) # These are the prerequisite macros for GNU's strftime.c replacement. AC_DEFUN([gl_FUNC_STRFTIME], [ AC_LIBOBJ([strftime]) # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE. AC_REQUIRE([AC_STRUCT_TIMEZONE]) AC_REQUIRE([AC_HEADER_TIME]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) AC_REQUIRE([gl_TM_GMTOFF]) AC_CHECK_FUNCS_ONCE(mblen mbrlen mempcpy tzset) AC_CHECK_HEADERS_ONCE(sys/time.h wchar.h) AC_DEFINE([my_strftime], [nstrftime], [Define to the name of the strftime replacement function.]) ]) blame-1.3.1/m4/strcase.m40000644000076400007640000000165710527555560011776 00000000000000# strcase.m4 serial 4 dnl Copyright (C) 2002, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_STRCASE], [ gl_FUNC_STRCASECMP gl_FUNC_STRNCASECMP ]) AC_DEFUN([gl_FUNC_STRCASECMP], [ dnl No known system has a strcasecmp() function that works correctly in dnl multibyte locales. Therefore we use our version always. AC_LIBOBJ(strcasecmp) gl_PREREQ_STRCASECMP ]) AC_DEFUN([gl_FUNC_STRNCASECMP], [ AC_REPLACE_FUNCS(strncasecmp) AC_CHECK_DECLS(strncasecmp) if test $ac_cv_func_strncasecmp = no; then gl_PREREQ_STRNCASECMP fi ]) # Prerequisites of lib/strcasecmp.c. AC_DEFUN([gl_PREREQ_STRCASECMP], [ AC_REQUIRE([gl_FUNC_MBRTOWC]) : ]) # Prerequisites of lib/strncasecmp.c. AC_DEFUN([gl_PREREQ_STRNCASECMP], [ : ]) blame-1.3.1/m4/d-ino.m40000644000076400007640000000164110527555560011331 00000000000000#serial 8 dnl From Jim Meyering. dnl dnl Check whether struct dirent has a member named d_ino. dnl # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2006 Free Software # Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO], [AC_CACHE_CHECK([for d_ino member in directory struct], jm_cv_struct_dirent_d_ino, [AC_TRY_LINK(dnl [ #include #include ], [struct dirent dp; dp.d_ino = 0;], jm_cv_struct_dirent_d_ino=yes, jm_cv_struct_dirent_d_ino=no) ] ) if test $jm_cv_struct_dirent_d_ino = yes; then AC_DEFINE(D_INO_IN_DIRENT, 1, [Define if there is a member named d_ino in the struct describing directory headers.]) fi ] ) blame-1.3.1/Makefile.am0000644000076400007640000000215110531314076011560 00000000000000# Process this file with automake to produce a Makefile. SUBDIRS = doc lib src tests AM_ETAGSFLAGS = --c-kinds=+lx ACLOCAL_AMFLAGS = -I m4 dist_noinst_DATA = blame.spec RPMBUILD_FLAGS = rpm: $(PACKAGE).spec dist rpmbuild $(RPMBUILD_FLAGS) -ta $(distdir).tar.gz mock: mock-fc6 mock-fc5 mock-fc4 mock-fc6: $(PACKAGE).spec dist-gzip TOPDIR="`rpm -E %_topdir`" || exit 1 && \ rpmbuild --define='fedora 6' --define='dist .fc6' --nodeps -ts $(distdir).tar.gz && \ mock -r fedora-6-i386-core.cfg --debug "$$TOPDIR/SRPMS/$(PACKAGE)-$(VERSION)-$(RELEASE).fc6.src.rpm" mock-fc5: $(PACKAGE).spec dist-gzip TOPDIR="`rpm -E %_topdir`" || exit 1 && \ rpmbuild --define='fedora 5' --define='dist .fc5' --nodeps -ts $(distdir).tar.gz && \ mock -r fedora-5-i386-core.cfg --debug "$$TOPDIR/SRPMS/$(PACKAGE)-$(VERSION)-$(RELEASE).fc5.src.rpm" mock-fc4: $(PACKAGE).spec dist-gzip TOPDIR="`rpm -E %_topdir`" || exit 1 && \ rpmbuild --define='fedora 4' --define='dist .fc4' --nodeps -ts $(distdir).tar.gz && \ mock -r fedora-4-i386-core.cfg --debug "$$TOPDIR/SRPMS/$(PACKAGE)-$(VERSION)-$(RELEASE).fc4.src.rpm" $(PACKAGE).spec: NEWS blame-1.3.1/config.h.in0000644000076400007640000005207310531540134011553 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define this to an absolute name of . */ #undef ABSOLUTE_STDINT_H /* Define this to an absolute name of . */ #undef ABSOLUTE_SYS_STAT_H /* Define to the number of bits in type 'ptrdiff_t'. */ #undef BITSIZEOF_PTRDIFF_T /* Define to the number of bits in type 'sig_atomic_t'. */ #undef BITSIZEOF_SIG_ATOMIC_T /* Define to the number of bits in type 'size_t'. */ #undef BITSIZEOF_SIZE_T /* Define to the number of bits in type 'wchar_t'. */ #undef BITSIZEOF_WCHAR_T /* Define to the number of bits in type 'wint_t'. */ #undef BITSIZEOF_WINT_T /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define to 1 if // is a file system root distinct from /. */ #undef DOUBLE_SLASH_IS_DISTINCT_ROOT /* Define if there is a member named d_ino in the struct describing directory headers. */ #undef D_INO_IN_DIRENT /* Define as good substitute value for EOVERFLOW. */ #undef EOVERFLOW /* Define to 1 to exit quickly without freeing all memory */ #undef FASTEXIT /* Define on systems for which file names may have a so-called `drive letter' prefix, define this to compute the length of that prefix, including the colon. */ #undef FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX /* Define if the backslash character may also serve as a file name component separator. */ #undef FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR /* Define if a drive letter prefix denotes a relative path if it is not followed by a file name component separator. */ #undef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE /* Define to 1 to add extern declaration of program_invocation_name to argp.h */ #undef GNULIB_PROGRAM_INVOCATION_NAME /* Define to 1 to add extern declaration of program_invocation_short_name to argp.h */ #undef GNULIB_PROGRAM_INVOCATION_SHORT_NAME /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have 'alloca' after including , a header that may be supplied by this distribution. */ #undef HAVE_ALLOCA /* Define HAVE_ALLOCA_H for backward compatibility with older code that includes only if HAVE_ALLOCA_H is defined. */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file. */ #undef HAVE_BP_SYM_H /* Define to 1 if your system has a GNU libc compatible `calloc' function, and to 0 otherwise. */ #undef HAVE_CALLOC /* Define to 1 if you have the `canonicalize_file_name' function. */ #undef HAVE_CANONICALIZE_FILE_NAME /* Define to 1 if you have the declaration of `canonicalize_file_name', and to 0 if you don't. */ #undef HAVE_DECL_CANONICALIZE_FILE_NAME /* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_CLEARERR_UNLOCKED /* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FEOF_UNLOCKED /* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FERROR_UNLOCKED /* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FFLUSH_UNLOCKED /* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FGETS_UNLOCKED /* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FPUTC_UNLOCKED /* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FPUTS_UNLOCKED /* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FREAD_UNLOCKED /* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FWRITE_UNLOCKED /* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_GETCHAR_UNLOCKED /* Define to 1 if you have the declaration of `getcwd', and to 0 if you don't. */ #undef HAVE_DECL_GETCWD /* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_GETC_UNLOCKED /* Define to 1 if you have the declaration of `getdelim', and to 0 if you don't. */ #undef HAVE_DECL_GETDELIM /* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. */ #undef HAVE_DECL_GETENV /* Define to 1 if you have the declaration of `getline', and to 0 if you don't. */ #undef HAVE_DECL_GETLINE /* Define to 1 if you have the declaration of `mkdir', and to 0 if you don't. */ #undef HAVE_DECL_MKDIR /* Define if program_invocation_name is declared */ #undef HAVE_DECL_PROGRAM_INVOCATION_NAME /* Define if program_invocation_short_name is declared */ #undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME /* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_PUTCHAR_UNLOCKED /* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_PUTC_UNLOCKED /* Define to 1 if you have the declaration of `strdup', and to 0 if you don't. */ #undef HAVE_DECL_STRDUP /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R /* Define to 1 if you have the declaration of `strncasecmp', and to 0 if you don't. */ #undef HAVE_DECL_STRNCASECMP /* Define to 1 if you have the declaration of `strndup', and to 0 if you don't. */ #undef HAVE_DECL_STRNDUP /* Define to 1 if you have the declaration of `strnlen', and to 0 if you don't. */ #undef HAVE_DECL_STRNLEN /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #undef HAVE_DECL_VSNPRINTF /* Define to 1 if you have the declaration of `wcwidth', and to 0 if you don't. */ #undef HAVE_DECL_WCWIDTH /* Define if you have the declaration of environ. */ #undef HAVE_ENVIRON_DECL /* Define to 1 if you have the header file. */ #undef HAVE_FEATURES_H /* Define to 1 if you have the `flockfile' function. */ #undef HAVE_FLOCKFILE /* Define to 1 if you have the `funlockfile' function. */ #undef HAVE_FUNLOCKFILE /* Define to 1 if you have the `getdelim' function. */ #undef HAVE_GETDELIM /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long_only' function. */ #undef HAVE_GETOPT_LONG_ONLY /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if the compiler supports one of the keywords 'inline', '__inline__', '__inline' and effectively inlines functions marked as such. */ #undef HAVE_INLINE /* Define if you have the 'intmax_t' type in or . */ #undef HAVE_INTMAX_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if exists, doesn't clash with , and declares uintmax_t. */ #undef HAVE_INTTYPES_H_WITH_UINTMAX /* Define to 1 if you have the header file. */ #undef HAVE_IO_H /* Define to 1 if you have the `iswcntrl' function. */ #undef HAVE_ISWCNTRL /* Define to 1 if you have the `iswprint' function. */ #undef HAVE_ISWPRINT /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the header file. */ #undef HAVE_LINEWRAP_H /* Define if you have the 'long double' type. */ #undef HAVE_LONG_DOUBLE /* Define to 1 if you support file names longer than 14 characters. */ #undef HAVE_LONG_FILE_NAMES /* Define if you have the 'long long' type. */ #undef HAVE_LONG_LONG /* Define to 1 if the system has the type `long long int'. */ #undef HAVE_LONG_LONG_INT /* Define to 1 if you have the `lstat' function. */ #undef HAVE_LSTAT /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the `mblen' function. */ #undef HAVE_MBLEN /* Define to 1 if you have the `mbrlen' function. */ #undef HAVE_MBRLEN /* Define to 1 if mbrtowc and mbstate_t are properly declared. */ #undef HAVE_MBRTOWC /* Define to 1 if declares mbstate_t. */ #undef HAVE_MBSTATE_T /* Define to 1 if you have the `memchr' function. */ #undef HAVE_MEMCHR /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mempcpy' function. */ #undef HAVE_MEMPCPY /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if defines the MIN and MAX macros. */ #undef HAVE_MINMAX_IN_LIMITS_H /* Define to 1 if defines the MIN and MAX macros. */ #undef HAVE_MINMAX_IN_SYS_PARAM_H /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define if you have the `nl_langinfo' function. */ #undef HAVE_NL_LANGINFO /* Define to 1 if libc includes obstacks. */ #undef HAVE_OBSTACK /* Define to 1 if getcwd works, except it sometimes fails when it shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT. If __GETCWD_PREFIX is not defined, it doesn't matter whether HAVE_PARTLY_WORKING_GETCWD is defined. */ #undef HAVE_PARTLY_WORKING_GETCWD /* Define if program_invocation_name is defined */ #undef HAVE_PROGRAM_INVOCATION_NAME /* Define if program_invocation_short_name is defined */ #undef HAVE_PROGRAM_INVOCATION_SHORT_NAME /* Define to 1 if the system has the type `ptrdiff_t'. */ #undef HAVE_PTRDIFF_T /* Define to 1 if you have the `readlink' function. */ #undef HAVE_READLINK /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if you have the `resolvepath' function. */ #undef HAVE_RESOLVEPATH /* Define to 1 if you have run the test for working tzset. */ #undef HAVE_RUN_TZSET_TEST /* Define to 1 if you have the header file. */ #undef HAVE_SEARCH_H /* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV /* Define to 1 if 'sig_atomic_t' is a signed integer type. */ #undef HAVE_SIGNED_SIG_ATOMIC_T /* Define to 1 if 'wchar_t' is a signed integer type. */ #undef HAVE_SIGNED_WCHAR_T /* Define to 1 if 'wint_t' is a signed integer type. */ #undef HAVE_SIGNED_WINT_T /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define if exists, doesn't clash with , and declares uintmax_t. */ #undef HAVE_STDINT_H_WITH_UINTMAX /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchrnul' function. */ #undef HAVE_STRCHRNUL /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror_r' function. */ #undef HAVE_STRERROR_R /* Define to 1 if cpp supports the ANSI # stringizing operator. */ #undef HAVE_STRINGIZE /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define if you have the strndup() function and it works. */ #undef HAVE_STRNDUP /* Define to 1 if you have the `strpbrk' function. */ #undef HAVE_STRPBRK /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if `tm_zone' is member of `struct tm'. */ #undef HAVE_STRUCT_TM_TM_ZONE /* Define to 1 if you have the header file. */ #undef HAVE_SYSEXITS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_BITYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if localtime_r, etc. have the type signatures that POSIX requires. */ #undef HAVE_TIME_R_POSIX /* Define if struct tm has the tm_gmtoff member. */ #undef HAVE_TM_GMTOFF /* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use `HAVE_STRUCT_TM_TM_ZONE' instead. */ #undef HAVE_TM_ZONE /* Define to 1 if you have the `tsearch' function. */ #undef HAVE_TSEARCH /* Define to 1 if you don't have `tm_zone' but do have the external array `tzname'. */ #undef HAVE_TZNAME /* Define to 1 if you have the `tzset' function. */ #undef HAVE_TZSET /* Define if you have the 'uintmax_t' type in or . */ #undef HAVE_UINTMAX_T /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unsetenv' function. */ #undef HAVE_UNSETENV /* Define if you have the 'unsigned long long' type. */ #undef HAVE_UNSIGNED_LONG_LONG /* Define to 1 if the system has the type `unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT /* Define to 1 if you have the `vasnprintf' function. */ #undef HAVE_VASNPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define if you have the 'wchar_t' type. */ #undef HAVE_WCHAR_T /* Define to 1 if you have the `wcslen' function. */ #undef HAVE_WCSLEN /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H /* Define to 1 if you have the `wcwidth' function. */ #undef HAVE_WCWIDTH /* Define if you have the 'wint_t' type. */ #undef HAVE_WINT_T /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL #if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR # define ISSLASH(C) ((C) == '/' || (C) == '\\') #else # define ISSLASH(C) ((C) == '/') #endif /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK /* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */ #undef MALLOC_0_IS_NONNULL /* Define to 1 to disable assertions */ #undef NDEBUG /* Define to the decimal point constant for use in the `nl_langinfo' function. Do not define if no constant is available. */ #undef NL_LANGINFO_DP /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if the C compiler supports function prototypes. */ #undef PROTOTYPES /* Define to 1 to provide canonicalize_filename_mode. */ #undef PROVIDE_CANONICALIZE_FILENAME_MODE /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'ptrdiff_t'. */ #undef PTRDIFF_T_SUFFIX /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'sig_atomic_t'. */ #undef SIG_ATOMIC_T_SUFFIX /* Define as the maximum value of type 'size_t', if the system doesn't define it. */ #undef SIZE_MAX /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'size_t'. */ #undef SIZE_T_SUFFIX /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if the `S_IS*' macros in do not work properly. */ #undef STAT_MACROS_BROKEN /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if strerror_r returns char *. */ #undef STRERROR_R_CHAR_P /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Define if tzset clobbers localtime's static buffer. */ #undef TZSET_CLOBBERS_LOCALTIME_BUFFER /* Define to 1 if you want getc etc. to use unlocked I/O if available. Unlocked I/O can improve performance in unithreaded apps, but it is not safe for multithreaded apps. */ #undef USE_UNLOCKED_IO /* Version number of package */ #undef VERSION /* Define if unsetenv() returns void, not int. */ #undef VOID_UNSETENV /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'wchar_t'. */ #undef WCHAR_T_SUFFIX /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'wint_t'. */ #undef WINT_T_SUFFIX /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Enable extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Define to rpl_ if the getcwd replacement function should be used. */ #undef __GETCWD_PREFIX /* Define to rpl_ if the getopt replacement functions and variables should be used. */ #undef __GETOPT_PREFIX /* Define like PROTOTYPES; this can be used by system headers. */ #undef __PROTOTYPES /* Define to rpl_calloc if the replacement function should be used. */ #undef calloc /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to rpl_free if the replacement function should be used. */ #undef free /* Define to a replacement function name for getline(). */ #undef getline /* Define to rpl_gettimeofday if the replacement function should be used. */ #undef gettimeofday /* Define to rpl_gmtime if the replacement function should be used. */ #undef gmtime /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to long or long long if and don't define. */ #undef intmax_t /* Define to rpl_localtime if the replacement function should be used. */ #undef localtime /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to a type if does not define. */ #undef mbstate_t /* Define to rpl_memcmp if the replacement function should be used. */ #undef memcmp /* Define to rpl_mktime if the replacement function should be used. */ #undef mktime /* Define to the name of the strftime replacement function. */ #undef my_strftime /* Define to `long' if does not define. */ #undef off_t /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to equivalent of C99 restrict keyword, or to nothing if this is not supported. Do not define if restrict is supported directly. */ #undef restrict /* Define to `unsigned' if does not define. */ #undef size_t /* Define as a signed type of the same size as size_t. */ #undef ssize_t /* Define to rpl_strnlen if the replacement function should be used. */ #undef strnlen /* Define to rpl_tzset if the wrapper function should be used. */ #undef tzset /* Define to unsigned long or unsigned long long if and don't define. */ #undef uintmax_t /* Define to empty if the keyword `volatile' does not work. Warning: valid code using `volatile' can become incorrect without. Disable with care. */ #undef volatile #ifndef PARAMS # if PROTOTYPES # define PARAMS(protos) protos # else /* ! PROTOTYPES */ # define PARAMS(protos) () # endif /* ! PROTOTYPES */ #endif /* Avoid memory leak in argp */ #define GNULIB_ARGP_DISABLE_DIRNAME 1 #if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR # define SUFFIXES "\\,v" # define DIRECTORY_SEPARATOR '\\' # define SSLASH "\\" #else /* ! FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR */ # define SUFFIXES ",v/" # define DIRECTORY_SEPARATOR '/' # define SSLASH "/" #endif /* ! FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR */ blame-1.3.1/config.sub0000755000076400007640000007577710527556374011555 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-07-08' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # 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 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | ms1 \ | msp430 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m32c) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | ms1-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; m32c-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: blame-1.3.1/NEWS0000644000076400007640000000254710531540012010223 00000000000000* Thu Nov 23 2006 Michael Chapman 1.3.1-1 - Gnulib updates. - Rebuilt for fc4/fc5/fc6. * Fri Dec 02 2005 Michael Chapman 1.3-1 - Minor bugfixes. * Thu Jun 30 2005 Michael Chapman 1.2-1 - Minor bugfixes. * Thu Nov 24 2004 Michael Chapman 1.1-1 - Rebuilt. * Thu Nov 24 2004 Michael Chapman 1.0-3 - Said gcc 3.4 bugs weren't actually bugs. * Thu Nov 23 2004 Michael Chapman 1.0-2 - Rebuild RPM with -mtune=i386 to work around gcc 3.4 bugs. * Thu Nov 23 2004 Michael Chapman 1.0-1 - Stable release. * Thu Nov 20 2004 Michael Chapman 0.3-2 - Fixed bug involving delta texts without empty last lines. - Fixed --help output. * Thu Nov 11 2004 Michael Chapman 0.3-1 - Support for $RCSINIT environment variable. - Support for -V and --version to emulate old RCS versions. - Minor bugfixes. - Added manpage. * Thu Oct 21 2004 Michael Chapman 0.2-1 - Major speed improvements. * Tue Sep 28 2004 Michael Chapman 0.1-2 - Fixed build for old Red Hat. * Mon Sep 27 2004 Michael Chapman 0.1-1 - Initial RPM release. blame-1.3.1/INSTALL0000664000076400007640000002203010125542443010555 00000000000000Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. blame-1.3.1/COPYING0000664000076400007640000004311010125542443010561 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. blame-1.3.1/configure.ac0000644000076400007640000000516710531537771012035 00000000000000# Process this file with autoconf to produce a configure script. AC_INIT([blame], [1.3.1], [foonly@users.sourceforge.net]) AC_CONFIG_SRCDIR([src/blame.c]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE([-Wall ansi2knr std-options]) AC_SUBST(RELEASE, 1) AC_CONFIG_MACRO_DIR(m4) AC_CONFIG_LIBOBJ_DIR(lib) AC_CONFIG_TESTDIR(tests, tests:src) AC_GNU_SOURCE # Checks for programs. AC_PROG_CC AM_PROG_CC_C_O gl_EARLY AM_PROG_LEX AC_PROG_YACC AC_PROG_RANLIB # Checks for libraries. # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS_ONCE([libintl.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AM_C_PROTOTYPES AC_C_STRINGIZE AC_C_VOLATILE AC_TYPE_SIZE_T AC_TYPE_OFF_T # canonicalize gnulib module needs this gl_AC_TYPE_UINTMAX_T AH_BOTTOM([ #ifndef PARAMS # if PROTOTYPES # define PARAMS(protos) protos # else /* ! PROTOTYPES */ # define PARAMS(protos) () # endif /* ! PROTOTYPES */ #endif ]) AH_BOTTOM([ /* Avoid memory leak in argp */ #define GNULIB_ARGP_DISABLE_DIRNAME 1 ]) # Checks for library functions. gl_INIT mac_HAVE_NL_LANGINFO AC_FUNC_MMAP AC_SYS_LONG_FILE_NAMES dnl This relies on certain dos.m4 behaviour... AC_SUBST(FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR, [$ac_fs_backslash_is_file_name_separator]) AH_BOTTOM([ #if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR # define SUFFIXES "\\,v" # define DIRECTORY_SEPARATOR '\\' # define SSLASH "\\" #else /* ! FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR */ # define SUFFIXES ",v/" # define DIRECTORY_SEPARATOR '/' # define SSLASH "/" #endif /* ! FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR */ ]) AC_ARG_ENABLE(debug, AS_HELP_STRING(--enable-debug, [include debug code (e.g. assertions)])) case "$enable_debug" in no|"") AC_DEFINE(NDEBUG, 1, [Define to 1 to disable assertions]) ;; *) ;; esac AC_ARG_ENABLE(debug, AS_HELP_STRING(--enable-profile, [enable profiling])) case "$enable_profile" in no|"") ;; *) if test "$GCC" != "yes"; then AC_MSG_ERROR([I can only use profiling on GCC]) fi CFLAGS=`echo $CFLAGS -pg -fprofile-arcs -ftest-coverage | sed -e s,-O2,-O0,` LDFLAGS="$LDFLAGS -pg -fprofile-arcs -ftest-coverage" ;; esac AC_ARG_ENABLE(fastexit, AS_HELP_STRING(--disable-fastexit, [free all memory when exiting])) case "$enable_fastexit" in yes|"") AC_DEFINE(FASTEXIT, 1, [Define to 1 to exit quickly without freeing all memory]) FASTEXIT=1 ;; *) FASTEXIT=0 ;; esac AC_SUBST([FASTEXIT]) AM_CONDITIONAL(GCC, test "$GCC" = yes) CFLAGS=`echo $CFLAGS | sed -e s,-O2,-O3,` NEWS=NEWS AC_SUBST_FILE(NEWS) AC_CONFIG_FILES([ Makefile doc/Makefile lib/Makefile src/Makefile tests/Makefile tests/atlocal blame.spec ]) AC_OUTPUT blame-1.3.1/config.rpath0000775000076400007640000003502510220031417012032 00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2005 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` cc_basename=`echo "$CC" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; darwin*) case "$cc_basename" in xlc*) wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux*) case $cc_basename in icc* | ecc*) wl='-Wl,' ;; pgcc | pgf77 | pgf90) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; como) wl='-lopt=' ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; sco3.2v5*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) wl='-Wl,' ;; sysv4*MP*) ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then case "$host_os" in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we cannot use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sunos4*) hardcode_direct=yes ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if test "$GCC" = yes ; then : else case "$cc_basename" in xlc*) ;; *) ld_shlibs=no ;; esac fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | kfreebsd*-gnu | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10* | hpux11*) if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4.2uw2*) hardcode_direct=yes hardcode_minus_L=no ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) ;; sysv5*) hardcode_libdir_flag_spec= ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. libname_spec='lib$name' case "$host_os" in aix3*) ;; aix4* | aix5*) ;; amigaos*) ;; beos*) ;; bsdi[45]*) ;; cygwin* | mingw* | pw32*) shrext=.dll ;; darwin* | rhapsody*) shrext=.dylib ;; dgux*) ;; freebsd1*) ;; kfreebsd*-gnu) ;; freebsd*) ;; gnu*) ;; hpux9* | hpux10* | hpux11*) case "$host_cpu" in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac ;; irix5* | irix6* | nonstopux*) case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux*) ;; knetbsd*-gnu) ;; netbsd*) ;; newsos6) ;; nto-qnx*) ;; openbsd*) ;; os2*) libname_spec='$name' shrext=.dll ;; osf3* | osf4* | osf5*) ;; sco3.2v5*) ;; solaris*) ;; sunos4*) ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) ;; sysv4*MP*) ;; uts4*) ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < BuildRoot: %{_tmppath}/%{name}-%{version}-root Prefix: %{_prefix} %description Blame displays the last modification for each line in an RCS file. It is the RCS equivalent of CVS's "annotate" command. %prep %setup %build %{configure} %{__make} %{__make} check %install %{makeinstall} %clean if test "$RPM_BUILD_ROOT" != "/"; then %{__rm} -rf $RPM_BUILD_ROOT fi %files %defattr(-,root,root) %doc AUTHORS COPYING ChangeLog INSTALL NEWS README %{_bindir}/* %{_mandir}/*/* %changelog @NEWS@ blame-1.3.1/install-sh0000775000076400007640000002177010125542443011542 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2004-02-15.20 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename= transform_arg= instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= usage="Usage: $0 [OPTION]... SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 -d DIRECTORIES... In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. In the second, create the directory path DIR. Options: -b=TRANSFORMBASENAME -c copy source (using $cpprog) instead of moving (using $mvprog). -d create directories instead of installing files. -g GROUP $chgrp installed files to GROUP. -m MODE $chmod installed files to MODE. -o USER $chown installed files to USER. -s strip installed files (using $stripprog). -t=TRANSFORM --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; -c) instcmd=$cpprog shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit 0;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; --version) echo "$0 $scriptversion"; exit 0;; *) # When -d is used, all remaining arguments are directories to create. test -n "$dir_arg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then instcmd=: chmodcmd= else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" || lasterr=$? # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; } fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $instcmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else # If we're going to rename the final executable, determine the name now. if test -z "$transformarg"; then dstfile=`basename "$dst"` else dstfile=`basename "$dst" $transformbasename \ | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename. test -z "$dstfile" && dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now remove or move aside any old file at destination location. We # try this two ways since rm can't unlink itself on some systems and # the destination file might be busy for other reasons. In this case, # the final cleanup might fail but the new file should still install # successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi || { (exit 1); exit; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: blame-1.3.1/tests/0000777000076400007640000000000010531540140010744 500000000000000blame-1.3.1/tests/atlocal.in0000644000076400007640000000076310527567565012666 00000000000000testdir=`(cd "${abs_srcdir}/testdata"; exec pwd)` username=`whoami 2>/dev/null` space=" " if test "@FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR@" = 1; then slash="\\" else slash="/" fi package_string="@PACKAGE_STRING@" PRELOAD= BLAME=$abs_top_builddir/src/blame if test "$VALGRIND" = 1; then if test "@FASTEXIT@" = 1; then PRELOAD="valgrind -q --tool=memcheck --error-exitcode=42" else PRELOAD="valgrind -q --tool=memcheck --error-exitcode=42 --leak-check=yes" fi fi export PRELOAD BLAME blame-1.3.1/tests/Makefile.in0000644000076400007640000003312610531540111012730 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Process this file with automake to produce a Makefile. srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/atlocal.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/allocsa.m4 \ $(top_srcdir)/m4/argp.m4 $(top_srcdir)/m4/calloc.m4 \ $(top_srcdir)/m4/canonicalize.m4 \ $(top_srcdir)/m4/cycle-check.m4 $(top_srcdir)/m4/d-ino.m4 \ $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ $(top_srcdir)/m4/double-slash-root.m4 \ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/eoverflow.m4 \ $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exitfail.m4 \ $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/filenamecat.m4 \ $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/getcwd-abort-bug.m4 \ $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ $(top_srcdir)/m4/getdelim.m4 $(top_srcdir)/m4/getline.m4 \ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/inline.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ $(top_srcdir)/m4/langinfo.m4 $(top_srcdir)/m4/longdouble.m4 \ $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memcmp.m4 \ $(top_srcdir)/m4/memcpy.m4 $(top_srcdir)/m4/memmove.m4 \ $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memset.m4 \ $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mktime.m4 \ $(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/pathmax.m4 \ $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/setenv.m4 \ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/ssize_t.m4 \ $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stdint.m4 \ $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcase.m4 \ $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \ $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strpbrk.m4 \ $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtol.m4 \ $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ $(top_srcdir)/m4/sysexits.m4 $(top_srcdir)/m4/time_r.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/tzset.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/unistd_h.m4 \ $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vsnprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \ $(top_srcdir)/m4/xreadlink.m4 $(top_srcdir)/m4/xsize.m4 \ $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = atlocal SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ FASTEXIT = @FASTEXIT@ FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR = @FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR@ GCC_FALSE = @GCC_FALSE@ GCC_TRUE = @GCC_TRUE@ GETOPT_H = @GETOPT_H@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ 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_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE__BOOL = @HAVE__BOOL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBMISC_LIBDEPS = @LIBMISC_LIBDEPS@ LIBMISC_LTLIBDEPS = @LIBMISC_LTLIBDEPS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYSEXITS_H = @SYSEXITS_H@ SYS_STAT_H = @SYS_STAT_H@ U = @U@ UNISTD_H = @UNISTD_H@ VERSION = @VERSION@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ EXTRA_DIST = blame package.m4 testsuite $(TESTSUITE_AT) testdata DISTCLEANFILES = atconfig atlocal MAINTAINERCLEANFILES = $(TESTSUITE) TESTSUITE = $(srcdir)/testsuite TESTSUITE_AT = \ testsuite.at \ argv.at \ rev.at \ date.at \ state.at \ author.at \ expand.at \ suffixes.at \ mixed.at \ branch.at \ rcs.at \ working.at \ pairing.at \ rcsinit.at \ version.at \ log.at AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te AUTOTEST = $(AUTOM4TE) --language=autotest all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh atlocal: $(top_builddir)/config.status $(srcdir)/atlocal.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: installcheck-local maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am check-local clean clean-generic \ clean-local distclean distclean-generic distdir dvi dvi-am \ html html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installcheck-local installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am $(srcdir)/package.m4: $(top_srcdir)/configure.ac @{ \ echo '# Signature of the current package.'; \ echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \ echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \ echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \ echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \ echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \ } >$(srcdir)/package.m4 $(TESTSUITE): package.m4 $(TESTSUITE_AT) $(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp mv $@.tmp $@ atconfig: $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status tests/$@ clean-local: if [ -x $(TESTSUITE) ]; then $(SHELL) $(TESTSUITE) --clean; fi check-local: atconfig atlocal $(TESTSUITE) $(top_builddir)/src/blame$(EXEEXT) $(SHELL) $(TESTSUITE) # Run the test suite on the *installed* tree. installcheck-local: atconfig atlocal $(TESTSUITE) $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin # 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. .NOEXPORT: blame-1.3.1/tests/package.m40000664000076400007640000000043010531540137012522 00000000000000# Signature of the current package. m4_define([AT_PACKAGE_NAME], [blame]) m4_define([AT_PACKAGE_TARNAME], [blame]) m4_define([AT_PACKAGE_VERSION], [1.3.1]) m4_define([AT_PACKAGE_STRING], [blame 1.3.1]) m4_define([AT_PACKAGE_BUGREPORT], [foonly@users.sourceforge.net]) blame-1.3.1/tests/testdata/0000777000076400007640000000000010337302611012560 500000000000000blame-1.3.1/tests/testdata/complex-1.2.1.1.1.1.expout0000664000076400007640000000043110125542443016507 000000000000001.1 (user3 01-Jan-01): Line 1 1.2 (user2 01-Jan-01): Line 2 1.2.1.1 (user1 01-Jan-01): On branch 1.2.1: 1.2.1.1 (user1 01-Jan-01): Line 1 1.2.1.1.1.1 (user1 01-Jan-01): On branch 1.2.1.1.1.1 1.2.1.1.1.1 (user1 01-Jan-01): Line 1 blame-1.3.1/tests/testdata/escape-1.2.expout0000664000076400007640000003337410337302532015516 000000000000001.2 (username 01-Jan-01): $ : @ @ : $ 1.2 (username 01-Jan-01): $ : @ $ : @ 1.2 (username 01-Jan-01): $ : @ $ @ : 1.2 (username 01-Jan-01): $ : @ $ : @ 1.2 (username 01-Jan-01): $ : @ $ : @ 1.2 (username 01-Jan-01): $ : @ $ @ : 1.2 (username 01-Jan-01): $ : @ $ @ : 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ : @ @ : $ 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ : @ @ : $ 1.2 (username 01-Jan-01): $ : @ @ : $ 1.2 (username 01-Jan-01): $ : @ $ @ : 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): @ : $ $ : @ 1.2 (username 01-Jan-01): @ : $ $ @ : 1.2 (username 01-Jan-01): @ : $ $ : @ 1.2 (username 01-Jan-01): @ : $ $ : @ 1.2 (username 01-Jan-01): @ : $ $ @ : 1.2 (username 01-Jan-01): @ : $ $ @ : 1.2 (username 01-Jan-01): @ : $ : $ @ 1.2 (username 01-Jan-01): @ : $ : @ $ 1.2 (username 01-Jan-01): @ : $ : $ @ 1.2 (username 01-Jan-01): @ : $ : $ @ 1.2 (username 01-Jan-01): @ : $ : @ $ 1.2 (username 01-Jan-01): @ : $ : @ $ 1.2 (username 01-Jan-01): @ : $ @ $ : 1.2 (username 01-Jan-01): @ : $ @ : $ 1.2 (username 01-Jan-01): @ : $ @ $ : 1.2 (username 01-Jan-01): @ : $ @ $ : 1.2 (username 01-Jan-01): @ : $ @ : $ 1.2 (username 01-Jan-01): @ : $ @ : $ 1.2 (username 01-Jan-01): @ : $ $ @ : 1.2 (username 01-Jan-01): @ : $ : $ @ 1.2 (username 01-Jan-01): @ : $ : @ $ 1.2 (username 01-Jan-01): @ : $ @ $ : 1.2 (username 01-Jan-01): $ : @ $ @ : 1.2 (username 01-Jan-01): $ : @ $ : @ 1.2 (username 01-Jan-01): $ : @ $ : @ 1.2 (username 01-Jan-01): $ : @ $ @ : 1.2 (username 01-Jan-01): $ : @ $ @ : 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ : @ @ : $ 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ : @ @ : $ 1.2 (username 01-Jan-01): $ : @ @ : $ 1.2 (username 01-Jan-01): $ : @ $ @ : 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ @ : $ : @ 1.2 (username 01-Jan-01): $ @ : $ : @ 1.2 (username 01-Jan-01): $ @ : $ @ : 1.2 (username 01-Jan-01): $ @ : $ @ : 1.2 (username 01-Jan-01): $ @ : : $ @ 1.2 (username 01-Jan-01): $ @ : : @ $ 1.2 (username 01-Jan-01): $ @ : : $ @ 1.2 (username 01-Jan-01): $ @ : : $ @ 1.2 (username 01-Jan-01): $ @ : : @ $ 1.2 (username 01-Jan-01): $ @ : : @ $ 1.2 (username 01-Jan-01): $ @ : @ $ : 1.2 (username 01-Jan-01): $ @ : @ : $ 1.2 (username 01-Jan-01): $ @ : @ $ : 1.2 (username 01-Jan-01): $ @ : @ $ : 1.2 (username 01-Jan-01): $ @ : @ : $ 1.2 (username 01-Jan-01): $ @ : @ : $ 1.2 (username 01-Jan-01): $ @ : $ @ : 1.2 (username 01-Jan-01): $ @ : : $ @ 1.2 (username 01-Jan-01): $ @ : : @ $ 1.2 (username 01-Jan-01): $ @ : @ $ : 1.2 (username 01-Jan-01): $ : @ $ : @ 1.2 (username 01-Jan-01): $ : @ $ @ : 1.2 (username 01-Jan-01): $ : @ $ @ : 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ : @ @ : $ 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ : @ @ : $ 1.2 (username 01-Jan-01): $ : @ @ : $ 1.2 (username 01-Jan-01): $ : @ $ @ : 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ : @ $ @ : 1.2 (username 01-Jan-01): $ : @ $ @ : 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ : @ @ : $ 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ : @ @ : $ 1.2 (username 01-Jan-01): $ : @ @ : $ 1.2 (username 01-Jan-01): $ : @ $ @ : 1.2 (username 01-Jan-01): $ : @ : $ @ 1.2 (username 01-Jan-01): $ : @ : @ $ 1.2 (username 01-Jan-01): $ : @ @ $ : 1.2 (username 01-Jan-01): $ @ : $ @ : 1.2 (username 01-Jan-01): $ @ : : $ @ 1.2 (username 01-Jan-01): $ @ : : @ $ 1.2 (username 01-Jan-01): $ @ : : $ @ 1.2 (username 01-Jan-01): $ @ : : $ @ 1.2 (username 01-Jan-01): $ @ : : @ $ 1.2 (username 01-Jan-01): $ @ : : @ $ 1.2 (username 01-Jan-01): $ @ : @ $ : 1.2 (username 01-Jan-01): $ @ : @ : $ 1.2 (username 01-Jan-01): $ @ : @ $ : 1.2 (username 01-Jan-01): $ @ : @ $ : 1.2 (username 01-Jan-01): $ @ : @ : $ 1.2 (username 01-Jan-01): $ @ : @ : $ 1.2 (username 01-Jan-01): $ @ : $ @ : 1.2 (username 01-Jan-01): $ @ : : $ @ 1.2 (username 01-Jan-01): $ @ : : @ $ 1.2 (username 01-Jan-01): $ @ : @ $ : 1.2 (username 01-Jan-01): $ @ : : $ @ 1.2 (username 01-Jan-01): $ @ : : @ $ 1.2 (username 01-Jan-01): $ @ : : $ @ 1.2 (username 01-Jan-01): $ @ : : $ @ 1.2 (username 01-Jan-01): $ @ : : @ $ 1.2 (username 01-Jan-01): $ @ : : @ $ 1.2 (username 01-Jan-01): $ @ : @ $ : 1.2 (username 01-Jan-01): $ @ : @ : $ 1.2 (username 01-Jan-01): $ @ : @ $ : 1.2 (username 01-Jan-01): $ @ : @ $ : 1.2 (username 01-Jan-01): $ @ : @ : $ 1.2 (username 01-Jan-01): $ @ : @ : $ 1.2 (username 01-Jan-01): $ @ : $ @ : 1.2 (username 01-Jan-01): $ @ : : $ @ 1.2 (username 01-Jan-01): $ @ : : @ $ 1.2 (username 01-Jan-01): $ @ : @ $ : 1.2 (username 01-Jan-01): : $ @ : @ $ 1.2 (username 01-Jan-01): : $ @ : $ @ 1.2 (username 01-Jan-01): : $ @ : $ @ 1.2 (username 01-Jan-01): : $ @ : @ $ 1.2 (username 01-Jan-01): : $ @ : @ $ 1.2 (username 01-Jan-01): : $ @ @ $ : 1.2 (username 01-Jan-01): : $ @ @ : $ 1.2 (username 01-Jan-01): : $ @ @ $ : 1.2 (username 01-Jan-01): : $ @ @ $ : 1.2 (username 01-Jan-01): : $ @ @ : $ 1.2 (username 01-Jan-01): : $ @ @ : $ 1.2 (username 01-Jan-01): : $ @ $ @ : 1.2 (username 01-Jan-01): : $ @ : $ @ 1.2 (username 01-Jan-01): : $ @ : @ $ 1.2 (username 01-Jan-01): : $ @ @ $ : 1.2 (username 01-Jan-01): : @ $ : $ @ 1.2 (username 01-Jan-01): : @ $ : $ @ 1.2 (username 01-Jan-01): : @ $ : @ $ 1.2 (username 01-Jan-01): : @ $ : @ $ 1.2 (username 01-Jan-01): : @ $ @ $ : 1.2 (username 01-Jan-01): : @ $ @ : $ 1.2 (username 01-Jan-01): : @ $ @ $ : 1.2 (username 01-Jan-01): : @ $ @ $ : 1.2 (username 01-Jan-01): : @ $ @ : $ 1.2 (username 01-Jan-01): : @ $ @ : $ 1.2 (username 01-Jan-01): : @ $ $ @ : 1.2 (username 01-Jan-01): : @ $ : $ @ 1.2 (username 01-Jan-01): : @ $ : @ $ 1.2 (username 01-Jan-01): : @ $ @ $ : 1.2 (username 01-Jan-01): : $ @ : $ @ 1.2 (username 01-Jan-01): : $ @ : @ $ 1.2 (username 01-Jan-01): : $ @ : @ $ 1.2 (username 01-Jan-01): : $ @ @ $ : 1.2 (username 01-Jan-01): : $ @ @ : $ 1.2 (username 01-Jan-01): : $ @ @ $ : 1.2 (username 01-Jan-01): : $ @ @ $ : 1.2 (username 01-Jan-01): : $ @ @ : $ 1.2 (username 01-Jan-01): : $ @ @ : $ 1.2 (username 01-Jan-01): : $ @ $ @ : 1.2 (username 01-Jan-01): : $ @ : $ @ 1.2 (username 01-Jan-01): : $ @ : @ $ 1.2 (username 01-Jan-01): : $ @ @ $ : 1.2 (username 01-Jan-01): : $ @ : @ $ 1.2 (username 01-Jan-01): : $ @ : @ $ 1.2 (username 01-Jan-01): : $ @ @ $ : 1.2 (username 01-Jan-01): : $ @ @ : $ 1.2 (username 01-Jan-01): : $ @ @ $ : 1.2 (username 01-Jan-01): : $ @ @ $ : 1.2 (username 01-Jan-01): : $ @ @ : $ 1.2 (username 01-Jan-01): : $ @ @ : $ 1.2 (username 01-Jan-01): : $ @ $ @ : 1.2 (username 01-Jan-01): : $ @ : $ @ 1.2 (username 01-Jan-01): : $ @ : @ $ 1.2 (username 01-Jan-01): : $ @ @ $ : 1.2 (username 01-Jan-01): : @ $ : @ $ 1.2 (username 01-Jan-01): : @ $ @ $ : 1.2 (username 01-Jan-01): : @ $ @ : $ 1.2 (username 01-Jan-01): : @ $ @ $ : 1.2 (username 01-Jan-01): : @ $ @ $ : 1.2 (username 01-Jan-01): : @ $ @ : $ 1.2 (username 01-Jan-01): : @ $ @ : $ 1.2 (username 01-Jan-01): : @ $ $ @ : 1.2 (username 01-Jan-01): : @ $ : $ @ 1.2 (username 01-Jan-01): : @ $ : @ $ 1.2 (username 01-Jan-01): : @ $ @ $ : 1.2 (username 01-Jan-01): : @ $ @ $ : 1.2 (username 01-Jan-01): : @ $ @ : $ 1.2 (username 01-Jan-01): : @ $ @ $ : 1.2 (username 01-Jan-01): : @ $ @ $ : 1.2 (username 01-Jan-01): : @ $ @ : $ 1.2 (username 01-Jan-01): : @ $ @ : $ 1.2 (username 01-Jan-01): : @ $ $ @ : 1.2 (username 01-Jan-01): : @ $ : $ @ 1.2 (username 01-Jan-01): : @ $ : @ $ 1.2 (username 01-Jan-01): : @ $ @ $ : 1.2 (username 01-Jan-01): @ $ : @ : $ 1.2 (username 01-Jan-01): @ $ : @ $ : 1.2 (username 01-Jan-01): @ $ : @ $ : 1.2 (username 01-Jan-01): @ $ : @ : $ 1.2 (username 01-Jan-01): @ $ : @ : $ 1.2 (username 01-Jan-01): @ $ : $ @ : 1.2 (username 01-Jan-01): @ $ : : $ @ 1.2 (username 01-Jan-01): @ $ : : @ $ 1.2 (username 01-Jan-01): @ $ : @ $ : 1.2 (username 01-Jan-01): @ : $ @ $ : 1.2 (username 01-Jan-01): @ : $ @ $ : 1.2 (username 01-Jan-01): @ : $ @ : $ 1.2 (username 01-Jan-01): @ : $ @ : $ 1.2 (username 01-Jan-01): @ : $ $ @ : 1.2 (username 01-Jan-01): @ : $ : $ @ 1.2 (username 01-Jan-01): @ : $ : @ $ 1.2 (username 01-Jan-01): @ : $ @ $ : 1.2 (username 01-Jan-01): @ $ : @ $ : 1.2 (username 01-Jan-01): @ $ : @ : $ 1.2 (username 01-Jan-01): @ $ : @ : $ 1.2 (username 01-Jan-01): @ $ : $ @ : 1.2 (username 01-Jan-01): @ $ : : $ @ 1.2 (username 01-Jan-01): @ $ : : @ $ 1.2 (username 01-Jan-01): @ $ : @ $ : 1.2 (username 01-Jan-01): @ $ : @ : $ 1.2 (username 01-Jan-01): @ $ : @ : $ 1.2 (username 01-Jan-01): @ $ : $ @ : 1.2 (username 01-Jan-01): @ $ : : $ @ 1.2 (username 01-Jan-01): @ $ : : @ $ 1.2 (username 01-Jan-01): @ $ : @ $ : 1.2 (username 01-Jan-01): @ : $ @ : $ 1.2 (username 01-Jan-01): @ : $ $ @ : 1.2 (username 01-Jan-01): @ : $ : $ @ 1.2 (username 01-Jan-01): @ : $ : @ $ 1.2 (username 01-Jan-01): @ : $ @ $ : 1.2 (username 01-Jan-01): @ : $ $ @ : 1.2 (username 01-Jan-01): @ : $ : $ @ 1.2 (username 01-Jan-01): @ : $ : @ $ 1.2 (username 01-Jan-01): @ : $ @ $ : 1.2 (username 01-Jan-01): $ @ : : $ @ 1.2 (username 01-Jan-01): $ @ : : @ $ 1.2 (username 01-Jan-01): $ @ : @ $ : 1.2 (username 01-Jan-01): : $ @ : @ $ 1.2 (username 01-Jan-01): : $ @ @ $ : 1.2 (username 01-Jan-01): : @ $ @ $ : blame-1.3.1/tests/testdata/compat-1.1.expout0000664000076400007640000000007410126243134015525 000000000000001.1 (username 31-Dec-99): Two-digit years in date. blame-1.3.1/tests/testdata/log.experr0000664000076400007640000000004510144372160014507 00000000000000 Annotations for log *************** blame-1.3.1/tests/testdata/empty,v0000664000076400007640000000011310126243134014014 00000000000000head ; access; symbols; locks; strict; comment @# @; desc @Empty file @ blame-1.3.1/tests/testdata/complex-3.4.expout0000664000076400007640000000054410125542443015724 000000000000001.4 (user3 01-Jan-01): Line 0 1.1 (user3 01-Jan-01): Line 1 1.4 (user3 01-Jan-01): Line 4 1.5 (user2 01-Jan-01): Line 5 2.1 (user1 01-Jan-01): Bump to branch 2 2.2 (user3 01-Jan-01): Line 6 3.3 (user2 01-Jan-01): Bump to branch 3 3.4 (user1 01-Jan-01): Line 7 blame-1.3.1/tests/testdata/log-1.2.expout0000664000076400007640000000506110260373433015032 000000000000001.2 (username 02-Feb-02): Text at top. Three ats: @@@ 1.1 (username 01-Jan-01): 1.2 (username 02-Feb-02): === $Log: log,v $ 1.2 (username 02-Feb-02): === Revision 1.2 2002/02/02 02:02:02 username 1.2 (username 02-Feb-02): === This log line contains an @ symbol... 1.2 (username 02-Feb-02): === 1.2 (username 02-Feb-02): === Revision 1.1 2001/01/01 01:01:01 username 1.2 (username 02-Feb-02): === Initial revision 1.2 (username 02-Feb-02): === === 1.2 (username 02-Feb-02): 1.2 (username 02-Feb-02): # $Log: log,v $ 1.2 (username 02-Feb-02): # Revision 1.2 2002/02/02 02:02:02 username 1.2 (username 02-Feb-02): # This log line contains an @ symbol... 1.2 (username 02-Feb-02): # 1.2 (username 02-Feb-02): # Revision 1.1 2001/01/01 01:01:01 username 1.2 (username 02-Feb-02): # Initial revision 1.2 (username 02-Feb-02): # 1.1 (username 01-Jan-01): 1.1 (username 01-Jan-01): /* 1.2 (username 02-Feb-02): * $Log: log,v $ 1.2 (username 02-Feb-02): * Revision 1.2 2002/02/02 02:02:02 username 1.2 (username 02-Feb-02): * This log line contains an @ symbol... 1.2 (username 02-Feb-02): * 1.2 (username 02-Feb-02): * Revision 1.1 2001/01/01 01:01:01 username 1.2 (username 02-Feb-02): * Initial revision 1.2 (username 02-Feb-02): * 1.1 (username 01-Jan-01): */ 1.1 (username 01-Jan-01): 1.2 (username 02-Feb-02): /* $Log: log,v $ 1.2 (username 02-Feb-02): * Revision 1.2 2002/02/02 02:02:02 username 1.2 (username 02-Feb-02): * This log line contains an @ symbol... 1.2 (username 02-Feb-02): * 1.2 (username 02-Feb-02): * Revision 1.1 2001/01/01 01:01:01 username 1.2 (username 02-Feb-02): * Initial revision 1.2 (username 02-Feb-02): * 1.1 (username 01-Jan-01): */ 1.1 (username 01-Jan-01): 1.2 (username 02-Feb-02): (* $Log: log,v $ 1.2 (username 02-Feb-02): * Revision 1.2 2002/02/02 02:02:02 username 1.2 (username 02-Feb-02): * This log line contains an @ symbol... 1.2 (username 02-Feb-02): * 1.2 (username 02-Feb-02): * Revision 1.1 2001/01/01 01:01:01 username 1.2 (username 02-Feb-02): * Initial revision 1.2 (username 02-Feb-02): * 1.1 (username 01-Jan-01): *) 1.2 (username 02-Feb-02): 1.2 (username 02-Feb-02): Text at bottom. blame-1.3.1/tests/testdata/keywords,v0000664000076400007640000000043510144371037014540 00000000000000head 1.1; access; symbols; locks username:1.1; strict; comment @# @; 1.1 date 2001.01.01.01.01.01; author username; state Exp; branches; next ; desc @@ 1.1 log @Initial revision @ text @$Author$ $Date$ $Header$ $Id$ $Locker$ $Log$ $Name$ $RCSfile$ $Revision$ $Source$ $State$ @ blame-1.3.1/tests/testdata/log-v3-1.1.expout0000664000076400007640000000265010260437707015365 000000000000001.1 (username 01-Jan-01): === $Log: log,v $ 1.1 (username 01-Jan-01): +@+Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): +@+Initial revision 1.1 (username 01-Jan-01): +@+ === 1.1 (username 01-Jan-01): 1.1 (username 01-Jan-01): # $Log: log,v $ 1.1 (username 01-Jan-01): +@+Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): +@+Initial revision 1.1 (username 01-Jan-01): +@+ 1.1 (username 01-Jan-01): 1.1 (username 01-Jan-01): /* 1.1 (username 01-Jan-01): * $Log: log,v $ 1.1 (username 01-Jan-01): +@+Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): +@+Initial revision 1.1 (username 01-Jan-01): +@+ 1.1 (username 01-Jan-01): */ 1.1 (username 01-Jan-01): 1.1 (username 01-Jan-01): /* $Log: log,v $ 1.1 (username 01-Jan-01): +@+Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): +@+Initial revision 1.1 (username 01-Jan-01): +@+ 1.1 (username 01-Jan-01): */ 1.1 (username 01-Jan-01): 1.1 (username 01-Jan-01): (* $Log: log,v $ 1.1 (username 01-Jan-01): +@+Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): +@+Initial revision 1.1 (username 01-Jan-01): +@+ 1.1 (username 01-Jan-01): *) blame-1.3.1/tests/testdata/escape.experr0000664000076400007640000000005010135177316015170 00000000000000 Annotations for escape *************** blame-1.3.1/tests/testdata/simple.experr0000664000076400007640000000005010125542443015215 00000000000000 Annotations for simple *************** blame-1.3.1/tests/testdata/complex-3.8.expout0000664000076400007640000000025010135174000015711 000000000000001.4 (user3 01-Jan-01): Line 0 1.1 (user3 01-Jan-01): Line 1 1.4 (user3 01-Jan-01): Line 4 1.5 (user2 01-Jan-01): Line 5 blame-1.3.1/tests/testdata/log,v0000644000076400007640000000165610260447074013462 00000000000000head 1.2; access; symbols; locks; strict; comment @+@@+@; 1.2 date 2002.02.02.02.02.02; author username; state Exp; branches; next 1.1; 1.1 date 2001.01.01.01.01.01; author username; state Stab; branches; next ; desc @@ 1.2 log @This log line contains an @@ symbol... @ text @Text at top. Three ats: @@@@@@ === $Log: log,v $ === Revision 1.1 2001/01/01 01:01:01 username === Initial revision === === # $Log: log,v $ # Revision 1.1 2001/01/01 01:01:01 username # Initial revision # /* * $Log: log,v $ * Revision 1.1 2001/01/01 01:01:01 username * Initial revision * */ /* $Log: log,v $ * Revision 1.1 2001/01/01 01:01:01 username * Initial revision * */ (* $Log: log,v $ * Revision 1.1 2001/01/01 01:01:01 username * Initial revision * *) Text at bottom. @ 1.1 log @Initial revision @ text @d1 1 a1 1 === $Log$ === d3 9 a11 1 # $Log$ d14 4 a17 1 * $Log$ d20 4 a23 1 /* $Log$ d26 4 a29 1 (* $Log$ d31 2 @ blame-1.3.1/tests/testdata/compat,v0000664000076400007640000000105510145577562014167 00000000000000head 1.3; access; symbols; locks; strict; comment @# @; 1.3 date 2001.01.01.01.01.02; author username; state Exp; branches; next 1.2; 1.2 date 2001.01.01.01.01.01; author username; state Exp; branches; next 1.1; 1.1 date 99.12.31.23.59.59; author username; state Exp; branches; next ; desc @This RCS file is to test compatibility issues. @ 1.3 log @*** empty log message *** @ text @. . . @ 1.2 log @*** empty log message *** @ text @d1 3 a3 1 No line at end of delta text@ 1.1 log @Initial revision @ text @d1 1 a1 1 Two-digit years in date. @ blame-1.3.1/tests/testdata/binary.experr0000664000076400007640000000005010260151154015203 00000000000000 Annotations for binary *************** blame-1.3.1/tests/testdata/simple-1.1.expout0000664000076400007640000000006010125542443015532 000000000000001.1 (username 01-Jan-01): Example file blame-1.3.1/tests/testdata/complex-1.4.expout0000664000076400007640000000032210125542443015714 000000000000001.4 (user3 01-Jan-01): Line 0 1.1 (user3 01-Jan-01): Line 1 1.2 (user2 01-Jan-01): Line 2 1.3 (user1 01-Jan-01): Line 3 1.4 (user3 01-Jan-01): Line 4 blame-1.3.1/tests/testdata/complex.experr0000664000076400007640000000005110125542443015374 00000000000000 Annotations for complex *************** blame-1.3.1/tests/testdata/file2-foo0000664000076400007640000000060310125542443014206 00000000000000head 1.2; access; symbols foo:1 bar:1.2; locks; strict; comment @# @; 1.2 date 2002.02.02.02.02.02; author somebody; state Stab; branches; next 1.1; 1.1 date 2001.01.01.01.01.01; author username; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @TEST TEST TEST TEST Example file TEST TEST TEST TEST @ 1.1 log @Initial revision @ text @d1 1 d3 1 @ blame-1.3.1/tests/testdata/CVS/0000777000076400007640000000000010432275252013221 500000000000000blame-1.3.1/tests/testdata/CVS/Repository0000664000076400007640000000002510125542720015232 00000000000000blame/tests/testdata blame-1.3.1/tests/testdata/CVS/Entries0000664000076400007640000000334010337302611014465 00000000000000/.cvsignore/1.1.1.1/Sun Sep 26 13:33:23 2004// /complex-1.1.expout/1.1.1.1/Sun Sep 26 13:33:23 2004// /complex-1.2.1.1.1.1.expout/1.1.1.1/Sun Sep 26 13:33:23 2004// /complex-1.2.1.1.expout/1.1.1.1/Sun Sep 26 13:33:23 2004// /complex-1.2.1.2.expout/1.1.1.1/Sun Sep 26 13:33:23 2004// /complex-1.2.1.3.expout/1.1.1.1/Sun Sep 26 13:33:23 2004// /complex-1.4.expout/1.1.1.1/Sun Sep 26 13:33:23 2004// /complex-2.2.expout/1.1.1.1/Sun Sep 26 13:33:23 2004// /complex-3.4.expout/1.1.1.1/Sun Sep 26 13:33:23 2004// /complex.experr/1.1.1.1/Sun Sep 26 13:33:23 2004// /file2-foo/1.1.1.1/Sun Sep 26 13:33:23 2004// /keywords.experr/1.1.1.1/Sun Sep 26 13:33:23 2004// /simple,v/1.1.1.1/Sun Sep 26 13:33:23 2004// /simple-1.1.expout/1.1.1.1/Sun Sep 26 13:33:23 2004// /simple-1.2.expout/1.1.1.1/Sun Sep 26 13:33:23 2004// /simple.experr/1.1.1.1/Sun Sep 26 13:33:23 2004// D/RCS//// /compat-1.1.expout/1.1/Tue Sep 28 11:09:16 2004// /compat.experr/1.1/Tue Sep 28 11:09:16 2004// /complex,v/1.1.1.1/Sun Sep 26 13:33:23 2004/-ko/ /empty,v/1.1/Tue Sep 28 11:09:16 2004// /complex-3.8.expout/1.1/Tue Oct 19 11:18:24 2004// /escape.experr/1.1/Tue Oct 19 11:47:26 2004// /keywords,v/1.1.1.1/Wed Nov 10 10:49:03 2004/-ko/ /log.experr/1.1/Wed Nov 10 10:58:56 2004// /compat,v/1.2/Sun Nov 14 06:47:14 2004// /binary,v/1.1/Tue Jun 28 04:30:36 2005// /binary.experr/1.1/Tue Jun 28 04:30:36 2005// /binary-1.2.expout/1.3/Tue Jun 28 14:40:20 2005// /compat-1.2.expout/1.2/Tue Jun 28 14:37:29 2005// /log,v/1.3/Wed Jun 29 07:31:08 2005/-ko/ /log-1.2.expout/1.1/Wed Jun 29 01:19:23 2005/-ko/ /log-v3-1.1.expout/1.2/Wed Jun 29 06:29:27 2005/-ko/ /log-v5-1.1.expout/1.1/Wed Jun 29 01:19:23 2005/-ko/ /escape,v/1.2/Fri Nov 18 07:40:57 2005// /escape-1.2.expout/1.1/Fri Nov 18 07:40:10 2005// blame-1.3.1/tests/testdata/CVS/Root0000664000076400007640000000006510432275252014006 00000000000000:ext:foonly@blame.cvs.sourceforge.net:/cvsroot/blame blame-1.3.1/tests/testdata/complex-1.2.1.2.expout0000664000076400007640000000033610125542443016216 000000000000001.1 (user3 01-Jan-01): Line 1 1.2 (user2 01-Jan-01): Line 2 1.2.1.1 (user1 01-Jan-01): On branch 1.2.1: 1.2.1.1 (user1 01-Jan-01): Line 1 1.2.1.2 (user2 01-Jan-01): Line 2 blame-1.3.1/tests/testdata/complex-1.2.1.3.expout0000664000076400007640000000026510125542443016220 000000000000001.2.1.1 (user1 01-Jan-01): On branch 1.2.1: 1.2.1.1 (user1 01-Jan-01): Line 1 1.2.1.2 (user2 01-Jan-01): Line 2 1.2.1.3 (user3 01-Jan-01): Line 3 blame-1.3.1/tests/testdata/complex-1.1.expout0000664000076400007640000000005210125542443015711 000000000000001.1 (user3 01-Jan-01): Line 1 blame-1.3.1/tests/testdata/escape,v0000664000076400007640000001230510337302611014124 00000000000000head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2001.01.01.01.01.02; author username; state Exp; branches; next 1.1; 1.1 date 2001.01.01.01.01.01; author username; state Exp; branches; next ; desc @@ 1.2 log @ @ text @ $ : @@ @@ : $ $ : @@ $ : @@ $ : @@ $ @@ : $ : @@ $ : @@ $ : @@ $ : @@ $ : @@ $ @@ : $ : @@ $ @@ : $ : @@ : $ @@ $ : @@ : @@ $ $ : @@ : $ @@ $ : @@ : $ @@ $ : @@ : @@ $ $ : @@ : @@ $ $ : @@ @@ $ : $ : @@ @@ : $ $ : @@ @@ $ : $ : @@ @@ $ : $ : @@ @@ : $ $ : @@ @@ : $ $ : @@ $ @@ : $ : @@ : $ @@ $ : @@ : @@ $ $ : @@ @@ $ : @@ : $ $ : @@ @@ : $ $ @@ : @@ : $ $ : @@ @@ : $ $ : @@ @@ : $ $ @@ : @@ : $ $ @@ : @@ : $ : $ @@ @@ : $ : @@ $ @@ : $ : $ @@ @@ : $ : $ @@ @@ : $ : @@ $ @@ : $ : @@ $ @@ : $ @@ $ : @@ : $ @@ : $ @@ : $ @@ $ : @@ : $ @@ $ : @@ : $ @@ : $ @@ : $ @@ : $ @@ : $ $ @@ : @@ : $ : $ @@ @@ : $ : @@ $ @@ : $ @@ $ : $ : @@ $ @@ : $ : @@ $ : @@ $ : @@ $ : @@ $ : @@ $ @@ : $ : @@ $ @@ : $ : @@ : $ @@ $ : @@ : @@ $ $ : @@ : $ @@ $ : @@ : $ @@ $ : @@ : @@ $ $ : @@ : @@ $ $ : @@ @@ $ : $ : @@ @@ : $ $ : @@ @@ $ : $ : @@ @@ $ : $ : @@ @@ : $ $ : @@ @@ : $ $ : @@ $ @@ : $ : @@ : $ @@ $ : @@ : @@ $ $ : @@ @@ $ : $ @@ : $ : @@ $ @@ : $ : @@ $ @@ : $ @@ : $ @@ : $ @@ : $ @@ : : $ @@ $ @@ : : @@ $ $ @@ : : $ @@ $ @@ : : $ @@ $ @@ : : @@ $ $ @@ : : @@ $ $ @@ : @@ $ : $ @@ : @@ : $ $ @@ : @@ $ : $ @@ : @@ $ : $ @@ : @@ : $ $ @@ : @@ : $ $ @@ : $ @@ : $ @@ : : $ @@ $ @@ : : @@ $ $ @@ : @@ $ : $ : @@ $ : @@ $ : @@ $ @@ : $ : @@ $ @@ : $ : @@ : $ @@ $ : @@ : @@ $ $ : @@ : $ @@ $ : @@ : $ @@ $ : @@ : @@ $ $ : @@ : @@ $ $ : @@ @@ $ : $ : @@ @@ : $ $ : @@ @@ $ : $ : @@ @@ $ : $ : @@ @@ : $ $ : @@ @@ : $ $ : @@ $ @@ : $ : @@ : $ @@ $ : @@ : @@ $ $ : @@ @@ $ : $ : @@ $ @@ : $ : @@ $ @@ : $ : @@ : $ @@ $ : @@ : @@ $ $ : @@ : $ @@ $ : @@ : $ @@ $ : @@ : @@ $ $ : @@ : @@ $ $ : @@ @@ $ : $ : @@ @@ : $ $ : @@ @@ $ : $ : @@ @@ $ : $ : @@ @@ : $ $ : @@ @@ : $ $ : @@ $ @@ : $ : @@ : $ @@ $ : @@ : @@ $ $ : @@ @@ $ : $ @@ : $ @@ : $ @@ : : $ @@ $ @@ : : @@ $ $ @@ : : $ @@ $ @@ : : $ @@ $ @@ : : @@ $ $ @@ : : @@ $ $ @@ : @@ $ : $ @@ : @@ : $ $ @@ : @@ $ : $ @@ : @@ $ : $ @@ : @@ : $ $ @@ : @@ : $ $ @@ : $ @@ : $ @@ : : $ @@ $ @@ : : @@ $ $ @@ : @@ $ : $ @@ : : $ @@ $ @@ : : @@ $ $ @@ : : $ @@ $ @@ : : $ @@ $ @@ : : @@ $ $ @@ : : @@ $ $ @@ : @@ $ : $ @@ : @@ : $ $ @@ : @@ $ : $ @@ : @@ $ : $ @@ : @@ : $ $ @@ : @@ : $ $ @@ : $ @@ : $ @@ : : $ @@ $ @@ : : @@ $ $ @@ : @@ $ : : $ @@ : @@ $ : $ @@ : $ @@ : $ @@ : $ @@ : $ @@ : @@ $ : $ @@ : @@ $ : $ @@ @@ $ : : $ @@ @@ : $ : $ @@ @@ $ : : $ @@ @@ $ : : $ @@ @@ : $ : $ @@ @@ : $ : $ @@ $ @@ : : $ @@ : $ @@ : $ @@ : @@ $ : $ @@ @@ $ : : @@ $ : $ @@ : @@ $ : $ @@ : @@ $ : @@ $ : @@ $ : @@ $ : @@ $ @@ $ : : @@ $ @@ : $ : @@ $ @@ $ : : @@ $ @@ $ : : @@ $ @@ : $ : @@ $ @@ : $ : @@ $ $ @@ : : @@ $ : $ @@ : @@ $ : @@ $ : @@ $ @@ $ : : $ @@ : $ @@ : $ @@ : @@ $ : $ @@ : @@ $ : $ @@ @@ $ : : $ @@ @@ : $ : $ @@ @@ $ : : $ @@ @@ $ : : $ @@ @@ : $ : $ @@ @@ : $ : $ @@ $ @@ : : $ @@ : $ @@ : $ @@ : @@ $ : $ @@ @@ $ : : $ @@ : @@ $ : $ @@ : @@ $ : $ @@ @@ $ : : $ @@ @@ : $ : $ @@ @@ $ : : $ @@ @@ $ : : $ @@ @@ : $ : $ @@ @@ : $ : $ @@ $ @@ : : $ @@ : $ @@ : $ @@ : @@ $ : $ @@ @@ $ : : @@ $ : @@ $ : @@ $ @@ $ : : @@ $ @@ : $ : @@ $ @@ $ : : @@ $ @@ $ : : @@ $ @@ : $ : @@ $ @@ : $ : @@ $ $ @@ : : @@ $ : $ @@ : @@ $ : @@ $ : @@ $ @@ $ : : @@ $ @@ $ : : @@ $ @@ : $ : @@ $ @@ $ : : @@ $ @@ $ : : @@ $ @@ : $ : @@ $ @@ : $ : @@ $ $ @@ : : @@ $ : $ @@ : @@ $ : @@ $ : @@ $ @@ $ : @@ $ : @@ : $ @@ $ : @@ $ : @@ $ : @@ $ : @@ $ : @@ : $ @@ $ : @@ : $ @@ $ : $ @@ : @@ $ : : $ @@ @@ $ : : @@ $ @@ $ : @@ $ : @@ : $ @@ $ : @@ : $ @@ $ : @@ : $ @@ : $ @@ : $ @@ : $ @@ : $ $ @@ : @@ : $ : $ @@ @@ : $ : @@ $ @@ : $ @@ $ : @@ $ : @@ $ : @@ $ : @@ : $ @@ $ : @@ : $ @@ $ : $ @@ : @@ $ : : $ @@ @@ $ : : @@ $ @@ $ : @@ $ : @@ $ : @@ : $ @@ $ : @@ : $ @@ $ : $ @@ : @@ $ : : $ @@ @@ $ : : @@ $ @@ $ : @@ $ : @@ : $ @@ : $ @@ : $ $ @@ : @@ : $ : $ @@ @@ : $ : @@ $ @@ : $ @@ $ : @@ : $ $ @@ : @@ : $ : $ @@ @@ : $ : @@ $ @@ : $ @@ $ : $ @@ : : $ @@ $ @@ : : @@ $ $ @@ : @@ $ : : $ @@ : @@ $ : $ @@ @@ $ : : @@ $ @@ $ : @ 1.1 log @Initial revision @ text @d1 276 a276 1 $Id: escape,v,v 1.2 2005/11/18 07:40:10 foonly Exp $ @ blame-1.3.1/tests/testdata/binary-1.2.expout0000664000076400007640000000050610260260524015530 000000000000001.2 (username 02-Feb-02): ÿþýüûúùø÷öõôóòñðïîíìëêéèçæåäãâáàßÞÝÜÛÚÙØ×ÖÕÔÓÒÑÐÏÎÍÌËÊÉÈÇÆÅÄÃÂÁÀ¿¾½¼»º¹¸·¶µ´³²±°¯®­¬«ª©¨§¦¥¤£¢¡ Ÿžœ›š™˜—–•”“’‘ŽŒ‹Š‰ˆ‡†…„ƒ‚€~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!  1.2 (username 02-Feb-02): blame-1.3.1/tests/testdata/compat-1.2.expout0000664000076400007640000000007710260260251015527 000000000000001.2 (username 01-Jan-01): No line at end of delta textblame-1.3.1/tests/testdata/log-v5-1.1.expout0000664000076400007640000000264210260373433015363 000000000000001.1 (username 01-Jan-01): === $Log: log,v $ 1.1 (username 01-Jan-01): === Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): === Initial revision 1.1 (username 01-Jan-01): === === 1.1 (username 01-Jan-01): 1.1 (username 01-Jan-01): # $Log: log,v $ 1.1 (username 01-Jan-01): # Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): # Initial revision 1.1 (username 01-Jan-01): # 1.1 (username 01-Jan-01): 1.1 (username 01-Jan-01): /* 1.1 (username 01-Jan-01): * $Log: log,v $ 1.1 (username 01-Jan-01): * Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): * Initial revision 1.1 (username 01-Jan-01): * 1.1 (username 01-Jan-01): */ 1.1 (username 01-Jan-01): 1.1 (username 01-Jan-01): /* $Log: log,v $ 1.1 (username 01-Jan-01): * Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): * Initial revision 1.1 (username 01-Jan-01): * 1.1 (username 01-Jan-01): */ 1.1 (username 01-Jan-01): 1.1 (username 01-Jan-01): (* $Log: log,v $ 1.1 (username 01-Jan-01): * Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): * Initial revision 1.1 (username 01-Jan-01): * 1.1 (username 01-Jan-01): *) blame-1.3.1/tests/testdata/simple-1.2.expout0000664000076400007640000000023610125542443015540 000000000000001.2 (somebody 02-Feb-02): TEST TEST TEST TEST 1.1 (username 01-Jan-01): Example file 1.2 (somebody 02-Feb-02): TEST TEST TEST TEST blame-1.3.1/tests/testdata/compat.experr0000664000076400007640000000005010126243134015203 00000000000000 Annotations for compat *************** blame-1.3.1/tests/testdata/binary,v0000664000076400007640000000154310260151154014151 00000000000000head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2002.02.02.02.02.02; author username; state Exp; branches; next 1.1; 1.1 date 2001.01.01.01.01.01; author username; state Exp; branches; next ; desc @This RCS file contains binary data. @ 1.2 log @*** empty log message *** @ text @ÿþýüûúùø÷öõôóòñðïîíìëêéèçæåäãâáàßÞÝÜÛÚÙØ×ÖÕÔÓÒÑÐÏÎÍÌËÊÉÈÇÆÅÄÃÂÁÀ¿¾½¼»º¹¸·¶µ´³²±°¯®­¬«ª©¨§¦¥¤£¢¡ Ÿžœ›š™˜—–•”“’‘ŽŒ‹Š‰ˆ‡†…„ƒ‚€~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@@?>=<;:9876543210/.-,+*)('&%$#"!  @ 1.1 log @Initial revision @ text @d1 2 a2 2   !"#$%&'()*+,-./0123456789:;<=>?@@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ@ blame-1.3.1/tests/testdata/complex-2.2.expout0000664000076400007640000000040610125542443015716 000000000000001.4 (user3 01-Jan-01): Line 0 1.1 (user3 01-Jan-01): Line 1 1.4 (user3 01-Jan-01): Line 4 1.5 (user2 01-Jan-01): Line 5 2.1 (user1 01-Jan-01): Bump to branch 2 2.2 (user3 01-Jan-01): Line 6 blame-1.3.1/tests/testdata/simple,v0000664000076400007640000000060310125542443014157 00000000000000head 1.2; access; symbols foo:1 bar:1.2; locks; strict; comment @# @; 1.2 date 2002.02.02.02.02.02; author somebody; state Stab; branches; next 1.1; 1.1 date 2001.01.01.01.01.01; author username; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @TEST TEST TEST TEST Example file TEST TEST TEST TEST @ 1.1 log @Initial revision @ text @d1 1 d3 1 @ blame-1.3.1/tests/testdata/complex,v0000664000076400007640000000555610125542443014351 00000000000000head 3.8; branch 1; access; symbols fred:2.1 plugh:1 xyzzy:1.1.1 quux:2.1.1.1.1 baz:1.2.1.3 bar:1.2.1 foo:1.2; locks; strict; comment @# @; 3.8 date 2001.01.01.03.08.00; author username; state Exp; branches; next 3.7; 3.7 date 2001.01.01.03.07.00; author username; state Exp; branches; next 3.6; 3.6 date 2001.01.01.03.06.00; author username; state Exp; branches; next 3.5; 3.5 date 2001.01.01.03.05.00; author username; state Exp; branches; next 3.4; 3.4 date 2001.01.01.03.04.00; author user1; state A; branches; next 3.3; 3.3 date 2001.01.01.03.03.00; author user2; state B; branches; next 2.2; 2.2 date 2001.01.01.02.02.00; author user3; state C; branches; next 2.1; 2.1 date 2001.01.01.02.01.00; author user1; state D; branches; next 1.5; 1.5 date 2001.01.01.01.05.00; author user2; state A; branches; next 1.4; 1.4 date 2001.01.01.01.04.00; author user3; state B; branches; next 1.3; 1.3 date 2001.01.01.01.03.00; author user1; state C; branches; next 1.2; 1.2 date 2001.01.01.01.02.00; author user2; state D; branches 1.2.1.1 1.2.2.1; next 1.1; 1.1 date 2001.01.01.01.01.00; author user3; state A; branches; next ; 1.2.1.1 date 2001.01.01.01.02.10; author user1; state B; branches 1.2.1.1.1.1; next 1.2.1.2; 1.2.1.2 date 2001.01.01.01.02.20; author user2; state C; branches; next 1.2.1.3; 1.2.1.3 date 2001.01.01.01.02.30; author user3; state D; branches; next ; 1.2.1.1.1.1 date 2001.01.01.01.02.12; author user1; state A; branches; next 1.2.1.1.1.2; 1.2.1.1.1.2 date 2001.01.01.01.02.14; author user2; state B; branches; next ; 1.2.2.1 date 2001.01.01.01.02.40; author user3; state C; branches; next 1.2.2.2; 1.2.2.2 date 2001.01.01.01.02.50; author user1; state D; branches; next ; desc @@ 3.8 log @Header -> Name @ text @$Name$ @ 3.7 log @Id -> Header @ text @d1 1 a1 1 $Header$ @ 3.6 log @Revision -> Id @ text @d1 1 a1 1 $Id$ @ 3.5 log @Add Revision @ text @d1 1 a1 1 $Revision$ @ 3.4 log @Added Line 7 @ text @d1 1 a1 8 Line 0 Line 1 Line 4 Line 5 Bump to branch 2 Line 6 Bump to branch 3 Line 7 @ 3.3 log @Bump to branch 3 (revision 3.3) @ text @d8 1 @ 2.2 log @Added Line 6 @ text @d7 1 @ 2.1 log @Bump to branch 2 @ text @d6 1 @ 1.5 log @Removed Line 2 and Line 3 Added Line 5 @ text @d5 1 @ 1.4 log @Added Line 0 and Line 4 @ text @a2 2 Line 2 Line 3 d4 1 @ 1.3 log @Added Line 3 @ text @d1 1 d5 1 @ 1.2 log @Added Line 2 @ text @d3 1 @ 1.2.2.1 log @Another branch @ text @a2 2 On branch 1.2.2: Line 1 @ 1.2.2.2 log @Added Line 2 @ text @a4 1 Line 2 @ 1.2.1.1 log @Added branch @ text @a2 2 On branch 1.2.1: Line 1 @ 1.2.1.1.1.1 log @Added another branch @ text @a4 2 On branch 1.2.1.1.1.1 Line 1 @ 1.2.1.1.1.2 log @Removed all lines @ text @d1 6 @ 1.2.1.2 log @Added Line 2 @ text @a4 1 Line 2 @ 1.2.1.3 log @Removed original Line 1 and Line 2; Added Line 3 @ text @d1 2 a5 1 Line 3 @ 1.1 log @Initial revision @ text @d2 1 @ blame-1.3.1/tests/testdata/complex-1.2.1.1.expout0000664000076400007640000000026310125542443016214 000000000000001.1 (user3 01-Jan-01): Line 1 1.2 (user2 01-Jan-01): Line 2 1.2.1.1 (user1 01-Jan-01): On branch 1.2.1: 1.2.1.1 (user1 01-Jan-01): Line 1 blame-1.3.1/tests/testdata/RCS/0000777000076400007640000000000010145577513013223 500000000000000blame-1.3.1/tests/testdata/RCS/CVS/0000777000076400007640000000000010432275252013650 500000000000000blame-1.3.1/tests/testdata/RCS/CVS/Repository0000664000076400007640000000003110125542720015656 00000000000000blame/tests/testdata/RCS blame-1.3.1/tests/testdata/RCS/CVS/Entries0000664000076400007640000000013210125542720015112 00000000000000/file1/1.1.1.1/Sun Sep 26 13:33:23 2004// /file3-bar/1.1.1.1/Sun Sep 26 13:33:23 2004// D blame-1.3.1/tests/testdata/RCS/CVS/Root0000664000076400007640000000006510432275252014435 00000000000000:ext:foonly@blame.cvs.sourceforge.net:/cvsroot/blame blame-1.3.1/tests/testdata/RCS/file3-bar0000664000076400007640000000060310125542443014617 00000000000000head 1.2; access; symbols foo:1 bar:1.2; locks; strict; comment @# @; 1.2 date 2002.02.02.02.02.02; author somebody; state Stab; branches; next 1.1; 1.1 date 2001.01.01.01.01.01; author username; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @TEST TEST TEST TEST Example file TEST TEST TEST TEST @ 1.1 log @Initial revision @ text @d1 1 d3 1 @ blame-1.3.1/tests/testdata/RCS/file10000664000076400007640000000060310125542443014053 00000000000000head 1.2; access; symbols foo:1 bar:1.2; locks; strict; comment @# @; 1.2 date 2002.02.02.02.02.02; author somebody; state Stab; branches; next 1.1; 1.1 date 2001.01.01.01.01.01; author username; state Exp; branches; next ; desc @@ 1.2 log @*** empty log message *** @ text @TEST TEST TEST TEST Example file TEST TEST TEST TEST @ 1.1 log @Initial revision @ text @d1 1 d3 1 @ blame-1.3.1/tests/testdata/.cvsignore0000664000076400007640000000000210125542443014472 00000000000000! blame-1.3.1/tests/testdata/keywords.experr0000664000076400007640000000005210125542443015575 00000000000000 Annotations for keywords *************** blame-1.3.1/tests/Makefile.am0000644000076400007640000000300510144371534012723 00000000000000# Process this file with automake to produce a Makefile. EXTRA_DIST = blame package.m4 testsuite $(TESTSUITE_AT) testdata DISTCLEANFILES = atconfig atlocal MAINTAINERCLEANFILES = $(TESTSUITE) TESTSUITE = $(srcdir)/testsuite TESTSUITE_AT = \ testsuite.at \ argv.at \ rev.at \ date.at \ state.at \ author.at \ expand.at \ suffixes.at \ mixed.at \ branch.at \ rcs.at \ working.at \ pairing.at \ rcsinit.at \ version.at \ log.at $(srcdir)/package.m4: $(top_srcdir)/configure.ac @{ \ echo '# Signature of the current package.'; \ echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \ echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \ echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \ echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \ echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \ } >$(srcdir)/package.m4 AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te AUTOTEST = $(AUTOM4TE) --language=autotest $(TESTSUITE): package.m4 $(TESTSUITE_AT) $(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp mv $@.tmp $@ atconfig: $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status tests/$@ clean-local: if [ -x $(TESTSUITE) ]; then $(SHELL) $(TESTSUITE) --clean; fi check-local: atconfig atlocal $(TESTSUITE) $(top_builddir)/src/blame$(EXEEXT) $(SHELL) $(TESTSUITE) # Run the test suite on the *installed* tree. installcheck-local: atconfig atlocal $(TESTSUITE) $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin blame-1.3.1/tests/branch.at0000664000076400007640000001345610261001154012453 00000000000000AT_BANNER([[Resolving revisions on branches.]]) AT_SETUP([Revision on branch]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) cp $testdir/complex-1.2.1.2.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r1.2.1.2 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Revision on deep branch]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) cp $testdir/complex-1.2.1.1.1.1.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r1.2.1.1.1.1 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Valid branch]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) cp $testdir/complex.experr experr AT_CHECK([[blame -r1.2.1.1.1 $testdir/complex,v]], 0, , experr) AT_CLEANUP AT_SETUP([Invalid branch]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([errors]) AT_CHECK([[blame -r1.2.1.3.1 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Valid branch and dot]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) cp $testdir/complex.experr experr AT_CHECK([[blame -r1.2.1.1.1. $testdir/complex,v]], 0, , experr) AT_CLEANUP AT_SETUP([Invalid branch and dot]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([errors]) AT_CHECK([[blame -r1.2.1.3.1. $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Dot and revision on branch]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) cp $testdir/complex-1.2.1.2.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r.2.1.2 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Dot and late revision on branch]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r.2.1.10 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Dot and early revision on branch]) AT_KEYWORDS([branch]) AT_KEYWORDS([errors]) AT_KEYWORDS([rev]) AT_CHECK([[blame -r.2.1.0 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Dot and branch]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r.2.1 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Dot, branch and dot]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r.2.1. $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Symbolic branch]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -rbar $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Symbolic branch and dot]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -rbar. $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Symbolic branch and revision]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/complex-1.2.1.2.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -rbar.2 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Symbolic branch and late revision]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -rbar.10 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Symbolic branch and early revision]) AT_KEYWORDS([branch]) AT_KEYWORDS([errors]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) AT_CHECK([[blame -rbar.0 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Symbolic revision on branch]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -rbaz $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Dot and symbolic revision on branch]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/complex-1.2.1.1.1.1.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r.quux $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Dot and symbolic branch]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r.fred $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Dot, symbolic branch and dot]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r.fred. $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Symbolic branch and symbolic revision]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/complex-1.2.1.1.1.1.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -rplugh.quux $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Number, symbol and symbol]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/complex-1.2.1.1.1.1.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r1.fred.xyzzy $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Symbol, number and symbol]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/complex-1.2.1.1.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -rfoo.1.plugh $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Symbol, symbol and number]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/complex-1.2.1.1.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -rfoo.plugh.1 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Number, symbol and number]) AT_KEYWORDS([branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/complex-1.2.1.1.1.1.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r1.2.xyzzy.1 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP blame-1.3.1/tests/testsuite0000755000076400007640000074360410531540140012655 00000000000000#! /bin/sh ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH SHELL=${CONFIG_SHELL-/bin/sh} # How were we run? at_cli_args="$@" # Load the config file. for at_file in atconfig atlocal do test -r $at_file || continue . ./$at_file || { echo "$as_me: error: invalid content: $at_file" >&2 { (exit 1); exit 1; }; } done # atconfig delivers paths relative to the directory the test suite is # in, but the groups themselves are run in testsuite-dir/group-dir. if test -n "$at_top_srcdir"; then builddir=../.. for at_dir in srcdir top_srcdir top_builddir do at_val=`eval echo '${'at_$at_dir'}'` eval "$at_dir=\$at_val/../.." done fi # Not all shells have the 'times' builtin; the subshell is needed to make # sure we discard the 'times: not found' message from the shell. at_times_p=false (times) >/dev/null 2>&1 && at_times_p=: # CLI Arguments to pass to the debugging scripts. at_debug_args= # -e sets to true at_errexit_p=false # Shall we be verbose? at_verbose=: at_quiet=echo # Shall we keep the debug scripts? Must be `:' when the suite is # run by a debug script, so that the script doesn't remove itself. at_debug_p=false # Display help message? at_help_p=false # List test groups? at_list_p=false # Test groups to run at_groups= # The directory we are in. at_dir=`pwd` # The directory the whole suite works in. # Should be absolutely to let the user `cd' at will. at_suite_dir=$at_dir/$as_me.dir # The file containing the suite. at_suite_log=$at_dir/$as_me.log # The file containing the location of the last AT_CHECK. at_check_line_file=$at_suite_dir/at-check-line # The file containing the exit status of the last command. at_status_file=$at_suite_dir/at-status # The files containing the output of the tested commands. at_stdout=$at_suite_dir/at-stdout at_stder1=$at_suite_dir/at-stder1 at_stderr=$at_suite_dir/at-stderr # The file containing dates. at_times_file=$at_suite_dir/at-times # List of the tested programs. at_tested='blame' # List of the all the test groups. at_groups_all=' banner-1 1 2 3 4 5 6 7 banner-2 8 9 10 11 12 13 banner-3 14 15 16 17 banner-4 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 banner-5 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 banner-6 62 63 64 65 66 67 68 69 banner-7 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 banner-8 85 86 87 88 banner-9 89 90 91 92 banner-10 93 94 95 96 97 98 99 100 101 102 banner-11 103 104 105 106 banner-12 107 108 109 banner-13 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 banner-14 132 133 134 banner-15 135 136 137 138' # As many dots as there are digits in the last test group number. # Used to normalize the test group numbers so that `ls' lists them in # numerical order. at_format='...' # Description of all the test groups. at_help_all='1;argv.at:3;No arguments;argv errors; 2;argv.at:10;Invalid argument;argv errors; 3;argv.at:17;-? and --help;argv; 4;argv.at:23;-V and --version;argv; 5;argv.at:32;Non-existant working file;argv errors; 6;argv.at:39;Non-existant RCS file;argv errors; 7;argv.at:46;Filenames only;argv; 8;pairing.at:3;Working file, then corresponding RCS file;pairing; 9;pairing.at:10;Working file, then independent working file;pairing; 10;pairing.at:20;Working file, then independent RCS file;pairing; 11;pairing.at:30;RCS file, then corresponding working file;pairing; 12;pairing.at:37;RCS file, then independent working file;pairing; 13;pairing.at:47;RCS file, then independent RCS file;pairing; 14;rcs.at:3;No revisions present;rcs errors; 15;rcs.at:10;Two-digit year before 2000;rcs; 16;rcs.at:17;Missing empty line after delta text;rcs; 17;rcs.at:24;Binary data;rcs; 18;rev.at:3;No revision;rev; 19;rev.at:11;Multiple revisions;rev errors; 20;rev.at:18;Single dot;rev; 21;rev.at:26;Valid trunk branch;rev; 22;rev.at:33;Invalid trunk branch;rev errors; 23;rev.at:40;Valid trunk branch and dot;rev; 24;rev.at:47;Invalid trunk branch and dot;rev errors; 25;rev.at:54;Dot and revision;rev; 26;rev.at:61;Dot and late revision;rev; 27;rev.at:68;Dot and early revision;rev errors; 28;rev.at:75;Symbolic trunk branch;rev symbol; 29;rev.at:83;Symbolic trunk branch and dot;rev symbol; 30;rev.at:91;Symbolic trunk branch and revision;rev symbol; 31;rev.at:99;Symbolic trunk branch and late revision;rev symbol; 32;rev.at:107;Symbolic trunk branch and early revision;rev errors symbol; 33;rev.at:115;Symbolic revision;rev symbol; 34;rev.at:123;Dot and symbolic revision;rev symbol; 35;rev.at:131;Symbolic trunk branch and symbolic revision;rev symbol; 36;rev.at:139;Invalid symbol;rev errors symbol; 37;branch.at:3;Revision on branch;branch rev; 38;branch.at:11;Revision on deep branch;branch rev; 39;branch.at:19;Valid branch;branch rev; 40;branch.at:26;Invalid branch;branch rev errors; 41;branch.at:34;Valid branch and dot;branch rev; 42;branch.at:41;Invalid branch and dot;branch rev errors; 43;branch.at:49;Dot and revision on branch;branch rev; 44;branch.at:57;Dot and late revision on branch;branch rev; 45;branch.at:65;Dot and early revision on branch;branch errors rev; 46;branch.at:73;Dot and branch;branch rev; 47;branch.at:81;Dot, branch and dot;branch rev; 48;branch.at:89;Symbolic branch;branch rev symbol; 49;branch.at:98;Symbolic branch and dot;branch rev symbol; 50;branch.at:107;Symbolic branch and revision;branch rev symbol; 51;branch.at:116;Symbolic branch and late revision;branch rev symbol; 52;branch.at:125;Symbolic branch and early revision;branch errors rev symbol; 53;branch.at:134;Symbolic revision on branch;branch rev symbol; 54;branch.at:143;Dot and symbolic revision on branch;branch rev symbol; 55;branch.at:152;Dot and symbolic branch;branch rev; 56;branch.at:160;Dot, symbolic branch and dot;branch rev; 57;branch.at:168;Symbolic branch and symbolic revision;branch rev symbol; 58;branch.at:177;Number, symbol and symbol;branch rev symbol; 59;branch.at:186;Symbol, number and symbol;branch rev symbol; 60;branch.at:195;Symbol, symbol and number;branch rev symbol; 61;branch.at:204;Number, symbol and number;branch rev symbol; 62;working.at:3;Valid revision;working rev; 63;working.at:21;Early revision;working rev errors; 64;working.at:42;Late revision;working rev; 65;working.at:60;Branch;working rev errors; 66;working.at:81;Other non-revision;working rev errors; 67;working.at:102;Parsing escape sequences;working rev; 68;working.at:112;Producing escape sequences;working; 69;working.at:122;Mixing escape characters;working; 70;date.at:3;Missing date argument;date errors; 71;date.at:10;Date after all revisions;date; 72;date.at:18;Date just after a revision;date; 73;date.at:25;Date on a revision;date; 74;date.at:32;Date just before a revision;date; 75;date.at:39;Date between revisions;date; 76;date.at:46;Date before all revisions;date errors; 77;date.at:53;Unparseable date;date errors; 78;date.at:60;Unknown timezone;date errors zone; 79;date.at:68;No timezone;date zone; 80;date.at:80;dd-Mon-yyyy hh:mm:ss;date; 81;date.at:91;h:mm:ss AM yyyymmdd;date; 82;date.at:102;Unusual timezone;date zone; 83;date.at:115;With -z or --zone option;date zone; 84;date.at:128;Multiple dates;date errors; 85;state.at:3;Missing state argument;state errors; 86;state.at:10;Known state;state; 87;state.at:22;Unknown state;state errors; 88;state.at:29;Multiple states;state errors; 89;author.at:3;No author;author; 90;author.at:17;Known author;author; 91;author.at:28;Unknown author;author errors; 92;author.at:35;Multiple authors;author errors; 93;expand.at:3;Default substitutions;expand log; 94;expand.at:26;Default substitutions, with timezone;expand log; 95;expand.at:49;Missing keyword substitution argument;expand errors; 96;expand.at:56;Keys and values (-kkv);expand log; 97;expand.at:81;Keys, values and locker (-kkvl);expand log; 98;expand.at:104;Keys only (-kk);expand log; 99;expand.at:127;Old keywords strings (-ko);expand log; 100;expand.at:147;Binary image of old keywords strings (-kb);expand log; 101;expand.at:167;Values only (-kv);expand log; 102;expand.at:190;Multiple substitution types;expand errors; 103;version.at:3;Invalid version argument;version errors; 104;version.at:12;Emulating RCS version 3;version log; 105;version.at:36;Emulating RCS version 4;version log; 106;version.at:60;Emulating RCS version 5;version log; 107;suffixes.at:3;Default suffixes;suffixes; 108;suffixes.at:9;Nonstandard suffixes;suffixes; 109;suffixes.at:17;Multiple suffixes specifications;suffixes errors; 110;mixed.at:3;Valid -r and -d combo;mixed rev date; 111;mixed.at:13;Invalid -r and -d combo;mixed errors rev date; 112;mixed.at:22;Valid -r and -s combo;mixed rev state; 113;mixed.at:31;Invalid -r and -s combo;mixed errors rev state; 114;mixed.at:40;Valid -r and -w combo;mixed rev author; 115;mixed.at:49;Invalid -r and -w combo;mixed errors rev author; 116;mixed.at:58;Valid -d and -s combo;mixed date state; 117;mixed.at:68;Invalid -d and -s combo;mixed errors date state; 118;mixed.at:77;Valid -d and -w combo;mixed date author; 119;mixed.at:87;Invalid -d and -w combo;mixed errors date author; 120;mixed.at:96;Valid -s and -w combo;mixed state author; 121;mixed.at:105;Invalid -s and -w combo;mixed errors state author; 122;mixed.at:114;Valid -r, -d and -s combo;mixed rev date state; 123;mixed.at:124;Invalid -r, -d and -s combo;mixed errors rev date state; 124;mixed.at:138;Valid -r, -d and -w combo;mixed rev date author; 125;mixed.at:148;Invalid -r, -d and -w combo;mixed errors rev date author; 126;mixed.at:162;Valid -r, -s and -w combo;mixed rev state author; 127;mixed.at:172;Invalid -r, -s and -w combo;mixed errors rev state author; 128;mixed.at:186;Valid -d, -s and -w combo;mixed date state author; 129;mixed.at:196;Invalid -d, -s and -w combo;mixed errors date state author; 130;mixed.at:210;Valid -r, -d, -s and -w combo;mixed rev date state author; 131;mixed.at:221;Invalid -r, -d, -s and -w combo;mixed errors rev date state author; 132;log.at:3;Old log expansion format;log version; 133;log.at:11;New log expansion format;log; 134;log.at:18;Logs for multiple revisions;log; 135;rcsinit.at:3;Empty RCSINIT;rcsinit rev state; 136;rcsinit.at:12;RCSINIT with options;rcsinit rev state; 137;rcsinit.at:21;RCSINIT with invalid options;rcsinit errors; 138;rcsinit.at:28;RCSINIT with a filename;rcsinit; ' at_keywords= at_prev= for at_option do # If the previous option needs an argument, assign it. if test -n "$at_prev"; then at_option=$at_prev=$at_option at_prev= fi at_optarg=`expr "x$at_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $at_option in --help | -h ) at_help_p=: ;; --list | -l ) at_list_p=: ;; --version | -V ) echo "$as_me (blame 1.3.1)" exit 0 ;; --clean | -c ) rm -rf $at_suite_dir $at_suite_log exit 0 ;; --debug | -d ) at_debug_p=: ;; --errexit | -e ) at_debug_p=: at_errexit_p=: ;; --verbose | -v ) at_verbose=echo; at_quiet=: ;; --trace | -x ) at_traceon='set -vx'; at_traceoff='set +vx' ;; [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]) at_groups="$at_groups$at_option " ;; # Ranges [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-) at_range_start=`echo $at_option |tr -d '-'` at_range=`echo " $at_groups_all " | \ sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,'` at_groups="$at_groups$at_range " ;; -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]) at_range_end=`echo $at_option |tr -d '-'` at_range=`echo " $at_groups_all " | \ sed -e 's, '$at_range_end' .*$, '$at_range_end','` at_groups="$at_groups$at_range " ;; [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \ [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \ [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \ [0-9][0-9][0-9]-[0-9][0-9][0-9] | \ [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \ [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] ) at_range_start=`echo $at_option |sed 's,-.*,,'` at_range_end=`echo $at_option |sed 's,.*-,,'` # FIXME: Maybe test to make sure start <= end? at_range=`echo " $at_groups_all " | \ sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,' \ -e 's, '$at_range_end' .*$, '$at_range_end','` at_groups="$at_groups$at_range " ;; # Keywords. --keywords | -k ) at_prev=--keywords ;; --keywords=* ) at_keywords="$at_keywords,$at_optarg" ;; *=*) at_envvar=`expr "x$at_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$at_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $at_envvar" >&2 { (exit 1); exit 1; }; } at_value=`echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$at_envvar='$at_value'" export $at_envvar # Propagate to debug scripts. at_debug_args="$at_debug_args $at_option" ;; *) echo "$as_me: invalid option: $at_option" >&2 echo "Try \`$0 --help' for more information." >&2 exit 1 ;; esac done # Process the --keywords if test -n "$at_keywords"; then at_groups_selected=$at_help_all for at_keyword in `IFS=,; set X $at_keywords; shift; echo ${1+$@}` do # It is on purpose that we match the test group titles too. at_groups_selected=`echo "$at_groups_selected" | grep -i "^[^;]*;[^;]*.*[; ]$at_keyword[ ;]"` done at_groups_selected=`echo "$at_groups_selected" | sed 's/;.*//'` # Smash the end of lines. at_groups_selected=`echo $at_groups_selected` at_groups="$at_groups$at_groups_selected " fi # Selected test groups. test -z "$at_groups" && at_groups=$at_groups_all # Help message. if $at_help_p; then cat <<_ATEOF Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS] Run all the tests, or the selected TESTS, and save a detailed log file. Upon failure, create debugging scripts. You should not change environment variables unless explicitly passed as command line arguments. Set \`AUTOTEST_PATH' to select the executables to exercise. Each relative directory is expanded as build and source directories relatively to the top level of this distribution. E.g., $ $0 AUTOTEST_PATH=bin possibly amounts into PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH _ATEOF cat <<_ATEOF Operation modes: -h, --help print the help message, then exit -V, --version print version number, then exit -c, --clean remove all the files this test suite might create and exit -l, --list describes all the tests, or the selected TESTS _ATEOF cat <<_ATEOF Execution tuning: -k, --keywords=KEYWORDS select the tests matching all the comma separated KEYWORDS accumulates -e, --errexit abort as soon as a test fails; implies --debug -v, --verbose force more detailed output default for debugging scripts -d, --debug inhibit clean up and debug script creation default for debugging scripts -x, --trace enable tests shell tracing _ATEOF cat <<_ATEOF Report bugs to . _ATEOF exit 0 fi # List of tests. if $at_list_p; then cat <<_ATEOF blame 1.3.1 test suite test groups: NUM: FILENAME:LINE TEST-GROUP-NAME KEYWORDS _ATEOF # " 1 42 45 " => "^(1|42|45);". at_groups_pattern=`echo "$at_groups" | sed 's/^ *//;s/ *$//;s/ */|/g'` echo "$at_help_all" | awk 'BEGIN { FS = ";" } { if ($1 !~ /^('"$at_groups_pattern"')$/) next } { if ($1) printf " %3d: %-18s %s\n", $1, $2, $3 if ($4) printf " %s\n", $4 } ' exit 0 fi # Don't take risks: use only absolute directories in PATH. # # For stand-alone test suites, AUTOTEST_PATH is relative to `.'. # # For embedded test suites, AUTOTEST_PATH is relative to the top level # of the package. Then expand it into build/src parts, since users # may create executables in both places. # # There might be directories that don't exist, but don't redirect # builtins' (eg., cd) stderr directly: Ultrix's sh hates that. AUTOTEST_PATH=`echo $AUTOTEST_PATH | tr ':' $PATH_SEPARATOR` at_path= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $AUTOTEST_PATH $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in [\\/]* | ?:[\\/]* ) at_path=$at_path$PATH_SEPARATOR$as_dir ;; * ) if test -z "$at_top_builddir"; then # Stand-alone test suite. at_path=$at_path$PATH_SEPARATOR$as_dir else # Embedded test suite. at_path=$at_path$PATH_SEPARATOR$at_top_builddir/$as_dir at_path=$at_path$PATH_SEPARATOR$at_top_srcdir/$as_dir fi ;; esac done # Now build and simplify PATH. PATH= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $at_path do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` test -d "$as_dir" || continue case $PATH in $as_dir | \ $as_dir$PATH_SEPARATOR* | \ *$PATH_SEPARATOR$as_dir | \ *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR* ) ;; '') PATH=$as_dir ;; *) PATH=$PATH$PATH_SEPARATOR$as_dir ;; esac done export PATH # Setting up the FDs. # 5 is the log file. Not to be overwritten if `-d'. $at_debug_p && at_suite_log=/dev/null exec 5>$at_suite_log # Banners and logs. cat <<\_ASBOX ## ----------------------- ## ## blame 1.3.1 test suite. ## ## ----------------------- ## _ASBOX { cat <<\_ASBOX ## ----------------------- ## ## blame 1.3.1 test suite. ## ## ----------------------- ## _ASBOX echo echo "$as_me: command line was:" echo " $ $0 $at_cli_args" echo # Try to find a few ChangeLogs in case it might help determining the # exact version. Use the relative dir: if the top dir is a symlink, # find will not follow it (and options to follow the links are not # portable), which would result in no output here. if test -n "$at_top_srcdir"; then cat <<\_ASBOX ## ----------- ## ## ChangeLogs. ## ## ----------- ## _ASBOX echo for at_file in `find "$at_top_srcdir" -name ChangeLog -print` do echo "$as_me: $at_file:" sed 's/^/| /;10q' $at_file echo done { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } echo fi # Contents of the config files. for at_file in atconfig atlocal do test -r $at_file || continue echo "$as_me: $at_file:" sed 's/^/| /' $at_file echo done cat <<\_ASBOX ## ---------------- ## ## Tested programs. ## ## ---------------- ## _ASBOX echo } >&5 # Report what programs are being tested. for at_program in : $at_tested do test "$at_program" = : && continue as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -f $as_dir/$at_program && break done if test -f $as_dir/$at_program; then { echo "testsuite.at:3: $as_dir/$at_program --version" $as_dir/$at_program --version echo } >&5 2>&1 else { { echo "$as_me:$LINENO: error: cannot find $at_program" >&5 echo "$as_me: error: cannot find $at_program" >&2;} { (exit 1); exit 1; }; } fi done { cat <<\_ASBOX ## ------------------ ## ## Running the tests. ## ## ------------------ ## _ASBOX } >&5 at_start_date=`date` at_start_time=`(date +%s) 2>/dev/null` echo "$as_me: starting at: $at_start_date" >&5 at_xpass_list= at_xfail_list= at_pass_list= at_fail_list= at_skip_list= at_group_count=0 # Create the master directory if it doesn't already exist. test -d $at_suite_dir || mkdir $at_suite_dir || { { echo "$as_me:$LINENO: error: cannot create $at_suite_dir" >&5 echo "$as_me: error: cannot create $at_suite_dir" >&2;} { (exit 1); exit 1; }; } # Can we diff with `/dev/null'? DU 5.0 refuses. if diff /dev/null /dev/null >/dev/null 2>&1; then at_devnull=/dev/null else at_devnull=$at_suite_dir/devnull cp /dev/null $at_devnull fi # Use `diff -u' when possible. if diff -u $at_devnull $at_devnull >/dev/null 2>&1; then at_diff='diff -u' else at_diff=diff fi for at_group in $at_groups do # Be sure to come back to the top test directory. cd $at_suite_dir case $at_group in banner-*) at_group_log=$at_suite_log ;; *) # Skip tests we already run (using --keywords makes it easy to get # duplication). case " $at_pass_test $at_skip_test $at_fail_test " in *" $at_group "* ) continue;; esac # Normalize the test group number. at_group_normalized=`expr "00000$at_group" : ".*\($at_format\)"` # Create a fresh directory for the next test group, and enter. at_group_dir=$at_suite_dir/$at_group_normalized at_group_log=$at_group_dir/$as_me.log rm -rf $at_group_dir mkdir $at_group_dir || { { echo "$as_me:$LINENO: error: cannot create $at_group_dir" >&5 echo "$as_me: error: cannot create $at_group_dir" >&2;} { (exit 1); exit 1; }; } cd $at_group_dir ;; esac echo 0 > $at_status_file # Clearly separate the test groups when verbose. test $at_group_count != 0 && $at_verbose # In verbose mode, append to the log file *and* show on # the standard output; in quiet mode only write to the log if test $at_verbose = echo; then at_tee_pipe="tee -a $at_group_log" else at_tee_pipe="cat >> $at_group_log" fi case $at_group in banner-1 ) # Banner 1. argv.at:1 cat <<\_ATEOF Command line argument parsing. _ATEOF ;; 1 ) # 1. argv.at:3: No arguments at_setup_line='argv.at:3' at_desc='No arguments' $at_quiet $ECHO_N " 1: No arguments $ECHO_C" at_xfail=no ( echo "1. argv.at:3: testing ..." $at_traceon $at_traceoff echo "argv.at:6: blame" echo argv.at:6 >$at_check_line_file ( $at_traceon; blame ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "argv.at:6: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 2 ) # 2. argv.at:10: Invalid argument at_setup_line='argv.at:10' at_desc='Invalid argument' $at_quiet $ECHO_N " 2: Invalid argument $ECHO_C" at_xfail=no ( echo "2. argv.at:10: testing ..." $at_traceon $at_traceoff echo "argv.at:13: blame --footle" echo argv.at:13 >$at_check_line_file ( $at_traceon; blame --footle ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "argv.at:13: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 3 ) # 3. argv.at:17: -? and --help at_setup_line='argv.at:17' at_desc='-? and --help' $at_quiet $ECHO_N " 3: -? and --help $ECHO_C" at_xfail=no ( echo "3. argv.at:17: testing ..." $at_traceon $at_traceoff echo "argv.at:19: blame -?" echo argv.at:19 >$at_check_line_file ( $at_traceon; blame -? ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo stdout:; cat $at_stdout case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "argv.at:19: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "argv.at:20: blame --help" echo argv.at:20 >$at_check_line_file ( $at_traceon; blame --help ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo stdout:; cat $at_stdout case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "argv.at:20: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 4 ) # 4. argv.at:23: -V and --version at_setup_line='argv.at:23' at_desc='-V and --version' $at_quiet $ECHO_N " 4: -V and --version $ECHO_C" at_xfail=no ( echo "4. argv.at:23: testing ..." $at_traceon cat < expout $package_string; emulating RCS version 5 EOF $at_traceoff echo "argv.at:28: blame -V" echo argv.at:28 >$at_check_line_file ( $at_traceon; blame -V ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "argv.at:28: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "argv.at:29: blame --version" echo argv.at:29 >$at_check_line_file ( $at_traceon; blame --version ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo stdout:; tee stdout <$at_stdout case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "argv.at:29: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 5 ) # 5. argv.at:32: Non-existant working file at_setup_line='argv.at:32' at_desc='Non-existant working file' $at_quiet $ECHO_N " 5: Non-existant working file $ECHO_C" at_xfail=no ( echo "5. argv.at:32: testing ..." $at_traceon $at_traceoff echo "argv.at:35: blame /nonexistant" echo argv.at:35 >$at_check_line_file ( $at_traceon; blame /nonexistant ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "argv.at:35: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 6 ) # 6. argv.at:39: Non-existant RCS file at_setup_line='argv.at:39' at_desc='Non-existant RCS file' $at_quiet $ECHO_N " 6: Non-existant RCS file $ECHO_C" at_xfail=no ( echo "6. argv.at:39: testing ..." $at_traceon $at_traceoff echo "argv.at:42: blame /nonexistant,v" echo argv.at:42 >$at_check_line_file ( $at_traceon; blame /nonexistant,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "argv.at:42: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 7 ) # 7. argv.at:46: Filenames only at_setup_line='argv.at:46' at_desc='Filenames only' $at_quiet $ECHO_N " 7: Filenames only $ECHO_C" at_xfail=no ( echo "7. argv.at:46: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr $at_traceoff echo "argv.at:50: blame \$testdir/simple,v" echo argv.at:50 >$at_check_line_file ( $at_traceon; blame $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "argv.at:50: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon rm -f experr cat $testdir/simple.experr | sed "s,simple,$testdir/simple,g" > experr $at_traceoff echo "argv.at:53: blame \$testdir/simple" echo argv.at:53 >$at_check_line_file ( $at_traceon; blame $testdir/simple ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "argv.at:53: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; banner-2 ) # Banner 2. pairing.at:1 cat <<\_ATEOF Filename pairing. _ATEOF ;; 8 ) # 8. pairing.at:3: Working file, then corresponding RCS file at_setup_line='pairing.at:3' at_desc='Working file, then corresponding RCS file' $at_quiet $ECHO_N " 8: Working file, then corresponding RCS file $ECHO_C" at_xfail=no ( echo "8. pairing.at:3: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cat $testdir/simple.experr | sed "s,simple,$testdir/simple,g" > experr $at_traceoff echo "pairing.at:7: blame \$testdir/simple \$testdir/simple,v" echo pairing.at:7 >$at_check_line_file ( $at_traceon; blame $testdir/simple $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "pairing.at:7: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 9 ) # 9. pairing.at:10: Working file, then independent working file at_setup_line='pairing.at:10' at_desc='Working file, then independent working file' $at_quiet $ECHO_N " 9: Working file, then independent working file $ECHO_C" at_xfail=no ( echo "9. pairing.at:10: testing ..." $at_traceon cat $testdir/simple-1.2.expout $testdir/complex-3.8.expout > expout ( cat $testdir/simple.experr | sed "s,simple,$testdir/simple,g" cat $testdir/complex.experr | sed "s,complex,$testdir/complex,g" ) > experr $at_traceoff echo "pairing.at:17: blame \$testdir/simple \$testdir/complex" echo pairing.at:17 >$at_check_line_file ( $at_traceon; blame $testdir/simple $testdir/complex ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "pairing.at:17: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 10 ) # 10. pairing.at:20: Working file, then independent RCS file at_setup_line='pairing.at:20' at_desc='Working file, then independent RCS file' $at_quiet $ECHO_N " 10: Working file, then independent RCS file $ECHO_C" at_xfail=no ( echo "10. pairing.at:20: testing ..." $at_traceon cat $testdir/simple-1.2.expout $testdir/complex-3.8.expout > expout ( cat $testdir/simple.experr | sed "s,simple,$testdir/simple,g" cat $testdir/complex.experr ) > experr $at_traceoff echo "pairing.at:27: blame \$testdir/simple \$testdir/complex,v" echo pairing.at:27 >$at_check_line_file ( $at_traceon; blame $testdir/simple $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "pairing.at:27: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 11 ) # 11. pairing.at:30: RCS file, then corresponding working file at_setup_line='pairing.at:30' at_desc='RCS file, then corresponding working file' $at_quiet $ECHO_N " 11: RCS file, then corresponding working file $ECHO_C" at_xfail=no ( echo "11. pairing.at:30: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cat $testdir/simple.experr | sed "s,simple,$testdir/simple,g" > experr $at_traceoff echo "pairing.at:34: blame \$testdir/simple,v \$testdir/simple" echo pairing.at:34 >$at_check_line_file ( $at_traceon; blame $testdir/simple,v $testdir/simple ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "pairing.at:34: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 12 ) # 12. pairing.at:37: RCS file, then independent working file at_setup_line='pairing.at:37' at_desc='RCS file, then independent working file' $at_quiet $ECHO_N " 12: RCS file, then independent working file $ECHO_C" at_xfail=no ( echo "12. pairing.at:37: testing ..." $at_traceon cat $testdir/simple-1.2.expout $testdir/complex-3.8.expout > expout ( cat $testdir/simple.experr cat $testdir/complex.experr | sed "s,complex,$testdir/complex,g" ) > experr $at_traceoff echo "pairing.at:44: blame \$testdir/simple,v \$testdir/complex" echo pairing.at:44 >$at_check_line_file ( $at_traceon; blame $testdir/simple,v $testdir/complex ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "pairing.at:44: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 13 ) # 13. pairing.at:47: RCS file, then independent RCS file at_setup_line='pairing.at:47' at_desc='RCS file, then independent RCS file' $at_quiet $ECHO_N " 13: RCS file, then independent RCS file $ECHO_C" at_xfail=no ( echo "13. pairing.at:47: testing ..." $at_traceon cat $testdir/simple-1.2.expout $testdir/complex-3.8.expout > expout cat $testdir/simple.experr $testdir/complex.experr > experr $at_traceoff echo "pairing.at:51: blame \$testdir/simple,v \$testdir/complex,v" echo pairing.at:51 >$at_check_line_file ( $at_traceon; blame $testdir/simple,v $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "pairing.at:51: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; banner-3 ) # Banner 3. rcs.at:1 cat <<\_ATEOF RCS file parsing. _ATEOF ;; 14 ) # 14. rcs.at:3: No revisions present at_setup_line='rcs.at:3' at_desc='No revisions present' $at_quiet $ECHO_N " 14: No revisions present $ECHO_C" at_xfail=no ( echo "14. rcs.at:3: testing ..." $at_traceon $at_traceoff echo "rcs.at:6: blame \$testdir/empty,v" echo rcs.at:6 >$at_check_line_file ( $at_traceon; blame $testdir/empty,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "rcs.at:6: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 15 ) # 15. rcs.at:10: Two-digit year before 2000 at_setup_line='rcs.at:10' at_desc='Two-digit year before 2000' $at_quiet $ECHO_N " 15: Two-digit year before 2000 $ECHO_C" at_xfail=no ( echo "15. rcs.at:10: testing ..." $at_traceon cp $testdir/compat-1.1.expout expout cp $testdir/compat.experr experr $at_traceoff echo "rcs.at:14: blame -r1.1 \$testdir/compat,v" echo rcs.at:14 >$at_check_line_file ( $at_traceon; blame -r1.1 $testdir/compat,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rcs.at:14: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 16 ) # 16. rcs.at:17: Missing empty line after delta text at_setup_line='rcs.at:17' at_desc='Missing empty line after delta text' $at_quiet $ECHO_N " 16: Missing empty line after delta text $ECHO_C" at_xfail=no ( echo "16. rcs.at:17: testing ..." $at_traceon cp $testdir/compat-1.2.expout expout cp $testdir/compat.experr experr $at_traceoff echo "rcs.at:21: blame -r1.2 \$testdir/compat,v" echo rcs.at:21 >$at_check_line_file ( $at_traceon; blame -r1.2 $testdir/compat,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rcs.at:21: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 17 ) # 17. rcs.at:24: Binary data at_setup_line='rcs.at:24' at_desc='Binary data' $at_quiet $ECHO_N " 17: Binary data $ECHO_C" at_xfail=no ( echo "17. rcs.at:24: testing ..." $at_traceon cp $testdir/binary-1.2.expout expout cp $testdir/binary.experr experr $at_traceoff echo "rcs.at:28: blame -r1.2 \$testdir/binary,v" echo rcs.at:28 >$at_check_line_file ( $at_traceon; blame -r1.2 $testdir/binary,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rcs.at:28: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; banner-4 ) # Banner 4. rev.at:1 cat <<\_ATEOF -r and --revision options. _ATEOF ;; 18 ) # 18. rev.at:3: No revision at_setup_line='rev.at:3' at_desc='No revision' $at_quiet $ECHO_N " 18: No revision $ECHO_C" at_xfail=no ( echo "18. rev.at:3: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr $at_traceoff echo "rev.at:7: blame -r -- \$testdir/simple,v" echo rev.at:7 >$at_check_line_file ( $at_traceon; blame -r -- $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:7: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "rev.at:8: blame --revision -- \$testdir/simple,v" echo rev.at:8 >$at_check_line_file ( $at_traceon; blame --revision -- $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:8: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 19 ) # 19. rev.at:11: Multiple revisions at_setup_line='rev.at:11' at_desc='Multiple revisions' $at_quiet $ECHO_N " 19: Multiple revisions $ECHO_C" at_xfail=no ( echo "19. rev.at:11: testing ..." $at_traceon $at_traceoff echo "rev.at:14: blame -r1.1 -r1.2 \$testdir/simple,v" echo rev.at:14 >$at_check_line_file ( $at_traceon; blame -r1.1 -r1.2 $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "rev.at:14: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 20 ) # 20. rev.at:18: Single dot at_setup_line='rev.at:18' at_desc='Single dot' $at_quiet $ECHO_N " 20: Single dot $ECHO_C" at_xfail=no ( echo "20. rev.at:18: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr $at_traceoff echo "rev.at:22: blame -r. \$testdir/simple,v" echo rev.at:22 >$at_check_line_file ( $at_traceon; blame -r. $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:22: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "rev.at:23: blame --revision=. \$testdir/simple,v" echo rev.at:23 >$at_check_line_file ( $at_traceon; blame --revision=. $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:23: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 21 ) # 21. rev.at:26: Valid trunk branch at_setup_line='rev.at:26' at_desc='Valid trunk branch' $at_quiet $ECHO_N " 21: Valid trunk branch $ECHO_C" at_xfail=no ( echo "21. rev.at:26: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr $at_traceoff echo "rev.at:30: blame -r1 \$testdir/simple,v" echo rev.at:30 >$at_check_line_file ( $at_traceon; blame -r1 $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:30: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 22 ) # 22. rev.at:33: Invalid trunk branch at_setup_line='rev.at:33' at_desc='Invalid trunk branch' $at_quiet $ECHO_N " 22: Invalid trunk branch $ECHO_C" at_xfail=no ( echo "22. rev.at:33: testing ..." $at_traceon $at_traceoff echo "rev.at:36: blame -r4 \$testdir/simple,v" echo rev.at:36 >$at_check_line_file ( $at_traceon; blame -r4 $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "rev.at:36: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 23 ) # 23. rev.at:40: Valid trunk branch and dot at_setup_line='rev.at:40' at_desc='Valid trunk branch and dot' $at_quiet $ECHO_N " 23: Valid trunk branch and dot $ECHO_C" at_xfail=no ( echo "23. rev.at:40: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr $at_traceoff echo "rev.at:44: blame -r1. \$testdir/simple,v" echo rev.at:44 >$at_check_line_file ( $at_traceon; blame -r1. $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:44: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 24 ) # 24. rev.at:47: Invalid trunk branch and dot at_setup_line='rev.at:47' at_desc='Invalid trunk branch and dot' $at_quiet $ECHO_N " 24: Invalid trunk branch and dot $ECHO_C" at_xfail=no ( echo "24. rev.at:47: testing ..." $at_traceon $at_traceoff echo "rev.at:50: blame -r4. \$testdir/simple,v" echo rev.at:50 >$at_check_line_file ( $at_traceon; blame -r4. $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "rev.at:50: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 25 ) # 25. rev.at:54: Dot and revision at_setup_line='rev.at:54' at_desc='Dot and revision' $at_quiet $ECHO_N " 25: Dot and revision $ECHO_C" at_xfail=no ( echo "25. rev.at:54: testing ..." $at_traceon cp $testdir/simple-1.1.expout expout cp $testdir/simple.experr experr $at_traceoff echo "rev.at:58: blame -r.1 \$testdir/simple,v" echo rev.at:58 >$at_check_line_file ( $at_traceon; blame -r.1 $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:58: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 26 ) # 26. rev.at:61: Dot and late revision at_setup_line='rev.at:61' at_desc='Dot and late revision' $at_quiet $ECHO_N " 26: Dot and late revision $ECHO_C" at_xfail=no ( echo "26. rev.at:61: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr $at_traceoff echo "rev.at:65: blame -r.10 \$testdir/simple,v" echo rev.at:65 >$at_check_line_file ( $at_traceon; blame -r.10 $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:65: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 27 ) # 27. rev.at:68: Dot and early revision at_setup_line='rev.at:68' at_desc='Dot and early revision' $at_quiet $ECHO_N " 27: Dot and early revision $ECHO_C" at_xfail=no ( echo "27. rev.at:68: testing ..." $at_traceon $at_traceoff echo "rev.at:71: blame -r.0 \$testdir/simple,v" echo rev.at:71 >$at_check_line_file ( $at_traceon; blame -r.0 $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "rev.at:71: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 28 ) # 28. rev.at:75: Symbolic trunk branch at_setup_line='rev.at:75' at_desc='Symbolic trunk branch' $at_quiet $ECHO_N " 28: Symbolic trunk branch $ECHO_C" at_xfail=no ( echo "28. rev.at:75: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr $at_traceoff echo "rev.at:80: blame -rfoo \$testdir/simple,v" echo rev.at:80 >$at_check_line_file ( $at_traceon; blame -rfoo $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:80: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 29 ) # 29. rev.at:83: Symbolic trunk branch and dot at_setup_line='rev.at:83' at_desc='Symbolic trunk branch and dot' $at_quiet $ECHO_N " 29: Symbolic trunk branch and dot $ECHO_C" at_xfail=no ( echo "29. rev.at:83: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr $at_traceoff echo "rev.at:88: blame -rfoo. \$testdir/simple,v" echo rev.at:88 >$at_check_line_file ( $at_traceon; blame -rfoo. $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:88: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 30 ) # 30. rev.at:91: Symbolic trunk branch and revision at_setup_line='rev.at:91' at_desc='Symbolic trunk branch and revision' $at_quiet $ECHO_N " 30: Symbolic trunk branch and revision $ECHO_C" at_xfail=no ( echo "30. rev.at:91: testing ..." $at_traceon cp $testdir/simple-1.1.expout expout cp $testdir/simple.experr experr $at_traceoff echo "rev.at:96: blame -rfoo.1 \$testdir/simple,v" echo rev.at:96 >$at_check_line_file ( $at_traceon; blame -rfoo.1 $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:96: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 31 ) # 31. rev.at:99: Symbolic trunk branch and late revision at_setup_line='rev.at:99' at_desc='Symbolic trunk branch and late revision' $at_quiet $ECHO_N " 31: Symbolic trunk branch and late revision $ECHO_C" at_xfail=no ( echo "31. rev.at:99: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr $at_traceoff echo "rev.at:104: blame -rfoo.10 \$testdir/simple,v" echo rev.at:104 >$at_check_line_file ( $at_traceon; blame -rfoo.10 $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:104: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 32 ) # 32. rev.at:107: Symbolic trunk branch and early revision at_setup_line='rev.at:107' at_desc='Symbolic trunk branch and early revision' $at_quiet $ECHO_N " 32: Symbolic trunk branch and early revision $ECHO_C" at_xfail=no ( echo "32. rev.at:107: testing ..." $at_traceon $at_traceoff echo "rev.at:111: blame -rfoo.0 \$testdir/simple,v" echo rev.at:111 >$at_check_line_file ( $at_traceon; blame -rfoo.0 $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "rev.at:111: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 33 ) # 33. rev.at:115: Symbolic revision at_setup_line='rev.at:115' at_desc='Symbolic revision' $at_quiet $ECHO_N " 33: Symbolic revision $ECHO_C" at_xfail=no ( echo "33. rev.at:115: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr $at_traceoff echo "rev.at:120: blame -rbar \$testdir/simple,v" echo rev.at:120 >$at_check_line_file ( $at_traceon; blame -rbar $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:120: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 34 ) # 34. rev.at:123: Dot and symbolic revision at_setup_line='rev.at:123' at_desc='Dot and symbolic revision' $at_quiet $ECHO_N " 34: Dot and symbolic revision $ECHO_C" at_xfail=no ( echo "34. rev.at:123: testing ..." $at_traceon cp $testdir/simple-1.1.expout expout cp $testdir/simple.experr experr $at_traceoff echo "rev.at:128: blame -r.foo \$testdir/simple,v" echo rev.at:128 >$at_check_line_file ( $at_traceon; blame -r.foo $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:128: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 35 ) # 35. rev.at:131: Symbolic trunk branch and symbolic revision at_setup_line='rev.at:131' at_desc='Symbolic trunk branch and symbolic revision' $at_quiet $ECHO_N " 35: Symbolic trunk branch and symbolic revision $ECHO_C" at_xfail=no ( echo "35. rev.at:131: testing ..." $at_traceon cp $testdir/simple-1.1.expout expout cp $testdir/simple.experr experr $at_traceoff echo "rev.at:136: blame -rfoo.foo \$testdir/simple,v" echo rev.at:136 >$at_check_line_file ( $at_traceon; blame -rfoo.foo $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rev.at:136: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 36 ) # 36. rev.at:139: Invalid symbol at_setup_line='rev.at:139' at_desc='Invalid symbol' $at_quiet $ECHO_N " 36: Invalid symbol $ECHO_C" at_xfail=no ( echo "36. rev.at:139: testing ..." $at_traceon $at_traceoff echo "rev.at:143: blame -rbaz \$testdir/simple,v" echo rev.at:143 >$at_check_line_file ( $at_traceon; blame -rbaz $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "rev.at:143: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "rev.at:145: blame -r.baz \$testdir/simple,v" echo rev.at:145 >$at_check_line_file ( $at_traceon; blame -r.baz $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "rev.at:145: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "rev.at:147: blame -rbaz. \$testdir/simple,v" echo rev.at:147 >$at_check_line_file ( $at_traceon; blame -rbaz. $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "rev.at:147: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "rev.at:149: blame -r1.baz \$testdir/simple,v" echo rev.at:149 >$at_check_line_file ( $at_traceon; blame -r1.baz $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "rev.at:149: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; banner-5 ) # Banner 5. branch.at:1 cat <<\_ATEOF Resolving revisions on branches. _ATEOF ;; 37 ) # 37. branch.at:3: Revision on branch at_setup_line='branch.at:3' at_desc='Revision on branch' $at_quiet $ECHO_N " 37: Revision on branch $ECHO_C" at_xfail=no ( echo "37. branch.at:3: testing ..." $at_traceon cp $testdir/complex-1.2.1.2.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:8: blame -r1.2.1.2 \$testdir/complex,v" echo branch.at:8 >$at_check_line_file ( $at_traceon; blame -r1.2.1.2 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:8: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 38 ) # 38. branch.at:11: Revision on deep branch at_setup_line='branch.at:11' at_desc='Revision on deep branch' $at_quiet $ECHO_N " 38: Revision on deep branch $ECHO_C" at_xfail=no ( echo "38. branch.at:11: testing ..." $at_traceon cp $testdir/complex-1.2.1.1.1.1.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:16: blame -r1.2.1.1.1.1 \$testdir/complex,v" echo branch.at:16 >$at_check_line_file ( $at_traceon; blame -r1.2.1.1.1.1 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:16: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 39 ) # 39. branch.at:19: Valid branch at_setup_line='branch.at:19' at_desc='Valid branch' $at_quiet $ECHO_N " 39: Valid branch $ECHO_C" at_xfail=no ( echo "39. branch.at:19: testing ..." $at_traceon cp $testdir/complex.experr experr $at_traceoff echo "branch.at:23: blame -r1.2.1.1.1 \$testdir/complex,v" echo branch.at:23 >$at_check_line_file ( $at_traceon; blame -r1.2.1.1.1 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:23: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 40 ) # 40. branch.at:26: Invalid branch at_setup_line='branch.at:26' at_desc='Invalid branch' $at_quiet $ECHO_N " 40: Invalid branch $ECHO_C" at_xfail=no ( echo "40. branch.at:26: testing ..." $at_traceon $at_traceoff echo "branch.at:30: blame -r1.2.1.3.1 \$testdir/complex,v" echo branch.at:30 >$at_check_line_file ( $at_traceon; blame -r1.2.1.3.1 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "branch.at:30: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 41 ) # 41. branch.at:34: Valid branch and dot at_setup_line='branch.at:34' at_desc='Valid branch and dot' $at_quiet $ECHO_N " 41: Valid branch and dot $ECHO_C" at_xfail=no ( echo "41. branch.at:34: testing ..." $at_traceon cp $testdir/complex.experr experr $at_traceoff echo "branch.at:38: blame -r1.2.1.1.1. \$testdir/complex,v" echo branch.at:38 >$at_check_line_file ( $at_traceon; blame -r1.2.1.1.1. $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:38: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 42 ) # 42. branch.at:41: Invalid branch and dot at_setup_line='branch.at:41' at_desc='Invalid branch and dot' $at_quiet $ECHO_N " 42: Invalid branch and dot $ECHO_C" at_xfail=no ( echo "42. branch.at:41: testing ..." $at_traceon $at_traceoff echo "branch.at:45: blame -r1.2.1.3.1. \$testdir/complex,v" echo branch.at:45 >$at_check_line_file ( $at_traceon; blame -r1.2.1.3.1. $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "branch.at:45: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 43 ) # 43. branch.at:49: Dot and revision on branch at_setup_line='branch.at:49' at_desc='Dot and revision on branch' $at_quiet $ECHO_N " 43: Dot and revision on branch $ECHO_C" at_xfail=no ( echo "43. branch.at:49: testing ..." $at_traceon cp $testdir/complex-1.2.1.2.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:54: blame -r.2.1.2 \$testdir/complex,v" echo branch.at:54 >$at_check_line_file ( $at_traceon; blame -r.2.1.2 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:54: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 44 ) # 44. branch.at:57: Dot and late revision on branch at_setup_line='branch.at:57' at_desc='Dot and late revision on branch' $at_quiet $ECHO_N " 44: Dot and late revision on branch $ECHO_C" at_xfail=no ( echo "44. branch.at:57: testing ..." $at_traceon cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:62: blame -r.2.1.10 \$testdir/complex,v" echo branch.at:62 >$at_check_line_file ( $at_traceon; blame -r.2.1.10 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:62: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 45 ) # 45. branch.at:65: Dot and early revision on branch at_setup_line='branch.at:65' at_desc='Dot and early revision on branch' $at_quiet $ECHO_N " 45: Dot and early revision on branch $ECHO_C" at_xfail=no ( echo "45. branch.at:65: testing ..." $at_traceon $at_traceoff echo "branch.at:69: blame -r.2.1.0 \$testdir/complex,v" echo branch.at:69 >$at_check_line_file ( $at_traceon; blame -r.2.1.0 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "branch.at:69: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 46 ) # 46. branch.at:73: Dot and branch at_setup_line='branch.at:73' at_desc='Dot and branch' $at_quiet $ECHO_N " 46: Dot and branch $ECHO_C" at_xfail=no ( echo "46. branch.at:73: testing ..." $at_traceon cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:78: blame -r.2.1 \$testdir/complex,v" echo branch.at:78 >$at_check_line_file ( $at_traceon; blame -r.2.1 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:78: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 47 ) # 47. branch.at:81: Dot, branch and dot at_setup_line='branch.at:81' at_desc='Dot, branch and dot' $at_quiet $ECHO_N " 47: Dot, branch and dot $ECHO_C" at_xfail=no ( echo "47. branch.at:81: testing ..." $at_traceon cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:86: blame -r.2.1. \$testdir/complex,v" echo branch.at:86 >$at_check_line_file ( $at_traceon; blame -r.2.1. $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:86: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 48 ) # 48. branch.at:89: Symbolic branch at_setup_line='branch.at:89' at_desc='Symbolic branch' $at_quiet $ECHO_N " 48: Symbolic branch $ECHO_C" at_xfail=no ( echo "48. branch.at:89: testing ..." $at_traceon cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:95: blame -rbar \$testdir/complex,v" echo branch.at:95 >$at_check_line_file ( $at_traceon; blame -rbar $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:95: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 49 ) # 49. branch.at:98: Symbolic branch and dot at_setup_line='branch.at:98' at_desc='Symbolic branch and dot' $at_quiet $ECHO_N " 49: Symbolic branch and dot $ECHO_C" at_xfail=no ( echo "49. branch.at:98: testing ..." $at_traceon cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:104: blame -rbar. \$testdir/complex,v" echo branch.at:104 >$at_check_line_file ( $at_traceon; blame -rbar. $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:104: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 50 ) # 50. branch.at:107: Symbolic branch and revision at_setup_line='branch.at:107' at_desc='Symbolic branch and revision' $at_quiet $ECHO_N " 50: Symbolic branch and revision $ECHO_C" at_xfail=no ( echo "50. branch.at:107: testing ..." $at_traceon cp $testdir/complex-1.2.1.2.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:113: blame -rbar.2 \$testdir/complex,v" echo branch.at:113 >$at_check_line_file ( $at_traceon; blame -rbar.2 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:113: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 51 ) # 51. branch.at:116: Symbolic branch and late revision at_setup_line='branch.at:116' at_desc='Symbolic branch and late revision' $at_quiet $ECHO_N " 51: Symbolic branch and late revision $ECHO_C" at_xfail=no ( echo "51. branch.at:116: testing ..." $at_traceon cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:122: blame -rbar.10 \$testdir/complex,v" echo branch.at:122 >$at_check_line_file ( $at_traceon; blame -rbar.10 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:122: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 52 ) # 52. branch.at:125: Symbolic branch and early revision at_setup_line='branch.at:125' at_desc='Symbolic branch and early revision' $at_quiet $ECHO_N " 52: Symbolic branch and early revision $ECHO_C" at_xfail=no ( echo "52. branch.at:125: testing ..." $at_traceon $at_traceoff echo "branch.at:130: blame -rbar.0 \$testdir/complex,v" echo branch.at:130 >$at_check_line_file ( $at_traceon; blame -rbar.0 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "branch.at:130: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 53 ) # 53. branch.at:134: Symbolic revision on branch at_setup_line='branch.at:134' at_desc='Symbolic revision on branch' $at_quiet $ECHO_N " 53: Symbolic revision on branch $ECHO_C" at_xfail=no ( echo "53. branch.at:134: testing ..." $at_traceon cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:140: blame -rbaz \$testdir/complex,v" echo branch.at:140 >$at_check_line_file ( $at_traceon; blame -rbaz $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:140: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 54 ) # 54. branch.at:143: Dot and symbolic revision on branch at_setup_line='branch.at:143' at_desc='Dot and symbolic revision on branch' $at_quiet $ECHO_N " 54: Dot and symbolic revision on branch $ECHO_C" at_xfail=no ( echo "54. branch.at:143: testing ..." $at_traceon cp $testdir/complex-1.2.1.1.1.1.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:149: blame -r.quux \$testdir/complex,v" echo branch.at:149 >$at_check_line_file ( $at_traceon; blame -r.quux $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:149: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 55 ) # 55. branch.at:152: Dot and symbolic branch at_setup_line='branch.at:152' at_desc='Dot and symbolic branch' $at_quiet $ECHO_N " 55: Dot and symbolic branch $ECHO_C" at_xfail=no ( echo "55. branch.at:152: testing ..." $at_traceon cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:157: blame -r.fred \$testdir/complex,v" echo branch.at:157 >$at_check_line_file ( $at_traceon; blame -r.fred $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:157: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 56 ) # 56. branch.at:160: Dot, symbolic branch and dot at_setup_line='branch.at:160' at_desc='Dot, symbolic branch and dot' $at_quiet $ECHO_N " 56: Dot, symbolic branch and dot $ECHO_C" at_xfail=no ( echo "56. branch.at:160: testing ..." $at_traceon cp $testdir/complex-1.2.1.3.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:165: blame -r.fred. \$testdir/complex,v" echo branch.at:165 >$at_check_line_file ( $at_traceon; blame -r.fred. $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:165: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 57 ) # 57. branch.at:168: Symbolic branch and symbolic revision at_setup_line='branch.at:168' at_desc='Symbolic branch and symbolic revision' $at_quiet $ECHO_N " 57: Symbolic branch and symbolic revision $ECHO_C" at_xfail=no ( echo "57. branch.at:168: testing ..." $at_traceon cp $testdir/complex-1.2.1.1.1.1.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:174: blame -rplugh.quux \$testdir/complex,v" echo branch.at:174 >$at_check_line_file ( $at_traceon; blame -rplugh.quux $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:174: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 58 ) # 58. branch.at:177: Number, symbol and symbol at_setup_line='branch.at:177' at_desc='Number, symbol and symbol' $at_quiet $ECHO_N " 58: Number, symbol and symbol $ECHO_C" at_xfail=no ( echo "58. branch.at:177: testing ..." $at_traceon cp $testdir/complex-1.2.1.1.1.1.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:183: blame -r1.fred.xyzzy \$testdir/complex,v" echo branch.at:183 >$at_check_line_file ( $at_traceon; blame -r1.fred.xyzzy $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:183: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 59 ) # 59. branch.at:186: Symbol, number and symbol at_setup_line='branch.at:186' at_desc='Symbol, number and symbol' $at_quiet $ECHO_N " 59: Symbol, number and symbol $ECHO_C" at_xfail=no ( echo "59. branch.at:186: testing ..." $at_traceon cp $testdir/complex-1.2.1.1.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:192: blame -rfoo.1.plugh \$testdir/complex,v" echo branch.at:192 >$at_check_line_file ( $at_traceon; blame -rfoo.1.plugh $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:192: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 60 ) # 60. branch.at:195: Symbol, symbol and number at_setup_line='branch.at:195' at_desc='Symbol, symbol and number' $at_quiet $ECHO_N " 60: Symbol, symbol and number $ECHO_C" at_xfail=no ( echo "60. branch.at:195: testing ..." $at_traceon cp $testdir/complex-1.2.1.1.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:201: blame -rfoo.plugh.1 \$testdir/complex,v" echo branch.at:201 >$at_check_line_file ( $at_traceon; blame -rfoo.plugh.1 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:201: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 61 ) # 61. branch.at:204: Number, symbol and number at_setup_line='branch.at:204' at_desc='Number, symbol and number' $at_quiet $ECHO_N " 61: Number, symbol and number $ECHO_C" at_xfail=no ( echo "61. branch.at:204: testing ..." $at_traceon cp $testdir/complex-1.2.1.1.1.1.expout expout cp $testdir/complex.experr experr $at_traceoff echo "branch.at:210: blame -r1.2.xyzzy.1 \$testdir/complex,v" echo branch.at:210 >$at_check_line_file ( $at_traceon; blame -r1.2.xyzzy.1 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "branch.at:210: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; banner-6 ) # Banner 6. working.at:1 cat <<\_ATEOF Handling RCS tags in working files. _ATEOF ;; 62 ) # 62. working.at:3: Valid revision at_setup_line='working.at:3' at_desc='Valid revision' $at_quiet $ECHO_N " 62: Valid revision $ECHO_C" at_xfail=no ( echo "62. working.at:3: testing ..." $at_traceon cp $testdir/keywords.experr experr cat < keywords \$Revision: 1.1 \$ EOF $at_traceoff echo "working.at:10: blame -r'\$' \$testdir/keywords,v" echo working.at:10 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: echo stdout:; cat $at_stdout case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "working.at:10: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon cat < keywords \$Id: keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ EOF $at_traceoff echo "working.at:14: blame -r'\$' \$testdir/keywords,v" echo working.at:14 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: echo stdout:; cat $at_stdout case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "working.at:14: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon cat < keywords \$Header: $testdir/keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ EOF $at_traceoff echo "working.at:18: blame -r'\$' \$testdir/keywords,v" echo working.at:18 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: echo stdout:; cat $at_stdout case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "working.at:18: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 63 ) # 63. working.at:21: Early revision at_setup_line='working.at:21' at_desc='Early revision' $at_quiet $ECHO_N " 63: Early revision $ECHO_C" at_xfail=no ( echo "63. working.at:21: testing ..." $at_traceon cat < keywords \$Revision: 1.0 \$ EOF $at_traceoff echo "working.at:28: blame -r'\$' \$testdir/keywords,v" echo working.at:28 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; cat $at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "working.at:28: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi cat < keywords \$Id: keywords,v 1.0 2001/01/01 01:01:01 username Exp \$ EOF $at_traceoff echo "working.at:33: blame -r'\$' \$testdir/keywords,v" echo working.at:33 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; cat $at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "working.at:33: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi cat < keywords \$Header: $testdir/keywords,v 1.0 2001/01/01 01:01:01 username Exp \$ EOF $at_traceoff echo "working.at:38: blame -r'\$' \$testdir/keywords,v" echo working.at:38 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; cat $at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "working.at:38: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 64 ) # 64. working.at:42: Late revision at_setup_line='working.at:42' at_desc='Late revision' $at_quiet $ECHO_N " 64: Late revision $ECHO_C" at_xfail=no ( echo "64. working.at:42: testing ..." $at_traceon cp $testdir/keywords.experr experr cat < keywords \$Revision: 1.2 \$ EOF $at_traceoff echo "working.at:49: blame -r'\$' \$testdir/keywords,v" echo working.at:49 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: echo stdout:; cat $at_stdout case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "working.at:49: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon cat < keywords \$Id: keywords,v 1.2 2001/01/01 01:01:01 username Exp \$ EOF $at_traceoff echo "working.at:53: blame -r'\$' \$testdir/keywords,v" echo working.at:53 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: echo stdout:; cat $at_stdout case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "working.at:53: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon cat < keywords \$Header: $testdir/keywords,v 1.2 2001/01/01 01:01:01 username Exp \$ EOF $at_traceoff echo "working.at:57: blame -r'\$' \$testdir/keywords,v" echo working.at:57 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: echo stdout:; cat $at_stdout case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "working.at:57: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 65 ) # 65. working.at:60: Branch at_setup_line='working.at:60' at_desc='Branch' $at_quiet $ECHO_N " 65: Branch $ECHO_C" at_xfail=no ( echo "65. working.at:60: testing ..." $at_traceon cat < keywords \$Revision: 1 \$ EOF $at_traceoff echo "working.at:67: blame -r'\$' \$testdir/keywords,v" echo working.at:67 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; cat $at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "working.at:67: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi cat < keywords \$Id: keywords,v 1 2001/01/01 01:01:01 username Exp \$ EOF $at_traceoff echo "working.at:72: blame -r'\$' \$testdir/keywords,v" echo working.at:72 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; cat $at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "working.at:72: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi cat < keywords \$Header: $testdir/keywords,v 1 2001/01/01 01:01:01 username Exp \$ EOF $at_traceoff echo "working.at:77: blame -r'\$' \$testdir/keywords,v" echo working.at:77 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; cat $at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "working.at:77: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 66 ) # 66. working.at:81: Other non-revision at_setup_line='working.at:81' at_desc='Other non-revision' $at_quiet $ECHO_N " 66: Other non-revision $ECHO_C" at_xfail=no ( echo "66. working.at:81: testing ..." $at_traceon cat < keywords \$Revision: bar \$ EOF $at_traceoff echo "working.at:88: blame -r'\$' \$testdir/keywords,v" echo working.at:88 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; cat $at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "working.at:88: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi cat < keywords \$Id: keywords,v bar 2001/01/01 01:01:01 username Exp \$ EOF $at_traceoff echo "working.at:93: blame -r'\$' \$testdir/keywords,v" echo working.at:93 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; cat $at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "working.at:93: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi cat < keywords \$Header: $testdir/keywords,v bar 2001/01/01 01:01:01 username Exp \$ EOF $at_traceoff echo "working.at:98: blame -r'\$' \$testdir/keywords,v" echo working.at:98 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; cat $at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "working.at:98: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 67 ) # 67. working.at:102: Parsing escape sequences at_setup_line='working.at:102' at_desc='Parsing escape sequences' $at_quiet $ECHO_N " 67: Parsing escape sequences $ECHO_C" at_xfail=no ( echo "67. working.at:102: testing ..." $at_traceon cp $testdir/keywords.experr experr cat < keywords \$Id: file\twith\nweird\\symbols\040in\044it,v 1.1 2001/01/01 01:01:01 username Exp \$ EOF $at_traceoff echo "working.at:109: blame -r'\$' \$testdir/keywords,v" echo working.at:109 >$at_check_line_file ( $at_traceon; blame -r'$' $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: echo stdout:; cat $at_stdout case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "working.at:109: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 68 ) # 68. working.at:112: Producing escape sequences at_setup_line='working.at:112' at_desc='Producing escape sequences' $at_quiet $ECHO_N " 68: Producing escape sequences $ECHO_C" at_xfail=no ( echo "68. working.at:112: testing ..." $at_traceon cp $testdir/escape,v 'x$ x,v' cat < 'x$ x' \$Id: x\044\040x,v 1.1 2001/01/01 01:01:01 username Exp \$ EOF cat $testdir/escape.experr | sed 's,escape,x$ x,g' > experr $at_traceoff echo "working.at:119: blame -r1.1 'x\$ x'" echo working.at:119 >$at_check_line_file ( $at_traceon; blame -r1.1 'x$ x' ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: echo stdout:; cat $at_stdout case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "working.at:119: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 69 ) # 69. working.at:122: Mixing escape characters at_setup_line='working.at:122' at_desc='Mixing escape characters' $at_quiet $ECHO_N " 69: Mixing escape characters $ECHO_C" at_xfail=no ( echo "69. working.at:122: testing ..." $at_traceon cp $testdir/escape-1.2.expout expout cp $testdir/escape.experr experr $at_traceoff echo "working.at:126: blame -r1.2 \$testdir/escape,v" echo working.at:126 >$at_check_line_file ( $at_traceon; blame -r1.2 $testdir/escape,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "working.at:126: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; banner-7 ) # Banner 7. date.at:1 cat <<\_ATEOF -d and --date options. _ATEOF ;; 70 ) # 70. date.at:3: Missing date argument at_setup_line='date.at:3' at_desc='Missing date argument' $at_quiet $ECHO_N " 70: Missing date argument $ECHO_C" at_xfail=no ( echo "70. date.at:3: testing ..." $at_traceon $at_traceoff echo "date.at:6: blame \$testdir/simple,v -d" echo date.at:6 >$at_check_line_file ( $at_traceon; blame $testdir/simple,v -d ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "date.at:6: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 71 ) # 71. date.at:10: Date after all revisions at_setup_line='date.at:10' at_desc='Date after all revisions' $at_quiet $ECHO_N " 71: Date after all revisions $ECHO_C" at_xfail=no ( echo "71. date.at:10: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr $at_traceoff echo "date.at:14: blame -d'2002-02-03 UTC' \$testdir/simple,v" echo date.at:14 >$at_check_line_file ( $at_traceon; blame -d'2002-02-03 UTC' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:14: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "date.at:15: blame --date='2002-02-03 UTC' \$testdir/simple,v" echo date.at:15 >$at_check_line_file ( $at_traceon; blame --date='2002-02-03 UTC' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:15: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 72 ) # 72. date.at:18: Date just after a revision at_setup_line='date.at:18' at_desc='Date just after a revision' $at_quiet $ECHO_N " 72: Date just after a revision $ECHO_C" at_xfail=no ( echo "72. date.at:18: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr $at_traceoff echo "date.at:22: blame -d'2002-02-02 02:02:03 UTC' \$testdir/simple,v" echo date.at:22 >$at_check_line_file ( $at_traceon; blame -d'2002-02-02 02:02:03 UTC' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:22: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 73 ) # 73. date.at:25: Date on a revision at_setup_line='date.at:25' at_desc='Date on a revision' $at_quiet $ECHO_N " 73: Date on a revision $ECHO_C" at_xfail=no ( echo "73. date.at:25: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr $at_traceoff echo "date.at:29: blame -d'2002-02-02 02:02:02 UTC' \$testdir/simple,v" echo date.at:29 >$at_check_line_file ( $at_traceon; blame -d'2002-02-02 02:02:02 UTC' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:29: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 74 ) # 74. date.at:32: Date just before a revision at_setup_line='date.at:32' at_desc='Date just before a revision' $at_quiet $ECHO_N " 74: Date just before a revision $ECHO_C" at_xfail=no ( echo "74. date.at:32: testing ..." $at_traceon cp $testdir/simple-1.1.expout expout cp $testdir/simple.experr experr $at_traceoff echo "date.at:36: blame -d'2002-02-02 02:02:01 UTC' \$testdir/simple,v" echo date.at:36 >$at_check_line_file ( $at_traceon; blame -d'2002-02-02 02:02:01 UTC' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:36: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 75 ) # 75. date.at:39: Date between revisions at_setup_line='date.at:39' at_desc='Date between revisions' $at_quiet $ECHO_N " 75: Date between revisions $ECHO_C" at_xfail=no ( echo "75. date.at:39: testing ..." $at_traceon cp $testdir/simple-1.1.expout expout cp $testdir/simple.experr experr $at_traceoff echo "date.at:43: blame -d'2001-01-02 UTC' \$testdir/simple,v" echo date.at:43 >$at_check_line_file ( $at_traceon; blame -d'2001-01-02 UTC' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:43: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 76 ) # 76. date.at:46: Date before all revisions at_setup_line='date.at:46' at_desc='Date before all revisions' $at_quiet $ECHO_N " 76: Date before all revisions $ECHO_C" at_xfail=no ( echo "76. date.at:46: testing ..." $at_traceon $at_traceoff echo "date.at:49: blame -d'2000-01-01 UTC' \$testdir/simple,v" echo date.at:49 >$at_check_line_file ( $at_traceon; blame -d'2000-01-01 UTC' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "date.at:49: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 77 ) # 77. date.at:53: Unparseable date at_setup_line='date.at:53' at_desc='Unparseable date' $at_quiet $ECHO_N " 77: Unparseable date $ECHO_C" at_xfail=no ( echo "77. date.at:53: testing ..." $at_traceon $at_traceoff echo "date.at:56: blame -d'floopy' \$testdir/simple,v" echo date.at:56 >$at_check_line_file ( $at_traceon; blame -d'floopy' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "date.at:56: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 78 ) # 78. date.at:60: Unknown timezone at_setup_line='date.at:60' at_desc='Unknown timezone' $at_quiet $ECHO_N " 78: Unknown timezone $ECHO_C" at_xfail=no ( echo "78. date.at:60: testing ..." $at_traceon $at_traceoff echo "date.at:64: blame -d'2000-01-01 FLOOPY' \$testdir/simple,v" echo date.at:64 >$at_check_line_file ( $at_traceon; blame -d'2000-01-01 FLOOPY' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "date.at:64: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 79 ) # 79. date.at:68: No timezone at_setup_line='date.at:68' at_desc='No timezone' $at_quiet $ECHO_N " 79: No timezone $ECHO_C" at_xfail=no ( echo "79. date.at:68: testing ..." $at_traceon cp $testdir/simple.experr experr cp $testdir/simple-1.2.expout expout $at_traceoff echo "date.at:73: blame -d'2002-02-02 02:02:03' \$testdir/simple,v" echo date.at:73 >$at_check_line_file ( $at_traceon; blame -d'2002-02-02 02:02:03' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:73: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "date.at:74: blame -d'2002-02-02 02:02:02' \$testdir/simple,v" echo date.at:74 >$at_check_line_file ( $at_traceon; blame -d'2002-02-02 02:02:02' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:74: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon rm -f expout cp $testdir/simple-1.1.expout expout $at_traceoff echo "date.at:77: blame -d'2002-02-02 02:02:01' \$testdir/simple,v" echo date.at:77 >$at_check_line_file ( $at_traceon; blame -d'2002-02-02 02:02:01' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:77: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 80 ) # 80. date.at:80: dd-Mon-yyyy hh:mm:ss at_setup_line='date.at:80' at_desc='dd-Mon-yyyy hh:mm:ss' $at_quiet $ECHO_N " 80: dd-Mon-yyyy hh:mm:ss $ECHO_C" at_xfail=no ( echo "80. date.at:80: testing ..." $at_traceon cp $testdir/simple.experr experr cp $testdir/simple-1.2.expout expout $at_traceoff echo "date.at:84: blame -d'02-Feb-2002 02:02:03 UTC' \$testdir/simple,v" echo date.at:84 >$at_check_line_file ( $at_traceon; blame -d'02-Feb-2002 02:02:03 UTC' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:84: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "date.at:85: blame -d'02-Feb-2002 02:02:02 UTC' \$testdir/simple,v" echo date.at:85 >$at_check_line_file ( $at_traceon; blame -d'02-Feb-2002 02:02:02 UTC' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:85: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon rm -f expout cp $testdir/simple-1.1.expout expout $at_traceoff echo "date.at:88: blame -d'02-Feb-2002 02:02:01 UTC' \$testdir/simple,v" echo date.at:88 >$at_check_line_file ( $at_traceon; blame -d'02-Feb-2002 02:02:01 UTC' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:88: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 81 ) # 81. date.at:91: h:mm:ss AM yyyymmdd at_setup_line='date.at:91' at_desc='h:mm:ss AM yyyymmdd' $at_quiet $ECHO_N " 81: h:mm:ss AM yyyymmdd $ECHO_C" at_xfail=no ( echo "81. date.at:91: testing ..." $at_traceon cp $testdir/simple.experr experr cp $testdir/simple-1.2.expout expout $at_traceoff echo "date.at:95: blame -d'2:02:03 am 02-Feb-2002 UTC' \$testdir/simple,v" echo date.at:95 >$at_check_line_file ( $at_traceon; blame -d'2:02:03 am 02-Feb-2002 UTC' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:95: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "date.at:96: blame -d'2:02:02 am 02-Feb-2002 UTC' \$testdir/simple,v" echo date.at:96 >$at_check_line_file ( $at_traceon; blame -d'2:02:02 am 02-Feb-2002 UTC' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:96: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon rm -f expout cp $testdir/simple-1.1.expout expout $at_traceoff echo "date.at:99: blame -d'2:02:01 am 02-Feb-2002 UTC' \$testdir/simple,v" echo date.at:99 >$at_check_line_file ( $at_traceon; blame -d'2:02:01 am 02-Feb-2002 UTC' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:99: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 82 ) # 82. date.at:102: Unusual timezone at_setup_line='date.at:102' at_desc='Unusual timezone' $at_quiet $ECHO_N " 82: Unusual timezone $ECHO_C" at_xfail=no ( echo "82. date.at:102: testing ..." $at_traceon cp $testdir/simple.experr experr cp $testdir/simple-1.2.expout expout $at_traceoff echo "date.at:107: blame -d'11:02:03 am 02-Feb-2002 AWSST' \$testdir/simple,v" echo date.at:107 >$at_check_line_file ( $at_traceon; blame -d'11:02:03 am 02-Feb-2002 AWSST' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:107: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "date.at:108: blame -d'04:02:02 am 02-Feb-2002 FWT' \$testdir/simple,v" echo date.at:108 >$at_check_line_file ( $at_traceon; blame -d'04:02:02 am 02-Feb-2002 FWT' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:108: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "date.at:109: blame -d'09:32:02 pm 01-Feb-2002 -04:30' \$testdir/simple,v" echo date.at:109 >$at_check_line_file ( $at_traceon; blame -d'09:32:02 pm 01-Feb-2002 -04:30' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:109: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon rm -f expout cp $testdir/simple-1.1.expout expout $at_traceoff echo "date.at:112: blame -d'09:32:01 pm 01-Feb-2002 -04:30' \$testdir/simple,v" echo date.at:112 >$at_check_line_file ( $at_traceon; blame -d'09:32:01 pm 01-Feb-2002 -04:30' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:112: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 83 ) # 83. date.at:115: With -z or --zone option at_setup_line='date.at:115' at_desc='With -z or --zone option' $at_quiet $ECHO_N " 83: With -z or --zone option $ECHO_C" at_xfail=no ( echo "83. date.at:115: testing ..." $at_traceon cp $testdir/simple.experr experr cp $testdir/simple-1.2.expout expout $at_traceoff echo "date.at:120: blame -d'11:02:03 am 02-Feb-2002' -z AWSST \$testdir/simple,v" echo date.at:120 >$at_check_line_file ( $at_traceon; blame -d'11:02:03 am 02-Feb-2002' -z AWSST $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:120: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "date.at:121: blame -d'04:02:02 am 02-Feb-2002' -z FWT \$testdir/simple,v" echo date.at:121 >$at_check_line_file ( $at_traceon; blame -d'04:02:02 am 02-Feb-2002' -z FWT $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:121: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "date.at:122: blame -d'09:32:02 pm 01-Feb-2002' -z -04:30 \$testdir/simple,v" echo date.at:122 >$at_check_line_file ( $at_traceon; blame -d'09:32:02 pm 01-Feb-2002' -z -04:30 $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:122: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon rm -f expout cp $testdir/simple-1.1.expout expout $at_traceoff echo "date.at:125: blame -z -04:30 -d'09:32:01 pm 01-Feb-2002' \$testdir/simple,v" echo date.at:125 >$at_check_line_file ( $at_traceon; blame -z -04:30 -d'09:32:01 pm 01-Feb-2002' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "date.at:125: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 84 ) # 84. date.at:128: Multiple dates at_setup_line='date.at:128' at_desc='Multiple dates' $at_quiet $ECHO_N " 84: Multiple dates $ECHO_C" at_xfail=no ( echo "84. date.at:128: testing ..." $at_traceon $at_traceoff echo "date.at:131: blame -d'2001-01-01 01:01:01 UTC' -d'2002-02-02 02:02:02 UTC' \$testdir/simple,v" echo date.at:131 >$at_check_line_file ( $at_traceon; blame -d'2001-01-01 01:01:01 UTC' -d'2002-02-02 02:02:02 UTC' $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "date.at:131: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; banner-8 ) # Banner 8. state.at:1 cat <<\_ATEOF -s and --state options. _ATEOF ;; 85 ) # 85. state.at:3: Missing state argument at_setup_line='state.at:3' at_desc='Missing state argument' $at_quiet $ECHO_N " 85: Missing state argument $ECHO_C" at_xfail=no ( echo "85. state.at:3: testing ..." $at_traceon $at_traceoff echo "state.at:6: blame \$testdir/simple,v -s" echo state.at:6 >$at_check_line_file ( $at_traceon; blame $testdir/simple,v -s ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "state.at:6: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 86 ) # 86. state.at:10: Known state at_setup_line='state.at:10' at_desc='Known state' $at_quiet $ECHO_N " 86: Known state $ECHO_C" at_xfail=no ( echo "86. state.at:10: testing ..." $at_traceon cp $testdir/simple.experr experr cp $testdir/simple-1.1.expout expout $at_traceoff echo "state.at:14: blame -sExp \$testdir/simple,v" echo state.at:14 >$at_check_line_file ( $at_traceon; blame -sExp $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "state.at:14: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "state.at:15: blame --state=Exp \$testdir/simple,v" echo state.at:15 >$at_check_line_file ( $at_traceon; blame --state=Exp $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "state.at:15: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon rm -f expout cp $testdir/simple-1.2.expout expout $at_traceoff echo "state.at:18: blame -sStab \$testdir/simple,v" echo state.at:18 >$at_check_line_file ( $at_traceon; blame -sStab $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "state.at:18: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "state.at:19: blame --state Stab \$testdir/simple,v" echo state.at:19 >$at_check_line_file ( $at_traceon; blame --state Stab $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "state.at:19: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 87 ) # 87. state.at:22: Unknown state at_setup_line='state.at:22' at_desc='Unknown state' $at_quiet $ECHO_N " 87: Unknown state $ECHO_C" at_xfail=no ( echo "87. state.at:22: testing ..." $at_traceon $at_traceoff echo "state.at:25: blame -sFloopy \$testdir/simple,v" echo state.at:25 >$at_check_line_file ( $at_traceon; blame -sFloopy $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "state.at:25: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 88 ) # 88. state.at:29: Multiple states at_setup_line='state.at:29' at_desc='Multiple states' $at_quiet $ECHO_N " 88: Multiple states $ECHO_C" at_xfail=no ( echo "88. state.at:29: testing ..." $at_traceon $at_traceoff echo "state.at:32: blame -sStab -sExp \$testdir/simple,v" echo state.at:32 >$at_check_line_file ( $at_traceon; blame -sStab -sExp $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "state.at:32: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; banner-9 ) # Banner 9. author.at:1 cat <<\_ATEOF -w and --author options. _ATEOF ;; 89 ) # 89. author.at:3: No author at_setup_line='author.at:3' at_desc='No author' $at_quiet $ECHO_N " 89: No author $ECHO_C" at_xfail=no test -z "$username" && at_xfail=yes test "$username" = username && at_xfail=yes test "$username" = somebody && at_xfail=yes ( echo "89. author.at:3: testing ..." $at_traceon replace="`echo $username | sed 's/$/ /;s/^\(.\{8\}\).*/\1/'`" $at_traceoff echo "author.at:9: blame -w -- \$testdir/simple,v" echo author.at:9 >$at_check_line_file ( $at_traceon; blame -w -- $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "author.at:9: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi cat $testdir/simple,v | sed "s/somebody/$username/g" > input,v cat $testdir/simple-1.2.expout | sed "s/somebody/$replace/g" > expout cat $testdir/simple.experr | sed "s/simple/input/g" > experr $at_traceoff echo "author.at:14: blame -w -- input,v" echo author.at:14 >$at_check_line_file ( $at_traceon; blame -w -- input,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "author.at:14: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 90 ) # 90. author.at:17: Known author at_setup_line='author.at:17' at_desc='Known author' $at_quiet $ECHO_N " 90: Known author $ECHO_C" at_xfail=no ( echo "90. author.at:17: testing ..." $at_traceon cp $testdir/simple.experr experr cp $testdir/simple-1.2.expout expout $at_traceoff echo "author.at:21: blame -wsomebody \$testdir/simple,v" echo author.at:21 >$at_check_line_file ( $at_traceon; blame -wsomebody $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "author.at:21: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon rm -f expout cp $testdir/simple-1.1.expout expout $at_traceoff echo "author.at:24: blame -wusername \$testdir/simple,v" echo author.at:24 >$at_check_line_file ( $at_traceon; blame -wusername $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "author.at:24: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "author.at:25: blame --author=username \$testdir/simple,v" echo author.at:25 >$at_check_line_file ( $at_traceon; blame --author=username $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "author.at:25: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 91 ) # 91. author.at:28: Unknown author at_setup_line='author.at:28' at_desc='Unknown author' $at_quiet $ECHO_N " 91: Unknown author $ECHO_C" at_xfail=no ( echo "91. author.at:28: testing ..." $at_traceon $at_traceoff echo "author.at:31: blame -wfloopy \$testdir/simple,v" echo author.at:31 >$at_check_line_file ( $at_traceon; blame -wfloopy $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "author.at:31: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 92 ) # 92. author.at:35: Multiple authors at_setup_line='author.at:35' at_desc='Multiple authors' $at_quiet $ECHO_N " 92: Multiple authors $ECHO_C" at_xfail=no ( echo "92. author.at:35: testing ..." $at_traceon $at_traceoff echo "author.at:38: blame -wusername -wsomebody \$testdir/simple,v" echo author.at:38 >$at_check_line_file ( $at_traceon; blame -wusername -wsomebody $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "author.at:38: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; banner-10 ) # Banner 10. expand.at:1 cat <<\_ATEOF -k and --expand options. _ATEOF ;; 93 ) # 93. expand.at:3: Default substitutions at_setup_line='expand.at:3' at_desc='Default substitutions' $at_quiet $ECHO_N " 93: Default substitutions $ECHO_C" at_xfail=no ( echo "93. expand.at:3: testing ..." $at_traceon cat < expout 1.1 (username 01-Jan-01): \$Author: username \$ 1.1 (username 01-Jan-01): \$Date: 2001/01/01 01:01:01 \$ 1.1 (username 01-Jan-01): \$Header: $testdir/keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ 1.1 (username 01-Jan-01): \$Id: keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ 1.1 (username 01-Jan-01): \$Locker: \$ 1.1 (username 01-Jan-01): \$Log: keywords,v \$ 1.1 (username 01-Jan-01): Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): Initial revision 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): \$Name: \$ 1.1 (username 01-Jan-01): \$RCSfile: keywords,v \$ 1.1 (username 01-Jan-01): \$Revision: 1.1 \$ 1.1 (username 01-Jan-01): \$Source: $testdir/keywords,v \$ 1.1 (username 01-Jan-01): \$State: Exp \$ EOF cp $testdir/keywords.experr experr $at_traceoff echo "expand.at:23: blame \$testdir/keywords,v" echo expand.at:23 >$at_check_line_file ( $at_traceon; blame $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "expand.at:23: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 94 ) # 94. expand.at:26: Default substitutions, with timezone at_setup_line='expand.at:26' at_desc='Default substitutions, with timezone' $at_quiet $ECHO_N " 94: Default substitutions, with timezone $ECHO_C" at_xfail=no ( echo "94. expand.at:26: testing ..." $at_traceon cat < expout 1.1 (username 01-Jan-01): \$Author: username \$ 1.1 (username 01-Jan-01): \$Date: 2000-12-31 20:01:01-05 \$ 1.1 (username 01-Jan-01): \$Header: $testdir/keywords,v 1.1 2000-12-31 20:01:01-05 username Exp \$ 1.1 (username 01-Jan-01): \$Id: keywords,v 1.1 2000-12-31 20:01:01-05 username Exp \$ 1.1 (username 01-Jan-01): \$Locker: \$ 1.1 (username 01-Jan-01): \$Log: keywords,v \$ 1.1 (username 01-Jan-01): Revision 1.1 2000-12-31 20:01:01-05 username 1.1 (username 01-Jan-01): Initial revision 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): \$Name: \$ 1.1 (username 01-Jan-01): \$RCSfile: keywords,v \$ 1.1 (username 01-Jan-01): \$Revision: 1.1 \$ 1.1 (username 01-Jan-01): \$Source: $testdir/keywords,v \$ 1.1 (username 01-Jan-01): \$State: Exp \$ EOF cp $testdir/keywords.experr experr $at_traceoff echo "expand.at:46: blame -zEST \$testdir/keywords,v" echo expand.at:46 >$at_check_line_file ( $at_traceon; blame -zEST $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "expand.at:46: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 95 ) # 95. expand.at:49: Missing keyword substitution argument at_setup_line='expand.at:49' at_desc='Missing keyword substitution argument' $at_quiet $ECHO_N " 95: Missing keyword substitution argument $ECHO_C" at_xfail=no ( echo "95. expand.at:49: testing ..." $at_traceon $at_traceoff echo "expand.at:52: blame \$testdir/keywords,v -k" echo expand.at:52 >$at_check_line_file ( $at_traceon; blame $testdir/keywords,v -k ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "expand.at:52: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 96 ) # 96. expand.at:56: Keys and values (-kkv) at_setup_line='expand.at:56' at_desc='Keys and values (-kkv)' $at_quiet $ECHO_N " 96: Keys and values (-kkv) $ECHO_C" at_xfail=no ( echo "96. expand.at:56: testing ..." $at_traceon cat < expout 1.1 (username 01-Jan-01): \$Author: username \$ 1.1 (username 01-Jan-01): \$Date: 2001/01/01 01:01:01 \$ 1.1 (username 01-Jan-01): \$Header: $testdir/keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ 1.1 (username 01-Jan-01): \$Id: keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ 1.1 (username 01-Jan-01): \$Locker: \$ 1.1 (username 01-Jan-01): \$Log: keywords,v \$ 1.1 (username 01-Jan-01): Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): Initial revision 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): \$Name: \$ 1.1 (username 01-Jan-01): \$RCSfile: keywords,v \$ 1.1 (username 01-Jan-01): \$Revision: 1.1 \$ 1.1 (username 01-Jan-01): \$Source: $testdir/keywords,v \$ 1.1 (username 01-Jan-01): \$State: Exp \$ EOF cp $testdir/keywords.experr experr $at_traceoff echo "expand.at:76: blame -kkv \$testdir/keywords,v" echo expand.at:76 >$at_check_line_file ( $at_traceon; blame -kkv $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "expand.at:76: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "expand.at:77: blame --expand=kv \$testdir/keywords,v" echo expand.at:77 >$at_check_line_file ( $at_traceon; blame --expand=kv $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "expand.at:77: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "expand.at:78: blame --expand kv \$testdir/keywords,v" echo expand.at:78 >$at_check_line_file ( $at_traceon; blame --expand kv $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "expand.at:78: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 97 ) # 97. expand.at:81: Keys, values and locker (-kkvl) at_setup_line='expand.at:81' at_desc='Keys, values and locker (-kkvl)' $at_quiet $ECHO_N " 97: Keys, values and locker (-kkvl) $ECHO_C" at_xfail=no ( echo "97. expand.at:81: testing ..." $at_traceon cat < expout 1.1 (username 01-Jan-01): \$Author: username \$ 1.1 (username 01-Jan-01): \$Date: 2001/01/01 01:01:01 \$ 1.1 (username 01-Jan-01): \$Header: $testdir/keywords,v 1.1 2001/01/01 01:01:01 username Exp username \$ 1.1 (username 01-Jan-01): \$Id: keywords,v 1.1 2001/01/01 01:01:01 username Exp username \$ 1.1 (username 01-Jan-01): \$Locker: username \$ 1.1 (username 01-Jan-01): \$Log: keywords,v \$ 1.1 (username 01-Jan-01): Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): Initial revision 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): \$Name: \$ 1.1 (username 01-Jan-01): \$RCSfile: keywords,v \$ 1.1 (username 01-Jan-01): \$Revision: 1.1 \$ 1.1 (username 01-Jan-01): \$Source: $testdir/keywords,v \$ 1.1 (username 01-Jan-01): \$State: Exp \$ EOF cp $testdir/keywords.experr experr $at_traceoff echo "expand.at:101: blame -kkvl \$testdir/keywords,v" echo expand.at:101 >$at_check_line_file ( $at_traceon; blame -kkvl $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "expand.at:101: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 98 ) # 98. expand.at:104: Keys only (-kk) at_setup_line='expand.at:104' at_desc='Keys only (-kk)' $at_quiet $ECHO_N " 98: Keys only (-kk) $ECHO_C" at_xfail=no ( echo "98. expand.at:104: testing ..." $at_traceon cat < expout 1.1 (username 01-Jan-01): \$Author\$ 1.1 (username 01-Jan-01): \$Date\$ 1.1 (username 01-Jan-01): \$Header\$ 1.1 (username 01-Jan-01): \$Id\$ 1.1 (username 01-Jan-01): \$Locker\$ 1.1 (username 01-Jan-01): \$Log\$ 1.1 (username 01-Jan-01): Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): Initial revision 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): \$Name\$ 1.1 (username 01-Jan-01): \$RCSfile\$ 1.1 (username 01-Jan-01): \$Revision\$ 1.1 (username 01-Jan-01): \$Source\$ 1.1 (username 01-Jan-01): \$State\$ EOF cp $testdir/keywords.experr experr $at_traceoff echo "expand.at:124: blame -kk \$testdir/keywords,v" echo expand.at:124 >$at_check_line_file ( $at_traceon; blame -kk $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "expand.at:124: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 99 ) # 99. expand.at:127: Old keywords strings (-ko) at_setup_line='expand.at:127' at_desc='Old keywords strings (-ko)' $at_quiet $ECHO_N " 99: Old keywords strings (-ko) $ECHO_C" at_xfail=no ( echo "99. expand.at:127: testing ..." $at_traceon cat < expout 1.1 (username 01-Jan-01): \$Author\$ 1.1 (username 01-Jan-01): \$Date\$ 1.1 (username 01-Jan-01): \$Header\$ 1.1 (username 01-Jan-01): \$Id\$ 1.1 (username 01-Jan-01): \$Locker\$ 1.1 (username 01-Jan-01): \$Log\$ 1.1 (username 01-Jan-01): \$Name\$ 1.1 (username 01-Jan-01): \$RCSfile\$ 1.1 (username 01-Jan-01): \$Revision\$ 1.1 (username 01-Jan-01): \$Source\$ 1.1 (username 01-Jan-01): \$State\$ EOF cp $testdir/keywords.experr experr $at_traceoff echo "expand.at:144: blame -ko \$testdir/keywords,v" echo expand.at:144 >$at_check_line_file ( $at_traceon; blame -ko $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "expand.at:144: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 100 ) # 100. expand.at:147: Binary image of old keywords strings (-kb) at_setup_line='expand.at:147' at_desc='Binary image of old keywords strings (-kb)' $at_quiet $ECHO_N "100: Binary image of old keywords strings (-kb) $ECHO_C" at_xfail=no ( echo "100. expand.at:147: testing ..." $at_traceon cat < expout 1.1 (username 01-Jan-01): \$Author\$ 1.1 (username 01-Jan-01): \$Date\$ 1.1 (username 01-Jan-01): \$Header\$ 1.1 (username 01-Jan-01): \$Id\$ 1.1 (username 01-Jan-01): \$Locker\$ 1.1 (username 01-Jan-01): \$Log\$ 1.1 (username 01-Jan-01): \$Name\$ 1.1 (username 01-Jan-01): \$RCSfile\$ 1.1 (username 01-Jan-01): \$Revision\$ 1.1 (username 01-Jan-01): \$Source\$ 1.1 (username 01-Jan-01): \$State\$ EOF cp $testdir/keywords.experr experr $at_traceoff echo "expand.at:164: blame -kb \$testdir/keywords,v" echo expand.at:164 >$at_check_line_file ( $at_traceon; blame -kb $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "expand.at:164: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 101 ) # 101. expand.at:167: Values only (-kv) at_setup_line='expand.at:167' at_desc='Values only (-kv)' $at_quiet $ECHO_N "101: Values only (-kv) $ECHO_C" at_xfail=no ( echo "101. expand.at:167: testing ..." $at_traceon cat < expout 1.1 (username 01-Jan-01): username 1.1 (username 01-Jan-01): 2001/01/01 01:01:01 1.1 (username 01-Jan-01): $testdir/keywords,v 1.1 2001/01/01 01:01:01 username Exp 1.1 (username 01-Jan-01): keywords,v 1.1 2001/01/01 01:01:01 username Exp 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): keywords,v 1.1 (username 01-Jan-01): Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): Initial revision 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): keywords,v 1.1 (username 01-Jan-01): 1.1 1.1 (username 01-Jan-01): $testdir/keywords,v 1.1 (username 01-Jan-01): Exp EOF cp $testdir/keywords.experr experr $at_traceoff echo "expand.at:187: blame -kv \$testdir/keywords,v" echo expand.at:187 >$at_check_line_file ( $at_traceon; blame -kv $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "expand.at:187: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 102 ) # 102. expand.at:190: Multiple substitution types at_setup_line='expand.at:190' at_desc='Multiple substitution types' $at_quiet $ECHO_N "102: Multiple substitution types $ECHO_C" at_xfail=no ( echo "102. expand.at:190: testing ..." $at_traceon $at_traceoff echo "expand.at:193: blame -ko -kkvl \$testdir/simple,v" echo expand.at:193 >$at_check_line_file ( $at_traceon; blame -ko -kkvl $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "expand.at:193: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; banner-11 ) # Banner 11. version.at:1 cat <<\_ATEOF -V and --version options. _ATEOF ;; 103 ) # 103. version.at:3: Invalid version argument at_setup_line='version.at:3' at_desc='Invalid version argument' $at_quiet $ECHO_N "103: Invalid version argument $ECHO_C" at_xfail=no ( echo "103. version.at:3: testing ..." $at_traceon $at_traceoff echo "version.at:6: blame -V1 \$testdir/keywords,v" echo version.at:6 >$at_check_line_file ( $at_traceon; blame -V1 $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "version.at:6: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "version.at:8: blame --version=foo \$testdir/keywords,v" echo version.at:8 >$at_check_line_file ( $at_traceon; blame --version=foo $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "version.at:8: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 104 ) # 104. version.at:12: Emulating RCS version 3 at_setup_line='version.at:12' at_desc='Emulating RCS version 3' $at_quiet $ECHO_N "104: Emulating RCS version 3 $ECHO_C" at_xfail=no ( echo "104. version.at:12: testing ..." $at_traceon cat < expout 1.1 (username 01-Jan-01): \$Author: username \$ 1.1 (username 01-Jan-01): \$Date: 2001/01/01 01:01:01 \$ 1.1 (username 01-Jan-01): \$Header: keywords,v 1.1 2001/01/01 01:01:01 username Locked \$ 1.1 (username 01-Jan-01): \$Id: keywords,v 1.1 2001/01/01 01:01:01 username Locked \$ 1.1 (username 01-Jan-01): \$Locker: username \$ 1.1 (username 01-Jan-01): \$Log: keywords,v \$ 1.1 (username 01-Jan-01): # Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): # Initial revision 1.1 (username 01-Jan-01): #$space 1.1 (username 01-Jan-01): \$Name: \$ 1.1 (username 01-Jan-01): \$RCSfile: keywords,v \$ 1.1 (username 01-Jan-01): \$Revision: 1.1 \$ 1.1 (username 01-Jan-01): \$Source: $testdir/keywords,v \$ 1.1 (username 01-Jan-01): \$State: Exp \$ EOF cp $testdir/keywords.experr experr $at_traceoff echo "version.at:32: blame -V3 \$testdir/keywords,v" echo version.at:32 >$at_check_line_file ( $at_traceon; blame -V3 $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "version.at:32: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "version.at:33: blame --version=3 \$testdir/keywords,v" echo version.at:33 >$at_check_line_file ( $at_traceon; blame --version=3 $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "version.at:33: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 105 ) # 105. version.at:36: Emulating RCS version 4 at_setup_line='version.at:36' at_desc='Emulating RCS version 4' $at_quiet $ECHO_N "105: Emulating RCS version 4 $ECHO_C" at_xfail=no ( echo "105. version.at:36: testing ..." $at_traceon cat < expout 1.1 (username 01-Jan-01): \$Author: username \$ 1.1 (username 01-Jan-01): \$Date: 2001/01/01 01:01:01 \$ 1.1 (username 01-Jan-01): \$Header: $testdir/keywords,v 1.1 2001/01/01 01:01:01 username Exp Locker: username \$ 1.1 (username 01-Jan-01): \$Id: keywords,v 1.1 2001/01/01 01:01:01 username Exp Locker: username \$ 1.1 (username 01-Jan-01): \$Locker: username \$ 1.1 (username 01-Jan-01): \$Log: keywords,v \$ 1.1 (username 01-Jan-01): # Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): # Initial revision 1.1 (username 01-Jan-01): #$space 1.1 (username 01-Jan-01): \$Name: \$ 1.1 (username 01-Jan-01): \$RCSfile: keywords,v \$ 1.1 (username 01-Jan-01): \$Revision: 1.1 \$ 1.1 (username 01-Jan-01): \$Source: $testdir/keywords,v \$ 1.1 (username 01-Jan-01): \$State: Exp \$ EOF cp $testdir/keywords.experr experr $at_traceoff echo "version.at:56: blame -V4 \$testdir/keywords,v" echo version.at:56 >$at_check_line_file ( $at_traceon; blame -V4 $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "version.at:56: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "version.at:57: blame --version=4 \$testdir/keywords,v" echo version.at:57 >$at_check_line_file ( $at_traceon; blame --version=4 $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "version.at:57: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 106 ) # 106. version.at:60: Emulating RCS version 5 at_setup_line='version.at:60' at_desc='Emulating RCS version 5' $at_quiet $ECHO_N "106: Emulating RCS version 5 $ECHO_C" at_xfail=no ( echo "106. version.at:60: testing ..." $at_traceon cat < expout 1.1 (username 01-Jan-01): \$Author: username \$ 1.1 (username 01-Jan-01): \$Date: 2001/01/01 01:01:01 \$ 1.1 (username 01-Jan-01): \$Header: $testdir/keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ 1.1 (username 01-Jan-01): \$Id: keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ 1.1 (username 01-Jan-01): \$Locker: \$ 1.1 (username 01-Jan-01): \$Log: keywords,v \$ 1.1 (username 01-Jan-01): Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): Initial revision 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): \$Name: \$ 1.1 (username 01-Jan-01): \$RCSfile: keywords,v \$ 1.1 (username 01-Jan-01): \$Revision: 1.1 \$ 1.1 (username 01-Jan-01): \$Source: $testdir/keywords,v \$ 1.1 (username 01-Jan-01): \$State: Exp \$ EOF cp $testdir/keywords.experr experr $at_traceoff echo "version.at:80: blame -V5 \$testdir/keywords,v" echo version.at:80 >$at_check_line_file ( $at_traceon; blame -V5 $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "version.at:80: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "version.at:81: blame --version=5 \$testdir/keywords,v" echo version.at:81 >$at_check_line_file ( $at_traceon; blame --version=5 $testdir/keywords,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "version.at:81: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; banner-12 ) # Banner 12. suffixes.at:1 cat <<\_ATEOF -x and --suffixes options. _ATEOF ;; 107 ) # 107. suffixes.at:3: Default suffixes at_setup_line='suffixes.at:3' at_desc='Default suffixes' $at_quiet $ECHO_N "107: Default suffixes $ECHO_C" at_xfail=no ( echo "107. suffixes.at:3: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout $at_traceoff echo "suffixes.at:6: blame \$testdir/file1" echo suffixes.at:6 >$at_check_line_file ( $at_traceon; blame $testdir/file1 ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; cat $at_stderr $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "suffixes.at:6: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 108 ) # 108. suffixes.at:9: Nonstandard suffixes at_setup_line='suffixes.at:9' at_desc='Nonstandard suffixes' $at_quiet $ECHO_N "108: Nonstandard suffixes $ECHO_C" at_xfail=no ( echo "108. suffixes.at:9: testing ..." $at_traceon cp $testdir/simple-1.2.expout expout $at_traceoff echo "suffixes.at:12: blame -x\$slash-foo\$slash-bar \$testdir/file2" echo suffixes.at:12 >$at_check_line_file ( $at_traceon; blame -x$slash-foo$slash-bar $testdir/file2 ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; cat $at_stderr $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "suffixes.at:12: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "suffixes.at:13: blame --suffixes=\$slash-foo\$slash-bar \$testdir/file3" echo suffixes.at:13 >$at_check_line_file ( $at_traceon; blame --suffixes=$slash-foo$slash-bar $testdir/file3 ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; cat $at_stderr $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "suffixes.at:13: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "suffixes.at:14: blame --suffixes \$slash-foo\$slash-bar \$testdir/file3" echo suffixes.at:14 >$at_check_line_file ( $at_traceon; blame --suffixes $slash-foo$slash-bar $testdir/file3 ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; cat $at_stderr $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "suffixes.at:14: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 109 ) # 109. suffixes.at:17: Multiple suffixes specifications at_setup_line='suffixes.at:17' at_desc='Multiple suffixes specifications' $at_quiet $ECHO_N "109: Multiple suffixes specifications $ECHO_C" at_xfail=no ( echo "109. suffixes.at:17: testing ..." $at_traceon $at_traceoff echo "suffixes.at:20: blame -x\$slash-foo\$slash-bar -x\$slash-bar\$slash-foo \$testdir/simple,v" echo suffixes.at:20 >$at_check_line_file ( $at_traceon; blame -x$slash-foo$slash-bar -x$slash-bar$slash-foo $testdir/simple,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "suffixes.at:20: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; banner-13 ) # Banner 13. mixed.at:1 cat <<\_ATEOF Mixing -r, -d, -s and -w options. _ATEOF ;; 110 ) # 110. mixed.at:3: Valid -r and -d combo at_setup_line='mixed.at:3' at_desc='Valid -r and -d combo' $at_quiet $ECHO_N "110: Valid -r and -d combo $ECHO_C" at_xfail=no ( echo "110. mixed.at:3: testing ..." $at_traceon cp $testdir/complex-3.4.expout expout cp $testdir/complex.experr experr $at_traceoff echo "mixed.at:9: blame -r3.4 -d'2001/01/01 03:04:01' \$testdir/complex,v" echo mixed.at:9 >$at_check_line_file ( $at_traceon; blame -r3.4 -d'2001/01/01 03:04:01' $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "mixed.at:9: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "mixed.at:10: blame -r3.4 -d'2001/01/01 03:04:00' \$testdir/complex,v" echo mixed.at:10 >$at_check_line_file ( $at_traceon; blame -r3.4 -d'2001/01/01 03:04:00' $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "mixed.at:10: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 111 ) # 111. mixed.at:13: Invalid -r and -d combo at_setup_line='mixed.at:13' at_desc='Invalid -r and -d combo' $at_quiet $ECHO_N "111: Invalid -r and -d combo $ECHO_C" at_xfail=no ( echo "111. mixed.at:13: testing ..." $at_traceon $at_traceoff echo "mixed.at:18: blame -r3.4 -d'2001/01/01 03:03:59' \$testdir/complex,v" echo mixed.at:18 >$at_check_line_file ( $at_traceon; blame -r3.4 -d'2001/01/01 03:03:59' $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:18: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 112 ) # 112. mixed.at:22: Valid -r and -s combo at_setup_line='mixed.at:22' at_desc='Valid -r and -s combo' $at_quiet $ECHO_N "112: Valid -r and -s combo $ECHO_C" at_xfail=no ( echo "112. mixed.at:22: testing ..." $at_traceon cp $testdir/complex-3.4.expout expout cp $testdir/complex.experr experr $at_traceoff echo "mixed.at:28: blame -r3.4 -sA \$testdir/complex,v" echo mixed.at:28 >$at_check_line_file ( $at_traceon; blame -r3.4 -sA $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "mixed.at:28: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 113 ) # 113. mixed.at:31: Invalid -r and -s combo at_setup_line='mixed.at:31' at_desc='Invalid -r and -s combo' $at_quiet $ECHO_N "113: Invalid -r and -s combo $ECHO_C" at_xfail=no ( echo "113. mixed.at:31: testing ..." $at_traceon $at_traceoff echo "mixed.at:36: blame -r3.4 -sB \$testdir/complex,v" echo mixed.at:36 >$at_check_line_file ( $at_traceon; blame -r3.4 -sB $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:36: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 114 ) # 114. mixed.at:40: Valid -r and -w combo at_setup_line='mixed.at:40' at_desc='Valid -r and -w combo' $at_quiet $ECHO_N "114: Valid -r and -w combo $ECHO_C" at_xfail=no ( echo "114. mixed.at:40: testing ..." $at_traceon cp $testdir/complex-3.4.expout expout cp $testdir/complex.experr experr $at_traceoff echo "mixed.at:46: blame -r3.4 -wuser1 \$testdir/complex,v" echo mixed.at:46 >$at_check_line_file ( $at_traceon; blame -r3.4 -wuser1 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "mixed.at:46: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 115 ) # 115. mixed.at:49: Invalid -r and -w combo at_setup_line='mixed.at:49' at_desc='Invalid -r and -w combo' $at_quiet $ECHO_N "115: Invalid -r and -w combo $ECHO_C" at_xfail=no ( echo "115. mixed.at:49: testing ..." $at_traceon $at_traceoff echo "mixed.at:54: blame -r3.4 -wuser2 \$testdir/complex,v" echo mixed.at:54 >$at_check_line_file ( $at_traceon; blame -r3.4 -wuser2 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:54: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 116 ) # 116. mixed.at:58: Valid -d and -s combo at_setup_line='mixed.at:58' at_desc='Valid -d and -s combo' $at_quiet $ECHO_N "116: Valid -d and -s combo $ECHO_C" at_xfail=no ( echo "116. mixed.at:58: testing ..." $at_traceon cp $testdir/complex-1.1.expout expout cp $testdir/complex.experr experr $at_traceoff echo "mixed.at:64: blame -d'2001/01/01 01:01:00' -sA \$testdir/complex,v" echo mixed.at:64 >$at_check_line_file ( $at_traceon; blame -d'2001/01/01 01:01:00' -sA $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "mixed.at:64: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "mixed.at:65: blame -d'2001/01/01 01:01:30' -sA \$testdir/complex,v" echo mixed.at:65 >$at_check_line_file ( $at_traceon; blame -d'2001/01/01 01:01:30' -sA $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "mixed.at:65: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 117 ) # 117. mixed.at:68: Invalid -d and -s combo at_setup_line='mixed.at:68' at_desc='Invalid -d and -s combo' $at_quiet $ECHO_N "117: Invalid -d and -s combo $ECHO_C" at_xfail=no ( echo "117. mixed.at:68: testing ..." $at_traceon $at_traceoff echo "mixed.at:73: blame -d'2001/01/01 01:01:30' -sB \$testdir/complex,v" echo mixed.at:73 >$at_check_line_file ( $at_traceon; blame -d'2001/01/01 01:01:30' -sB $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:73: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 118 ) # 118. mixed.at:77: Valid -d and -w combo at_setup_line='mixed.at:77' at_desc='Valid -d and -w combo' $at_quiet $ECHO_N "118: Valid -d and -w combo $ECHO_C" at_xfail=no ( echo "118. mixed.at:77: testing ..." $at_traceon cp $testdir/complex-1.1.expout expout cp $testdir/complex.experr experr $at_traceoff echo "mixed.at:83: blame -d'2001/01/01 01:01:00' -wuser3 \$testdir/complex,v" echo mixed.at:83 >$at_check_line_file ( $at_traceon; blame -d'2001/01/01 01:01:00' -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "mixed.at:83: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "mixed.at:84: blame -d'2001/01/01 01:01:30' -wuser3 \$testdir/complex,v" echo mixed.at:84 >$at_check_line_file ( $at_traceon; blame -d'2001/01/01 01:01:30' -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "mixed.at:84: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 119 ) # 119. mixed.at:87: Invalid -d and -w combo at_setup_line='mixed.at:87' at_desc='Invalid -d and -w combo' $at_quiet $ECHO_N "119: Invalid -d and -w combo $ECHO_C" at_xfail=no ( echo "119. mixed.at:87: testing ..." $at_traceon $at_traceoff echo "mixed.at:92: blame -d'2001/01/01 01:01:30' -wuser2 \$testdir/complex,v" echo mixed.at:92 >$at_check_line_file ( $at_traceon; blame -d'2001/01/01 01:01:30' -wuser2 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:92: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 120 ) # 120. mixed.at:96: Valid -s and -w combo at_setup_line='mixed.at:96' at_desc='Valid -s and -w combo' $at_quiet $ECHO_N "120: Valid -s and -w combo $ECHO_C" at_xfail=no ( echo "120. mixed.at:96: testing ..." $at_traceon cp $testdir/complex-1.1.expout expout cp $testdir/complex.experr experr $at_traceoff echo "mixed.at:102: blame -sA -wuser3 \$testdir/complex,v" echo mixed.at:102 >$at_check_line_file ( $at_traceon; blame -sA -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "mixed.at:102: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 121 ) # 121. mixed.at:105: Invalid -s and -w combo at_setup_line='mixed.at:105' at_desc='Invalid -s and -w combo' $at_quiet $ECHO_N "121: Invalid -s and -w combo $ECHO_C" at_xfail=no ( echo "121. mixed.at:105: testing ..." $at_traceon $at_traceoff echo "mixed.at:110: blame -sC -wuser2 \$testdir/complex,v" echo mixed.at:110 >$at_check_line_file ( $at_traceon; blame -sC -wuser2 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:110: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 122 ) # 122. mixed.at:114: Valid -r, -d and -s combo at_setup_line='mixed.at:114' at_desc='Valid -r, -d and -s combo' $at_quiet $ECHO_N "122: Valid -r, -d and -s combo $ECHO_C" at_xfail=no ( echo "122. mixed.at:114: testing ..." $at_traceon cp $testdir/complex-2.2.expout expout cp $testdir/complex.experr experr $at_traceoff echo "mixed.at:121: blame -r2.2 -d'2001/01/01 03:10:00' -sC \$testdir/complex,v" echo mixed.at:121 >$at_check_line_file ( $at_traceon; blame -r2.2 -d'2001/01/01 03:10:00' -sC $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "mixed.at:121: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 123 ) # 123. mixed.at:124: Invalid -r, -d and -s combo at_setup_line='mixed.at:124' at_desc='Invalid -r, -d and -s combo' $at_quiet $ECHO_N "123: Invalid -r, -d and -s combo $ECHO_C" at_xfail=no ( echo "123. mixed.at:124: testing ..." $at_traceon $at_traceoff echo "mixed.at:130: blame -r2.1 -d'2001/01/01 03:10:00' -sC \$testdir/complex,v" echo mixed.at:130 >$at_check_line_file ( $at_traceon; blame -r2.1 -d'2001/01/01 03:10:00' -sC $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:130: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "mixed.at:132: blame -r2.2 -d'2001/01/01 01:10:00' -sC \$testdir/complex,v" echo mixed.at:132 >$at_check_line_file ( $at_traceon; blame -r2.2 -d'2001/01/01 01:10:00' -sC $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:132: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "mixed.at:134: blame -r2.2 -d'2001/01/01 03:10:00' -sA \$testdir/complex,v" echo mixed.at:134 >$at_check_line_file ( $at_traceon; blame -r2.2 -d'2001/01/01 03:10:00' -sA $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:134: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 124 ) # 124. mixed.at:138: Valid -r, -d and -w combo at_setup_line='mixed.at:138' at_desc='Valid -r, -d and -w combo' $at_quiet $ECHO_N "124: Valid -r, -d and -w combo $ECHO_C" at_xfail=no ( echo "124. mixed.at:138: testing ..." $at_traceon cp $testdir/complex-2.2.expout expout cp $testdir/complex.experr experr $at_traceoff echo "mixed.at:145: blame -r2.2 -d'2001/01/01 03:10:00' -wuser3 \$testdir/complex,v" echo mixed.at:145 >$at_check_line_file ( $at_traceon; blame -r2.2 -d'2001/01/01 03:10:00' -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "mixed.at:145: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 125 ) # 125. mixed.at:148: Invalid -r, -d and -w combo at_setup_line='mixed.at:148' at_desc='Invalid -r, -d and -w combo' $at_quiet $ECHO_N "125: Invalid -r, -d and -w combo $ECHO_C" at_xfail=no ( echo "125. mixed.at:148: testing ..." $at_traceon $at_traceoff echo "mixed.at:154: blame -r2.1 -d'2001/01/01 03:10:00' -wuser3 \$testdir/complex,v" echo mixed.at:154 >$at_check_line_file ( $at_traceon; blame -r2.1 -d'2001/01/01 03:10:00' -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:154: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "mixed.at:156: blame -r2.2 -d'2001/01/01 01:10:00' -wuser3 \$testdir/complex,v" echo mixed.at:156 >$at_check_line_file ( $at_traceon; blame -r2.2 -d'2001/01/01 01:10:00' -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:156: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "mixed.at:158: blame -r2.2 -d'2001/01/01 03:10:00' -wuser2 \$testdir/complex,v" echo mixed.at:158 >$at_check_line_file ( $at_traceon; blame -r2.2 -d'2001/01/01 03:10:00' -wuser2 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:158: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 126 ) # 126. mixed.at:162: Valid -r, -s and -w combo at_setup_line='mixed.at:162' at_desc='Valid -r, -s and -w combo' $at_quiet $ECHO_N "126: Valid -r, -s and -w combo $ECHO_C" at_xfail=no ( echo "126. mixed.at:162: testing ..." $at_traceon cp $testdir/complex-2.2.expout expout cp $testdir/complex.experr experr $at_traceoff echo "mixed.at:169: blame -r2.2 -sC -wuser3 \$testdir/complex,v" echo mixed.at:169 >$at_check_line_file ( $at_traceon; blame -r2.2 -sC -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "mixed.at:169: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 127 ) # 127. mixed.at:172: Invalid -r, -s and -w combo at_setup_line='mixed.at:172' at_desc='Invalid -r, -s and -w combo' $at_quiet $ECHO_N "127: Invalid -r, -s and -w combo $ECHO_C" at_xfail=no ( echo "127. mixed.at:172: testing ..." $at_traceon $at_traceoff echo "mixed.at:178: blame -r2.1 -sC -wuser3 \$testdir/complex,v" echo mixed.at:178 >$at_check_line_file ( $at_traceon; blame -r2.1 -sC -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:178: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "mixed.at:180: blame -r2.2 -sA -wuser3 \$testdir/complex,v" echo mixed.at:180 >$at_check_line_file ( $at_traceon; blame -r2.2 -sA -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:180: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "mixed.at:182: blame -r2.2 -sC -wuser2 \$testdir/complex,v" echo mixed.at:182 >$at_check_line_file ( $at_traceon; blame -r2.2 -sC -wuser2 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:182: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 128 ) # 128. mixed.at:186: Valid -d, -s and -w combo at_setup_line='mixed.at:186' at_desc='Valid -d, -s and -w combo' $at_quiet $ECHO_N "128: Valid -d, -s and -w combo $ECHO_C" at_xfail=no ( echo "128. mixed.at:186: testing ..." $at_traceon cp $testdir/complex-1.4.expout expout cp $testdir/complex.experr experr $at_traceoff echo "mixed.at:193: blame -d'2001/01/01 01:10:00' -sB -wuser3 \$testdir/complex,v" echo mixed.at:193 >$at_check_line_file ( $at_traceon; blame -d'2001/01/01 01:10:00' -sB -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "mixed.at:193: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 129 ) # 129. mixed.at:196: Invalid -d, -s and -w combo at_setup_line='mixed.at:196' at_desc='Invalid -d, -s and -w combo' $at_quiet $ECHO_N "129: Invalid -d, -s and -w combo $ECHO_C" at_xfail=no ( echo "129. mixed.at:196: testing ..." $at_traceon $at_traceoff echo "mixed.at:202: blame -d'2001/01/01 01:02:30' -sB -wuser3 \$testdir/complex,v" echo mixed.at:202 >$at_check_line_file ( $at_traceon; blame -d'2001/01/01 01:02:30' -sB -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:202: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "mixed.at:204: blame -d'2001/01/01 01:10:00' -sC -wuser3 \$testdir/complex,v" echo mixed.at:204 >$at_check_line_file ( $at_traceon; blame -d'2001/01/01 01:10:00' -sC -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:204: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "mixed.at:206: blame -d'2001/01/01 01:10:00' -sB -wuser2 \$testdir/complex,v" echo mixed.at:206 >$at_check_line_file ( $at_traceon; blame -d'2001/01/01 01:10:00' -sB -wuser2 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:206: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 130 ) # 130. mixed.at:210: Valid -r, -d, -s and -w combo at_setup_line='mixed.at:210' at_desc='Valid -r, -d, -s and -w combo' $at_quiet $ECHO_N "130: Valid -r, -d, -s and -w combo $ECHO_C" at_xfail=no ( echo "130. mixed.at:210: testing ..." $at_traceon cp $testdir/complex-1.4.expout expout cp $testdir/complex.experr experr $at_traceoff echo "mixed.at:218: blame -r1.4 -d'2001/01/01 01:10:00' -sB -wuser3 \$testdir/complex,v" echo mixed.at:218 >$at_check_line_file ( $at_traceon; blame -r1.4 -d'2001/01/01 01:10:00' -sB -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "mixed.at:218: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 131 ) # 131. mixed.at:221: Invalid -r, -d, -s and -w combo at_setup_line='mixed.at:221' at_desc='Invalid -r, -d, -s and -w combo' $at_quiet $ECHO_N "131: Invalid -r, -d, -s and -w combo $ECHO_C" at_xfail=no ( echo "131. mixed.at:221: testing ..." $at_traceon $at_traceoff echo "mixed.at:228: blame -r1.3 -d'2001/01/01 01:10:00' -sB -wuser3 \$testdir/complex,v" echo mixed.at:228 >$at_check_line_file ( $at_traceon; blame -r1.3 -d'2001/01/01 01:10:00' -sB -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:228: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "mixed.at:230: blame -r1.4 -d'2001/01/01 01:02:30' -sB -wuser3 \$testdir/complex,v" echo mixed.at:230 >$at_check_line_file ( $at_traceon; blame -r1.4 -d'2001/01/01 01:02:30' -sB -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:230: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "mixed.at:232: blame -r1.4 -d'2001/01/01 01:10:00' -sC -wuser3 \$testdir/complex,v" echo mixed.at:232 >$at_check_line_file ( $at_traceon; blame -r1.4 -d'2001/01/01 01:10:00' -sC -wuser3 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:232: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff echo "mixed.at:234: blame -r1.4 -d'2001/01/01 01:10:00' -sB -wuser2 \$testdir/complex,v" echo mixed.at:234 >$at_check_line_file ( $at_traceon; blame -r1.4 -d'2001/01/01 01:10:00' -sB -wuser2 $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "mixed.at:234: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; banner-14 ) # Banner 14. log.at:1 cat <<\_ATEOF Expanding Log keywords. _ATEOF ;; 132 ) # 132. log.at:3: Old log expansion format at_setup_line='log.at:3' at_desc='Old log expansion format' $at_quiet $ECHO_N "132: Old log expansion format $ECHO_C" at_xfail=no ( echo "132. log.at:3: testing ..." $at_traceon cp $testdir/log-v3-1.1.expout expout cp $testdir/log.experr experr $at_traceoff echo "log.at:8: blame -r1.1 -V3 \$testdir/log,v" echo log.at:8 >$at_check_line_file ( $at_traceon; blame -r1.1 -V3 $testdir/log,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "log.at:8: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 133 ) # 133. log.at:11: New log expansion format at_setup_line='log.at:11' at_desc='New log expansion format' $at_quiet $ECHO_N "133: New log expansion format $ECHO_C" at_xfail=no ( echo "133. log.at:11: testing ..." $at_traceon cp $testdir/log-v5-1.1.expout expout cp $testdir/log.experr experr $at_traceoff echo "log.at:15: blame -r1.1 \$testdir/log,v" echo log.at:15 >$at_check_line_file ( $at_traceon; blame -r1.1 $testdir/log,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "log.at:15: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 134 ) # 134. log.at:18: Logs for multiple revisions at_setup_line='log.at:18' at_desc='Logs for multiple revisions' $at_quiet $ECHO_N "134: Logs for multiple revisions $ECHO_C" at_xfail=no ( echo "134. log.at:18: testing ..." $at_traceon cp $testdir/log-1.2.expout expout cp $testdir/log.experr experr $at_traceoff echo "log.at:22: blame -r1.2 \$testdir/log,v" echo log.at:22 >$at_check_line_file ( $at_traceon; blame -r1.2 $testdir/log,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "log.at:22: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; banner-15 ) # Banner 15. rcsinit.at:1 cat <<\_ATEOF RCSINIT environment variable support. _ATEOF ;; 135 ) # 135. rcsinit.at:3: Empty RCSINIT at_setup_line='rcsinit.at:3' at_desc='Empty RCSINIT' $at_quiet $ECHO_N "135: Empty RCSINIT $ECHO_C" at_xfail=no ( echo "135. rcsinit.at:3: testing ..." $at_traceon cp $testdir/complex-3.4.expout expout cp $testdir/complex.experr experr $at_traceoff echo "rcsinit.at:9: RCSINIT= blame -r3.4 -sA \$testdir/complex,v" echo rcsinit.at:9 >$at_check_line_file ( $at_traceon; RCSINIT= blame -r3.4 -sA $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rcsinit.at:9: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 136 ) # 136. rcsinit.at:12: RCSINIT with options at_setup_line='rcsinit.at:12' at_desc='RCSINIT with options' $at_quiet $ECHO_N "136: RCSINIT with options $ECHO_C" at_xfail=no ( echo "136. rcsinit.at:12: testing ..." $at_traceon cp $testdir/complex-3.4.expout expout cp $testdir/complex.experr experr $at_traceoff echo "rcsinit.at:18: RCSINIT='-r3.4 -sA' blame \$testdir/complex,v" echo rcsinit.at:18 >$at_check_line_file ( $at_traceon; RCSINIT='-r3.4 -sA' blame $testdir/complex,v ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rcsinit.at:18: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 137 ) # 137. rcsinit.at:21: RCSINIT with invalid options at_setup_line='rcsinit.at:21' at_desc='RCSINIT with invalid options' $at_quiet $ECHO_N "137: RCSINIT with invalid options $ECHO_C" at_xfail=no ( echo "137. rcsinit.at:21: testing ..." $at_traceon $at_traceoff echo "rcsinit.at:24: RCSINIT='--foo' blame" echo rcsinit.at:24 >$at_check_line_file ( $at_traceon; RCSINIT='--foo' blame ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo stderr:; tee stderr <$at_stderr $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "rcsinit.at:24: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon if grep -q '^==[0-9][0-9]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 138 ) # 138. rcsinit.at:28: RCSINIT with a filename at_setup_line='rcsinit.at:28' at_desc='RCSINIT with a filename' $at_quiet $ECHO_N "138: RCSINIT with a filename $ECHO_C" at_xfail=no ( echo "138. rcsinit.at:28: testing ..." $at_traceon cp $testdir/complex-3.8.expout expout cp $testdir/complex.experr experr $at_traceoff echo "rcsinit.at:32: RCSINIT=\"\$testdir/complex,v\" blame" echo rcsinit.at:32 >$at_check_line_file ( $at_traceon; RCSINIT="$testdir/complex,v" blame ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff experr $at_stderr || at_failed=: $at_diff expout $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "rcsinit.at:32: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; * ) echo "$as_me: no such test group: $at_group" >&2 continue ;; esac # Be sure to come back to the suite directory, in particular # since below we might `rm' the group directory we are in currently. cd $at_suite_dir case $at_group in banner-*) ;; *) if test ! -f $at_check_line_file; then sed "s/^ */$as_me: warning: /" <<_ATEOF A failure happened in a test group before any test could be run. This means that test suite is improperly designed. Please report this failure to . _ATEOF echo "$at_setup_line" >$at_check_line_file fi at_group_count=`expr 1 + $at_group_count` $at_verbose $ECHO_N "$at_group. $at_setup_line: $ECHO_C" echo $ECHO_N "$at_group. $at_setup_line: $ECHO_C" >> $at_group_log case $at_xfail:$at_status in yes:0) at_msg="UNEXPECTED PASS" at_xpass_list="$at_xpass_list $at_group" at_errexit=$at_errexit_p ;; no:0) at_msg="ok" at_pass_list="$at_pass_list $at_group" at_errexit=false ;; *:77) at_msg="skipped (`cat $at_check_line_file`)" at_skip_list="$at_skip_list $at_group" at_errexit=false ;; yes:*) at_msg="expected failure (`cat $at_check_line_file`)" at_xfail_list="$at_xfail_list $at_group" at_errexit=false ;; no:*) at_msg="FAILED (`cat $at_check_line_file`)" at_fail_list="$at_fail_list $at_group" at_errexit=$at_errexit_p ;; esac echo $at_msg at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg" case $at_status in 0|77) # $at_times_file is only available if the group succeeded. # We're not including the group log, so the success message # is written in the global log separately. But we also # write to the group log in case they're using -d. if test -f $at_times_file; then at_log_msg="$at_log_msg (`sed 1d $at_times_file`)" rm -f $at_times_file fi echo "$at_log_msg" >> $at_group_log echo "$at_log_msg" >&5 # Cleanup the group directory, unless the user wants the files. $at_debug_p || rm -rf $at_group_dir ;; *) # Upon failure, include the log into the testsuite's global # log. The failure message is written in the group log. It # is later included in the global log. echo "$at_log_msg" >> $at_group_log # Upon failure, keep the group directory for autopsy, and # create the debugging script. { echo "#! /bin/sh" echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' echo "cd $at_dir" echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$0" \ '-v -d' "$at_debug_args" "$at_group" '${1+"$@"}' echo 'exit 1' } >$at_group_dir/run chmod +x $at_group_dir/run $at_errexit && break ;; esac ;; esac done # Back to the top directory. cd $at_dir # Compute the duration of the suite. at_stop_date=`date` at_stop_time=`(date +%s) 2>/dev/null` echo "$as_me: ending at: $at_stop_date" >&5 at_duration_s=`(expr $at_stop_time - $at_start_time) 2>/dev/null` at_duration_m=`(expr $at_duration_s / 60) 2>/dev/null` at_duration_h=`(expr $at_duration_m / 60) 2>/dev/null` at_duration_s=`(expr $at_duration_s % 60) 2>/dev/null` at_duration_m=`(expr $at_duration_m % 60) 2>/dev/null` at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s" if test "$at_duration" != "h m s"; then echo "$as_me: test suite duration: $at_duration" >&5 fi # Wrap up the test suite with summary statistics. at_skip_count=`set dummy $at_skip_list; shift; echo $#` at_fail_count=`set dummy $at_fail_list; shift; echo $#` at_xpass_count=`set dummy $at_xpass_list; shift; echo $#` at_xfail_count=`set dummy $at_xfail_list; shift; echo $#` at_run_count=`expr $at_group_count - $at_skip_count` at_unexpected_count=`expr $at_xpass_count + $at_fail_count` at_total_fail_count=`expr $at_xfail_count + $at_fail_count` echo cat <<\_ASBOX ## ------------- ## ## Test results. ## ## ------------- ## _ASBOX echo { echo cat <<\_ASBOX ## ------------- ## ## Test results. ## ## ------------- ## _ASBOX echo } >&5 if test $at_run_count = 1; then at_result="1 test" at_were=was else at_result="$at_run_count tests" at_were=were fi if $at_errexit_p && test $at_unexpected_count != 0; then if test $at_xpass_count = 1; then at_result="$at_result $at_were run, one passed" else at_result="$at_result $at_were run, one failed" fi at_result="$at_result unexpectedly and inhibited subsequent tests." else # Don't you just love exponential explosion of the number of cases? case $at_xpass_count:$at_fail_count:$at_xfail_count in # So far, so good. 0:0:0) at_result="$at_result $at_were successful." ;; 0:0:*) at_result="$at_result behaved as expected." ;; # Some unexpected failures 0:*:0) at_result="$at_result $at_were run, $at_fail_count failed unexpectedly." ;; # Some failures, both expected and unexpected 0:*:1) at_result="$at_result $at_were run, $at_total_fail_count failed ($at_xfail_count expected failure)." ;; 0:*:*) at_result="$at_result $at_were run, $at_total_fail_count failed ($at_xfail_count expected failures)." ;; # No unexpected failures, but some xpasses *:0:*) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly." ;; # No expected failures, but failures and xpasses *:1:0) at_result="$at_result $at_were run, $at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;; *:*:0) at_result="$at_result $at_were run, $at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;; # All of them. *:*:1) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly, $at_total_fail_count failed ($at_xfail_count expected failure)." ;; *:*:*) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly, $at_total_fail_count failed ($at_xfail_count expected failures)." ;; esac if test $at_skip_count = 0 && test $at_run_count -gt 1; then at_result="All $at_result" fi fi # Now put skips in the mix. case $at_skip_count in 0) ;; 1) at_result="$at_result 1 test was skipped." ;; *) at_result="$at_result $at_skip_count tests were skipped." ;; esac if test $at_unexpected_count = 0; then echo "$at_result" echo "$at_result" >&5 else echo "ERROR: $at_result" >&2 echo "ERROR: $at_result" >&5 { echo cat <<\_ASBOX ## ------------------------ ## ## Summary of the failures. ## ## ------------------------ ## _ASBOX # Summary of failed and skipped tests. if test $at_fail_count != 0; then echo "Failed tests:" $SHELL $0 $at_fail_list --list echo fi if test $at_skip_count != 0; then echo "Skipped tests:" $SHELL $0 $at_skip_list --list echo fi if test $at_xpass_count != 0; then echo "Unexpected passes:" $SHELL $0 $at_xpass_list --list echo fi if test $at_fail_count != 0; then cat <<\_ASBOX ## ---------------------- ## ## Detailed failed tests. ## ## ---------------------- ## _ASBOX echo for at_group in $at_fail_list do # Normalize the test group number. at_group_normalized=`expr "00000$at_group" : ".*\($at_format\)"` # Create a fresh directory for the next test group, and enter. at_group_dir=$at_suite_dir/$at_group_normalized at_group_log=$at_group_dir/$as_me.log cat $at_group_log echo done echo fi if test -n "$at_top_srcdir"; then sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## $at_top_builddir/config.log ## _ASBOX sed 's/^/| /' $at_top_builddir/config.log echo fi } >&5 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## $as_me.log was created. ## _ASBOX echo echo "Please send \`$as_me.log' and all information you think might help:" echo echo " To: " echo " Subject: [blame 1.3.1] $as_me:$at_fail_list${at_fail_list:+ failed${at_xpass_list:+,}}$at_xpass_list${at_xpass_list:+ passed unexpectedly}" echo if test $at_debug_p = false; then echo echo 'You may investigate any problem if you feel able to do so, in which' echo 'case the test suite provides a good starting point.' echo fi exit 1 fi exit 0 blame-1.3.1/tests/rev.at0000664000076400007640000001016110135160766012017 00000000000000AT_BANNER([[-r and --revision options.]]) AT_SETUP([No revision]) AT_KEYWORDS([rev]) cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -r -- $testdir/simple,v]], 0, expout, experr) AT_CHECK([[blame --revision -- $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Multiple revisions]) AT_KEYWORDS([rev]) AT_KEYWORDS([errors]) AT_CHECK([[blame -r1.1 -r1.2 $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Single dot]) AT_KEYWORDS([rev]) cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -r. $testdir/simple,v]], 0, expout, experr) AT_CHECK([[blame --revision=. $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Valid trunk branch]) AT_KEYWORDS([rev]) cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -r1 $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Invalid trunk branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([errors]) AT_CHECK([[blame -r4 $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Valid trunk branch and dot]) AT_KEYWORDS([rev]) cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -r1. $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Invalid trunk branch and dot]) AT_KEYWORDS([rev]) AT_KEYWORDS([errors]) AT_CHECK([[blame -r4. $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Dot and revision]) AT_KEYWORDS([rev]) cp $testdir/simple-1.1.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -r.1 $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Dot and late revision]) AT_KEYWORDS([rev]) cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -r.10 $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Dot and early revision]) AT_KEYWORDS([rev]) AT_KEYWORDS([errors]) AT_CHECK([[blame -r.0 $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Symbolic trunk branch]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -rfoo $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Symbolic trunk branch and dot]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -rfoo. $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Symbolic trunk branch and revision]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/simple-1.1.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -rfoo.1 $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Symbolic trunk branch and late revision]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -rfoo.10 $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Symbolic trunk branch and early revision]) AT_KEYWORDS([rev]) AT_KEYWORDS([errors]) AT_KEYWORDS([symbol]) AT_CHECK([[blame -rfoo.0 $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Symbolic revision]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -rbar $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Dot and symbolic revision]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/simple-1.1.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -r.foo $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Symbolic trunk branch and symbolic revision]) AT_KEYWORDS([rev]) AT_KEYWORDS([symbol]) cp $testdir/simple-1.1.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -rfoo.foo $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Invalid symbol]) AT_KEYWORDS([rev]) AT_KEYWORDS([errors]) AT_KEYWORDS([symbol]) AT_CHECK([[blame -rbaz $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame -r.baz $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame -rbaz. $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame -r1.baz $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP blame-1.3.1/tests/log.at0000644000076400007640000000121310260447073011776 00000000000000AT_BANNER([[Expanding Log keywords.]]) AT_SETUP([Old log expansion format]) AT_KEYWORDS([log]) AT_KEYWORDS([version]) cp $testdir/log-v3-1.1.expout expout cp $testdir/log.experr experr AT_CHECK([[blame -r1.1 -V3 $testdir/log,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([New log expansion format]) AT_KEYWORDS([log]) cp $testdir/log-v5-1.1.expout expout cp $testdir/log.experr experr AT_CHECK([[blame -r1.1 $testdir/log,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Logs for multiple revisions]) AT_KEYWORDS([log]) cp $testdir/log-1.2.expout expout cp $testdir/log.experr experr AT_CHECK([[blame -r1.2 $testdir/log,v]], 0, expout, experr) AT_CLEANUP blame-1.3.1/tests/author.at0000644000076400007640000000246410530062137012522 00000000000000AT_BANNER([[-w and --author options.]]) AT_SETUP([No author]) AT_KEYWORDS([author]) AT_XFAIL_IF([test -z "$username"]) AT_XFAIL_IF([test "$username" = username]) AT_XFAIL_IF([test "$username" = somebody]) replace="`echo $username | sed 's/$/ /;s/^\(.\{8\}\).*/\1/'`" AT_CHECK([[blame -w -- $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR cat $testdir/simple,v | sed "s/somebody/$username/g" > input,v cat $testdir/simple-1.2.expout | sed "s/somebody/$replace/g" > expout cat $testdir/simple.experr | sed "s/simple/input/g" > experr AT_CHECK([[blame -w -- input,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Known author]) AT_KEYWORDS([author]) cp $testdir/simple.experr experr cp $testdir/simple-1.2.expout expout AT_CHECK([[blame -wsomebody $testdir/simple,v]], 0, expout, experr) rm -f expout cp $testdir/simple-1.1.expout expout AT_CHECK([[blame -wusername $testdir/simple,v]], 0, expout, experr) AT_CHECK([[blame --author=username $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Unknown author]) AT_KEYWORDS([author]) AT_KEYWORDS([errors]) AT_CHECK([[blame -wfloopy $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Multiple authors]) AT_KEYWORDS([author]) AT_KEYWORDS([errors]) AT_CHECK([[blame -wusername -wsomebody $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP blame-1.3.1/tests/rcs.at0000644000076400007640000000142510260233067012005 00000000000000AT_BANNER([[RCS file parsing.]]) AT_SETUP([No revisions present]) AT_KEYWORDS([rcs]) AT_KEYWORDS([errors]) AT_CHECK([[blame $testdir/empty,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Two-digit year before 2000]) AT_KEYWORDS([rcs]) cp $testdir/compat-1.1.expout expout cp $testdir/compat.experr experr AT_CHECK([[blame -r1.1 $testdir/compat,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Missing empty line after delta text]) AT_KEYWORDS([rcs]) cp $testdir/compat-1.2.expout expout cp $testdir/compat.experr experr AT_CHECK([[blame -r1.2 $testdir/compat,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Binary data]) AT_KEYWORDS([rcs]) cp $testdir/binary-1.2.expout expout cp $testdir/binary.experr experr AT_CHECK([[blame -r1.2 $testdir/binary,v]], 0, expout, experr) AT_CLEANUP blame-1.3.1/tests/argv.at0000644000076400007640000000241010527572170012157 00000000000000AT_BANNER([[Command line argument parsing.]]) AT_SETUP([No arguments]) AT_KEYWORDS([argv]) AT_KEYWORDS([errors]) AT_CHECK([[blame]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Invalid argument]) AT_KEYWORDS([argv]) AT_KEYWORDS([errors]) AT_CHECK([[blame --footle]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([-? and --help]) AT_KEYWORDS([argv]) AT_CHECK([[blame -?]], 0, ignore, ) AT_CHECK([[blame --help]], 0, ignore, ) AT_CLEANUP AT_SETUP([-V and --version]) AT_KEYWORDS([argv]) cat < expout $package_string; emulating RCS version 5 EOF AT_CHECK([[blame -V]], 0, expout, ) AT_CHECK([[blame --version]], 0, stdout, ) AT_CLEANUP AT_SETUP([Non-existant working file]) AT_KEYWORDS([argv]) AT_KEYWORDS([errors]) AT_CHECK([[blame /nonexistant]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Non-existant RCS file]) AT_KEYWORDS([argv]) AT_KEYWORDS([errors]) AT_CHECK([[blame /nonexistant,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Filenames only]) AT_KEYWORDS([argv]) cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame $testdir/simple,v]], 0, expout, experr) rm -f experr cat $testdir/simple.experr | sed "s,simple,$testdir/simple,g" > experr AT_CHECK([[blame $testdir/simple]], 0, expout, experr) AT_CLEANUP blame-1.3.1/tests/state.at0000664000076400007640000000170510125542443012342 00000000000000AT_BANNER([[-s and --state options.]]) AT_SETUP([Missing state argument]) AT_KEYWORDS([state]) AT_KEYWORDS([errors]) AT_CHECK([[blame $testdir/simple,v -s]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Known state]) AT_KEYWORDS([state]) cp $testdir/simple.experr experr cp $testdir/simple-1.1.expout expout AT_CHECK([[blame -sExp $testdir/simple,v]], 0, expout, experr) AT_CHECK([[blame --state=Exp $testdir/simple,v]], 0, expout, experr) rm -f expout cp $testdir/simple-1.2.expout expout AT_CHECK([[blame -sStab $testdir/simple,v]], 0, expout, experr) AT_CHECK([[blame --state Stab $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Unknown state]) AT_KEYWORDS([state]) AT_KEYWORDS([errors]) AT_CHECK([[blame -sFloopy $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Multiple states]) AT_KEYWORDS([state]) AT_KEYWORDS([errors]) AT_CHECK([[blame -sStab -sExp $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP blame-1.3.1/tests/suffixes.at0000664000076400007640000000140210125542443013050 00000000000000AT_BANNER([[-x and --suffixes options.]]) AT_SETUP([Default suffixes]) AT_KEYWORDS([suffixes]) cp $testdir/simple-1.2.expout expout AT_CHECK([[blame $testdir/file1]], 0, expout, ignore) AT_CLEANUP AT_SETUP([Nonstandard suffixes]) AT_KEYWORDS([suffixes]) cp $testdir/simple-1.2.expout expout AT_CHECK([[blame -x$slash-foo$slash-bar $testdir/file2]], 0, expout, ignore) AT_CHECK([[blame --suffixes=$slash-foo$slash-bar $testdir/file3]], 0, expout, ignore) AT_CHECK([[blame --suffixes $slash-foo$slash-bar $testdir/file3]], 0, expout, ignore) AT_CLEANUP AT_SETUP([Multiple suffixes specifications]) AT_KEYWORDS([suffixes]) AT_KEYWORDS([errors]) AT_CHECK([[blame -x$slash-foo$slash-bar -x$slash-bar$slash-foo $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP blame-1.3.1/tests/pairing.at0000664000076400007640000000355710135214010012645 00000000000000AT_BANNER([[Filename pairing.]]) AT_SETUP([Working file, then corresponding RCS file]) AT_KEYWORDS([pairing]) cp $testdir/simple-1.2.expout expout cat $testdir/simple.experr | sed "s,simple,$testdir/simple,g" > experr AT_CHECK([[blame $testdir/simple $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Working file, then independent working file]) AT_KEYWORDS([pairing]) cat $testdir/simple-1.2.expout $testdir/complex-3.8.expout > expout ( cat $testdir/simple.experr | sed "s,simple,$testdir/simple,g" cat $testdir/complex.experr | sed "s,complex,$testdir/complex,g" ) > experr AT_CHECK([[blame $testdir/simple $testdir/complex]], 0, expout, experr) AT_CLEANUP AT_SETUP([Working file, then independent RCS file]) AT_KEYWORDS([pairing]) cat $testdir/simple-1.2.expout $testdir/complex-3.8.expout > expout ( cat $testdir/simple.experr | sed "s,simple,$testdir/simple,g" cat $testdir/complex.experr ) > experr AT_CHECK([[blame $testdir/simple $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([RCS file, then corresponding working file]) AT_KEYWORDS([pairing]) cp $testdir/simple-1.2.expout expout cat $testdir/simple.experr | sed "s,simple,$testdir/simple,g" > experr AT_CHECK([[blame $testdir/simple,v $testdir/simple]], 0, expout, experr) AT_CLEANUP AT_SETUP([RCS file, then independent working file]) AT_KEYWORDS([pairing]) cat $testdir/simple-1.2.expout $testdir/complex-3.8.expout > expout ( cat $testdir/simple.experr cat $testdir/complex.experr | sed "s,complex,$testdir/complex,g" ) > experr AT_CHECK([[blame $testdir/simple,v $testdir/complex]], 0, expout, experr) AT_CLEANUP AT_SETUP([RCS file, then independent RCS file]) AT_KEYWORDS([pairing]) cat $testdir/simple-1.2.expout $testdir/complex-3.8.expout > expout cat $testdir/simple.experr $testdir/complex.experr > experr AT_CHECK([[blame $testdir/simple,v $testdir/complex,v]], 0, expout, experr) AT_CLEANUP blame-1.3.1/tests/blame0000775000076400007640000000012710150573442011700 00000000000000#! /bin/sh case $# in 0) exec $PRELOAD $BLAME ;; *) exec $PRELOAD $BLAME "$@" ;; esac blame-1.3.1/tests/mixed.at0000664000076400007640000001577110125542443012340 00000000000000AT_BANNER([[Mixing -r, -d, -s and -w options.]]) AT_SETUP([Valid -r and -d combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([rev]) AT_KEYWORDS([date]) cp $testdir/complex-3.4.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r3.4 -d'2001/01/01 03:04:01' $testdir/complex,v]], 0, expout, experr) AT_CHECK([[blame -r3.4 -d'2001/01/01 03:04:00' $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Invalid -r and -d combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([errors]) AT_KEYWORDS([rev]) AT_KEYWORDS([date]) AT_CHECK([[blame -r3.4 -d'2001/01/01 03:03:59' $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Valid -r and -s combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([rev]) AT_KEYWORDS([state]) cp $testdir/complex-3.4.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r3.4 -sA $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Invalid -r and -s combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([errors]) AT_KEYWORDS([rev]) AT_KEYWORDS([state]) AT_CHECK([[blame -r3.4 -sB $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Valid -r and -w combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([rev]) AT_KEYWORDS([author]) cp $testdir/complex-3.4.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r3.4 -wuser1 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Invalid -r and -w combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([errors]) AT_KEYWORDS([rev]) AT_KEYWORDS([author]) AT_CHECK([[blame -r3.4 -wuser2 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Valid -d and -s combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([date]) AT_KEYWORDS([state]) cp $testdir/complex-1.1.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -d'2001/01/01 01:01:00' -sA $testdir/complex,v]], 0, expout, experr) AT_CHECK([[blame -d'2001/01/01 01:01:30' -sA $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Invalid -d and -s combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([errors]) AT_KEYWORDS([date]) AT_KEYWORDS([state]) AT_CHECK([[blame -d'2001/01/01 01:01:30' -sB $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Valid -d and -w combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([date]) AT_KEYWORDS([author]) cp $testdir/complex-1.1.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -d'2001/01/01 01:01:00' -wuser3 $testdir/complex,v]], 0, expout, experr) AT_CHECK([[blame -d'2001/01/01 01:01:30' -wuser3 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Invalid -d and -w combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([errors]) AT_KEYWORDS([date]) AT_KEYWORDS([author]) AT_CHECK([[blame -d'2001/01/01 01:01:30' -wuser2 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Valid -s and -w combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([state]) AT_KEYWORDS([author]) cp $testdir/complex-1.1.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -sA -wuser3 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Invalid -s and -w combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([errors]) AT_KEYWORDS([state]) AT_KEYWORDS([author]) AT_CHECK([[blame -sC -wuser2 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Valid -r, -d and -s combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([rev]) AT_KEYWORDS([date]) AT_KEYWORDS([state]) cp $testdir/complex-2.2.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r2.2 -d'2001/01/01 03:10:00' -sC $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Invalid -r, -d and -s combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([errors]) AT_KEYWORDS([rev]) AT_KEYWORDS([date]) AT_KEYWORDS([state]) AT_CHECK([[blame -r2.1 -d'2001/01/01 03:10:00' -sC $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame -r2.2 -d'2001/01/01 01:10:00' -sC $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame -r2.2 -d'2001/01/01 03:10:00' -sA $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Valid -r, -d and -w combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([rev]) AT_KEYWORDS([date]) AT_KEYWORDS([author]) cp $testdir/complex-2.2.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r2.2 -d'2001/01/01 03:10:00' -wuser3 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Invalid -r, -d and -w combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([errors]) AT_KEYWORDS([rev]) AT_KEYWORDS([date]) AT_KEYWORDS([author]) AT_CHECK([[blame -r2.1 -d'2001/01/01 03:10:00' -wuser3 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame -r2.2 -d'2001/01/01 01:10:00' -wuser3 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame -r2.2 -d'2001/01/01 03:10:00' -wuser2 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Valid -r, -s and -w combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([rev]) AT_KEYWORDS([state]) AT_KEYWORDS([author]) cp $testdir/complex-2.2.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r2.2 -sC -wuser3 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Invalid -r, -s and -w combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([errors]) AT_KEYWORDS([rev]) AT_KEYWORDS([state]) AT_KEYWORDS([author]) AT_CHECK([[blame -r2.1 -sC -wuser3 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame -r2.2 -sA -wuser3 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame -r2.2 -sC -wuser2 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Valid -d, -s and -w combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([date]) AT_KEYWORDS([state]) AT_KEYWORDS([author]) cp $testdir/complex-1.4.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -d'2001/01/01 01:10:00' -sB -wuser3 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Invalid -d, -s and -w combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([errors]) AT_KEYWORDS([date]) AT_KEYWORDS([state]) AT_KEYWORDS([author]) AT_CHECK([[blame -d'2001/01/01 01:02:30' -sB -wuser3 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame -d'2001/01/01 01:10:00' -sC -wuser3 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame -d'2001/01/01 01:10:00' -sB -wuser2 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Valid -r, -d, -s and -w combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([rev]) AT_KEYWORDS([date]) AT_KEYWORDS([state]) AT_KEYWORDS([author]) cp $testdir/complex-1.4.expout expout cp $testdir/complex.experr experr AT_CHECK([[blame -r1.4 -d'2001/01/01 01:10:00' -sB -wuser3 $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Invalid -r, -d, -s and -w combo]) AT_KEYWORDS([mixed]) AT_KEYWORDS([errors]) AT_KEYWORDS([rev]) AT_KEYWORDS([date]) AT_KEYWORDS([state]) AT_KEYWORDS([author]) AT_CHECK([[blame -r1.3 -d'2001/01/01 01:10:00' -sB -wuser3 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame -r1.4 -d'2001/01/01 01:02:30' -sB -wuser3 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame -r1.4 -d'2001/01/01 01:10:00' -sC -wuser3 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame -r1.4 -d'2001/01/01 01:10:00' -sB -wuser2 $testdir/complex,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP blame-1.3.1/tests/date.at0000664000076400007640000001076410125542443012144 00000000000000AT_BANNER([[-d and --date options.]]) AT_SETUP([Missing date argument]) AT_KEYWORDS([date]) AT_KEYWORDS([errors]) AT_CHECK([[blame $testdir/simple,v -d]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Date after all revisions]) AT_KEYWORDS([date]) cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -d'2002-02-03 UTC' $testdir/simple,v]], 0, expout, experr) AT_CHECK([[blame --date='2002-02-03 UTC' $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Date just after a revision]) AT_KEYWORDS([date]) cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -d'2002-02-02 02:02:03 UTC' $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Date on a revision]) AT_KEYWORDS([date]) cp $testdir/simple-1.2.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -d'2002-02-02 02:02:02 UTC' $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Date just before a revision]) AT_KEYWORDS([date]) cp $testdir/simple-1.1.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -d'2002-02-02 02:02:01 UTC' $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Date between revisions]) AT_KEYWORDS([date]) cp $testdir/simple-1.1.expout expout cp $testdir/simple.experr experr AT_CHECK([[blame -d'2001-01-02 UTC' $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Date before all revisions]) AT_KEYWORDS([date]) AT_KEYWORDS([errors]) AT_CHECK([[blame -d'2000-01-01 UTC' $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Unparseable date]) AT_KEYWORDS([date]) AT_KEYWORDS([errors]) AT_CHECK([[blame -d'floopy' $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Unknown timezone]) AT_KEYWORDS([date]) AT_KEYWORDS([errors]) AT_KEYWORDS([zone]) AT_CHECK([[blame -d'2000-01-01 FLOOPY' $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([No timezone]) AT_KEYWORDS([date]) AT_KEYWORDS([zone]) cp $testdir/simple.experr experr cp $testdir/simple-1.2.expout expout AT_CHECK([[blame -d'2002-02-02 02:02:03' $testdir/simple,v]], 0, expout, experr) AT_CHECK([[blame -d'2002-02-02 02:02:02' $testdir/simple,v]], 0, expout, experr) rm -f expout cp $testdir/simple-1.1.expout expout AT_CHECK([[blame -d'2002-02-02 02:02:01' $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([dd-Mon-yyyy hh:mm:ss]) AT_KEYWORDS([date]) cp $testdir/simple.experr experr cp $testdir/simple-1.2.expout expout AT_CHECK([[blame -d'02-Feb-2002 02:02:03 UTC' $testdir/simple,v]], 0, expout, experr) AT_CHECK([[blame -d'02-Feb-2002 02:02:02 UTC' $testdir/simple,v]], 0, expout, experr) rm -f expout cp $testdir/simple-1.1.expout expout AT_CHECK([[blame -d'02-Feb-2002 02:02:01 UTC' $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([h:mm:ss AM yyyymmdd]) AT_KEYWORDS([date]) cp $testdir/simple.experr experr cp $testdir/simple-1.2.expout expout AT_CHECK([[blame -d'2:02:03 am 02-Feb-2002 UTC' $testdir/simple,v]], 0, expout, experr) AT_CHECK([[blame -d'2:02:02 am 02-Feb-2002 UTC' $testdir/simple,v]], 0, expout, experr) rm -f expout cp $testdir/simple-1.1.expout expout AT_CHECK([[blame -d'2:02:01 am 02-Feb-2002 UTC' $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Unusual timezone]) AT_KEYWORDS([date]) AT_KEYWORDS([zone]) cp $testdir/simple.experr experr cp $testdir/simple-1.2.expout expout AT_CHECK([[blame -d'11:02:03 am 02-Feb-2002 AWSST' $testdir/simple,v]], 0, expout, experr) AT_CHECK([[blame -d'04:02:02 am 02-Feb-2002 FWT' $testdir/simple,v]], 0, expout, experr) AT_CHECK([[blame -d'09:32:02 pm 01-Feb-2002 -04:30' $testdir/simple,v]], 0, expout, experr) rm -f expout cp $testdir/simple-1.1.expout expout AT_CHECK([[blame -d'09:32:01 pm 01-Feb-2002 -04:30' $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([With -z or --zone option]) AT_KEYWORDS([date]) AT_KEYWORDS([zone]) cp $testdir/simple.experr experr cp $testdir/simple-1.2.expout expout AT_CHECK([[blame -d'11:02:03 am 02-Feb-2002' -z AWSST $testdir/simple,v]], 0, expout, experr) AT_CHECK([[blame -d'04:02:02 am 02-Feb-2002' -z FWT $testdir/simple,v]], 0, expout, experr) AT_CHECK([[blame -d'09:32:02 pm 01-Feb-2002' -z -04:30 $testdir/simple,v]], 0, expout, experr) rm -f expout cp $testdir/simple-1.1.expout expout AT_CHECK([[blame -z -04:30 -d'09:32:01 pm 01-Feb-2002' $testdir/simple,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Multiple dates]) AT_KEYWORDS([date]) AT_KEYWORDS([errors]) AT_CHECK([[blame -d'2001-01-01 01:01:01 UTC' -d'2002-02-02 02:02:02 UTC' $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP blame-1.3.1/tests/working.at0000644000076400007640000000675610530053344012710 00000000000000AT_BANNER([[Handling RCS tags in working files.]]) AT_SETUP([Valid revision]) AT_KEYWORDS([working]) AT_KEYWORDS([rev]) cp $testdir/keywords.experr experr cat < keywords \$Revision: 1.1 \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 0, ignore, experr) cat < keywords \$Id: keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 0, ignore, experr) cat < keywords \$Header: $testdir/keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 0, ignore, experr) AT_CLEANUP AT_SETUP([Early revision]) AT_KEYWORDS([working]) AT_KEYWORDS([rev]) AT_KEYWORDS([errors]) cat < keywords \$Revision: 1.0 \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 1, , ignore) MAC_CHECK_STDERR cat < keywords \$Id: keywords,v 1.0 2001/01/01 01:01:01 username Exp \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 1, , ignore) MAC_CHECK_STDERR cat < keywords \$Header: $testdir/keywords,v 1.0 2001/01/01 01:01:01 username Exp \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 1, , ignore) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Late revision]) AT_KEYWORDS([working]) AT_KEYWORDS([rev]) cp $testdir/keywords.experr experr cat < keywords \$Revision: 1.2 \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 0, ignore, experr) cat < keywords \$Id: keywords,v 1.2 2001/01/01 01:01:01 username Exp \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 0, ignore, experr) cat < keywords \$Header: $testdir/keywords,v 1.2 2001/01/01 01:01:01 username Exp \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 0, ignore, experr) AT_CLEANUP AT_SETUP([Branch]) AT_KEYWORDS([working]) AT_KEYWORDS([rev]) AT_KEYWORDS([errors]) cat < keywords \$Revision: 1 \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 1, , ignore) MAC_CHECK_STDERR cat < keywords \$Id: keywords,v 1 2001/01/01 01:01:01 username Exp \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 1, , ignore) MAC_CHECK_STDERR cat < keywords \$Header: $testdir/keywords,v 1 2001/01/01 01:01:01 username Exp \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 1, , ignore) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Other non-revision]) AT_KEYWORDS([working]) AT_KEYWORDS([rev]) AT_KEYWORDS([errors]) cat < keywords \$Revision: bar \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 1, , ignore) MAC_CHECK_STDERR cat < keywords \$Id: keywords,v bar 2001/01/01 01:01:01 username Exp \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 1, , ignore) MAC_CHECK_STDERR cat < keywords \$Header: $testdir/keywords,v bar 2001/01/01 01:01:01 username Exp \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 1, , ignore) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Parsing escape sequences]) AT_KEYWORDS([working]) AT_KEYWORDS([rev]) cp $testdir/keywords.experr experr cat < keywords \$Id: file\twith\nweird\\symbols\040in\044it,v 1.1 2001/01/01 01:01:01 username Exp \$ EOF AT_CHECK([[blame -r'$' $testdir/keywords,v]], 0, ignore, experr) AT_CLEANUP AT_SETUP([Producing escape sequences]) AT_KEYWORDS([working]) cp $testdir/escape,v 'x$ x,v' cat < 'x$ x' \$Id: x\044\040x,v 1.1 2001/01/01 01:01:01 username Exp \$ EOF cat $testdir/escape.experr | sed 's,escape,x$ x,g' > experr AT_CHECK([[blame -r1.1 'x$ x']], 0, ignore, experr) AT_CLEANUP AT_SETUP([Mixing escape characters]) AT_KEYWORDS([working]) cp $testdir/escape-1.2.expout expout cp $testdir/escape.experr experr AT_CHECK([[blame -r1.2 $testdir/escape,v]], 0, expout, experr) AT_CLEANUP blame-1.3.1/tests/testsuite.at0000644000076400007640000000127210527572337013263 00000000000000# Process this file with autom4te to create testsuite. AT_INIT AT_TESTED([blame]) m4_defun([MAC_CHECK_STDERR], [ dnl Catch Valgrind errors if grep -q '^==[[0-9]][[0-9]]*==' $at_stderr; then echo 42 > $at_status_file exit 42 fi dnl Make sure stderr isn't empty if $at_diff $at_devnull $at_stderr; then echo 1 > $at_status_file exit 1 fi ]) m4_include([argv.at]) m4_include([pairing.at]) m4_include([rcs.at]) m4_include([rev.at]) m4_include([branch.at]) m4_include([working.at]) m4_include([date.at]) m4_include([state.at]) m4_include([author.at]) m4_include([expand.at]) m4_include([version.at]) m4_include([suffixes.at]) m4_include([mixed.at]) m4_include([log.at]) m4_include([rcsinit.at]) blame-1.3.1/tests/version.at0000664000076400007640000000736710144373546012730 00000000000000AT_BANNER([[-V and --version options.]]) AT_SETUP([Invalid version argument]) AT_KEYWORDS([version]) AT_KEYWORDS([errors]) AT_CHECK([[blame -V1 $testdir/keywords,v]], 1, , stderr) MAC_CHECK_STDERR AT_CHECK([[blame --version=foo $testdir/keywords,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Emulating RCS version 3]) AT_KEYWORDS([version]) AT_KEYWORDS([log]) cat < expout 1.1 (username 01-Jan-01): \$Author: username \$ 1.1 (username 01-Jan-01): \$Date: 2001/01/01 01:01:01 \$ 1.1 (username 01-Jan-01): \$Header: keywords,v 1.1 2001/01/01 01:01:01 username Locked \$ 1.1 (username 01-Jan-01): \$Id: keywords,v 1.1 2001/01/01 01:01:01 username Locked \$ 1.1 (username 01-Jan-01): \$Locker: username \$ 1.1 (username 01-Jan-01): \$Log: keywords,v \$ 1.1 (username 01-Jan-01): # Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): # Initial revision 1.1 (username 01-Jan-01): #$space 1.1 (username 01-Jan-01): \$Name: \$ 1.1 (username 01-Jan-01): \$RCSfile: keywords,v \$ 1.1 (username 01-Jan-01): \$Revision: 1.1 \$ 1.1 (username 01-Jan-01): \$Source: $testdir/keywords,v \$ 1.1 (username 01-Jan-01): \$State: Exp \$ EOF cp $testdir/keywords.experr experr AT_CHECK([[blame -V3 $testdir/keywords,v]], 0, expout, experr) AT_CHECK([[blame --version=3 $testdir/keywords,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Emulating RCS version 4]) AT_KEYWORDS([version]) AT_KEYWORDS([log]) cat < expout 1.1 (username 01-Jan-01): \$Author: username \$ 1.1 (username 01-Jan-01): \$Date: 2001/01/01 01:01:01 \$ 1.1 (username 01-Jan-01): \$Header: $testdir/keywords,v 1.1 2001/01/01 01:01:01 username Exp Locker: username \$ 1.1 (username 01-Jan-01): \$Id: keywords,v 1.1 2001/01/01 01:01:01 username Exp Locker: username \$ 1.1 (username 01-Jan-01): \$Locker: username \$ 1.1 (username 01-Jan-01): \$Log: keywords,v \$ 1.1 (username 01-Jan-01): # Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): # Initial revision 1.1 (username 01-Jan-01): #$space 1.1 (username 01-Jan-01): \$Name: \$ 1.1 (username 01-Jan-01): \$RCSfile: keywords,v \$ 1.1 (username 01-Jan-01): \$Revision: 1.1 \$ 1.1 (username 01-Jan-01): \$Source: $testdir/keywords,v \$ 1.1 (username 01-Jan-01): \$State: Exp \$ EOF cp $testdir/keywords.experr experr AT_CHECK([[blame -V4 $testdir/keywords,v]], 0, expout, experr) AT_CHECK([[blame --version=4 $testdir/keywords,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Emulating RCS version 5]) AT_KEYWORDS([version]) AT_KEYWORDS([log]) cat < expout 1.1 (username 01-Jan-01): \$Author: username \$ 1.1 (username 01-Jan-01): \$Date: 2001/01/01 01:01:01 \$ 1.1 (username 01-Jan-01): \$Header: $testdir/keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ 1.1 (username 01-Jan-01): \$Id: keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ 1.1 (username 01-Jan-01): \$Locker: \$ 1.1 (username 01-Jan-01): \$Log: keywords,v \$ 1.1 (username 01-Jan-01): Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): Initial revision 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): \$Name: \$ 1.1 (username 01-Jan-01): \$RCSfile: keywords,v \$ 1.1 (username 01-Jan-01): \$Revision: 1.1 \$ 1.1 (username 01-Jan-01): \$Source: $testdir/keywords,v \$ 1.1 (username 01-Jan-01): \$State: Exp \$ EOF cp $testdir/keywords.experr experr AT_CHECK([[blame -V5 $testdir/keywords,v]], 0, expout, experr) AT_CHECK([[blame --version=5 $testdir/keywords,v]], 0, expout, experr) AT_CLEANUP blame-1.3.1/tests/rcsinit.at0000664000076400007640000000165010144372724012700 00000000000000AT_BANNER([[RCSINIT environment variable support.]]) AT_SETUP([Empty RCSINIT]) AT_KEYWORDS([rcsinit]) AT_KEYWORDS([rev]) AT_KEYWORDS([state]) cp $testdir/complex-3.4.expout expout cp $testdir/complex.experr experr AT_CHECK([[RCSINIT= blame -r3.4 -sA $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([RCSINIT with options]) AT_KEYWORDS([rcsinit]) AT_KEYWORDS([rev]) AT_KEYWORDS([state]) cp $testdir/complex-3.4.expout expout cp $testdir/complex.experr experr AT_CHECK([[RCSINIT='-r3.4 -sA' blame $testdir/complex,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([RCSINIT with invalid options]) AT_KEYWORDS([rcsinit]) AT_KEYWORDS([errors]) AT_CHECK([[RCSINIT='--foo' blame]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([RCSINIT with a filename]) AT_KEYWORDS([rcsinit]) cp $testdir/complex-3.8.expout expout cp $testdir/complex.experr experr AT_CHECK([[RCSINIT="$testdir/complex,v" blame]], 0, expout, experr) AT_CLEANUP blame-1.3.1/tests/expand.at0000664000076400007640000002001410144371756012503 00000000000000AT_BANNER([[-k and --expand options.]]) AT_SETUP([Default substitutions]) AT_KEYWORDS([expand]) AT_KEYWORDS([log]) cat < expout 1.1 (username 01-Jan-01): \$Author: username \$ 1.1 (username 01-Jan-01): \$Date: 2001/01/01 01:01:01 \$ 1.1 (username 01-Jan-01): \$Header: $testdir/keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ 1.1 (username 01-Jan-01): \$Id: keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ 1.1 (username 01-Jan-01): \$Locker: \$ 1.1 (username 01-Jan-01): \$Log: keywords,v \$ 1.1 (username 01-Jan-01): Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): Initial revision 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): \$Name: \$ 1.1 (username 01-Jan-01): \$RCSfile: keywords,v \$ 1.1 (username 01-Jan-01): \$Revision: 1.1 \$ 1.1 (username 01-Jan-01): \$Source: $testdir/keywords,v \$ 1.1 (username 01-Jan-01): \$State: Exp \$ EOF cp $testdir/keywords.experr experr AT_CHECK([[blame $testdir/keywords,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Default substitutions, with timezone]) AT_KEYWORDS([expand]) AT_KEYWORDS([log]) cat < expout 1.1 (username 01-Jan-01): \$Author: username \$ 1.1 (username 01-Jan-01): \$Date: 2000-12-31 20:01:01-05 \$ 1.1 (username 01-Jan-01): \$Header: $testdir/keywords,v 1.1 2000-12-31 20:01:01-05 username Exp \$ 1.1 (username 01-Jan-01): \$Id: keywords,v 1.1 2000-12-31 20:01:01-05 username Exp \$ 1.1 (username 01-Jan-01): \$Locker: \$ 1.1 (username 01-Jan-01): \$Log: keywords,v \$ 1.1 (username 01-Jan-01): Revision 1.1 2000-12-31 20:01:01-05 username 1.1 (username 01-Jan-01): Initial revision 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): \$Name: \$ 1.1 (username 01-Jan-01): \$RCSfile: keywords,v \$ 1.1 (username 01-Jan-01): \$Revision: 1.1 \$ 1.1 (username 01-Jan-01): \$Source: $testdir/keywords,v \$ 1.1 (username 01-Jan-01): \$State: Exp \$ EOF cp $testdir/keywords.experr experr AT_CHECK([[blame -zEST $testdir/keywords,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Missing keyword substitution argument]) AT_KEYWORDS([expand]) AT_KEYWORDS([errors]) AT_CHECK([[blame $testdir/keywords,v -k]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP AT_SETUP([Keys and values (-kkv)]) AT_KEYWORDS([expand]) AT_KEYWORDS([log]) cat < expout 1.1 (username 01-Jan-01): \$Author: username \$ 1.1 (username 01-Jan-01): \$Date: 2001/01/01 01:01:01 \$ 1.1 (username 01-Jan-01): \$Header: $testdir/keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ 1.1 (username 01-Jan-01): \$Id: keywords,v 1.1 2001/01/01 01:01:01 username Exp \$ 1.1 (username 01-Jan-01): \$Locker: \$ 1.1 (username 01-Jan-01): \$Log: keywords,v \$ 1.1 (username 01-Jan-01): Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): Initial revision 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): \$Name: \$ 1.1 (username 01-Jan-01): \$RCSfile: keywords,v \$ 1.1 (username 01-Jan-01): \$Revision: 1.1 \$ 1.1 (username 01-Jan-01): \$Source: $testdir/keywords,v \$ 1.1 (username 01-Jan-01): \$State: Exp \$ EOF cp $testdir/keywords.experr experr AT_CHECK([[blame -kkv $testdir/keywords,v]], 0, expout, experr) AT_CHECK([[blame --expand=kv $testdir/keywords,v]], 0, expout, experr) AT_CHECK([[blame --expand kv $testdir/keywords,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Keys, values and locker (-kkvl)]) AT_KEYWORDS([expand]) AT_KEYWORDS([log]) cat < expout 1.1 (username 01-Jan-01): \$Author: username \$ 1.1 (username 01-Jan-01): \$Date: 2001/01/01 01:01:01 \$ 1.1 (username 01-Jan-01): \$Header: $testdir/keywords,v 1.1 2001/01/01 01:01:01 username Exp username \$ 1.1 (username 01-Jan-01): \$Id: keywords,v 1.1 2001/01/01 01:01:01 username Exp username \$ 1.1 (username 01-Jan-01): \$Locker: username \$ 1.1 (username 01-Jan-01): \$Log: keywords,v \$ 1.1 (username 01-Jan-01): Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): Initial revision 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): \$Name: \$ 1.1 (username 01-Jan-01): \$RCSfile: keywords,v \$ 1.1 (username 01-Jan-01): \$Revision: 1.1 \$ 1.1 (username 01-Jan-01): \$Source: $testdir/keywords,v \$ 1.1 (username 01-Jan-01): \$State: Exp \$ EOF cp $testdir/keywords.experr experr AT_CHECK([[blame -kkvl $testdir/keywords,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Keys only (-kk)]) AT_KEYWORDS([expand]) AT_KEYWORDS([log]) cat < expout 1.1 (username 01-Jan-01): \$Author\$ 1.1 (username 01-Jan-01): \$Date\$ 1.1 (username 01-Jan-01): \$Header\$ 1.1 (username 01-Jan-01): \$Id\$ 1.1 (username 01-Jan-01): \$Locker\$ 1.1 (username 01-Jan-01): \$Log\$ 1.1 (username 01-Jan-01): Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): Initial revision 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): \$Name\$ 1.1 (username 01-Jan-01): \$RCSfile\$ 1.1 (username 01-Jan-01): \$Revision\$ 1.1 (username 01-Jan-01): \$Source\$ 1.1 (username 01-Jan-01): \$State\$ EOF cp $testdir/keywords.experr experr AT_CHECK([[blame -kk $testdir/keywords,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Old keywords strings (-ko)]) AT_KEYWORDS([expand]) AT_KEYWORDS([log]) cat < expout 1.1 (username 01-Jan-01): \$Author\$ 1.1 (username 01-Jan-01): \$Date\$ 1.1 (username 01-Jan-01): \$Header\$ 1.1 (username 01-Jan-01): \$Id\$ 1.1 (username 01-Jan-01): \$Locker\$ 1.1 (username 01-Jan-01): \$Log\$ 1.1 (username 01-Jan-01): \$Name\$ 1.1 (username 01-Jan-01): \$RCSfile\$ 1.1 (username 01-Jan-01): \$Revision\$ 1.1 (username 01-Jan-01): \$Source\$ 1.1 (username 01-Jan-01): \$State\$ EOF cp $testdir/keywords.experr experr AT_CHECK([[blame -ko $testdir/keywords,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Binary image of old keywords strings (-kb)]) AT_KEYWORDS([expand]) AT_KEYWORDS([log]) cat < expout 1.1 (username 01-Jan-01): \$Author\$ 1.1 (username 01-Jan-01): \$Date\$ 1.1 (username 01-Jan-01): \$Header\$ 1.1 (username 01-Jan-01): \$Id\$ 1.1 (username 01-Jan-01): \$Locker\$ 1.1 (username 01-Jan-01): \$Log\$ 1.1 (username 01-Jan-01): \$Name\$ 1.1 (username 01-Jan-01): \$RCSfile\$ 1.1 (username 01-Jan-01): \$Revision\$ 1.1 (username 01-Jan-01): \$Source\$ 1.1 (username 01-Jan-01): \$State\$ EOF cp $testdir/keywords.experr experr AT_CHECK([[blame -kb $testdir/keywords,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Values only (-kv)]) AT_KEYWORDS([expand]) AT_KEYWORDS([log]) cat < expout 1.1 (username 01-Jan-01): username 1.1 (username 01-Jan-01): 2001/01/01 01:01:01 1.1 (username 01-Jan-01): $testdir/keywords,v 1.1 2001/01/01 01:01:01 username Exp 1.1 (username 01-Jan-01): keywords,v 1.1 2001/01/01 01:01:01 username Exp 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): keywords,v 1.1 (username 01-Jan-01): Revision 1.1 2001/01/01 01:01:01 username 1.1 (username 01-Jan-01): Initial revision 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01):$space 1.1 (username 01-Jan-01): keywords,v 1.1 (username 01-Jan-01): 1.1 1.1 (username 01-Jan-01): $testdir/keywords,v 1.1 (username 01-Jan-01): Exp EOF cp $testdir/keywords.experr experr AT_CHECK([[blame -kv $testdir/keywords,v]], 0, expout, experr) AT_CLEANUP AT_SETUP([Multiple substitution types]) AT_KEYWORDS([expand]) AT_KEYWORDS([errors]) AT_CHECK([[blame -ko -kkvl $testdir/simple,v]], 1, , stderr) MAC_CHECK_STDERR AT_CLEANUP blame-1.3.1/ChangeLog0000644000076400007640000003550510531540025011302 000000000000002006-11-23 Michael Chapman * Makefile.am: Use mock, not mockbuild * Released 1.3.1 2006-11-20 Michael Chapman * author.at: Fix test when current username is longer than 8 characters. * Makefile.am: New mockbuild targets -- build against fc4/fc5/fc6. 2006-11-19 Michael Chapman * blame.spec.in: Add disttag. * date.c (undefine, date_parse): Fix warnings. * system.h (SALLOC): Take the string length without the null-terminator. * keyword.c (_keyword_unescape, _keyword_escape): Fix calls to SALLOC. * system.h (SREALLOC): New macro. * rcs.c (_rcs_find_rev): Use it. * config.sub: Added. * Resync with gnulib. base_name now returns a newly malloced string. * configure.ac: Define GNULIB_ARGP_DISABLE_DIRNAME, because argp leaks memory with the new base_name. * util.c (does_working_filename_match_rcs_filename, find_matching_rcs_filename, find_matching_working_filename): Various base_name memory leak cleanups. * atlocal.in: Use special error code for valgrind errors. * testsuite.at (MAC_CHECK_STDERR): Catch valgrind errors. * argv.at, working.at: Remember to check stderr on every failure. 2005-12-02 Michael Chapman * Released 1.3 2005-11-18 Michael Chapman * keyword.c (_keyword_shrink_output, keyword_annotate): Don't explicitly use unlocked IO calls since this is handled by gnulib. * keyword.c (keyword_annotate): Use fputs where possible. * keyword.c (keyword_annotate): Fix handling of @ symbols within $-delimited text ranges. * working.at: New test. * More testdata for new test. * Resync with gnulib. * configure.ac: Remove gl_* calls that are handled by gnulib internally). 2005-06-30 Michael Chapman * keyword.c (_keyword_shrink_output, keyword_annotate): Use unlocked IO. * system.h: Include unlocked-io.h. * branch.at: Spelling fix. * Released 1.2. 2005-06-29 Michael Chapman * blame.c (annotate_revision, annotate, parse_options, main), configure.ac, atlocal.in: Add fastexit support. * blame.c (annotate_revision), date.c (date_sprintf_prefix), keyword.c (keyword_annotate): Malloc less often by outputting on the fly. 2005-06-28 Michael Chapman * src/Makefile.am (AM_LFLAGS): Add -8. * rcs.at: New test. * blame.c (annotate_revision): Rework last-line handling. * Fix last-line handling testdata. * Resync with gnulib. * configure.ac (gl_MODULES): Update list. 2005-06-17 Michael Chapman * author.at: Don't use substring expansion. * Resync with gnulib. * configure.ac (gl_MODULES): Update list. 2004-11-25 Michael Chapman * Released 1.1. 2004-11-24 Michael Chapman * Said GCC 3.4 bugs weren't actually bugs. * Remove function attributes -- they're too dangerous! * blame.spec.in (%build): Run tests after build. 2004-11-23 Michael Chapman * Resync with gnulib... * getopt_.h (__need_getopt, __getopt_argv_const), getopt.m4 (gl_GETOPT): ... and remove local fixes. * tests/blame: Replace ${1+"$@"}, so that Zsh (such as on Mac OS X) works. * keyword.c (keyword_expand): Work around "cast used as lvalue" warning. * hash.c (_hash_entry_new): Remove useless assertion. * Released 1.0. * Rebuild RPM with -mtune=i386 to work around GCC 3.4 bugs. 2004-11-20 Michael Chapman * Resync with gnulib... * getopt_.h (__need_getopt, __getopt_argv_const), getopt.m4 (gl_GETOPT): ... modulo some fixes. * configure.ac (RELEASE): Bump release number. 2004-11-18 Michael Chapman * blame.c (parse_options): Fix ordering of options in --help. 2004-11-14 Michael Chapman * lines.c (lines_apply): Handle a delta text without an empty last line properly. Bug discovered by Bob Proulx . * rcs.at: Check the bug doesn't happen again. * More testdata for new test. 2004-11-11 Michael Chapman * branch.at: Fix duplicated test. * Released 0.3. 2004-11-10 Michael Chapman * argv.at: -V output has changed. * blame.c (parse_options): Store the correct version in rcs_emulation. * date.c (date_parse), keyword.c (_keyword_escape, keyword_expand): Emulate old RCS versions. * rcs.h (_rcs): Comment prefix in RCS files is now used. * log.at, version.at: New tests. * More testdata for new tests. * blame.1: Documentation update. 2004-11-09 Michael Chapman * blame.c: Parse -V[VER] and --version[=VER] (but the result is not used yet). 2004-11-08 Michael Chapman * doc/blame.1: Initial cut of manpage. 2004-11-07 Michael Chapman * blame.c (parse_options, main): Use $RCSINIT environment variable. * rcsinit.at, testsuite.at: New tests. * Resync with gnulib. 2004-10-23 Michael Chapman * blame.c (main): s/TAG/REV/, and make --rev an alias for --revision. 2004-10-22 Michael Chapman * configure.ac (RELEASE): Bump release number. * README: Turn "Known Issues" into "Getting Help" -- it didn't describe any actual known issues... 2004-10-21 Michael Chapman * lexer.l, parser.y: No need for a pure parser. * configure.ac (AC_INIT): Use my Sourceforge email address. * Released 0.2. 2004-10-20 Michael Chapman * configure.ac (gl_MODULES): Update list. * parser.y (deltatext): Move declaration of delta to top of block. * blame.c (annotate), lines.c (lines_append_nocopy), system.h (OINIT, OALLOC, _OALLOC, OFREEALL): Use obstacks to allocate lines. * blame.c (main): Set program_name from argv[0]. 2004-10-19 Michael Chapman * Major reworking of memory management. Profiling showed that most time was spent in redundant memory movement. By mmapping the file into we can form pointers to interesting bits of it, rather than copying the interesting bits in the lexer. Using a private mmap means we can modify it by strategically placing '\0' characters in it. This also means many of the program's data structures no longer need to concern themselves with memory management. * The algorithm to apply deltas has been modified to be far more efficient. The line buffer is memcpy'ed at most once during a single lines_apply call. No memory is malloced or freed at all during the entire annotation run. * configure.ac: Add -fprofile-arcs -ftest-coverage for profiling. * src/Makefile.am (AM_LFLAGS): Add -f. * llist.c, llist.h: Removed. * Globally replace llist with vector. * Scrap vector iterators. * vector.c (vector_insert, vector_insert_nocopy, vector_remove): Functions not used any more (because of dedicated vector handling for line buffers in lines.c). * vector.c (vector_append_nocopy), vector.h (vector_append): New functions. * blame.c (annotate_revision): Always exit function at the bottom. * blame.c (annotate_revision): Copy rev so that it can be modified on the fly. Use pointer comparisons rather than string comparisons wherever possible. * rcs.c (rcs_parse): Mmap the input file and pass the buffer to the lexer. * delta.c, delta.h: Point to locations in mmapped file rather than using duplicates. * delta.h (for_each_branch_base): A delta may not have a branch hash. * lines.c, lines.h: Almost a complete rewrite. Shrink amount to memcpy as much as possible, by reading and writing different line buffers. Text is pointers into mmapped file. * blame.c (annotate_revision): Use spare line buffer, swapping with current buffer after applying each delta. * lexer.l: Rework rules to grab as much as possible per yylex call. * parser.y: Use pointers into mmapped file. * keyword.c (_keyword_append_mem): Handle @@ -> @ conversion here, rather than the lexer. * blame.c (annotate): When extracting a revision from a working file, ensure it is valid. * blame.c (parse_options), data.h, hash.c, hash.h: Make NULL/NULL be no-op dup and free functions; explicitly use string_dup/string_free for the old behaviour. * pairing.at, working.at: New tests. * More testdata for new tests. * Resync with gnulib. 2004-10-08 Michael Chapman * system.h (ALLOCA): New macro. * blame.c (annotate_revision): Make prefix an auto variable. * keyword.c (keyword_extract_revision): Allocate buffer on stack. * lines.c (lines_new): Allocate ll on stack. * Resync with gnulib. * configure.ac (RELEASE): Bump release number. 2004-09-28 Michael Chapman * date.c (date_sprintf), system.h (_UNUSED, _UNUSED_LABEL): Split macros up. * configure.ac (RELEASE): Bump release number. * date.c (date_parse_rev): Handle old RCS files with dates before year 2000. Original patch from Mats Kronberg . 2004-09-27 Michael Chapman * util.c (does_working_filename_match_rcs_filename) (find_matching_rcs_filename, find_matching_working_filename): Use the gnulib-supplied base_name. * rcs.c (rcs_parse): Call canonicalize_file_name and base_name directly. * fs.c, fs.h: Removed -- no longer used. * Released 0.1. 2004-09-26 Michael Chapman * blame.c (main): Change assignments to argp_program_version and argp_program_bug_address to global variable definitions, so that picky linkers don't complain about undefined symbols. * atlocal.in: Replace computing $testdir with an experimental test. This automatically resolves ".", ".." and symlinks all at once. * *.at: Check that stderr is not empty when it shouldn't be. * rev.at, branch.at: New tests. * More testdata for new tests. * blame.c (annotate_revision), date.c (_date_parse_decimal, date_parse_zone, parse_pattern_letter) (date_parse), lines.c (lines_apply), rcs.c (_isidchar, rcs_rev_is_valid, rcs_branch_is_valid), system.h (ISALNUM, ISALPHA, ISDIGIT, ISGRAPH, ISSPACE): Explicitly cast argument to all character classification functions, since they're macros with a subscript lookup on some platforms. * rcs.c (_rcs_get_base, _rcs_find_rev, _rcs_find_rev_before) (rcs_resolve_tag): Move error messages deeper down. 2004-09-25 Michael Chapman * src/Makefile.am [GCC] (AM_CFLAGS): More aggressive warnings. * blame.c (main): Assign parser.options at run-time, since it's value isn't known at compile-time. * blame.c (main), date.c: End all struct initializers properly. * date.c (parse_pattern_letter): Remove assertion that am and pm differ (it generates too much for older CPP implementations). Use AM/PM if the locale doesn't have its own values. * parser.y (rcstext): Cast count to unsigned when comparing. * system.h (UNUSED, PURE, MALLOC, NONNULL, NONNULL_PARAMS): New macros. * delta.h (delta_ref_free): Mark delta with UNUSED. * parser.y (yyerror): Mark rcs with UNUSED. * src/*.h: Mark functions with appropriate attributes. * rcs.c (rcs_resolve_tag): Add zone_offset parameter. Use it when formatting error messages containing dates. * mixed.at: Added expout for tests that should succeed. * date.c (date_sprintf): Handle missing tm_gmtoff member. * date.c (date_sprintf_prefix): UTC time not local time. I think. * m4/langinfo.m4, date.c (_date_parse_decimal): Use RADIXCHAR instead of DECIMAL_POINT, if the latter is not found. * atlocal.in: Make $testdir sed script work on Sparc. * author.at : Build a replacement string for $username that's exactly 8 characters long. 2004-09-24 Michael Chapman * atlocal.in: Normalize $testdir. * parser.y (_parser_count_deltalist, rcstext), rcs.c (rcs_free, _rcs_get_base, _revcmp, _rcs_find_rev_before) (rcs_resolve_tag), rcs.h (rcs_t): Build trunk branches. * argv.at, author.at, date.at, expand.at, rev.at, state.at, suffixes.at, testsuite.at: Copy expected output/errors into expout/experr rather than using M4 macro. * mixed.at: New tests. * tests/atlocal.in, tests/blame, tests/Makefile.am, configure.at (AC_CONFIG_TESTDIR): Provide a way to pass tests through valgrind. * Resync with gnulib. * rcs.c (rcs_resolve_tag): Error if a tag is resolved but the date is too late. * blame.c (parse_options): Error on multiple keyword substituion types. 2004-09-23 Michael Chapman * date.c (_date_parse_decimal): Bugfixes. * argv.at, rev.at, date.at: Extended tests. * date.at, author.at, state.at, expand.at, suffixes.at: New tests. * More testdata for new tests. * configure.ac blame.spec.in: Use NEWS as the AC_SUBST_FILE variable. * configure.ac: Determine directory separator differently. * dirsep.m4: Removed. * blame.c, system.h, util.c: Use different directory separator. * util.c: Fix broken suffix parsing. * keyword.c (keyword_expand): Colon should be output only if both key and value are to be output. 2004-09-22 Michael Chapman * Resync with gnulib. * configure.ac (gl_MODULES): Add getline and setenv. * configure.ac (gl_AC_TYPE_UINTMAX_T): Needed by lib/canonicalize.c. * date.c, lexer.l, system.h, working.c: Add #includes for gnulib headers. * blame.c (program_name): Needed by lib/error.c. * vector.h (vector_t): Use unsigned int rather than u_int32_t. * tests/*, tests/testdata/*: Added test directory. * argv.at, rev.at, date.at: Added tests. 2004-09-21 Michael Chapman * blame.c (annotate_revision): Command-line keyword expansion overrides the RCS file's default. * parser.y (admin_expand): Free $2 after parsing it. * keyword.c (keyword_expand): Add support for Locker keyword. * rcs.c rcs.h (rcs_get_locker): Added. * fs.c (fs_get_short_name): strdup the return value. * Convert ALLOC to CALLOC/MALLOC/SALLOC variants. * Resync with gnulib. * configure.ac (gl_LIB): Now defined by gnulib * configure.ac (AC_SYS_LONG_FILE_NAMES): Needed by lib/same.c 2004-09-20 Michael Chapman * configure.ac, Makefile.am: Use GCC Automake conditional to control whether -Wno-format-y2k is used. * keyword.c (_keyword_append_mem): Preallocate 32 extra bytes at a time. * More comments! 2004-09-19 Michael Chapman * Comments! 2004-09-18 Michael Chapman * ChangeLog, NEWS, rsxs.spec.in: Added. * configure.ac: Use gnulib. 2004-09-04 Michael Chapman * Initial lexer/parser for Blame. blame-1.3.1/blame.spec0000644000076400007640000000414310531540134011457 00000000000000Summary: An RCS file annotator Name: blame Version: 1.3.1 Release: 1%{?dist} License: GPL Version 2 Group: Development/Tools Source0: %{name}-%{version}.tar.gz URL: http://blame.sourceforge.net/ Vendor: Michael Chapman Packager: Michael Chapman BuildRoot: %{_tmppath}/%{name}-%{version}-root Prefix: %{_prefix} %description Blame displays the last modification for each line in an RCS file. It is the RCS equivalent of CVS's "annotate" command. %prep %setup %build %{configure} %{__make} %{__make} check %install %{makeinstall} %clean if test "$RPM_BUILD_ROOT" != "/"; then %{__rm} -rf $RPM_BUILD_ROOT fi %files %defattr(-,root,root) %doc AUTHORS COPYING ChangeLog INSTALL NEWS README %{_bindir}/* %{_mandir}/*/* %changelog * Thu Nov 23 2006 Michael Chapman 1.3.1-1 - Gnulib updates. - Rebuilt for fc4/fc5/fc6. * Fri Dec 02 2005 Michael Chapman 1.3-1 - Minor bugfixes. * Thu Jun 30 2005 Michael Chapman 1.2-1 - Minor bugfixes. * Thu Nov 24 2004 Michael Chapman 1.1-1 - Rebuilt. * Thu Nov 24 2004 Michael Chapman 1.0-3 - Said gcc 3.4 bugs weren't actually bugs. * Thu Nov 23 2004 Michael Chapman 1.0-2 - Rebuild RPM with -mtune=i386 to work around gcc 3.4 bugs. * Thu Nov 23 2004 Michael Chapman 1.0-1 - Stable release. * Thu Nov 20 2004 Michael Chapman 0.3-2 - Fixed bug involving delta texts without empty last lines. - Fixed --help output. * Thu Nov 11 2004 Michael Chapman 0.3-1 - Support for $RCSINIT environment variable. - Support for -V and --version to emulate old RCS versions. - Minor bugfixes. - Added manpage. * Thu Oct 21 2004 Michael Chapman 0.2-1 - Major speed improvements. * Tue Sep 28 2004 Michael Chapman 0.1-2 - Fixed build for old Red Hat. * Mon Sep 27 2004 Michael Chapman 0.1-1 - Initial RPM release. blame-1.3.1/depcomp0000775000076400007640000003477110125542443011120 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2003-11-08.23 # Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit 0 ;; -v | --v*) echo "depcomp $scriptversion" exit 0 ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: blame-1.3.1/config.guess0000664000076400007640000012502010125542443012044 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2004-03-03' # 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 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pegasos:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha*:OpenVMS:*:*) echo alpha-hp-vms exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` # GNU/KFreeBSD systems have a "k" prefix to indicate we are using # FreeBSD's kernel, but not the complete OS. case ${LIBC} in gnu) kernel_only='k' ;; esac echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: blame-1.3.1/doc/0000777000076400007640000000000010531540135010353 500000000000000blame-1.3.1/doc/Makefile.in0000644000076400007640000003303410531540110012330 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Process this file with automake to produce a Makefile. srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/allocsa.m4 \ $(top_srcdir)/m4/argp.m4 $(top_srcdir)/m4/calloc.m4 \ $(top_srcdir)/m4/canonicalize.m4 \ $(top_srcdir)/m4/cycle-check.m4 $(top_srcdir)/m4/d-ino.m4 \ $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ $(top_srcdir)/m4/double-slash-root.m4 \ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/eoverflow.m4 \ $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exitfail.m4 \ $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/filenamecat.m4 \ $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/getcwd-abort-bug.m4 \ $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ $(top_srcdir)/m4/getdelim.m4 $(top_srcdir)/m4/getline.m4 \ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/inline.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ $(top_srcdir)/m4/langinfo.m4 $(top_srcdir)/m4/longdouble.m4 \ $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memcmp.m4 \ $(top_srcdir)/m4/memcpy.m4 $(top_srcdir)/m4/memmove.m4 \ $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memset.m4 \ $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mktime.m4 \ $(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/pathmax.m4 \ $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/setenv.m4 \ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/ssize_t.m4 \ $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stdint.m4 \ $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcase.m4 \ $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \ $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strpbrk.m4 \ $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtol.m4 \ $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ $(top_srcdir)/m4/sysexits.m4 $(top_srcdir)/m4/time_r.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/tzset.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/unistd_h.m4 \ $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vsnprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \ $(top_srcdir)/m4/xreadlink.m4 $(top_srcdir)/m4/xsize.m4 \ $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(dist_man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ FASTEXIT = @FASTEXIT@ FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR = @FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR@ GCC_FALSE = @GCC_FALSE@ GCC_TRUE = @GCC_TRUE@ GETOPT_H = @GETOPT_H@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ 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_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE__BOOL = @HAVE__BOOL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBMISC_LIBDEPS = @LIBMISC_LIBDEPS@ LIBMISC_LTLIBDEPS = @LIBMISC_LTLIBDEPS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYSEXITS_H = @SYSEXITS_H@ SYS_STAT_H = @SYS_STAT_H@ U = @U@ UNISTD_H = @UNISTD_H@ VERSION = @VERSION@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ dist_man_MANS = blame.1 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh uninstall-info-am: install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-man install-exec-am: install-info: install-info-am install-man: install-man1 installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-man uninstall-man: uninstall-man1 .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-man1 install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-info-am uninstall-man uninstall-man1 # 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. .NOEXPORT: blame-1.3.1/doc/Makefile.am0000664000076400007640000000012210143642753012330 00000000000000# Process this file with automake to produce a Makefile. dist_man_MANS = blame.1 blame-1.3.1/doc/blame.10000644000076400007640000002016110260750142011431 00000000000000.de Id .ds Rv \\$3 .ds Dt \\$4 .. .Id $Id: blame.1,v 1.3 2005/06/30 10:58:42 foonly Exp $ .ds b \fBblame\fP .ds i \&\s-1ISO\s0 .ds r \&\s-1RCS\s0 .ds u \&\s-1UTC\s0 .TH BLAME 1 \*(Dt "" "" .SH NAME \*b \- annotate RCS files .SH SYNOPSIS .B \*b .RI [ options ] " file " .\|.\|. .SH DESCRIPTION .B \*b outputs an annotated revision from each \*r file. An annotated RCS file describes the revision and date in which each line was added to the file, and the author of each line. .PP Pathnames matching an \*r suffix denote \*r files; all others denote working files. Names are paired as explained in .BR ci (1). .PP A revision is selected by options for revision or branch number, checkin date/time, author, or state. When the selection options are applied in combination, .B \*b retrieves the latest revision that satisfies all of them. If none of the selection options is specified, .B \*b retrieves the latest revision on the default branch (normally the trunk, see the .B \-b option of .BR rcs (1)). The options .BR "\-d " ( \-\^\-date ), .BR "\-s " ( \-\^\-state ), and .BR "\-w " ( \-\^\-author ) retrieve from a single branch, the .I selected branch, which is specified by .BR "\-r " ( \-\-revision ), or the default branch. .PP .B \*b always performs keyword substitution (see .SM "KEYWORD SUBSTITUTION" in .BR co (1)). .SH OPTIONS .TP .BR \-r ", " \-\^\-revision "[=\fIrev\fP]" Retrieves the latest revision whose number is less than or equal to .IR rev . If .I rev indicates a branch rather than a revision, the latest revision on that branch is retrieved. If .I rev is omitted, the latest revision on the default branch (see the .B \-b option of .BR rcs (1)) is annotated. If .I rev is .BR $ , .B \*b determines the revision number from keyword values in the working file. Otherwise, a revision is composed of one or more numeric or symbolic fields separated by periods. If .I rev begins with a period, then the default branch (normally the trunk) is prepended to it. If .I rev is a branch number followed by a period, then the latest revision on that branch is used. The numeric equivalent of a symbolic field is specified with the .B \-n option of the commands .BR ci (1) and .BR rcs (1). .TP .BR \-kkv ", " \-\^\-expand "=kv" Generate keyword strings using the default form, e.g.\& .B "$\&Revision: \*(Rv $" for the .B Revision keyword. This is the default. .TP .BR \-kkvl ", " \-\^\-expand "=kvl" Like .BR \-kkv , except that a locker's name is inserted into the value of the .BR Header , .BR Id , and .B Locker keyword strings if the given revision is currently locked. .TP .BR \-kk ", " \-\^\-expand "=k" Generate only keyword names in keyword strings; omit their values. See .SM "KEYWORD SUBSTITUTION" in .BR co (1). For example, for the .B Revision keyword, generate the string .B $\&Revision$ instead of .BR "$\&Revision: \*(Rv $" . Log messages are inserted after .B $\&Log$ keywords even if this option is specified. .TP .BR \-ko ", " \-\^\-expand "=o" Generate the old keyword string, present in the working file just before it was checked in. For example, for the .B Revision keyword, generate the string .B "$\&Revision: 1.1 $" instead of .B "$\&Revision: \*(Rv $" if that is how the string appeared when the file was checked in. .TP .BR \-kb ", " \-\^\-expand "=b" Generate a binary image of the old keyword string. This acts like .BR \-ko , except it performs all working file input and output in binary mode. This makes little difference on Posix and Unix hosts. .TP .BR \-kv ", " \-\^\-expand "=v" Generate only keyword values for keyword strings. For example, for the .B Revision keyword, generate the string .B \*(Rv instead of .BR "$\&Revision: \*(Rv $" . .TP .BR \-d ", " \-\^\-date "=\fIdate\fP" Retrieves the latest revision on the selected branch whose checkin date/time is less than or equal to .IR date . The date and time can be given in free format. The time zone .B LT stands for local time; other common time zone names are understood. For example, the following .IR date s are equivalent if local time is January 11, 1990, 8pm Pacific Standard Time, eight hours west of Coordinated Universal Time (\*u): .RS .LP .RS .nf .ta \w'\f3Thu, 11 Jan 1990 20:00:00 \-0800\fP 'u .ne 10 \f38:00 pm lt\fP \f34:00 AM, Jan. 12, 1990\fP default is \*u \f31990-01-12 04:00:00+00\fP \*i 8601 (\*u) \f31990-01-11 20:00:00\-08\fP \*i 8601 (local time) \f31990/01/12 04:00:00\fP traditional \*r format \f3Thu Jan 11 20:00:00 1990 LT\fP output of \f3ctime\fP(3) + \f3LT\fP \f3Thu Jan 11 20:00:00 PST 1990\fP output of \f3date\fP(1) \f3Fri Jan 12 04:00:00 GMT 1990\fP \f3Thu, 11 Jan 1990 20:00:00 \-0800\fP Internet RFC 822 \f312-January-1990, 04:00 WET\fP .ta 4n +4n +4n +4n .fi .RE .LP Most fields in the date and time can be defaulted. The default time zone is normally \*u, but this can be overridden by the .B \-z option. The other defaults are determined in the order year, month, day, hour, minute, and second (most to least significant). At least one of these fields must be provided. For omitted fields that are of higher significance than the highest provided field, the time zone's current values are assumed. For all other omitted fields, the lowest possible values are assumed. For example, without .BR \-z , the date .B "20, 10:30" defaults to 10:30:00 \*u of the 20th of the \*u time zone's current month and year. The date/time must be quoted if it contains spaces. .RE .TP .BR \-s ", " \-\^\-state "=\fIstate\fP" Retrieves the latest revision on the selected branch whose state is set to .IR state . .TP .BR \-w ", " \-\^\-login "[=\fIlogin\fP]" Retrieves the latest revision on the selected branch which was checked in by the user with login name .IR login . If the argument .I login is omitted, the caller's login is assumed. .TP .BR \-V ", " \-\^\-version "[=\fIver\fP]" If no argument is supplied, print \*b's version number, and the version of \*r it emulates by default. Otherwise emulate the specified version. See .BR co (1) for details. .TP .BR \-x ", " \-\^\-suffixes "=\fIsuffixes\fP" Use .I suffixes to characterize \*r files. See .BR ci (1) for details. .TP .BR \-z ", " \-\^\-zone "=\fIzone\fP" Specifies the date output format in keyword substitution, and specifies the default time zone for .I date in the .BI \-d date option. The .I zone should be empty, a numeric \*u offset, or the special string .B LT for local time. The default is an empty .IR zone , which uses the traditional \*r format of \*u without any time zone indication and with slashes separating the parts of the date; otherwise, times are output in \*i 8601 format with time zone indication. For example, if local time is January 11, 1990, 8pm Pacific Standard Time, eight hours west of \*u, then the time is output as follows: .RS .LP .RS .nf .ta \w'\f3\-z+05:30\fP 'u +\w'\f31990-01-11 09:30:00+05:30\fP 'u .ne 4 \f2option\fP \f2time output\fP \f3\-z\fP \f31990/01/12 04:00:00\fP \f2(default)\fP \f3\-zLT\fP \f31990-01-11 20:00:00\-08\fP \f3\-z+05:30\fP \f31990-01-12 09:30:00+05:30\fP .ta 4n +4n +4n +4n .fi .RE .RE .SH "KEYWORD SUBSTITUION" Strings of the form .BI $ keyword $ and .BI $ keyword : .\|.\|. $ embedded in the text are replaced with strings of the form .BI $ keyword : value $ as described in .BR co (1). .SH FILES \*b never changes an \*r or working file. It uses the effective user for all accesses, and it does not even read the working file unless a revision number of .B $ is specified. .SH ENVIRONMENT .TP .B \s-1RCSINIT\s0 Options prepended to the argument list, separated by spaces. See .BR ci (1) for details. .SH DIAGNOSTICS The working pathname and a separator line is written to the diagnostic output. The exit status is zero if and only if all operations were successful. .SH EXAMPLES One day, there will be a whole bunch of useful examples here. .SH SEE ALSO .BR rcsintro (1), .BR ci (1), .BR co (1), .BR ctime (3), .BR date (1), .BR rcs (1), .BR rcsfile (5) .SH AUTHOR Michael Chapman .PP Portions of this manual page are from .BR ci (1) and .BR co (1) by Walter F. Tichy and Paul Eggert. .SH "COPYRIGHT AND LICENSE" \*b is copyright \(co 2004, 2005 Michael Chapman. .PP \*b is released under the terms and conditions of the \s-1GNU\s0 General Public License version 2. Please read the \s-1COPYING\s0 file carefully. blame-1.3.1/configure0000775000076400007640000222656310531540112011446 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for blame 1.3.1. # # Report bugs to . # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='blame' PACKAGE_TARNAME='blame' PACKAGE_VERSION='1.3.1' PACKAGE_STRING='blame 1.3.1' PACKAGE_BUGREPORT='foonly@users.sourceforge.net' ac_unique_file="src/blame.c" ac_config_libobj_dir=lib # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" gl_header_list= gl_func_list= ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar RELEASE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB CPP EGREP LEX LEXLIB LEX_OUTPUT_ROOT YACC U ANSI2KNR GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE ALLOCA ALLOCA_H GETOPT_H build build_cpu build_vendor build_os host host_cpu host_vendor host_os STDBOOL_H HAVE__BOOL HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_WCHAR_H HAVE_INTTYPES_H HAVE_SYS_TYPES_H ABSOLUTE_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H ABSOLUTE_SYS_STAT_H SYS_STAT_H SYSEXITS_H UNISTD_H EOVERFLOW LIBMISC_LIBDEPS LIBMISC_LTLIBDEPS FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR FASTEXIT GCC_TRUE GCC_FALSE LIBOBJS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS' ac_subst_files='NEWS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures blame 1.3.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of blame 1.3.1:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-debug include debug code (e.g. assertions) --enable-profile enable profiling --disable-fastexit free all memory when exiting Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF blame configure 1.3.1 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by blame $as_me 1.3.1, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu gl_header_list="$gl_header_list libintl.h" gl_func_list="$gl_func_list flockfile" gl_func_list="$gl_func_list funlockfile" gl_header_list="$gl_header_list features.h" gl_header_list="$gl_header_list linewrap.h" gl_header_list="$gl_header_list sys/param.h" gl_func_list="$gl_func_list canonicalize_file_name" gl_func_list="$gl_func_list resolvepath" gl_func_list="$gl_func_list mempcpy" gl_header_list="$gl_header_list wchar.h" gl_header_list="$gl_header_list wctype.h" gl_header_list="$gl_header_list sys/time.h" gl_header_list="$gl_header_list unistd.h" gl_func_list="$gl_func_list alarm" gl_header_list="$gl_header_list stdint.h" gl_func_list="$gl_func_list mblen" gl_func_list="$gl_func_list mbrlen" gl_func_list="$gl_func_list tzset" gl_func_list="$gl_func_list lstat" gl_header_list="$gl_header_list sys/stat.h" gl_func_list="$gl_func_list iswprint" gl_func_list="$gl_func_list wcwidth" gl_header_list="$gl_header_list langinfo.h" ac_config_headers="$ac_config_headers config.h" am__api_version="1.9" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='blame' VERSION='1.3.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' RELEASE=1 case m4 in [\\/]* | ?:[\\/]* ) ac_macro_dir=m4 ;; *) ac_macro_dir=$srcdir/m4 ;; esac if test -d "$ac_macro_dir"; then : else { { echo "$as_me:$LINENO: error: cannot find macro directory \`m4'" >&5 echo "$as_me: error: cannot find macro directory \`m4'" >&2;} { (exit 1); exit 1; }; } fi ac_config_commands="$ac_config_commands tests/atconfig" cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test "x$CC" != xcc; then echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6 fi set dummy $CC; ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&5' if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&5' if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 cat >>confdefs.h <<\_ACEOF #define NO_MINUS_C_MINUS_O 1 _ACEOF fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for AIX" >&5 echo $ECHO_N "checking for AIX... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef _AIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest* echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_minix_config_h+set}" = set; then echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking minix/config.h usability" >&5 echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking minix/config.h presence" >&5 echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_minix_config_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 fi if test $ac_cv_header_minix_config_h = yes; then MINIX=yes else MINIX= fi if test "$MINIX" = yes; then cat >>confdefs.h <<\_ACEOF #define _POSIX_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_1_SOURCE 2 _ACEOF cat >>confdefs.h <<\_ACEOF #define _MINIX 1 _ACEOF fi echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 echo $ECHO_N "checking whether it is safe to define __EXTENSIONS__... $ECHO_C" >&6 if test "${ac_cv_safe_to_define___extensions__+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_safe_to_define___extensions__=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_safe_to_define___extensions__=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 echo "${ECHO_T}$ac_cv_safe_to_define___extensions__" >&6 test $ac_cv_safe_to_define___extensions__ = yes && cat >>confdefs.h <<\_ACEOF #define __EXTENSIONS__ 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _TANDEM_SOURCE 1 _ACEOF for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then echo "$as_me:$LINENO: result: $LEX" >&5 echo "${ECHO_T}$LEX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test -z "$LEXLIB" then echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 if test "${ac_cv_lib_fl_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_fl_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fl_yywrap=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 if test $ac_cv_lib_fl_yywrap = yes; then LEXLIB="-lfl" else echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 if test "${ac_cv_lib_l_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ll $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_l_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_l_yywrap=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 if test $ac_cv_lib_l_yywrap = yes; then LEXLIB="-ll" fi fi fi if test "x$LEX" != "x:"; then echo "$as_me:$LINENO: checking lex output file root" >&5 echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 if test "${ac_cv_prog_lex_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # The minimal lex program is just a single line: %%. But some broken lexes # (Solaris, I think it was) want two %% lines, so accommodate them. cat >conftest.l <<_ACEOF %% %% _ACEOF { (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 (eval $LEX conftest.l) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} { (exit 1); exit 1; }; } fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 rm -f conftest.l LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS=$LIBS LIBS="$LIBS $LEXLIB" cat >conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS rm -f "${LEX_OUTPUT_ROOT}.c" fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF #define YYTEXT_POINTER 1 _ACEOF fi fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then echo "$as_me:$LINENO: result: $YACC" >&5 echo "${ECHO_T}$YACC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi # Checks for libraries. # Checks for header files. echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_header in $gl_header_list do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done : # Checks for typedefs, structures, and compiler characteristics. echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac echo "$as_me:$LINENO: checking for function prototypes" >&5 echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6 if test "$ac_cv_prog_cc_stdc" != no; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define PROTOTYPES 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define __PROTOTYPES 1 _ACEOF else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$ac_cv_prog_cc_stdc" != no; then U= ANSI2KNR= else U=_ ANSI2KNR=./ansi2knr fi # Ensure some checks needed by ansi2knr itself. for ac_header in string.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for preprocessor stringizing operator" >&5 echo $ECHO_N "checking for preprocessor stringizing operator... $ECHO_C" >&6 if test "${ac_cv_c_stringize+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define x(y) #y char *s = x(teststring); _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "#teststring" >/dev/null 2>&1; then ac_cv_c_stringize=no else ac_cv_c_stringize=yes fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_c_stringize" >&5 echo "${ECHO_T}$ac_cv_c_stringize" >&6 if test $ac_cv_c_stringize = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRINGIZE 1 _ACEOF fi echo "$as_me:$LINENO: checking for working volatile" >&5 echo $ECHO_N "checking for working volatile... $ECHO_C" >&6 if test "${ac_cv_c_volatile+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { volatile int x; int * volatile y; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_volatile=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_volatile=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5 echo "${ECHO_T}$ac_cv_c_volatile" >&6 if test $ac_cv_c_volatile = no; then cat >>confdefs.h <<\_ACEOF #define volatile _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((off_t *) 0) return 0; if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long _ACEOF fi # canonicalize gnulib module needs this echo "$as_me:$LINENO: checking for inttypes.h" >&5 echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 if test "${gl_cv_header_inttypes_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { uintmax_t i = (uintmax_t) -1; return !i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_header_inttypes_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_inttypes_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5 echo "${ECHO_T}$gl_cv_header_inttypes_h" >&6 if test $gl_cv_header_inttypes_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H_WITH_UINTMAX 1 _ACEOF fi echo "$as_me:$LINENO: checking for stdint.h" >&5 echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6 if test "${gl_cv_header_stdint_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { uintmax_t i = (uintmax_t) -1; return !i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_header_stdint_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_stdint_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 echo "${ECHO_T}$gl_cv_header_stdint_h" >&6 if test $gl_cv_header_stdint_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STDINT_H_WITH_UINTMAX 1 _ACEOF fi echo "$as_me:$LINENO: checking for unsigned long long int" >&5 echo $ECHO_N "checking for unsigned long long int... $ECHO_C" >&6 if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ unsigned long long int ull = 18446744073709551615ULL; typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63; int main () { unsigned long long int ullmax = 18446744073709551615ull; return (ull << 63 | ull >> 63 | ull << i | ull >> i | ullmax / ull | ullmax % ull); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_unsigned_long_long_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_long_long_int=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5 echo "${ECHO_T}$ac_cv_type_unsigned_long_long_int" >&6 if test $ac_cv_type_unsigned_long_long_int = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UNSIGNED_LONG_LONG_INT 1 _ACEOF fi ac_cv_type_unsigned_long_long=$ac_cv_type_unsigned_long_long_int if test $ac_cv_type_unsigned_long_long = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UNSIGNED_LONG_LONG 1 _ACEOF fi if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' cat >>confdefs.h <<_ACEOF #define uintmax_t $ac_type _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_UINTMAX_T 1 _ACEOF fi # Checks for library functions. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo "$as_me:$LINENO: checking for working alloca.h" >&5 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for alloca" >&5 echo $ECHO_N "checking for alloca... $ECHO_C" >&6 if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 echo "${ECHO_T}$ac_cv_os_cray" >&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { exit (find_stack_direction () < 0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if STDC_HEADERS || HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { exit (malloc (0) ? 0 : 1); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_malloc_0_nonnull=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 if test $ac_cv_func_malloc_0_nonnull = yes; then gl_cv_func_malloc_0_nonnull=1 else gl_cv_func_malloc_0_nonnull=0 fi cat >>confdefs.h <<_ACEOF #define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull _ACEOF echo "$as_me:$LINENO: checking for long long int" >&5 echo $ECHO_N "checking for long long int... $ECHO_C" >&6 if test "${ac_cv_type_long_long_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; int i = 63; int main () { long long int llmax = 9223372036854775807ll; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if test "$cross_compiling" = yes; then ac_cv_type_long_long_int=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef LLONG_MAX # define HALF \ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) # define LLONG_MAX (HALF - 1 + HALF) #endif int main () { long long int n = 1; int i; for (i = 0; ; i++) { long long int m = n << i; if (m >> i != n) return 1; if (LLONG_MAX / 2 < m) break; } return 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_long_long_int=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_type_long_long_int=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long_int=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 echo "${ECHO_T}$ac_cv_type_long_long_int" >&6 if test $ac_cv_type_long_long_int = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_LONG_INT 1 _ACEOF fi echo "$as_me:$LINENO: checking for long double" >&5 echo $ECHO_N "checking for long double... $ECHO_C" >&6 if test "${gt_cv_c_long_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$GCC" = yes; then gt_cv_c_long_double=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* The Stardent Vistra knows sizeof(long double), but does not support it. */ long double foo = 0.0; /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ int array [2*(sizeof(long double) >= sizeof(double)) - 1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_c_long_double=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_long_double=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $gt_cv_c_long_double" >&5 echo "${ECHO_T}$gt_cv_c_long_double" >&6 if test $gt_cv_c_long_double = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_DOUBLE 1 _ACEOF fi echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5 echo $ECHO_N "checking for C/C++ restrict keyword... $ECHO_C" >&6 if test "${ac_cv_c_restrict+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_restrict=no # Try the official restrict keyword, then gcc's __restrict, and # the less common variants. for ac_kw in restrict __restrict __restrict__ _Restrict; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ float * $ac_kw x; _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_restrict=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_restrict" >&5 echo "${ECHO_T}$ac_cv_c_restrict" >&6 case $ac_cv_c_restrict in restrict) ;; no) cat >>confdefs.h <<\_ACEOF #define restrict _ACEOF ;; *) cat >>confdefs.h <<_ACEOF #define restrict $ac_cv_c_restrict _ACEOF ;; esac echo "$as_me:$LINENO: checking whether getenv is declared" >&5 echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_getenv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef getenv char *p = (char *) getenv; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_getenv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getenv=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6 if test $ac_cv_have_decl_getenv = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETENV 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETENV 0 _ACEOF fi gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" GETOPT_H=getopt.h cat >>confdefs.h <<\_ACEOF #define __GETOPT_PREFIX rpl_ _ACEOF : echo "$as_me:$LINENO: checking whether clearerr_unlocked is declared" >&5 echo $ECHO_N "checking whether clearerr_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_clearerr_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef clearerr_unlocked char *p = (char *) clearerr_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_clearerr_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_clearerr_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_clearerr_unlocked" >&6 if test $ac_cv_have_decl_clearerr_unlocked = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CLEARERR_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CLEARERR_UNLOCKED 0 _ACEOF fi echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef feof_unlocked char *p = (char *) feof_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_feof_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_feof_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6 if test $ac_cv_have_decl_feof_unlocked = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FEOF_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FEOF_UNLOCKED 0 _ACEOF fi echo "$as_me:$LINENO: checking whether ferror_unlocked is declared" >&5 echo $ECHO_N "checking whether ferror_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_ferror_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef ferror_unlocked char *p = (char *) ferror_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_ferror_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_ferror_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_ferror_unlocked" >&6 if test $ac_cv_have_decl_ferror_unlocked = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FERROR_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FERROR_UNLOCKED 0 _ACEOF fi echo "$as_me:$LINENO: checking whether fflush_unlocked is declared" >&5 echo $ECHO_N "checking whether fflush_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_fflush_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef fflush_unlocked char *p = (char *) fflush_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_fflush_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_fflush_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_fflush_unlocked" >&6 if test $ac_cv_have_decl_fflush_unlocked = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FFLUSH_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FFLUSH_UNLOCKED 0 _ACEOF fi echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef fgets_unlocked char *p = (char *) fgets_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_fgets_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_fgets_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6 if test $ac_cv_have_decl_fgets_unlocked = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FGETS_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FGETS_UNLOCKED 0 _ACEOF fi echo "$as_me:$LINENO: checking whether fputc_unlocked is declared" >&5 echo $ECHO_N "checking whether fputc_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_fputc_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef fputc_unlocked char *p = (char *) fputc_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_fputc_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_fputc_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_fputc_unlocked" >&6 if test $ac_cv_have_decl_fputc_unlocked = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FPUTC_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FPUTC_UNLOCKED 0 _ACEOF fi echo "$as_me:$LINENO: checking whether fputs_unlocked is declared" >&5 echo $ECHO_N "checking whether fputs_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_fputs_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef fputs_unlocked char *p = (char *) fputs_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_fputs_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_fputs_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_fputs_unlocked" >&6 if test $ac_cv_have_decl_fputs_unlocked = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FPUTS_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FPUTS_UNLOCKED 0 _ACEOF fi echo "$as_me:$LINENO: checking whether fread_unlocked is declared" >&5 echo $ECHO_N "checking whether fread_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_fread_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef fread_unlocked char *p = (char *) fread_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_fread_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_fread_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_fread_unlocked" >&6 if test $ac_cv_have_decl_fread_unlocked = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FREAD_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FREAD_UNLOCKED 0 _ACEOF fi echo "$as_me:$LINENO: checking whether fwrite_unlocked is declared" >&5 echo $ECHO_N "checking whether fwrite_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_fwrite_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef fwrite_unlocked char *p = (char *) fwrite_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_fwrite_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_fwrite_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_fwrite_unlocked" >&6 if test $ac_cv_have_decl_fwrite_unlocked = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FWRITE_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FWRITE_UNLOCKED 0 _ACEOF fi echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef getc_unlocked char *p = (char *) getc_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_getc_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getc_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6 if test $ac_cv_have_decl_getc_unlocked = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETC_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETC_UNLOCKED 0 _ACEOF fi echo "$as_me:$LINENO: checking whether getchar_unlocked is declared" >&5 echo $ECHO_N "checking whether getchar_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_getchar_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef getchar_unlocked char *p = (char *) getchar_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_getchar_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getchar_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_getchar_unlocked" >&6 if test $ac_cv_have_decl_getchar_unlocked = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETCHAR_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETCHAR_UNLOCKED 0 _ACEOF fi echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 echo $ECHO_N "checking whether putc_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef putc_unlocked char *p = (char *) putc_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_putc_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_putc_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6 if test $ac_cv_have_decl_putc_unlocked = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_PUTC_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_PUTC_UNLOCKED 0 _ACEOF fi echo "$as_me:$LINENO: checking whether putchar_unlocked is declared" >&5 echo $ECHO_N "checking whether putchar_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_putchar_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef putchar_unlocked char *p = (char *) putchar_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_putchar_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_putchar_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_putchar_unlocked" >&6 if test $ac_cv_have_decl_putchar_unlocked = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_PUTCHAR_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_PUTCHAR_UNLOCKED 0 _ACEOF fi for ac_func in $gl_func_list do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking whether canonicalize_file_name is declared" >&5 echo $ECHO_N "checking whether canonicalize_file_name is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_canonicalize_file_name+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef canonicalize_file_name char *p = (char *) canonicalize_file_name; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_canonicalize_file_name=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_canonicalize_file_name=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_canonicalize_file_name" >&5 echo "${ECHO_T}$ac_cv_have_decl_canonicalize_file_name" >&6 if test $ac_cv_have_decl_canonicalize_file_name = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CANONICALIZE_FILE_NAME 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CANONICALIZE_FILE_NAME 0 _ACEOF fi echo "$as_me:$LINENO: checking whether system is Windows or MSDOS" >&5 echo $ECHO_N "checking whether system is Windows or MSDOS... $ECHO_C" >&6 if test "${ac_cv_win_or_dos+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__ neither MSDOS nor Windows #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_win_or_dos=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_win_or_dos=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5 echo "${ECHO_T}$ac_cv_win_or_dos" >&6 if test x"$ac_cv_win_or_dos" = xyes; then ac_fs_accepts_drive_letter_prefix=1 ac_fs_backslash_is_file_name_separator=1 echo "$as_me:$LINENO: checking whether drive letter can start relative path" >&5 echo $ECHO_N "checking whether drive letter can start relative path... $ECHO_C" >&6 if test "${ac_cv_drive_letter_can_be_relative+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #if defined __CYGWIN__ drive letters are always absolute #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_drive_letter_can_be_relative=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_drive_letter_can_be_relative=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_drive_letter_can_be_relative" >&5 echo "${ECHO_T}$ac_cv_drive_letter_can_be_relative" >&6 if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then ac_fs_drive_letter_can_be_relative=1 else ac_fs_drive_letter_can_be_relative=0 fi else ac_fs_accepts_drive_letter_prefix=0 ac_fs_backslash_is_file_name_separator=0 ac_fs_drive_letter_can_be_relative=0 fi cat >>confdefs.h <<_ACEOF #define FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX $ac_fs_accepts_drive_letter_prefix _ACEOF cat >>confdefs.h <<_ACEOF #define FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR $ac_fs_backslash_is_file_name_separator _ACEOF cat >>confdefs.h <<_ACEOF #define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE $ac_fs_drive_letter_can_be_relative _ACEOF # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking whether // is distinct from /" >&5 echo $ECHO_N "checking whether // is distinct from /... $ECHO_C" >&6 if test "${ac_cv_double_slash_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test x"$cross_compiling" = xyes ; then # When cross-compiling, there is no way to tell whether // is special # short of a list of hosts. However, the only known hosts to date # that have a distinct // are Apollo DomainOS (too old to port to) # and Cygwin. If anyone knows of another system for which // has # special semantics and is distinct from /, please report it to # . case $host in *-cygwin) ac_cv_double_slash_root=yes ;; *) # Be optimistic and assume that / and // are the same when we # don't know. ac_cv_double_slash_root='unknown, assuming no' ;; esac else set x `ls -di / //` if test $2 = $4; then ac_cv_double_slash_root=no else ac_cv_double_slash_root=yes fi fi fi echo "$as_me:$LINENO: result: $ac_cv_double_slash_root" >&5 echo "${ECHO_T}$ac_cv_double_slash_root" >&6 if test x"$ac_cv_double_slash_root" = xyes; then ac_double_slash_root=1 else ac_double_slash_root=0 fi cat >>confdefs.h <<_ACEOF #define DOUBLE_SLASH_IS_DISTINCT_ROOT $ac_double_slash_root _ACEOF echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_strerror_r+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strerror_r char *p = (char *) strerror_r; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strerror_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strerror_r=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6 if test $ac_cv_have_decl_strerror_r = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R 0 _ACEOF fi for ac_func in strerror_r do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6 if test "${ac_cv_func_strerror_r_char_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strerror_r_char_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else # strerror_r is not declared. Choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default extern char *strerror_r (); int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); exit (!isalpha (x)); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strerror_r_char_p=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6 if test $ac_cv_func_strerror_r_char_p = yes; then cat >>confdefs.h <<\_ACEOF #define STRERROR_R_CHAR_P 1 _ACEOF fi echo "$as_me:$LINENO: checking whether getcwd (NULL, 0) allocates memory for result" >&5 echo $ECHO_N "checking whether getcwd (NULL, 0) allocates memory for result... $ECHO_C" >&6 if test "${gl_cv_func_getcwd_null+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then gl_cv_func_getcwd_null=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # include # include # ifndef getcwd char *getcwd (); # endif int main () { if (chdir ("/") != 0) exit (1); else { char *f = getcwd (NULL, 0); exit (! (f && f[0] == '/' && !f[1])); } } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_func_getcwd_null=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gl_cv_func_getcwd_null=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $gl_cv_func_getcwd_null" >&5 echo "${ECHO_T}$gl_cv_func_getcwd_null" >&6 echo "$as_me:$LINENO: checking whether getcwd is declared" >&5 echo $ECHO_N "checking whether getcwd is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_getcwd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef getcwd char *p = (char *) getcwd; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_getcwd=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getcwd=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_getcwd" >&5 echo "${ECHO_T}$ac_cv_have_decl_getcwd" >&6 if test $ac_cv_have_decl_getcwd = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETCWD 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETCWD 0 _ACEOF fi echo "$as_me:$LINENO: checking whether getdelim is declared" >&5 echo $ECHO_N "checking whether getdelim is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_getdelim+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef getdelim char *p = (char *) getdelim; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_getdelim=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getdelim=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_getdelim" >&5 echo "${ECHO_T}$ac_cv_have_decl_getdelim" >&6 if test $ac_cv_have_decl_getdelim = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETDELIM 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETDELIM 0 _ACEOF fi if test -z "$GETOPT_H"; then for ac_header in getopt.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else GETOPT_H=getopt.h fi done fi if test -z "$GETOPT_H"; then for ac_func in getopt_long_only do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else GETOPT_H=getopt.h fi done fi if test -z "$GETOPT_H"; then echo "$as_me:$LINENO: checking whether optreset is declared" >&5 echo $ECHO_N "checking whether optreset is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_optreset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef optreset char *p = (char *) optreset; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_optreset=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_optreset=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5 echo "${ECHO_T}$ac_cv_have_decl_optreset" >&6 if test $ac_cv_have_decl_optreset = yes; then GETOPT_H=getopt.h fi fi if test -z "$GETOPT_H"; then echo "$as_me:$LINENO: checking for working GNU getopt function" >&5 echo $ECHO_N "checking for working GNU getopt function... $ECHO_C" >&6 if test "${gl_cv_func_gnu_getopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5 echo $ECHO_N "checking whether getopt_clip is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_getopt_clip+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef getopt_clip char *p = (char *) getopt_clip; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_getopt_clip=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getopt_clip=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5 echo "${ECHO_T}$ac_cv_have_decl_getopt_clip" >&6 if test $ac_cv_have_decl_getopt_clip = yes; then gl_cv_func_gnu_getopt=no else gl_cv_func_gnu_getopt=yes fi else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *myargv[3]; myargv[0] = "conftest"; myargv[1] = "-+"; myargv[2] = 0; return getopt (2, myargv, "+a") != '?'; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_func_gnu_getopt=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gl_cv_func_gnu_getopt=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $gl_cv_func_gnu_getopt" >&5 echo "${ECHO_T}$gl_cv_func_gnu_getopt" >&6 if test "$gl_cv_func_gnu_getopt" = "no"; then GETOPT_H=getopt.h fi fi echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6 if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then if test "$cross_compiling" = yes; then ac_cv_func_lstat_dereferences_slashed_symlink=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; /* Linux will dereference the symlink and fail. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_lstat_dereferences_slashed_symlink=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else # If the `ln -s' command failed, then we probably don't even # have an lstat function. ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f conftest.sym conftest.file fi echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6 test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && cat >>confdefs.h <<_ACEOF #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 _ACEOF if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext" fi echo "$as_me:$LINENO: checking for mbstate_t" >&5 echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6 if test "${ac_cv_type_mbstate_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default # include int main () { mbstate_t x; return sizeof x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_mbstate_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mbstate_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6 if test $ac_cv_type_mbstate_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MBSTATE_T 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define mbstate_t int _ACEOF fi echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5 echo $ECHO_N "checking whether mbrtowc and mbstate_t are properly declared... $ECHO_C" >&6 if test "${gl_cv_func_mbrtowc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { wchar_t wc; char const s[] = ""; size_t n = 1; mbstate_t state; return ! (sizeof state && (mbrtowc) (&wc, s, n, &state)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_func_mbrtowc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_func_mbrtowc=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc" >&5 echo "${ECHO_T}$gl_cv_func_mbrtowc" >&6 if test $gl_cv_func_mbrtowc = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MBRTOWC 1 _ACEOF fi echo "$as_me:$LINENO: checking for working memcmp" >&5 echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6 if test "${ac_cv_func_memcmp_working+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_working=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = 0x40, c1 = 0x80, c2 = 0x81; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) exit (1); /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) exit (1); } exit (0); } ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memcmp_working=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_memcmp_working=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6 test $ac_cv_func_memcmp_working = no && gl_LIBOBJS="$gl_LIBOBJS memcmp.$ac_objext" echo "$as_me:$LINENO: checking whether defines MIN and MAX" >&5 echo $ECHO_N "checking whether defines MIN and MAX... $ECHO_C" >&6 if test "${gl_cv_minmax_in_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int x = MIN (42, 17); int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_minmax_in_limits_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_minmax_in_limits_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gl_cv_minmax_in_limits_h" >&5 echo "${ECHO_T}$gl_cv_minmax_in_limits_h" >&6 if test $gl_cv_minmax_in_limits_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MINMAX_IN_LIMITS_H 1 _ACEOF fi echo "$as_me:$LINENO: checking whether defines MIN and MAX" >&5 echo $ECHO_N "checking whether defines MIN and MAX... $ECHO_C" >&6 if test "${gl_cv_minmax_in_sys_param_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int x = MIN (42, 17); int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_minmax_in_sys_param_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_minmax_in_sys_param_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gl_cv_minmax_in_sys_param_h" >&5 echo "${ECHO_T}$gl_cv_minmax_in_sys_param_h" >&6 if test $gl_cv_minmax_in_sys_param_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MINMAX_IN_SYS_PARAM_H 1 _ACEOF fi : : echo "$as_me:$LINENO: checking for working mktime" >&5 echo $ECHO_N "checking for working mktime... $ECHO_C" >&6 if test "${ac_cv_func_working_mktime+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_working_mktime=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Test program from Paul Eggert and Tony Leneis. */ #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include #ifdef HAVE_UNISTD_H # include #endif #ifndef HAVE_ALARM # define alarm(X) /* empty */ #endif /* Work around redefinition to rpl_putenv by other config tests. */ #undef putenv static time_t time_t_max; static time_t time_t_min; /* Values we'll use to set the TZ environment variable. */ static char *tz_strings[] = { (char *) 0, "TZ=GMT0", "TZ=JST-9", "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) /* Return 0 if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ static int spring_forward_gap () { /* glibc (up to about 1998-10-07) failed this test. */ struct tm tm; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); tm.tm_year = 98; tm.tm_mon = 3; tm.tm_mday = 5; tm.tm_hour = 2; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; return mktime (&tm) != (time_t) -1; } static int mktime_test1 (now) time_t now; { struct tm *lt; return ! (lt = localtime (&now)) || mktime (lt) == now; } static int mktime_test (now) time_t now; { return (mktime_test1 (now) && mktime_test1 ((time_t) (time_t_max - now)) && mktime_test1 ((time_t) (time_t_min + now))); } static int irix_6_4_bug () { /* Based on code from Ariel Faigon. */ struct tm tm; tm.tm_year = 96; tm.tm_mon = 3; tm.tm_mday = 0; tm.tm_hour = 0; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; mktime (&tm); return tm.tm_mon == 2 && tm.tm_mday == 31; } static int bigtime_test (j) int j; { struct tm tm; time_t now; tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; now = mktime (&tm); if (now != (time_t) -1) { struct tm *lt = localtime (&now); if (! (lt && lt->tm_year == tm.tm_year && lt->tm_mon == tm.tm_mon && lt->tm_mday == tm.tm_mday && lt->tm_hour == tm.tm_hour && lt->tm_min == tm.tm_min && lt->tm_sec == tm.tm_sec && lt->tm_yday == tm.tm_yday && lt->tm_wday == tm.tm_wday && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) return 0; } return 1; } static int year_2050_test () { /* The correct answer for 2050-02-01 00:00:00 in Pacific time, ignoring leap seconds. */ unsigned long int answer = 2527315200UL; struct tm tm; time_t t; tm.tm_year = 2050 - 1900; tm.tm_mon = 2 - 1; tm.tm_mday = 1; tm.tm_hour = tm.tm_min = tm.tm_sec = 0; tm.tm_isdst = -1; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); t = mktime (&tm); /* Check that the result is either a failure, or close enough to the correct answer that we can assume the discrepancy is due to leap seconds. */ return (t == (time_t) -1 || (0 < t && answer - 120 <= t && t <= answer + 120)); } int main () { time_t t, delta; int i, j; /* This test makes some buggy mktime implementations loop. Give up after 60 seconds; a mktime slower than that isn't worth using anyway. */ alarm (60); for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2) continue; time_t_max--; if ((time_t) -1 < 0) for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2) continue; delta = time_t_max / 997; /* a suitable prime number */ for (i = 0; i < N_STRINGS; i++) { if (tz_strings[i]) putenv (tz_strings[i]); for (t = 0; t <= time_t_max - delta; t += delta) if (! mktime_test (t)) return 1; if (! (mktime_test ((time_t) 1) && mktime_test ((time_t) (60 * 60)) && mktime_test ((time_t) (60 * 60 * 24)))) return 1; for (j = 1; 0 < j; j *= 2) if (! bigtime_test (j)) return 1; if (! bigtime_test (j - 1)) return 1; } return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_working_mktime=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_working_mktime=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_working_mktime" >&5 echo "${ECHO_T}$ac_cv_func_working_mktime" >&6 if test $ac_cv_func_working_mktime = no; then gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext" fi echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6 if test "${ac_cv_header_stdbool_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; #if defined __xlc__ || defined __GNUC__ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 reported by James Lemley on 2005-10-05; see http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html This test is not quite right, since xlc is allowed to reject this program, as the initializer for xlcbug is not one of the forms that C requires support for. However, doing the test right would require a run-time test, and that would make cross-compilation harder. Let us hope that IBM fixes the xlc bug, and also adds support for this kind of constant expression. In the meantime, this test will reject xlc, which is OK, since our stdbool.h substitute should suffice. We also test this with GCC, where it should work, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); #endif /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 echo "$as_me:$LINENO: checking for _Bool" >&5 echo $ECHO_N "checking for _Bool... $ECHO_C" >&6 if test "${ac_cv_type__Bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((_Bool *) 0) return 0; if (sizeof (_Bool)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type__Bool=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 echo "${ECHO_T}$ac_cv_type__Bool" >&6 if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF fi echo "$as_me:$LINENO: checking whether strdup is declared" >&5 echo $ECHO_N "checking whether strdup is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_strdup+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strdup char *p = (char *) strdup; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strdup=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strdup=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_strdup" >&5 echo "${ECHO_T}$ac_cv_have_decl_strdup" >&6 if test $ac_cv_have_decl_strdup = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRDUP 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRDUP 0 _ACEOF fi echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 if test "${ac_cv_struct_tm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct tm *tp; tp->tm_sec; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 echo "${ECHO_T}$ac_cv_struct_tm" >&6 if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 _ACEOF fi echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6 if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_cv_struct_tm> int main () { static struct tm ac_aggr; if (ac_aggr.tm_zone) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_tm_tm_zone=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_cv_struct_tm> int main () { static struct tm ac_aggr; if (sizeof ac_aggr.tm_zone) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_tm_tm_zone=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6 if test $ac_cv_member_struct_tm_tm_zone = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 _ACEOF fi if test "$ac_cv_member_struct_tm_tm_zone" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TM_ZONE 1 _ACEOF else echo "$as_me:$LINENO: checking for tzname" >&5 echo $ECHO_N "checking for tzname... $ECHO_C" >&6 if test "${ac_cv_var_tzname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef tzname /* For SGI. */ extern char *tzname[]; /* RS6000 and others reject char **tzname. */ #endif int main () { atoi(*tzname); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_var_tzname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 echo "${ECHO_T}$ac_cv_var_tzname" >&6 if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TZNAME 1 _ACEOF fi fi echo "$as_me:$LINENO: checking for struct tm.tm_gmtoff" >&5 echo $ECHO_N "checking for struct tm.tm_gmtoff... $ECHO_C" >&6 if test "${ac_cv_member_struct_tm_tm_gmtoff+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static struct tm ac_aggr; if (ac_aggr.tm_gmtoff) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_tm_tm_gmtoff=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static struct tm ac_aggr; if (sizeof ac_aggr.tm_gmtoff) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_tm_tm_gmtoff=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_gmtoff=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_gmtoff" >&5 echo "${ECHO_T}$ac_cv_member_struct_tm_tm_gmtoff" >&6 if test $ac_cv_member_struct_tm_tm_gmtoff = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TM_GMTOFF 1 _ACEOF fi gl_LIBOBJS="$gl_LIBOBJS strftime.$ac_objext" # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE. : : cat >>confdefs.h <<\_ACEOF #define my_strftime nstrftime _ACEOF echo "$as_me:$LINENO: checking whether strndup is declared" >&5 echo $ECHO_N "checking whether strndup is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_strndup+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strndup char *p = (char *) strndup; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strndup=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strndup=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_strndup" >&5 echo "${ECHO_T}$ac_cv_have_decl_strndup" >&6 if test $ac_cv_have_decl_strndup = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRNDUP 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRNDUP 0 _ACEOF fi echo "$as_me:$LINENO: checking whether strnlen is declared" >&5 echo $ECHO_N "checking whether strnlen is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_strnlen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strnlen char *p = (char *) strnlen; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strnlen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strnlen=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_strnlen" >&5 echo "${ECHO_T}$ac_cv_have_decl_strnlen" >&6 if test $ac_cv_have_decl_strnlen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRNLEN 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRNLEN 0 _ACEOF fi echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6 if test "${ac_cv_header_stat_broken+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if defined(S_ISBLK) && defined(S_IFDIR) # if S_ISBLK (S_IFDIR) You lose. # endif #endif #if defined(S_ISBLK) && defined(S_IFCHR) # if S_ISBLK (S_IFCHR) You lose. # endif #endif #if defined(S_ISLNK) && defined(S_IFREG) # if S_ISLNK (S_IFREG) You lose. # endif #endif #if defined(S_ISSOCK) && defined(S_IFREG) # if S_ISSOCK (S_IFREG) You lose. # endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "You lose" >/dev/null 2>&1; then ac_cv_header_stat_broken=yes else ac_cv_header_stat_broken=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 echo "${ECHO_T}$ac_cv_header_stat_broken" >&6 if test $ac_cv_header_stat_broken = yes; then cat >>confdefs.h <<\_ACEOF #define STAT_MACROS_BROKEN 1 _ACEOF fi echo "$as_me:$LINENO: checking for EOVERFLOW" >&5 echo $ECHO_N "checking for EOVERFLOW... $ECHO_C" >&6 if test "${ac_cv_decl_EOVERFLOW+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef EOVERFLOW yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then have_eoverflow=1 fi rm -f conftest* if test -n "$have_eoverflow"; then ac_cv_decl_EOVERFLOW=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include #ifdef EOVERFLOW yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then have_eoverflow=1 fi rm -f conftest* if test -n "$have_eoverflow"; then if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include int main () { static int test_array [1 - 2 * !((EOVERFLOW) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include int main () { static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include int main () { static int test_array [1 - 2 * !((EOVERFLOW) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include int main () { static int test_array [1 - 2 * !((EOVERFLOW) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include int main () { static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_decl_EOVERFLOW=$ac_lo;; '') ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include long longval () { return EOVERFLOW; } unsigned long ulongval () { return EOVERFLOW; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if ((EOVERFLOW) < 0) { long i = longval (); if (i != (EOVERFLOW)) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != (EOVERFLOW)) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_decl_EOVERFLOW=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_decl_EOVERFLOW=E2BIG fi fi fi echo "$as_me:$LINENO: result: $ac_cv_decl_EOVERFLOW" >&5 echo "${ECHO_T}$ac_cv_decl_EOVERFLOW" >&6 if test "$ac_cv_decl_EOVERFLOW" != yes; then cat >>confdefs.h <<_ACEOF #define EOVERFLOW $ac_cv_decl_EOVERFLOW _ACEOF EOVERFLOW="$ac_cv_decl_EOVERFLOW" fi echo "$as_me:$LINENO: checking for wchar_t" >&5 echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6 if test "${gt_cv_c_wchar_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include wchar_t foo = (wchar_t)'\0'; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_c_wchar_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_wchar_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 echo "${ECHO_T}$gt_cv_c_wchar_t" >&6 if test $gt_cv_c_wchar_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WCHAR_T 1 _ACEOF fi echo "$as_me:$LINENO: checking for wint_t" >&5 echo $ECHO_N "checking for wint_t... $ECHO_C" >&6 if test "${gt_cv_c_wint_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include wint_t foo = (wchar_t)'\0'; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_c_wint_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_wint_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 echo "${ECHO_T}$gt_cv_c_wint_t" >&6 if test $gt_cv_c_wint_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WINT_T 1 _ACEOF fi ac_cv_type_long_long=$ac_cv_type_long_long_int if test $ac_cv_type_long_long = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_LONG 1 _ACEOF fi echo "$as_me:$LINENO: checking for intmax_t" >&5 echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6 if test "${gt_cv_c_intmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif int main () { intmax_t x = -1; return !x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_c_intmax_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_intmax_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5 echo "${ECHO_T}$gt_cv_c_intmax_t" >&6 if test $gt_cv_c_intmax_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_INTMAX_T 1 _ACEOF else test $ac_cv_type_long_long = yes \ && ac_type='long long' \ || ac_type='long' cat >>confdefs.h <<_ACEOF #define intmax_t $ac_type _ACEOF fi echo "$as_me:$LINENO: checking whether vsnprintf is declared" >&5 echo $ECHO_N "checking whether vsnprintf is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_vsnprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef vsnprintf char *p = (char *) vsnprintf; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_vsnprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_vsnprintf=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_vsnprintf" >&5 echo "${ECHO_T}$ac_cv_have_decl_vsnprintf" >&6 if test $ac_cv_have_decl_vsnprintf = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_VSNPRINTF 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_VSNPRINTF 0 _ACEOF fi if false; then GL_COND_LIBTOOL_TRUE= GL_COND_LIBTOOL_FALSE='#' else GL_COND_LIBTOOL_TRUE='#' GL_COND_LIBTOOL_FALSE= fi gl_cond_libtool=false gl_libdeps= gl_ltlibdeps= gl_source_base='lib' if test $ac_cv_func_alloca_works = no; then : fi # Define an additional variable used in the Makefile substitution. if test $ac_cv_working_alloca_h = yes; then echo "$as_me:$LINENO: checking for alloca as a compiler built-in" >&5 echo $ECHO_N "checking for alloca as a compiler built-in... $ECHO_C" >&6 if test "${gl_cv_rpl_alloca+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined __GNUC__ || defined _AIX || defined _MSC_VER Need own alloca #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Need own alloca" >/dev/null 2>&1; then gl_cv_rpl_alloca=yes else gl_cv_rpl_alloca=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $gl_cv_rpl_alloca" >&5 echo "${ECHO_T}$gl_cv_rpl_alloca" >&6 if test $gl_cv_rpl_alloca = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF ALLOCA_H=alloca.h else ALLOCA_H= fi else ALLOCA_H=alloca.h fi cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF echo "$as_me:$LINENO: checking whether program_invocation_name is declared" >&5 echo $ECHO_N "checking whether program_invocation_name is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_program_invocation_name+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef program_invocation_name char *p = (char *) program_invocation_name; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_program_invocation_name=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_program_invocation_name=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_program_invocation_name" >&5 echo "${ECHO_T}$ac_cv_have_decl_program_invocation_name" >&6 if test $ac_cv_have_decl_program_invocation_name = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DECL_PROGRAM_INVOCATION_NAME 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define GNULIB_PROGRAM_INVOCATION_NAME 1 _ACEOF fi echo "$as_me:$LINENO: checking whether program_invocation_short_name is declared" >&5 echo $ECHO_N "checking whether program_invocation_short_name is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_program_invocation_short_name+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef program_invocation_short_name char *p = (char *) program_invocation_short_name; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_program_invocation_short_name=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_program_invocation_short_name=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_program_invocation_short_name" >&5 echo "${ECHO_T}$ac_cv_have_decl_program_invocation_short_name" >&6 if test $ac_cv_have_decl_program_invocation_short_name = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define GNULIB_PROGRAM_INVOCATION_SHORT_NAME 1 _ACEOF fi # Check if program_invocation_name and program_invocation_short_name # are defined elsewhere. It is improbable that only one of them will # be defined and other not, I prefer to stay on the safe side and to # test each one separately. echo "$as_me:$LINENO: checking whether program_invocation_name is defined" >&5 echo $ECHO_N "checking whether program_invocation_name is defined... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { program_invocation_name = "test"; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_PROGRAM_INVOCATION_NAME 1 _ACEOF echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: checking whether program_invocation_short_name is defined" >&5 echo $ECHO_N "checking whether program_invocation_short_name is defined... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { program_invocation_short_name = "test"; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_PROGRAM_INVOCATION_SHORT_NAME 1 _ACEOF echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext : : : : : : : : : : : : : : : echo "$as_me:$LINENO: checking for GNU libc compatible calloc" >&5 echo $ECHO_N "checking for GNU libc compatible calloc... $ECHO_C" >&6 if test "${ac_cv_func_calloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_calloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { exit (!calloc (0, 0) || calloc ((size_t) -1 / 8 + 1, 8)); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_calloc_0_nonnull=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_calloc_0_nonnull=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_calloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_calloc_0_nonnull" >&6 if test $ac_cv_func_calloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_CALLOC 0 _ACEOF gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext" cat >>confdefs.h <<\_ACEOF #define calloc rpl_calloc _ACEOF fi gl_LIBOBJS="$gl_LIBOBJS canonicalize.$ac_objext" : : : cat >>confdefs.h <<\_ACEOF #define PROVIDE_CANONICALIZE_FILENAME_MODE 1 _ACEOF gl_LIBOBJS="$gl_LIBOBJS cycle-check.$ac_objext" echo "$as_me:$LINENO: checking for d_ino member in directory struct" >&5 echo $ECHO_N "checking for d_ino member in directory struct... $ECHO_C" >&6 if test "${jm_cv_struct_dirent_d_ino+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct dirent dp; dp.d_ino = 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then jm_cv_struct_dirent_d_ino=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 jm_cv_struct_dirent_d_ino=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $jm_cv_struct_dirent_d_ino" >&5 echo "${ECHO_T}$jm_cv_struct_dirent_d_ino" >&6 if test $jm_cv_struct_dirent_d_ino = yes; then cat >>confdefs.h <<\_ACEOF #define D_INO_IN_DIRENT 1 _ACEOF fi gl_LIBOBJS="$gl_LIBOBJS basename.$ac_objext" gl_LIBOBJS="$gl_LIBOBJS dirname.$ac_objext" gl_LIBOBJS="$gl_LIBOBJS stripslash.$ac_objext" echo "$as_me:$LINENO: checking for error_at_line" >&5 echo $ECHO_N "checking for error_at_line... $ECHO_C" >&6 if test "${ac_cv_lib_error_at_line+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { error_at_line (0, 0, "", 0, ""); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_error_at_line=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_error_at_line=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5 echo "${ECHO_T}$ac_cv_lib_error_at_line" >&6 if test $ac_cv_lib_error_at_line = no; then gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext" fi : gl_LIBOBJS="$gl_LIBOBJS exitfail.$ac_objext" : gl_LIBOBJS="$gl_LIBOBJS filenamecat.$ac_objext" : echo "$as_me:$LINENO: checking whether free (NULL) is known to work" >&5 echo $ECHO_N "checking whether free (NULL) is known to work... $ECHO_C" >&6 if test "${gl_cv_func_free+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #if _POSIX_VERSION < 199009L && \ (defined unix || defined _unix || defined _unix_ \ || defined __unix || defined __unix__) #error "'free (NULL)' is not known to work" #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_func_free=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_func_free=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gl_cv_func_free" >&5 echo "${ECHO_T}$gl_cv_func_free" >&6 if test $gl_cv_func_free = no; then gl_LIBOBJS="$gl_LIBOBJS free.$ac_objext" cat >>confdefs.h <<\_ACEOF #define free rpl_free _ACEOF fi gl_abort_bug=no case $gl_cv_func_getcwd_null in yes) : echo "$as_me:$LINENO: checking whether getcwd handles long file names properly" >&5 echo $ECHO_N "checking whether getcwd handles long file names properly... $ECHO_C" >&6 if test "${gl_cv_func_getcwd_path_max+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Arrange for deletion of the temporary directory this test creates. ac_clean_files="$ac_clean_files confdir3" if test "$cross_compiling" = yes; then gl_cv_func_getcwd_path_max=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include #include #include #include #include #ifndef AT_FDCWD # define AT_FDCWD 0 #endif #ifdef ENAMETOOLONG # define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG) #else # define is_ENAMETOOLONG(x) 0 #endif /* Don't get link errors because mkdir is redefined to rpl_mkdir. */ #undef mkdir #ifndef S_IRWXU # define S_IRWXU 0700 #endif /* The length of this name must be 8. */ #define DIR_NAME "confdir3" #define DIR_NAME_LEN 8 #define DIR_NAME_SIZE (DIR_NAME_LEN + 1) /* The length of "../". */ #define DOTDOTSLASH_LEN 3 /* Leftover bytes in the buffer, to work around library or OS bugs. */ #define BUF_SLOP 20 int main () { #ifndef PATH_MAX /* The Hurd doesn't define this, so getcwd can't exhibit the bug -- at least not on a local file system. And if we were to start worrying about remote file systems, we'd have to enable the wrapper function all of the time, just to be safe. That's not worth the cost. */ exit (0); #elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \ - DIR_NAME_SIZE - BUF_SLOP) \ <= PATH_MAX) /* FIXME: Assuming there's a system for which this is true, this should be done in a compile test. */ exit (0); #else char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) + DIR_NAME_SIZE + BUF_SLOP]; char *cwd = getcwd (buf, PATH_MAX); size_t initial_cwd_len; size_t cwd_len; int fail = 0; size_t n_chdirs = 0; if (cwd == NULL) exit (1); cwd_len = initial_cwd_len = strlen (cwd); while (1) { size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN); char *c = NULL; cwd_len += DIR_NAME_SIZE; /* If mkdir or chdir fails, it could be that this system cannot create any file with an absolute name longer than PATH_MAX, such as cygwin. If so, leave fail as 0, because the current working directory can't be too long for getcwd if it can't even be created. For other errors, be pessimistic and consider that as a failure, too. */ if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0) { if (! (errno == ERANGE || is_ENAMETOOLONG (errno))) fail = 2; break; } if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE) { c = getcwd (buf, PATH_MAX); if (!c && errno == ENOENT) { fail = 1; break; } if (c || ! (errno == ERANGE || is_ENAMETOOLONG (errno))) { fail = 2; break; } } if (dotdot_max <= cwd_len - initial_cwd_len) { if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len) break; c = getcwd (buf, cwd_len + 1); if (!c) { if (! (errno == ERANGE || errno == ENOENT || is_ENAMETOOLONG (errno))) { fail = 2; break; } if (AT_FDCWD || errno == ERANGE || errno == ENOENT) { fail = 1; break; } } } if (c && strlen (c) != cwd_len) { fail = 2; break; } ++n_chdirs; } /* Leaving behind such a deep directory is not polite. So clean up here, right away, even though the driving shell script would also clean up. */ { size_t i; /* Try rmdir first, in case the chdir failed. */ rmdir (DIR_NAME); for (i = 0; i <= n_chdirs; i++) { if (chdir ("..") < 0) break; rmdir (DIR_NAME); } } exit (fail); #endif } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_func_getcwd_path_max=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) case $? in 1) gl_cv_func_getcwd_path_max='no, but it is partly working';; *) gl_cv_func_getcwd_path_max=no;; esac fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $gl_cv_func_getcwd_path_max" >&5 echo "${ECHO_T}$gl_cv_func_getcwd_path_max" >&6 case $gl_cv_func_getcwd_path_max in no,*) cat >>confdefs.h <<\_ACEOF #define HAVE_PARTLY_WORKING_GETCWD 1 _ACEOF ;; esac : for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking whether getcwd aborts when 4k < cwd_length < 16k" >&5 echo $ECHO_N "checking whether getcwd aborts when 4k < cwd_length < 16k... $ECHO_C" >&6 if test "${gl_cv_func_getcwd_abort_bug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Remove any remnants of a previous test. rm -rf confdir-14B--- # Arrange for deletion of the temporary directory this test creates. ac_clean_files="$ac_clean_files confdir-14B---" if test "$cross_compiling" = yes; then gl_cv_func_getcwd_abort_bug=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include #include /* Don't get link errors because mkdir is redefined to rpl_mkdir. */ #undef mkdir #ifndef S_IRWXU # define S_IRWXU 0700 #endif /* FIXME: skip the run-test altogether on systems without getpagesize. */ #if ! HAVE_GETPAGESIZE # define getpagesize() 0 #endif /* This size is chosen to be larger than PATH_MAX (4k), yet smaller than the 16kB pagesize on ia64 linux. Those conditions make the code below trigger a bug in glibc's getcwd implementation before 2.4.90-10. */ #define TARGET_LEN (5 * 1024) int main () { char const *dir_name = "confdir-14B---"; char *cwd; size_t initial_cwd_len; int fail = 0; size_t desired_depth; size_t d; /* The bug is triggered when PATH_MAX < getpagesize (), so skip this relative expensive and invasive test if that's not true. */ if (getpagesize () <= PATH_MAX) return 0; cwd = getcwd (NULL, 0); if (cwd == NULL) return 0; initial_cwd_len = strlen (cwd); free (cwd); desired_depth = ((TARGET_LEN - 1 - initial_cwd_len) / (1 + strlen (dir_name))); for (d = 0; d < desired_depth; d++) { if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0) { fail = 3; /* Unable to construct deep hierarchy. */ break; } } /* If libc has the bug in question, this invocation of getcwd results in a failed assertion. */ cwd = getcwd (NULL, 0); if (cwd == NULL) fail = 4; /* getcwd failed. This is ok, and expected. */ free (cwd); /* Call rmdir first, in case the above chdir failed. */ rmdir (dir_name); while (0 < d--) { if (chdir ("..") < 0) break; rmdir (dir_name); } return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_func_getcwd_abort_bug=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gl_cv_func_getcwd_abort_bug=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $gl_cv_func_getcwd_abort_bug" >&5 echo "${ECHO_T}$gl_cv_func_getcwd_abort_bug" >&6 if test $gl_cv_func_getcwd_abort_bug = yes; then gl_abort_bug=yes fi ;; esac case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_path_max,$gl_abort_bug in yes,yes,no) ;; *) gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext" cat >>confdefs.h <<\_ACEOF #define __GETCWD_PREFIX rpl_ _ACEOF : ;; esac for ac_func in getdelim do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done : if test $ac_cv_func_getdelim = no; then for ac_func in flockfile funlockfile do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi echo "$as_me:$LINENO: checking whether getline is declared" >&5 echo $ECHO_N "checking whether getline is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_getline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef getline char *p = (char *) getline; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_getline=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getline=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_getline" >&5 echo "${ECHO_T}$ac_cv_have_decl_getline" >&6 if test $ac_cv_have_decl_getline = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETLINE 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETLINE 0 _ACEOF fi gl_getline_needs_run_time_check=no echo "$as_me:$LINENO: checking for getline" >&5 echo $ECHO_N "checking for getline... $ECHO_C" >&6 if test "${ac_cv_func_getline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define getline to an innocuous variant, in case declares getline. For example, HP-UX 11i declares gettimeofday. */ #define getline innocuous_getline /* System header to define __stub macros and hopefully few prototypes, which can conflict with char getline (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef getline /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getline (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_getline) || defined (__stub___getline) choke me #else char (*f) () = getline; #endif #ifdef __cplusplus } #endif int main () { return f != getline; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_getline=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_getline=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_getline" >&5 echo "${ECHO_T}$ac_cv_func_getline" >&6 if test $ac_cv_func_getline = yes; then gl_getline_needs_run_time_check=yes else am_cv_func_working_getline=no fi if test $gl_getline_needs_run_time_check = yes; then echo "$as_me:$LINENO: checking for working getline function" >&5 echo $ECHO_N "checking for working getline function... $ECHO_C" >&6 if test "${am_cv_func_working_getline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else echo fooN |tr -d '\012'|tr N '\012' > conftest.data if test "$cross_compiling" = yes; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ >= 2) Lucky GNU user #endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Lucky GNU user" >/dev/null 2>&1; then am_cv_func_working_getline=yes else am_cv_func_working_getline=no fi rm -f conftest* else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # include # include # include int main () { /* Based on a test program from Karl Heuer. */ char *line = NULL; size_t siz = 0; int len; FILE *in = fopen ("./conftest.data", "r"); if (!in) return 1; len = getline (&line, &siz, in); exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_func_working_getline=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) am_cv_func_working_getline=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $am_cv_func_working_getline" >&5 echo "${ECHO_T}$am_cv_func_working_getline" >&6 fi if test $am_cv_func_working_getline = no; then cat >>confdefs.h <<\_ACEOF #define getline gnu_getline _ACEOF gl_LIBOBJS="$gl_LIBOBJS getline.$ac_objext" for ac_func in getdelim do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done : if test $ac_cv_func_getdelim = no; then for ac_func in flockfile funlockfile do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi fi if test -n "$GETOPT_H"; then gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" GETOPT_H=getopt.h cat >>confdefs.h <<\_ACEOF #define __GETOPT_PREFIX rpl_ _ACEOF : fi echo "$as_me:$LINENO: checking whether gettimeofday clobbers localtime buffer" >&5 echo $ECHO_N "checking whether gettimeofday clobbers localtime buffer... $ECHO_C" >&6 if test "${jm_cv_func_gettimeofday_clobber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then jm_cv_func_gettimeofday_clobber=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #include int main () { time_t t = 0; struct tm *lt; struct tm saved_lt; struct timeval tv; lt = localtime (&t); saved_lt = *lt; gettimeofday (&tv, NULL); if (memcmp (lt, &saved_lt, sizeof (struct tm)) != 0) exit (1); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then jm_cv_func_gettimeofday_clobber=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) jm_cv_func_gettimeofday_clobber=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $jm_cv_func_gettimeofday_clobber" >&5 echo "${ECHO_T}$jm_cv_func_gettimeofday_clobber" >&6 if test $jm_cv_func_gettimeofday_clobber = yes; then gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" cat >>confdefs.h <<\_ACEOF #define gmtime rpl_gmtime _ACEOF cat >>confdefs.h <<\_ACEOF #define localtime rpl_localtime _ACEOF cat >>confdefs.h <<\_ACEOF #define gettimeofday rpl_gettimeofday _ACEOF fi echo "$as_me:$LINENO: checking whether the compiler generally respects inline" >&5 echo $ECHO_N "checking whether the compiler generally respects inline... $ECHO_C" >&6 if test "${gl_cv_c_inline_effective+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test $ac_cv_c_inline = no; then gl_cv_c_inline_effective=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifdef __NO_INLINE__ #error "inline is not effective" #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_c_inline_effective=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_c_inline_effective=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $gl_cv_c_inline_effective" >&5 echo "${ECHO_T}$gl_cv_c_inline_effective" >&6 if test $gl_cv_c_inline_effective = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_INLINE 1 _ACEOF fi : for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if STDC_HEADERS || HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { exit (malloc (0) ? 0 : 1); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_malloc_0_nonnull=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 0 _ACEOF gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi : if test $ac_cv_header_wchar_h = yes; then gl_LIBOBJS="$gl_LIBOBJS mbchar.$ac_objext" : for ac_func in iswcntrl do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi : for ac_func in memchr do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test $ac_cv_func_memchr = no; then for ac_header in bp-sym.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi if test $ac_cv_func_memcmp_working = no; then cat >>confdefs.h <<\_ACEOF #define memcmp rpl_memcmp _ACEOF : fi for ac_func in memcpy do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test $ac_cv_func_memcpy = no; then : fi for ac_func in memmove do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test $ac_cv_func_memmove = no; then : fi for ac_func in mempcpy do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test $ac_cv_func_mempcpy = no; then : fi for ac_func in memset do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test $ac_cv_func_memset = no; then : fi if test $ac_cv_func_working_mktime = no; then cat >>confdefs.h <<\_ACEOF #define mktime rpl_mktime _ACEOF : fi echo "$as_me:$LINENO: checking for obstacks" >&5 echo $ECHO_N "checking for obstacks... $ECHO_C" >&6 if test "${ac_cv_func_obstack+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "obstack.h" int main () { struct obstack *mem; obstack_free(mem,(char *) 0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_obstack=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_obstack=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_obstack" >&5 echo "${ECHO_T}$ac_cv_func_obstack" >&6 if test $ac_cv_func_obstack = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OBSTACK 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS obstack.$ac_objext" fi : for ac_func in readlink do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test $ac_cv_func_readlink = no; then gl_LIBOBJS="$gl_LIBOBJS readlink.$ac_objext" : fi for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6 if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_realloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if STDC_HEADERS || HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { exit (realloc (0, 0) ? 0 : 1); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_realloc_0_nonnull=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_realloc_0_nonnull=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6 if test $ac_cv_func_realloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_REALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_REALLOC 0 _ACEOF gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext" cat >>confdefs.h <<\_ACEOF #define realloc rpl_realloc _ACEOF fi for ac_func in setenv unsetenv do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test $ac_cv_func_setenv = no; then : for ac_header in search.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in tsearch do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking if environ is properly declared" >&5 echo $ECHO_N "checking if environ is properly declared... $ECHO_C" >&6 if test "${gt_cv_var_environ_declaration+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern struct { int foo; } environ; int main () { environ.foo = 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_var_environ_declaration=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_var_environ_declaration=yes fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_var_environ_declaration" >&5 echo "${ECHO_T}$gt_cv_var_environ_declaration" >&6 if test $gt_cv_var_environ_declaration = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ENVIRON_DECL 1 _ACEOF fi fi if test $ac_cv_func_unsetenv = no; then : echo "$as_me:$LINENO: checking if environ is properly declared" >&5 echo $ECHO_N "checking if environ is properly declared... $ECHO_C" >&6 if test "${gt_cv_var_environ_declaration+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern struct { int foo; } environ; int main () { environ.foo = 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_var_environ_declaration=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_var_environ_declaration=yes fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_var_environ_declaration" >&5 echo "${ECHO_T}$gt_cv_var_environ_declaration" >&6 if test $gt_cv_var_environ_declaration = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ENVIRON_DECL 1 _ACEOF fi else echo "$as_me:$LINENO: checking for unsetenv() return type" >&5 echo $ECHO_N "checking for unsetenv() return type... $ECHO_C" >&6 if test "${gt_cv_func_unsetenv_ret+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) int unsetenv (const char *name); #else int unsetenv(); #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_unsetenv_ret='int' else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_unsetenv_ret='void' fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_func_unsetenv_ret" >&5 echo "${ECHO_T}$gt_cv_func_unsetenv_ret" >&6 if test $gt_cv_func_unsetenv_ret = 'void'; then cat >>confdefs.h <<\_ACEOF #define VOID_UNSETENV 1 _ACEOF fi fi for ac_header in stdint.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for SIZE_MAX" >&5 echo $ECHO_N "checking for SIZE_MAX... $ECHO_C" >&6 if test "${gl_cv_size_max+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gl_cv_size_max= cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Found it" >/dev/null 2>&1; then gl_cv_size_max=yes fi rm -f conftest* if test -z "$gl_cv_size_max"; then if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) size_t_bits_minus_1=$ac_lo;; '') size_t_bits_minus_1= ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include long longval () { return sizeof (size_t) * CHAR_BIT - 1; } unsigned long ulongval () { return sizeof (size_t) * CHAR_BIT - 1; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if ((sizeof (size_t) * CHAR_BIT - 1) < 0) { long i = longval (); if (i != (sizeof (size_t) * CHAR_BIT - 1)) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != (sizeof (size_t) * CHAR_BIT - 1)) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then size_t_bits_minus_1=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) size_t_bits_minus_1= fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) fits_in_uint=$ac_lo;; '') fits_in_uint= ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include long longval () { return sizeof (size_t) <= sizeof (unsigned int); } unsigned long ulongval () { return sizeof (size_t) <= sizeof (unsigned int); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if ((sizeof (size_t) <= sizeof (unsigned int)) < 0) { long i = longval (); if (i != (sizeof (size_t) <= sizeof (unsigned int))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != (sizeof (size_t) <= sizeof (unsigned int))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then fits_in_uint=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) fits_in_uint= fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then if test $fits_in_uint = 1; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern size_t foo; extern unsigned long foo; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then fits_in_uint=0 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $fits_in_uint = 1; then gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" else gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" fi else gl_cv_size_max='((size_t)~(size_t)0)' fi fi fi echo "$as_me:$LINENO: result: $gl_cv_size_max" >&5 echo "${ECHO_T}$gl_cv_size_max" >&6 if test "$gl_cv_size_max" != yes; then cat >>confdefs.h <<_ACEOF #define SIZE_MAX $gl_cv_size_max _ACEOF fi echo "$as_me:$LINENO: checking for ssize_t" >&5 echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 if test "${gt_cv_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int x = sizeof (ssize_t *) + sizeof (ssize_t); return !x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_ssize_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_ssize_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5 echo "${ECHO_T}$gt_cv_ssize_t" >&6 if test $gt_cv_ssize_t = no; then cat >>confdefs.h <<\_ACEOF #define ssize_t int _ACEOF fi # Define two additional variables used in the Makefile substitution. if test "$ac_cv_header_stdbool_h" = yes; then STDBOOL_H='' else STDBOOL_H='stdbool.h' fi if test "$ac_cv_type__Bool" = yes; then HAVE__BOOL=1 else HAVE__BOOL=0 fi if test $ac_cv_type_long_long_int = yes; then HAVE_LONG_LONG_INT=1 else HAVE_LONG_LONG_INT=0 fi if test $ac_cv_type_unsigned_long_long_int = yes; then HAVE_UNSIGNED_LONG_LONG_INT=1 else HAVE_UNSIGNED_LONG_LONG_INT=0 fi : if test $ac_cv_header_wchar_h = yes; then HAVE_WCHAR_H=1 else HAVE_WCHAR_H=0 fi if test $ac_cv_header_inttypes_h = yes; then HAVE_INTTYPES_H=1 else HAVE_INTTYPES_H=0 fi if test $ac_cv_header_sys_types_h = yes; then HAVE_SYS_TYPES_H=1 else HAVE_SYS_TYPES_H=0 fi if test $ac_cv_header_stdint_h = yes; then echo "$as_me:$LINENO: checking absolute name of " >&5 echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6 if test "${gl_cv_absolute_stdint_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else : if test $ac_cv_header_stdint_h = yes; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF gl_cv_absolute_stdint_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/stdint.h#{s#.*"\(.*/stdint.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` fi fi echo "$as_me:$LINENO: result: $gl_cv_absolute_stdint_h" >&5 echo "${ECHO_T}$gl_cv_absolute_stdint_h" >&6 cat >>confdefs.h <<_ACEOF #define ABSOLUTE_STDINT_H "$gl_cv_absolute_stdint_h" _ACEOF ABSOLUTE_STDINT_H=\"$gl_cv_absolute_stdint_h\" HAVE_STDINT_H=1 else ABSOLUTE_STDINT_H=\"no/such/file/stdint.h\" HAVE_STDINT_H=0 fi if test $ac_cv_header_stdint_h = yes; then echo "$as_me:$LINENO: checking whether stdint.h conforms to C99" >&5 echo $ECHO_N "checking whether stdint.h conforms to C99... $ECHO_C" >&6 if test "${gl_cv_header_working_stdint_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gl_cv_header_working_stdint_h=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ #include ABSOLUTE_STDINT_H #ifdef INT8_MAX int8_t a1 = INT8_MAX; int8_t a1min = INT8_MIN; #endif #ifdef INT16_MAX int16_t a2 = INT16_MAX; int16_t a2min = INT16_MIN; #endif #ifdef INT32_MAX int32_t a3 = INT32_MAX; int32_t a3min = INT32_MIN; #endif #ifdef INT64_MAX int64_t a4 = INT64_MAX; int64_t a4min = INT64_MIN; #endif #ifdef UINT8_MAX uint8_t b1 = UINT8_MAX; #else typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; #endif #ifdef UINT16_MAX uint16_t b2 = UINT16_MAX; #endif #ifdef UINT32_MAX uint32_t b3 = UINT32_MAX; #endif #ifdef UINT64_MAX uint64_t b4 = UINT64_MAX; #endif int_least8_t c1 = INT8_C (0x7f); int_least8_t c1max = INT_LEAST8_MAX; int_least8_t c1min = INT_LEAST8_MIN; int_least16_t c2 = INT16_C (0x7fff); int_least16_t c2max = INT_LEAST16_MAX; int_least16_t c2min = INT_LEAST16_MIN; int_least32_t c3 = INT32_C (0x7fffffff); int_least32_t c3max = INT_LEAST32_MAX; int_least32_t c3min = INT_LEAST32_MIN; int_least64_t c4 = INT64_C (0x7fffffffffffffff); int_least64_t c4max = INT_LEAST64_MAX; int_least64_t c4min = INT_LEAST64_MIN; uint_least8_t d1 = UINT8_C (0xff); uint_least8_t d1max = UINT_LEAST8_MAX; uint_least16_t d2 = UINT16_C (0xffff); uint_least16_t d2max = UINT_LEAST16_MAX; uint_least32_t d3 = UINT32_C (0xffffffff); uint_least32_t d3max = UINT_LEAST32_MAX; uint_least64_t d4 = UINT64_C (0xffffffffffffffff); uint_least64_t d4max = UINT_LEAST64_MAX; int_fast8_t e1 = INT_FAST8_MAX; int_fast8_t e1min = INT_FAST8_MIN; int_fast16_t e2 = INT_FAST16_MAX; int_fast16_t e2min = INT_FAST16_MIN; int_fast32_t e3 = INT_FAST32_MAX; int_fast32_t e3min = INT_FAST32_MIN; int_fast64_t e4 = INT_FAST64_MAX; int_fast64_t e4min = INT_FAST64_MIN; uint_fast8_t f1 = UINT_FAST8_MAX; uint_fast16_t f2 = UINT_FAST16_MAX; uint_fast32_t f3 = UINT_FAST32_MAX; uint_fast64_t f4 = UINT_FAST64_MAX; #ifdef INTPTR_MAX intptr_t g = INTPTR_MAX; intptr_t gmin = INTPTR_MIN; #endif #ifdef UINTPTR_MAX uintptr_t h = UINTPTR_MAX; #endif intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; struct s { int check_PTRDIFF: PTRDIFF_MIN < 0 && 0 < PTRDIFF_MAX ? 1 : -1; int check_SIG_ATOMIC: SIG_ATOMIC_MIN <= 0 && 0 < SIG_ATOMIC_MAX ? 1 : -1; int check_SIZE: 0 < SIZE_MAX ? 1 : -1; int check_WCHAR: WCHAR_MIN <= 0 && 0 < WCHAR_MAX ? 1 : -1; int check_WINT: WINT_MIN <= 0 && 0 < WINT_MAX ? 1 : -1; /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ int check_UINT8_C: (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; int check_UINT16_C: (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; /* Detect bugs in OpenBSD 3.9 stdint.h. */ #ifdef UINT8_MAX int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; #endif #ifdef UINT16_MAX int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; #endif #ifdef UINT32_MAX int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; #endif #ifdef UINT64_MAX int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; #endif int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; }; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_header_working_stdint_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gl_cv_header_working_stdint_h" >&5 echo "${ECHO_T}$gl_cv_header_working_stdint_h" >&6 fi if test "$gl_cv_header_working_stdint_h" != yes; then for ac_header in sys/inttypes.h sys/bitypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test $ac_cv_header_sys_inttypes_h = yes; then HAVE_SYS_INTTYPES_H=1 else HAVE_SYS_INTTYPES_H=0 fi if test $ac_cv_header_sys_bitypes_h = yes; then HAVE_SYS_BITYPES_H=1 else HAVE_SYS_BITYPES_H=0 fi for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do echo "$as_me:$LINENO: checking for bit size of $gltype" >&5 echo $ECHO_N "checking for bit size of $gltype... $ECHO_C" >&6 if eval "test \"\${gl_cv_bitsizeof_${gltype}+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if HAVE_WCHAR_H /* BSD/OS 4.1 has a bug: and must be included before . */ # include # include # include #endif #include int main () { static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if HAVE_WCHAR_H /* BSD/OS 4.1 has a bug: and must be included before . */ # include # include # include #endif #include int main () { static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if HAVE_WCHAR_H /* BSD/OS 4.1 has a bug: and must be included before . */ # include # include # include #endif #include int main () { static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if HAVE_WCHAR_H /* BSD/OS 4.1 has a bug: and must be included before . */ # include # include # include #endif #include int main () { static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if HAVE_WCHAR_H /* BSD/OS 4.1 has a bug: and must be included before . */ # include # include # include #endif #include int main () { static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) result=$ac_lo;; '') result=unknown ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if HAVE_WCHAR_H /* BSD/OS 4.1 has a bug: and must be included before . */ # include # include # include #endif #include long longval () { return sizeof ($gltype) * CHAR_BIT; } unsigned long ulongval () { return sizeof ($gltype) * CHAR_BIT; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if ((sizeof ($gltype) * CHAR_BIT) < 0) { long i = longval (); if (i != (sizeof ($gltype) * CHAR_BIT)) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != (sizeof ($gltype) * CHAR_BIT)) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then result=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) result=unknown fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val eval gl_cv_bitsizeof_${gltype}=\$result fi echo "$as_me:$LINENO: result: `eval echo '${'gl_cv_bitsizeof_${gltype}'}'`" >&5 echo "${ECHO_T}`eval echo '${'gl_cv_bitsizeof_${gltype}'}'`" >&6 eval result=\$gl_cv_bitsizeof_${gltype} if test $result = unknown; then result=0 fi GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` cat >>confdefs.h <<_ACEOF #define BITSIZEOF_${GLTYPE} $result _ACEOF eval BITSIZEOF_${GLTYPE}=\$result done for gltype in sig_atomic_t wchar_t wint_t ; do echo "$as_me:$LINENO: checking whether $gltype is signed" >&5 echo $ECHO_N "checking whether $gltype is signed... $ECHO_C" >&6 if eval "test \"\${gl_cv_type_${gltype}_signed+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if HAVE_WCHAR_H /* BSD/OS 4.1 has a bug: and must be included before . */ # include # include # include #endif int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then result=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 result=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext eval gl_cv_type_${gltype}_signed=\$result fi echo "$as_me:$LINENO: result: `eval echo '${'gl_cv_type_${gltype}_signed'}'`" >&5 echo "${ECHO_T}`eval echo '${'gl_cv_type_${gltype}_signed'}'`" >&6 eval result=\$gl_cv_type_${gltype}_signed GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` if test "$result" = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_SIGNED_${GLTYPE} 1 _ACEOF eval HAVE_SIGNED_${GLTYPE}=1 else eval HAVE_SIGNED_${GLTYPE}=0 fi done gl_cv_type_ptrdiff_t_signed=yes gl_cv_type_size_t_signed=no for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do echo "$as_me:$LINENO: checking for $gltype integer literal suffix" >&5 echo $ECHO_N "checking for $gltype integer literal suffix... $ECHO_C" >&6 if eval "test \"\${gl_cv_type_${gltype}_suffix+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval gl_cv_type_${gltype}_suffix=no eval result=\$gl_cv_type_${gltype}_signed if test "$result" = yes; then glsufu= else glsufu=u fi for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do case $glsuf in '') gltype1='int';; l) gltype1='long int';; ll) gltype1='long long int';; i64) gltype1='__int64';; u) gltype1='unsigned int';; ul) gltype1='unsigned long int';; ull) gltype1='unsigned long long int';; ui64)gltype1='unsigned __int64';; esac cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if HAVE_WCHAR_H /* BSD/OS 4.1 has a bug: and must be included before . */ # include # include # include #endif extern $gltype foo; extern $gltype1 foo; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval gl_cv_type_${gltype}_suffix=\$glsuf else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext eval result=\$gl_cv_type_${gltype}_suffix test "$result" != no && break done fi echo "$as_me:$LINENO: result: `eval echo '${'gl_cv_type_${gltype}_suffix'}'`" >&5 echo "${ECHO_T}`eval echo '${'gl_cv_type_${gltype}_suffix'}'`" >&6 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` eval result=\$gl_cv_type_${gltype}_suffix test "$result" = no && result= eval ${GLTYPE}_SUFFIX=\$result cat >>confdefs.h <<_ACEOF #define ${GLTYPE}_SUFFIX $result _ACEOF done STDINT_H=stdint.h fi gl_LIBOBJS="$gl_LIBOBJS strcasecmp.$ac_objext" : for ac_func in strncasecmp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done echo "$as_me:$LINENO: checking whether strncasecmp is declared" >&5 echo $ECHO_N "checking whether strncasecmp is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_strncasecmp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strncasecmp char *p = (char *) strncasecmp; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strncasecmp=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strncasecmp=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_strncasecmp" >&5 echo "${ECHO_T}$ac_cv_have_decl_strncasecmp" >&6 if test $ac_cv_have_decl_strncasecmp = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRNCASECMP 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRNCASECMP 0 _ACEOF fi if test $ac_cv_func_strncasecmp = no; then : fi for ac_func in strchrnul do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test $ac_cv_func_strchrnul = no; then : fi for ac_func in strdup do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done : : : # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. echo "$as_me:$LINENO: checking for working strndup" >&5 echo $ECHO_N "checking for working strndup... $ECHO_C" >&6 if test "${gl_cv_func_strndup+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then echo "$as_me:$LINENO: checking for strndup" >&5 echo $ECHO_N "checking for strndup... $ECHO_C" >&6 if test "${ac_cv_func_strndup+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define strndup to an innocuous variant, in case declares strndup. For example, HP-UX 11i declares gettimeofday. */ #define strndup innocuous_strndup /* System header to define __stub macros and hopefully few prototypes, which can conflict with char strndup (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef strndup /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strndup (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_strndup) || defined (__stub___strndup) choke me #else char (*f) () = strndup; #endif #ifdef __cplusplus } #endif int main () { return f != strndup; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strndup=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_strndup=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_strndup" >&5 echo "${ECHO_T}$ac_cv_func_strndup" >&6 if test $ac_cv_func_strndup = yes; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef _AIX too risky #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "too risky" >/dev/null 2>&1; then gl_cv_func_strndup=no else gl_cv_func_strndup=yes fi rm -f conftest* else gl_cv_func_strndup=no fi else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #ifndef HAVE_DECL_STRNDUP extern char *strndup (const char *, size_t); #endif char *s; s = strndup ("some longer string", 15); free (s); s = strndup ("shorter string", 13); return s[13] != '\0'; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_func_strndup=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gl_cv_func_strndup=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $gl_cv_func_strndup" >&5 echo "${ECHO_T}$gl_cv_func_strndup" >&6 if test $gl_cv_func_strndup = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRNDUP 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext" : fi echo "$as_me:$LINENO: checking for working strnlen" >&5 echo $ECHO_N "checking for working strnlen... $ECHO_C" >&6 if test "${ac_cv_func_strnlen_working+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_strnlen_working=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #define S "foobar" #define S_LEN (sizeof S - 1) /* At least one implementation is buggy: that of AIX 4.3 would give strnlen (S, 1) == 3. */ int i; for (i = 0; i < S_LEN + 1; ++i) { int expected = i <= S_LEN ? i : S_LEN; if (strnlen (S, i) != expected) exit (1); } exit (0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strnlen_working=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_strnlen_working=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_strnlen_working" >&5 echo "${ECHO_T}$ac_cv_func_strnlen_working" >&6 test $ac_cv_func_strnlen_working = no && gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext" if test $ac_cv_func_strnlen_working = no; then # This is necessary because automake-1.6.1 doens't understand # that the above use of AC_FUNC_STRNLEN means we may have to use # lib/strnlen.c. #AC_LIBOBJ(strnlen) cat >>confdefs.h <<\_ACEOF #define strnlen rpl_strnlen _ACEOF : fi for ac_func in strpbrk do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test $ac_cv_func_strpbrk = no; then : fi gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext" : for ac_func in strtol do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done for ac_func in strtoul do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done : echo "$as_me:$LINENO: checking whether mkdir is declared" >&5 echo $ECHO_N "checking whether mkdir is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef mkdir char *p = (char *) mkdir; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_mkdir=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_mkdir=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_mkdir" >&5 echo "${ECHO_T}$ac_cv_have_decl_mkdir" >&6 if test $ac_cv_have_decl_mkdir = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_MKDIR 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_MKDIR 0 _ACEOF for ac_header in io.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi echo "$as_me:$LINENO: checking absolute name of " >&5 echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6 if test "${gl_cv_absolute_sys_stat_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else : if test $ac_cv_header_sys_stat_h = yes; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF gl_cv_absolute_sys_stat_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | sed -n '\#/sys/stat.h#{s#.*"\(.*/sys/stat.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` fi fi echo "$as_me:$LINENO: result: $gl_cv_absolute_sys_stat_h" >&5 echo "${ECHO_T}$gl_cv_absolute_sys_stat_h" >&6 cat >>confdefs.h <<_ACEOF #define ABSOLUTE_SYS_STAT_H "$gl_cv_absolute_sys_stat_h" _ACEOF ABSOLUTE_SYS_STAT_H=\"$gl_cv_absolute_sys_stat_h\" SYS_STAT_H='sys/stat.h' for ac_header in sysexits.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF SYSEXITS_H= else SYSEXITS_H=sysexits.h fi done echo "$as_me:$LINENO: checking whether localtime_r is compatible with its POSIX signature" >&5 echo $ECHO_N "checking whether localtime_r is compatible with its POSIX signature... $ECHO_C" >&6 if test "${gl_cv_time_r_posix+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { /* We don't need to append 'restrict's to the argument types, even though the POSIX signature has the 'restrict's, since C99 says they can't affect type compatibility. */ struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; if (ptr) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_time_r_posix=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_time_r_posix=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gl_cv_time_r_posix" >&5 echo "${ECHO_T}$gl_cv_time_r_posix" >&6 if test $gl_cv_time_r_posix = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TIME_R_POSIX 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS time_r.$ac_objext" : fi echo "$as_me:$LINENO: checking whether tzset clobbers localtime buffer" >&5 echo $ECHO_N "checking whether tzset clobbers localtime buffer... $ECHO_C" >&6 if test "${gl_cv_func_tzset_clobber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then gl_cv_func_tzset_clobber=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #include int main () { time_t t1 = 853958121; struct tm *p, s; putenv ("TZ=GMT0"); p = localtime (&t1); s = *p; putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"); tzset (); exit (p->tm_year != s.tm_year || p->tm_mon != s.tm_mon || p->tm_mday != s.tm_mday || p->tm_hour != s.tm_hour || p->tm_min != s.tm_min || p->tm_sec != s.tm_sec); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_func_tzset_clobber=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gl_cv_func_tzset_clobber=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $gl_cv_func_tzset_clobber" >&5 echo "${ECHO_T}$gl_cv_func_tzset_clobber" >&6 cat >>confdefs.h <<\_ACEOF #define HAVE_RUN_TZSET_TEST 1 _ACEOF if test $gl_cv_func_tzset_clobber = yes; then gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" cat >>confdefs.h <<\_ACEOF #define gmtime rpl_gmtime _ACEOF cat >>confdefs.h <<\_ACEOF #define localtime rpl_localtime _ACEOF cat >>confdefs.h <<\_ACEOF #define tzset rpl_tzset _ACEOF cat >>confdefs.h <<\_ACEOF #define TZSET_CLOBBERS_LOCALTIME_BUFFER 1 _ACEOF fi for ac_header in unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF UNISTD_H='' else UNISTD_H='unistd.h' fi done cat >>confdefs.h <<\_ACEOF #define USE_UNLOCKED_IO 1 _ACEOF : : : : : : : : : : : : : for ac_func in vasnprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done if test $ac_cv_func_vasnprintf = no; then gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6 if test "${ac_cv_type_ptrdiff_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((ptrdiff_t *) 0) return 0; if (sizeof (ptrdiff_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_ptrdiff_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_ptrdiff_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6 if test $ac_cv_type_ptrdiff_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_PTRDIFF_T 1 _ACEOF fi for ac_func in snprintf wcslen do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi for ac_func in vsnprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done : : : : echo "$as_me:$LINENO: checking whether wcwidth is declared" >&5 echo $ECHO_N "checking whether wcwidth is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_wcwidth+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* AIX 3.2.5 declares wcwidth in . */ #include #if HAVE_WCHAR_H /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.1 has a bug: and must be included before . */ # include # include # include #endif int main () { #ifndef wcwidth char *p = (char *) wcwidth; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_wcwidth=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_wcwidth=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_wcwidth" >&5 echo "${ECHO_T}$ac_cv_have_decl_wcwidth" >&6 if test $ac_cv_have_decl_wcwidth = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_WCWIDTH 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_WCWIDTH 0 _ACEOF fi gl_LIBOBJS="$gl_LIBOBJS xmalloc.$ac_objext" : : gl_LIBOBJS="$gl_LIBOBJS xgetcwd.$ac_objext" gl_LIBOBJS="$gl_LIBOBJS xreadlink.$ac_objext" for ac_header in stdint.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done : LIBMISC_LIBDEPS="$gl_libdeps" LIBMISC_LTLIBDEPS="$gl_ltlibdeps" : if test "$ac_cv_header_langinfo_h" = yes; then echo "$as_me:$LINENO: checking for nl_langinfo in langinfo.h" >&5 echo $ECHO_N "checking for nl_langinfo in langinfo.h... $ECHO_C" >&6 if test "${mac_cv_have_nl_langinfo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char* am = nl_langinfo(AM_STR); char* pm = nl_langinfo(PM_STR); char* m1 = nl_langinfo(MON_1); char* am1 = nl_langinfo(ABMON_1); char* d1 = nl_langinfo(DAY_1); char* ad1 = nl_langinfo(ABDAY_1); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then mac_cv_have_nl_langinfo=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 mac_cv_have_nl_langinfo=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $mac_cv_have_nl_langinfo" >&5 echo "${ECHO_T}$mac_cv_have_nl_langinfo" >&6 if test "$mac_cv_have_nl_langinfo" = yes; then echo "$as_me:$LINENO: checking for decimal point constant for nl_langinfo" >&5 echo $ECHO_N "checking for decimal point constant for nl_langinfo... $ECHO_C" >&6 if test "${mac_cv_nl_langinfo_dp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char* dp = nl_langinfo(DECIMAL_POINT); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then mac_cv_nl_langinfo_dp=DECIMAL_POINT else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char* dp = nl_langinfo(RADIXCHAR); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then mac_cv_nl_langinfo_dp=RADIXCHAR else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 mac_cv_have_nl_langinfo=unknown fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $mac_cv_nl_langinfo_dp" >&5 echo "${ECHO_T}$mac_cv_nl_langinfo_dp" >&6 else mac_cv_nl_langinfo_dp=unknown fi if test "$mac_cv_have_nl_langinfo" != no; then cat >>confdefs.h <<\_ACEOF #define HAVE_NL_LANGINFO 1 _ACEOF fi if test "$mac_cv_nl_langinfo_dp" != unknown; then cat >>confdefs.h <<_ACEOF #define NL_LANGINFO_DP $mac_cv_nl_langinfo_dp _ACEOF fi fi for ac_header in stdlib.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to foonly@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for working mmap" >&5 echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !STDC_HEADERS && !HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #if !HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ # if !HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # if HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) exit (1); for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) exit (1); if (write (fd, data, pagesize) != pagesize) exit (1); close (fd); /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) exit (1); data2 = (char *) malloc (2 * pagesize); if (!data2) exit (1); data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) exit (1); /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) exit (1); if (read (fd, data3, pagesize) != pagesize) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) exit (1); close (fd); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 _ACEOF fi rm -f conftest.mmap echo "$as_me:$LINENO: checking for long file names" >&5 echo $ECHO_N "checking for long file names... $ECHO_C" >&6 if test "${ac_cv_sys_long_file_names+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_long_file_names=yes # Test for long file names in all the places we know might matter: # . the current directory, where building will happen # $prefix/lib where we will be installing things # $exec_prefix/lib likewise # eval it to expand exec_prefix. # $TMPDIR if set, where it might want to write temporary files # if $TMPDIR is not set: # /tmp where it might want to write temporary files # /var/tmp likewise # /usr/tmp likewise if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then ac_tmpdirs=$TMPDIR else ac_tmpdirs='/tmp /var/tmp /usr/tmp' fi for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do test -d $ac_dir || continue test -w $ac_dir || continue # It is less confusing to not echo anything here. ac_xdir=$ac_dir/cf$$ (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue ac_tf1=$ac_xdir/conftest9012345 ac_tf2=$ac_xdir/conftest9012346 (echo 1 >$ac_tf1) 2>/dev/null (echo 2 >$ac_tf2) 2>/dev/null ac_val=`cat $ac_tf1 2>/dev/null` if test ! -f $ac_tf1 || test "$ac_val" != 1; then ac_cv_sys_long_file_names=no rm -rf $ac_xdir 2>/dev/null break fi rm -rf $ac_xdir 2>/dev/null done fi echo "$as_me:$LINENO: result: $ac_cv_sys_long_file_names" >&5 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 if test $ac_cv_sys_long_file_names = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_FILE_NAMES 1 _ACEOF fi FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR=$ac_fs_backslash_is_file_name_separator # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" fi; case "$enable_debug" in no|"") cat >>confdefs.h <<\_ACEOF #define NDEBUG 1 _ACEOF ;; *) ;; esac # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" fi; case "$enable_profile" in no|"") ;; *) if test "$GCC" != "yes"; then { { echo "$as_me:$LINENO: error: I can only use profiling on GCC" >&5 echo "$as_me: error: I can only use profiling on GCC" >&2;} { (exit 1); exit 1; }; } fi CFLAGS=`echo $CFLAGS -pg -fprofile-arcs -ftest-coverage | sed -e s,-O2,-O0,` LDFLAGS="$LDFLAGS -pg -fprofile-arcs -ftest-coverage" ;; esac # Check whether --enable-fastexit or --disable-fastexit was given. if test "${enable_fastexit+set}" = set; then enableval="$enable_fastexit" fi; case "$enable_fastexit" in yes|"") cat >>confdefs.h <<\_ACEOF #define FASTEXIT 1 _ACEOF FASTEXIT=1 ;; *) FASTEXIT=0 ;; esac if test "$GCC" = yes; then GCC_TRUE= GCC_FALSE='#' else GCC_TRUE='#' GCC_FALSE= fi CFLAGS=`echo $CFLAGS | sed -e s,-O2,-O3,` NEWS=NEWS ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile src/Makefile tests/Makefile tests/atlocal blame.spec" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GL_COND_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GL_COND_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi gl_libobjs= gl_ltlibobjs= if test -n "$gl_LIBOBJS"; then # Remove the extension. sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do gl_libobjs="$gl_libobjs $i.$ac_objext" gl_ltlibobjs="$gl_ltlibobjs $i.lo" done fi gl_LIBOBJS=$gl_libobjs gl_LTLIBOBJS=$gl_ltlibobjs if test -z "${GCC_TRUE}" && test -z "${GCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by blame $as_me 1.3.1, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ blame config.status 1.3.1 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/atlocal" ) CONFIG_FILES="$CONFIG_FILES tests/atlocal" ;; "blame.spec" ) CONFIG_FILES="$CONFIG_FILES blame.spec" ;; "tests/atconfig" ) CONFIG_COMMANDS="$CONFIG_COMMANDS tests/atconfig" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@AMTAR@,$AMTAR,;t t s,@am__tar@,$am__tar,;t t s,@am__untar@,$am__untar,;t t s,@RELEASE@,$RELEASE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LEX@,$LEX,;t t s,@LEXLIB@,$LEXLIB,;t t s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t s,@YACC@,$YACC,;t t s,@U@,$U,;t t s,@ANSI2KNR@,$ANSI2KNR,;t t s,@GL_COND_LIBTOOL_TRUE@,$GL_COND_LIBTOOL_TRUE,;t t s,@GL_COND_LIBTOOL_FALSE@,$GL_COND_LIBTOOL_FALSE,;t t s,@ALLOCA@,$ALLOCA,;t t s,@ALLOCA_H@,$ALLOCA_H,;t t s,@GETOPT_H@,$GETOPT_H,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@STDBOOL_H@,$STDBOOL_H,;t t s,@HAVE__BOOL@,$HAVE__BOOL,;t t s,@HAVE_LONG_LONG_INT@,$HAVE_LONG_LONG_INT,;t t s,@HAVE_UNSIGNED_LONG_LONG_INT@,$HAVE_UNSIGNED_LONG_LONG_INT,;t t s,@HAVE_WCHAR_H@,$HAVE_WCHAR_H,;t t s,@HAVE_INTTYPES_H@,$HAVE_INTTYPES_H,;t t s,@HAVE_SYS_TYPES_H@,$HAVE_SYS_TYPES_H,;t t s,@ABSOLUTE_STDINT_H@,$ABSOLUTE_STDINT_H,;t t s,@HAVE_STDINT_H@,$HAVE_STDINT_H,;t t s,@HAVE_SYS_INTTYPES_H@,$HAVE_SYS_INTTYPES_H,;t t s,@HAVE_SYS_BITYPES_H@,$HAVE_SYS_BITYPES_H,;t t s,@BITSIZEOF_PTRDIFF_T@,$BITSIZEOF_PTRDIFF_T,;t t s,@BITSIZEOF_SIG_ATOMIC_T@,$BITSIZEOF_SIG_ATOMIC_T,;t t s,@BITSIZEOF_SIZE_T@,$BITSIZEOF_SIZE_T,;t t s,@BITSIZEOF_WCHAR_T@,$BITSIZEOF_WCHAR_T,;t t s,@BITSIZEOF_WINT_T@,$BITSIZEOF_WINT_T,;t t s,@HAVE_SIGNED_SIG_ATOMIC_T@,$HAVE_SIGNED_SIG_ATOMIC_T,;t t s,@HAVE_SIGNED_WCHAR_T@,$HAVE_SIGNED_WCHAR_T,;t t s,@HAVE_SIGNED_WINT_T@,$HAVE_SIGNED_WINT_T,;t t s,@PTRDIFF_T_SUFFIX@,$PTRDIFF_T_SUFFIX,;t t s,@SIG_ATOMIC_T_SUFFIX@,$SIG_ATOMIC_T_SUFFIX,;t t s,@SIZE_T_SUFFIX@,$SIZE_T_SUFFIX,;t t s,@WCHAR_T_SUFFIX@,$WCHAR_T_SUFFIX,;t t s,@WINT_T_SUFFIX@,$WINT_T_SUFFIX,;t t s,@STDINT_H@,$STDINT_H,;t t s,@ABSOLUTE_SYS_STAT_H@,$ABSOLUTE_SYS_STAT_H,;t t s,@SYS_STAT_H@,$SYS_STAT_H,;t t s,@SYSEXITS_H@,$SYSEXITS_H,;t t s,@UNISTD_H@,$UNISTD_H,;t t s,@EOVERFLOW@,$EOVERFLOW,;t t s,@LIBMISC_LIBDEPS@,$LIBMISC_LIBDEPS,;t t s,@LIBMISC_LTLIBDEPS@,$LIBMISC_LTLIBDEPS,;t t s,@FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR@,$FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR,;t t s,@FASTEXIT@,$FASTEXIT,;t t s,@GCC_TRUE@,$GCC_TRUE,;t t s,@GCC_FALSE@,$GCC_FALSE,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t s,@gl_LIBOBJS@,$gl_LIBOBJS,;t t s,@gl_LTLIBOBJS@,$gl_LTLIBOBJS,;t t /@NEWS@/r $NEWS s,@NEWS@,,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in tests/atconfig ) cat >tests/atconfig < /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi blame-1.3.1/README0000644000076400007640000000351510136150141010401 00000000000000Blame ===== 1. Description -------------- Blame displays the last modification for each line in an RCS file. It is the RCS equivalent of CVS's "annotate" command. An annotated RCS file describes the revision and date in which each line was added to the file and the author of each line. 2. Requirements --------------- To compile Blame you will need a C compiler and standard C library. Once installed, Blame does not have any external dependencies. It uses its own RCS parsing code, so it does not itself require RCS. 3. Installation --------------- In general, the standard $ ./configure $ make # make install will do what you want. You may wish to run "make check" before switching to root. This will run Blame's testsuite, which will test many aspects of the program on your system. 4. Usage -------- A full list of valid command-line options can be viewed using `--help': $ blame --help Blame accepts many of the standard RCS options, such as `-r' (to select a revision): $ blame -r1.123 myfile 5. Getting Help --------------- If Blame doesn't compile on your system please send me the config.log file generated by configure, and a description of which bits don't compile. If you're having trouble running Blame on certain files you might want to try the test suite in the tarball. Simply run make check after compilation. If Blame segfaults and you're feeling adventurous, you can enable full debugging by using the --enable-debug option in configure. This turns on a bunch of assertions -- hopefully this will turn the segfault into an identifiable assertion failure. If you're still stuck, feel free to mail bug reports to . 6. Legal Stuff -------------- Blame is released under the terms and conditions of the GNU General Public License version 2. Please read the COPYING file carefully. blame-1.3.1/src/0000777000076400007640000000000010531540137010377 500000000000000blame-1.3.1/src/parser.c0000644000076400007640000017164610527553345012004 00000000000000/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* 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. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 1 /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { NUM = 258, ID = 259, SYM = 260, STR = 261, STR_FINAL = 262, HEAD = 263, BRANCH = 264, ACCESS = 265, SYMBOLS = 266, LOCKS = 267, STRICT = 268, COMMENT = 269, EXPAND = 270, DATE = 271, AUTHOR = 272, STATE = 273, BRANCHES = 274, NEXT = 275, DESC = 276, LOG = 277, TEXT = 278 }; #endif /* Tokens. */ #define NUM 258 #define ID 259 #define SYM 260 #define STR 261 #define STR_FINAL 262 #define HEAD 263 #define BRANCH 264 #define ACCESS 265 #define SYMBOLS 266 #define LOCKS 267 #define STRICT 268 #define COMMENT 269 #define EXPAND 270 #define DATE 271 #define AUTHOR 272 #define STATE 273 #define BRANCHES 274 #define NEXT 275 #define DESC 276 #define LOG 277 #define TEXT 278 /* Copy the first part of user declarations. */ #line 1 "parser.y" /* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include extern int yylex PARAMS((void)); static void yyerror PARAMS((const char *, rcs_t *, char const *)); static int _parser_count_deltalist PARAMS((const rcs_t *, const delta_t *, hash_t *)); typedef struct { unsigned int line; off_t off; off_t next; } loc_t; #define YYLTYPE loc_t #define YYLLOC_DEFAULT(Current, Rhs, N) \ ((Current).line = (Rhs)[1].line, \ (Current).off = (Rhs)[1].off, \ (Current).next = (Rhs)[N].next) static unsigned int lines; /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 1 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE #line 43 "parser.y" { char *s; unsigned int i; time_t date; hash_t *hash; vector_t *vector; lines_t *lines; delta_t *delta; struct { delta_t *head; hash_t *branches; } trunk; expand_t expand; } /* Line 193 of yacc.c. */ #line 199 "parser.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED typedef struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; } YYLTYPE; # define yyltype YYLTYPE /* obsolescent; will be withdrawn */ # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 216 of yacc.c. */ #line 224 "parser.c" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int i) #else static int YYID (i) int i; #endif { return i; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss; YYSTYPE yyvs; YYLTYPE yyls; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (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) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 82 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 26 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 37 /* YYNRULES -- Number of rules. */ #define YYNRULES 63 /* YYNRULES -- Number of states. */ #define YYNSTATES 108 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 278 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 25, 24, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint8 yyprhs[] = { 0, 0, 3, 4, 5, 20, 24, 27, 28, 32, 35, 39, 43, 47, 48, 51, 52, 56, 59, 60, 64, 67, 68, 71, 79, 83, 87, 91, 94, 98, 101, 105, 108, 111, 112, 115, 116, 122, 126, 127, 130, 134, 135, 138, 139, 142, 144, 147, 148, 153, 154, 159, 160, 164, 165, 168, 170, 172, 174, 176, 178, 180, 183, 184 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 27, 0, -1, -1, -1, 28, 30, 31, 32, 33, 34, 35, 36, 37, 57, 38, 29, 45, 46, -1, 8, 3, 24, -1, 8, 24, -1, -1, 9, 3, 24, -1, 9, 24, -1, 10, 53, 24, -1, 11, 56, 24, -1, 12, 55, 24, -1, -1, 13, 24, -1, -1, 14, 7, 24, -1, 14, 24, -1, -1, 15, 7, 24, -1, 15, 24, -1, -1, 38, 39, -1, 3, 40, 41, 42, 43, 44, 57, -1, 16, 3, 24, -1, 17, 60, 24, -1, 18, 60, 24, -1, 18, 24, -1, 19, 54, 24, -1, 19, 24, -1, 20, 3, 24, -1, 20, 24, -1, 21, 61, -1, -1, 46, 47, -1, -1, 3, 48, 49, 57, 51, -1, 22, 50, 7, -1, -1, 50, 6, -1, 23, 52, 7, -1, -1, 52, 6, -1, -1, 53, 60, -1, 3, -1, 54, 3, -1, -1, 55, 60, 25, 3, -1, -1, 56, 5, 25, 3, -1, -1, 60, 58, 24, -1, -1, 58, 59, -1, 4, -1, 3, -1, 61, -1, 25, -1, 4, -1, 5, -1, 62, 7, -1, -1, 62, 6, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 101, 101, 117, 101, 159, 160, 164, 165, 166, 170, 174, 178, 182, 183, 187, 188, 189, 193, 194, 212, 215, 217, 221, 241, 253, 257, 258, 262, 263, 267, 272, 276, 279, 281, 285, 285, 303, 312, 313, 317, 325, 326, 333, 334, 338, 347, 362, 365, 373, 374, 384, 386, 389, 391, 395, 396, 397, 398, 402, 403, 407, 410, 412 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* 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", "ID", "SYM", "STR", "STR_FINAL", "HEAD", "BRANCH", "ACCESS", "SYMBOLS", "LOCKS", "STRICT", "COMMENT", "EXPAND", "DATE", "AUTHOR", "STATE", "BRANCHES", "NEXT", "DESC", "LOG", "TEXT", "';'", "':'", "$accept", "rcstext", "@1", "@2", "admin_head", "admin_branch", "admin_access", "admin_symbols", "admin_locks", "admin_strict", "admin_comment", "admin_expand", "delta_list", "delta", "delta_date", "delta_author", "delta_state", "delta_branches", "delta_next", "desc", "deltatext_list", "deltatext", "@3", "deltatext_log", "deltatext_log_bit", "deltatext_text", "deltatext_text_string", "id_list", "num_list", "id_num_list", "sym_num_list", "newphrase_list", "word_list", "word", "id_or_sym", "gobble_string", "gobble_string_bit", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 59, 58 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 26, 28, 29, 27, 30, 30, 31, 31, 31, 32, 33, 34, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 39, 40, 41, 42, 42, 43, 43, 44, 44, 45, 46, 46, 48, 47, 49, 50, 50, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 59, 59, 60, 60, 61, 62, 62 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 0, 14, 3, 2, 0, 3, 2, 3, 3, 3, 0, 2, 0, 3, 2, 0, 3, 2, 0, 2, 7, 3, 3, 3, 2, 3, 2, 3, 2, 2, 0, 2, 0, 5, 3, 0, 2, 3, 0, 2, 0, 2, 1, 2, 0, 4, 0, 4, 0, 3, 0, 2, 1, 1, 1, 1, 1, 1, 2, 0, 2 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 2, 0, 0, 1, 0, 7, 0, 6, 0, 0, 5, 0, 9, 43, 0, 8, 0, 49, 0, 59, 60, 10, 44, 0, 47, 13, 0, 11, 0, 0, 15, 0, 12, 0, 14, 0, 18, 50, 0, 0, 17, 0, 51, 48, 16, 0, 20, 21, 53, 19, 3, 62, 0, 0, 22, 56, 55, 52, 58, 54, 57, 0, 0, 0, 62, 33, 63, 61, 0, 0, 0, 32, 4, 24, 0, 0, 0, 35, 34, 25, 27, 0, 0, 0, 0, 26, 45, 29, 0, 0, 51, 38, 51, 46, 28, 0, 31, 23, 0, 0, 30, 39, 37, 41, 36, 0, 42, 40 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 1, 2, 53, 5, 9, 14, 18, 25, 30, 36, 42, 50, 54, 63, 70, 76, 83, 90, 65, 72, 78, 84, 92, 98, 104, 105, 16, 88, 28, 23, 47, 51, 59, 48, 60, 61 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -73 static const yytype_int8 yypact[] = { -73, 8, 13, -73, 0, 34, 20, -73, 1, 36, -73, 21, -73, -73, 37, -73, 5, -73, 38, -73, -73, -73, -73, 6, -73, 39, 22, -73, 9, 25, 40, 48, -73, 30, -73, 10, 41, -73, 54, 42, -73, 12, 27, -73, -73, 43, -73, -73, -73, -73, 55, -2, 44, 47, -73, -73, -73, -73, -73, -73, -73, 31, 58, 45, -73, -73, -73, -73, 46, 27, 51, -73, 60, -73, 49, 11, 52, -73, -73, -73, -73, 50, 2, 56, 53, -73, -73, -73, 3, 4, 27, -73, 27, -73, -73, 57, -73, -73, 33, 59, -73, -73, -73, -73, -73, 35, -73, -73 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -72, -73, -73, -16, 14, -73 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { 22, 55, 56, 6, 11, 86, 93, 95, 3, 19, 20, 26, 33, 19, 20, 19, 20, 39, 97, 45, 99, 4, 57, 58, 7, 12, 87, 94, 96, 21, 27, 19, 20, 32, 40, 80, 46, 66, 67, 101, 102, 106, 107, 8, 10, 15, 13, 31, 17, 34, 24, 37, 29, 74, 35, 38, 41, 43, 52, 81, 62, 68, 69, 77, 0, 0, 44, 49, 64, 75, 73, 82, 0, 79, 85, 91, 89, 0, 71, 0, 0, 100, 103 }; static const yytype_int8 yycheck[] = { 16, 3, 4, 3, 3, 3, 3, 3, 0, 4, 5, 5, 28, 4, 5, 4, 5, 7, 90, 7, 92, 8, 24, 25, 24, 24, 24, 24, 24, 24, 24, 4, 5, 24, 24, 24, 24, 6, 7, 6, 7, 6, 7, 9, 24, 24, 10, 25, 11, 24, 12, 3, 13, 69, 14, 25, 15, 3, 3, 75, 16, 3, 17, 3, -1, -1, 24, 24, 21, 18, 24, 19, -1, 24, 24, 22, 20, -1, 64, -1, -1, 24, 23 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 27, 28, 0, 8, 30, 3, 24, 9, 31, 24, 3, 24, 10, 32, 24, 53, 11, 33, 4, 5, 24, 60, 56, 12, 34, 5, 24, 55, 13, 35, 25, 24, 60, 24, 14, 36, 3, 25, 7, 24, 15, 37, 3, 24, 7, 24, 57, 60, 24, 38, 58, 3, 29, 39, 3, 4, 24, 25, 59, 61, 62, 16, 40, 21, 45, 6, 7, 3, 17, 41, 61, 46, 24, 60, 18, 42, 3, 47, 24, 24, 60, 19, 43, 48, 24, 3, 24, 54, 20, 44, 22, 49, 3, 24, 3, 24, 57, 50, 57, 24, 6, 7, 23, 51, 52, 6, 7 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (filename, rcs, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value, Location, filename, rcs); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, const char *filename, rcs_t *rcs) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, filename, rcs) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; YYLTYPE const * const yylocationp; const char *filename; rcs_t *rcs; #endif { if (!yyvaluep) return; YYUSE (yylocationp); YYUSE (filename); YYUSE (rcs); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, const char *filename, rcs_t *rcs) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, filename, rcs) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; YYLTYPE const * const yylocationp; const char *filename; rcs_t *rcs; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); YY_LOCATION_PRINT (yyoutput, *yylocationp); YYFPRINTF (yyoutput, ": "); yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, filename, rcs); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) yytype_int16 *bottom; yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, const char *filename, rcs_t *rcs) #else static void yy_reduce_print (yyvsp, yylsp, yyrule, filename, rcs) YYSTYPE *yyvsp; YYLTYPE *yylsp; int yyrule; const char *filename; rcs_t *rcs; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) , &(yylsp[(yyi + 1) - (yynrhs)]) , filename, rcs); fprintf (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, yylsp, Rule, filename, rcs); \ } while (YYID (0)) /* 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) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # 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. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # 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 contains an apostrophe, a comma, or backslash (other than 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 yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ 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 yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, const char *filename, rcs_t *rcs) #else static void yydestruct (yymsg, yytype, yyvaluep, yylocationp, filename, rcs) const char *yymsg; int yytype; YYSTYPE *yyvaluep; YYLTYPE *yylocationp; const char *filename; rcs_t *rcs; #endif { YYUSE (yyvaluep); YYUSE (yylocationp); YYUSE (filename); YYUSE (rcs); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (const char *filename, rcs_t *rcs); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The look-ahead symbol. */ int yychar; /* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /* Location data for the look-ahead symbol. */ YYLTYPE yylloc; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (const char *filename, rcs_t *rcs) #else int yyparse (filename, rcs) const char *filename; rcs_t *rcs; #endif #endif { int yystate; int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss = yyssa; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp; /* The location stack. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; /* The locations where the error started and ended. */ YYLTYPE yyerror_range[2]; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; YYLTYPE yyloc; /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; yylsp = yyls; #if YYLTYPE_IS_TRIVIAL /* Initialize the default location before parsing starts. */ yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = 0; #endif goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef 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. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; YYLTYPE *yyls1 = yyls; /* 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), &yyls1, yysize * sizeof (*yylsp), &yystacksize); yyls = yyls1; yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); YYSTACK_RELOCATE (yyls); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; yylsp = yyls + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a look-ahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a look-ahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; *++yylsp = yylloc; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; /* Default location. */ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 101 "parser.y" { yylloc.line = 1; yylloc.off = yylloc.next = 0; lines = 0; rcs->delta_list = hash_new((dup_fn_t)delta_dup, (free_fn_t)delta_free); } break; case 3: #line 117 "parser.y" { if ((yyvsp[(2) - (11)].s)) { int count; (yyval.trunk).head = (delta_t *)rcs_get_delta(rcs, (yyvsp[(2) - (11)].s)); if (!(yyval.trunk).head) { yyerror(filename, rcs, "head revision is missing"); YYERROR; } (yyval.trunk).branches = hash_new(NULL, NULL); count = _parser_count_deltalist(rcs, (yyval.trunk).head, (yyval.trunk).branches); if (count < 0) { yyerror(filename, rcs, "delta tree is malformed"); YYERROR; } if ((unsigned)count != hash_count(rcs->delta_list)) { yyerror(filename, rcs, "unreachable deltas exist"); YYERROR; } } else { (yyval.trunk).head = NULL; (yyval.trunk).branches = NULL; } } break; case 4: #line 144 "parser.y" { rcs->head = (yyvsp[(12) - (14)].trunk).head; rcs->branch = ((yyvsp[(3) - (14)].s) ? strdup((yyvsp[(3) - (14)].s)) : ((yyvsp[(2) - (14)].s) ? rcs_rev_to_branch((yyvsp[(2) - (14)].s)) : NULL)); rcs->branches = (yyvsp[(12) - (14)].trunk).branches; rcs->access = (yyvsp[(4) - (14)].vector); rcs->symbols = (yyvsp[(5) - (14)].hash); rcs->locks = (yyvsp[(6) - (14)].hash); rcs->strict = (yyvsp[(7) - (14)].i); rcs->comment = (yyvsp[(8) - (14)].s); rcs->expand = (yyvsp[(9) - (14)].expand); rcs->lines = lines; } break; case 5: #line 159 "parser.y" { (yyval.s) = rcs->start + (yylsp[(2) - (3)]).off; *((yyval.s) + (yyvsp[(2) - (3)].i)) = '\0'; } break; case 6: #line 160 "parser.y" { (yyval.s) = NULL; } break; case 7: #line 164 "parser.y" { (yyval.s) = NULL; } break; case 8: #line 165 "parser.y" { (yyval.s) = rcs->start + (yylsp[(2) - (3)]).off; *((yyval.s) + (yyvsp[(2) - (3)].i)) = '\0'; } break; case 9: #line 166 "parser.y" { (yyval.s) = NULL; } break; case 10: #line 170 "parser.y" { (yyval.vector) = (yyvsp[(2) - (3)].vector); } break; case 11: #line 174 "parser.y" { (yyval.hash) = (yyvsp[(2) - (3)].hash); } break; case 12: #line 178 "parser.y" { (yyval.hash) = (yyvsp[(2) - (3)].hash); } break; case 13: #line 182 "parser.y" { (yyval.i) = 0; } break; case 14: #line 183 "parser.y" { (yyval.i) = 1; } break; case 15: #line 187 "parser.y" { (yyval.s) = NULL; } break; case 16: #line 188 "parser.y" { (yyval.s) = rcs->start + (yylsp[(2) - (3)]).off; *((yyval.s) + (yyvsp[(2) - (3)].i)) = '\0'; } break; case 17: #line 189 "parser.y" { (yyval.s) = NULL; } break; case 18: #line 193 "parser.y" { (yyval.expand) = EXPAND_UNDEFINED; } break; case 19: #line 194 "parser.y" { if (!strncmp(rcs->start + (yylsp[(2) - (3)]).off, "kv", (yyvsp[(2) - (3)].i))) (yyval.expand) = EXPAND_KEY_VALUE; else if (!strncmp(rcs->start + (yylsp[(2) - (3)]).off, "kvl", (yyvsp[(2) - (3)].i))) (yyval.expand) = EXPAND_KEY_VALUE_LOCKER; else if (!strncmp(rcs->start + (yylsp[(2) - (3)]).off, "k", (yyvsp[(2) - (3)].i))) (yyval.expand) = EXPAND_KEY_ONLY; else if (!strncmp(rcs->start + (yylsp[(2) - (3)]).off, "o", (yyvsp[(2) - (3)].i))) (yyval.expand) = EXPAND_OLD_STRING; else if (!strncmp(rcs->start + (yylsp[(2) - (3)]).off, "b", (yyvsp[(2) - (3)].i))) (yyval.expand) = EXPAND_BINARY_STRING; else if (!strncmp(rcs->start + (yylsp[(2) - (3)]).off, "v", (yyvsp[(2) - (3)].i))) (yyval.expand) = EXPAND_VALUE_ONLY; else { yyerror(filename, rcs, "invalid keyword expansion type"); YYERROR; } } break; case 20: #line 212 "parser.y" { (yyval.expand) = EXPAND_UNDEFINED; } break; case 23: #line 228 "parser.y" { char *num = rcs->start + (yylsp[(1) - (7)]).off; *(num + (yyvsp[(1) - (7)].i)) = '\0'; (yyval.delta) = rcs_get_delta_template(rcs, num); if (!delta_is_template((yyval.delta))) { yyerror(filename, rcs, "delta is multiply defined"); YYERROR; } delta_complete_template_nocopy((yyval.delta), (yyvsp[(2) - (7)].date), (yyvsp[(3) - (7)].s), (yyvsp[(4) - (7)].s), (yyvsp[(5) - (7)].hash), (yyvsp[(6) - (7)].delta)); } break; case 24: #line 241 "parser.y" { char *num = rcs->start + (yylsp[(2) - (3)]).off; *(num + (yyvsp[(2) - (3)].i)) = '\0'; (yyval.date) = date_parse_rev(num); if ((yyval.date) < 0) { yyerror(filename, rcs, "invalid date"); YYERROR; } } break; case 25: #line 253 "parser.y" { (yyval.s) = (yyvsp[(2) - (3)].s); } break; case 26: #line 257 "parser.y" { (yyval.s) = (yyvsp[(2) - (3)].s); } break; case 27: #line 258 "parser.y" { (yyval.s) = NULL; } break; case 28: #line 262 "parser.y" { (yyval.hash) = (yyvsp[(2) - (3)].hash); } break; case 29: #line 263 "parser.y" { (yyval.hash) = NULL; } break; case 30: #line 267 "parser.y" { char *num = rcs->start + (yylsp[(2) - (3)]).off; *(num + (yyvsp[(2) - (3)].i)) = '\0'; (yyval.delta) = rcs_get_delta_template(rcs, num); } break; case 31: #line 272 "parser.y" { (yyval.delta) = NULL; } break; case 35: #line 285 "parser.y" { const delta_t *delta; char *num = rcs->start + (yylsp[(1) - (1)]).off; *(num + (yyvsp[(1) - (1)].i)) = '\0'; delta = rcs_get_delta(rcs, num); if (delta && !delta_is_template(delta)) (yyval.delta) = (delta_t *)delta; else { yyerror(filename, rcs, "invalid delta revision"); YYERROR; } } break; case 36: #line 299 "parser.y" { delta_complete_text_nocopy((yyvsp[(2) - (5)].delta), (yyvsp[(3) - (5)].s), (yyvsp[(5) - (5)].lines)); } break; case 37: #line 303 "parser.y" { /* Sigh... Can't rely on @2 because the empty rule below * screws up the location stack. */ rcs->start[(yylsp[(3) - (3)]).off + (yyvsp[(3) - (3)].i)] = '\0'; (yyval.s) = rcs->start + (yylsp[(3) - (3)]).off - (yyvsp[(2) - (3)].i); } break; case 38: #line 312 "parser.y" { (yyval.i) = 0; } break; case 39: #line 313 "parser.y" { (yyval.i) = (yyvsp[(1) - (2)].i) + (yyvsp[(2) - (2)].i); } break; case 40: #line 317 "parser.y" { (yyval.lines) = (yyvsp[(2) - (3)].lines); lines_append_nocopy((yyval.lines), rcs->start + (yylsp[(3) - (3)]).off, (yyvsp[(3) - (3)].i)); lines++; } break; case 41: #line 325 "parser.y" { (yyval.lines) = lines_new(); } break; case 42: #line 326 "parser.y" { lines_append_nocopy((yyval.lines), rcs->start + (yylsp[(2) - (2)]).off, (yyvsp[(2) - (2)].i)); lines++; } break; case 43: #line 333 "parser.y" { (yyval.vector) = vector_new(NULL, NULL); } break; case 44: #line 334 "parser.y" { vector_append_nocopy((yyval.vector), (yyvsp[(2) - (2)].s)); } break; case 45: #line 338 "parser.y" { char *branch, *num; (yyval.hash) = hash_new(NULL, NULL); num = rcs->start + (yylsp[(1) - (1)]).off; *(num + (yyvsp[(1) - (1)].i)) = '\0'; branch = rcs_rev_to_branch(num); hash_insert_nocopy((yyval.hash), branch, rcs_get_delta_template(rcs, num)); FREE(branch); } break; case 46: #line 347 "parser.y" { char *branch, *num; num = rcs->start + (yylsp[(2) - (2)]).off; *(num + (yyvsp[(2) - (2)].i)) = '\0'; if (!rcs_rev_is_valid(num)) { yyerror(filename, rcs, "branch revision is malformed"); YYERROR; } branch = rcs_rev_to_branch(num); hash_insert_nocopy((yyval.hash), branch, rcs_get_delta_template(rcs, num)); FREE(branch); } break; case 47: #line 362 "parser.y" { (yyval.hash) = hash_new(NULL, NULL); } break; case 48: #line 365 "parser.y" { char *num = rcs->start + (yylsp[(4) - (4)]).off; *(num + (yyvsp[(4) - (4)].i)) = '\0'; hash_insert_nocopy((yyval.hash), (yyvsp[(2) - (4)].s), rcs_get_delta_template(rcs, num)); } break; case 49: #line 373 "parser.y" { (yyval.hash) = hash_new(NULL, NULL); } break; case 50: #line 374 "parser.y" { char *sym, *num; sym = rcs->start + (yylsp[(2) - (4)]).off; *(sym + (yyvsp[(2) - (4)].i)) = '\0'; num = rcs->start + (yylsp[(4) - (4)]).off; *(num + (yyvsp[(4) - (4)].i)) = '\0'; hash_insert_nocopy((yyval.hash), sym, num); } break; case 59: #line 402 "parser.y" { (yyval.s) = rcs->start + (yylsp[(1) - (1)]).off; *((yyval.s) + (yyvsp[(1) - (1)].i)) = '\0'; } break; case 60: #line 403 "parser.y" { (yyval.s) = rcs->start + (yylsp[(1) - (1)]).off; *((yyval.s) + (yyvsp[(1) - (1)].i)) = '\0'; } break; /* Line 1267 of yacc.c. */ #line 1911 "parser.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; *++yylsp = yyloc; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (filename, rcs, YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (filename, rcs, yymsg); } else { yyerror (filename, rcs, YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } yyerror_range[0] = yylloc; if (yyerrstatus == 3) { /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval, &yylloc, filename, rcs); yychar = YYEMPTY; } } /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; yyerror_range[0] = yylsp[1-yylen]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yyerror_range[0] = *yylsp; yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp, filename, rcs); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; *++yyvsp = yylval; yyerror_range[1] = yylloc; /* Using YYLLOC is tempting, but would change the location of the look-ahead. YYLOC is available though. */ YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); *++yylsp = yyloc; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (filename, rcs, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc, filename, rcs); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp, yylsp, filename, rcs); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } #line 415 "parser.y" static void yyerror( const char *filename, __attribute__((unused)) rcs_t *rcs, char const *err ) { assert(filename); assert(rcs); assert(err); error(0, 0, "%s: %s at line %u", filename, err, yylloc.line); } /* * Returns the number of reachable revisions from in . * If a loop is detected, -1 is returned. */ static int _parser_count_deltalist(const rcs_t *rcs, const delta_t *delta, hash_t *branches) { int count; const char *prev; if (delta_is_template(delta)) return -1; prev = NULL; count = 0; while (delta) { const delta_t *base; hash_iter_t iter; count++; if (branches) { const char *rev, *dot; rev = delta_get_revision(delta); dot = strrchr(rev, '.'); assert(dot); if (!prev || strncmp(prev, rev, dot - rev + 1)) { char *copy = strndup(rev, dot - rev); hash_insert(branches, copy, delta); FREE(copy); prev = rev; } } for_each_branch_base(base, delta, iter) { int c; assert(base); if ((c = _parser_count_deltalist(rcs, base, NULL)) < 0) { hash_iter_free(iter); return -1; } count += c; } hash_iter_free(iter); delta = delta_get_next(delta); } return count; } blame-1.3.1/src/data.h0000664000076400007640000000361610135203412011375 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _DATA_H #define _DATA_H #include /* * Dup and free operators for data stored in data structures. * * Either: * - The dup operator returns a deep duplication of the specified pointer. * - The free operator deeply frees the given pointer. * Or: * - The dup operator returns a duplication of the specified pointer. * - The free operator frees the given pointer. * Or (if dup and free operators are both NULL): * - The dup operator returns a copy of the specified pointer. * - The free operator does nothing. * * This lets data structures correctly manage memory. In the first case * the entry is completely owned by the data structure. In the second, only * the pointer is owned by the data structure. Otherwise the data structure * owns nothing. */ typedef void * (*dup_fn_t)(const void *); typedef void (*free_fn_t)(void *); /* * A dup function to duplicate strings or NULL. */ static inline char * string_dup(const char *p) { return p ? strdup(p) : NULL; } /* * A free function to free strings or NULL. */ static inline void string_free(char *p) { if (p) FREE(p); } #endif /* _DATA_H */ blame-1.3.1/src/Makefile.in0000644000076400007640000005576610531540110012372 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Process this file with automake to produce a Makefile. srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ ANSI2KNR = $(top_builddir)/lib/ansi2knr bin_PROGRAMS = blame$(EXEEXT) @GCC_TRUE@am__append_1 = -W -Wno-format-y2k subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in lexer.c \ parser.c parser.h ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/allocsa.m4 \ $(top_srcdir)/m4/argp.m4 $(top_srcdir)/m4/calloc.m4 \ $(top_srcdir)/m4/canonicalize.m4 \ $(top_srcdir)/m4/cycle-check.m4 $(top_srcdir)/m4/d-ino.m4 \ $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ $(top_srcdir)/m4/double-slash-root.m4 \ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/eoverflow.m4 \ $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exitfail.m4 \ $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/filenamecat.m4 \ $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/getcwd-abort-bug.m4 \ $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \ $(top_srcdir)/m4/getdelim.m4 $(top_srcdir)/m4/getline.m4 \ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettimeofday.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/inline.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \ $(top_srcdir)/m4/langinfo.m4 $(top_srcdir)/m4/longdouble.m4 \ $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/memcmp.m4 \ $(top_srcdir)/m4/memcpy.m4 $(top_srcdir)/m4/memmove.m4 \ $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memset.m4 \ $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mktime.m4 \ $(top_srcdir)/m4/onceonly_2_57.m4 $(top_srcdir)/m4/pathmax.m4 \ $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/setenv.m4 \ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/ssize_t.m4 \ $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stdint.m4 \ $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcase.m4 \ $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \ $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strpbrk.m4 \ $(top_srcdir)/m4/strstr.m4 $(top_srcdir)/m4/strtol.m4 \ $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ $(top_srcdir)/m4/sysexits.m4 $(top_srcdir)/m4/time_r.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/tzset.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/unistd_h.m4 \ $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vsnprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ $(top_srcdir)/m4/wcwidth.m4 $(top_srcdir)/m4/wint_t.m4 \ $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \ $(top_srcdir)/m4/xreadlink.m4 $(top_srcdir)/m4/xsize.m4 \ $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_blame_OBJECTS = blame$U.$(OBJEXT) date$U.$(OBJEXT) \ delta$U.$(OBJEXT) hash$U.$(OBJEXT) keyword$U.$(OBJEXT) \ lexer$U.$(OBJEXT) lines$U.$(OBJEXT) parser$U.$(OBJEXT) \ rcs$U.$(OBJEXT) util$U.$(OBJEXT) vector$U.$(OBJEXT) \ working$U.$(OBJEXT) blame_OBJECTS = $(am_blame_OBJECTS) blame_DEPENDENCIES = $(top_builddir)/lib/libmisc.a DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) SOURCES = $(blame_SOURCES) DIST_SOURCES = $(blame_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@ ABSOLUTE_SYS_STAT_H = @ABSOLUTE_SYS_STAT_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ FASTEXIT = @FASTEXIT@ FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR = @FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR@ GCC_FALSE = @GCC_FALSE@ GCC_TRUE = @GCC_TRUE@ GETOPT_H = @GETOPT_H@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ 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_STDINT_H = @HAVE_STDINT_H@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_WCHAR_H = @HAVE_WCHAR_H@ HAVE__BOOL = @HAVE__BOOL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBMISC_LIBDEPS = @LIBMISC_LIBDEPS@ LIBMISC_LTLIBDEPS = @LIBMISC_LTLIBDEPS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ SYSEXITS_H = @SYSEXITS_H@ SYS_STAT_H = @SYS_STAT_H@ U = @U@ UNISTD_H = @UNISTD_H@ VERSION = @VERSION@ WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ WINT_T_SUFFIX = @WINT_T_SUFFIX@ YACC = @YACC@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ blame_SOURCES = \ blame.c \ data.h \ date.c date.h \ delta.c delta.h \ hash.c hash.h \ keyword.c keyword.h \ lexer.l \ lines.c lines.h \ parser.y \ rcs.c rcs.h \ system.h \ util.c util.h \ vector.c vector.h \ working.c working.h blame_LDADD = $(top_builddir)/lib/libmisc.a AM_YFLAGS = -d AM_LFLAGS = -f -8 AM_CFLAGS = -Wall $(am__append_1) AM_CPPFLAGS = -I$(top_srcdir)/lib BUILT_SOURCES = parser.h AUTOMAKE_OPTIONS = $(top_builddir)/lib/ansi2knr MAINTAINERCLEANFILES = lexer.c parser.c all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .l .o .obj .y $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) installcheck-binPROGRAMS: $(bin_PROGRAMS) bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | \ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad parser.h: parser.c @if test ! -f $@; then \ rm -f parser.c; \ $(MAKE) parser.c; \ else :; fi blame$(EXEEXT): $(blame_OBJECTS) $(blame_DEPENDENCIES) @rm -f blame$(EXEEXT) $(LINK) $(blame_LDFLAGS) $(blame_OBJECTS) $(blame_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c $(top_builddir)/lib/ansi2knr: cd $(top_builddir)/lib && $(MAKE) $(AM_MAKEFLAGS) ansi2knr mostlyclean-kr: -test "$U" = "" || rm -f *_.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blame$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/date$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delta$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyword$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lexer$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lines$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rcs$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/working$U.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` blame_.c: blame.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/blame.c; then echo $(srcdir)/blame.c; else echo blame.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ date_.c: date.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/date.c; then echo $(srcdir)/date.c; else echo date.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ delta_.c: delta.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/delta.c; then echo $(srcdir)/delta.c; else echo delta.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ hash_.c: hash.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/hash.c; then echo $(srcdir)/hash.c; else echo hash.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ keyword_.c: keyword.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/keyword.c; then echo $(srcdir)/keyword.c; else echo keyword.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ lexer_.c: lexer.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lexer.c; then echo $(srcdir)/lexer.c; else echo lexer.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ lines_.c: lines.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lines.c; then echo $(srcdir)/lines.c; else echo lines.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ parser_.c: parser.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/parser.c; then echo $(srcdir)/parser.c; else echo parser.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ rcs_.c: rcs.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rcs.c; then echo $(srcdir)/rcs.c; else echo rcs.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ util_.c: util.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/util.c; then echo $(srcdir)/util.c; else echo util.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ vector_.c: vector.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/vector.c; then echo $(srcdir)/vector.c; else echo vector.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ working_.c: working.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/working.c; then echo $(srcdir)/working.c; else echo working.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ blame_.$(OBJEXT) date_.$(OBJEXT) delta_.$(OBJEXT) hash_.$(OBJEXT) \ keyword_.$(OBJEXT) lexer_.$(OBJEXT) lines_.$(OBJEXT) parser_.$(OBJEXT) \ rcs_.$(OBJEXT) util_.$(OBJEXT) vector_.$(OBJEXT) working_.$(OBJEXT) : \ $(ANSI2KNR) .l.c: $(LEXCOMPILE) $< sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@ rm -f $(LEX_OUTPUT_ROOT).c .y.c: $(YACCCOMPILE) $< if test -f y.tab.h; then \ to=`echo "$*_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$$to/g" -e "s|y\.tab\.h|$*.h|" \ y.tab.h >$*.ht; \ rm -f y.tab.h; \ if cmp -s $*.ht $*.h; then \ rm -f $*.ht ;\ else \ mv $*.ht $*.h; \ fi; \ fi if test -f y.output; then \ mv y.output $*.output; \ fi sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >$@t && mv $@t $@ rm -f y.tab.c uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f lexer.c -rm -f parser.c -rm -f parser.h -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: installcheck-binPROGRAMS maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installcheck-binPROGRAMS \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-kr pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-info-am # 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. .NOEXPORT: blame-1.3.1/src/delta.h0000664000076400007640000001227010151073564011564 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _DELTA_H #define _DELTA_H #include #include #include /* * An RCS delta entry. This contains info from both the delta and deltatext * portions of the RCS file. */ typedef struct _delta_t { int template; /* If true, then all but the revision field is empty. */ const char *revision; /* The delta's revision. */ time_t date; /* The delta's date. */ const char *author; /* The delta's author. */ const char *state; /* The delta's state. */ hash_t *branches; /* Maps (char *) to (delta_t). */ /* The delta's log entry. */ const char *log; /* * The delta's text. Verbatim for the head revision; otherwise a sequence * of deletions or additions. */ lines_t *text; /* * A pointer to the next revision, or NULL if it is at a branch tip or * the bottom of the trunk. During RCS file parsing this may point to * a template delta. */ const struct _delta_t *next; } delta_t; /* * Loop each branch base on delta using hash_iter_t . */ #define for_each_branch_base(B, D, I) \ for ( \ (I) = ((D)->branches ? hash_iter((D)->branches) : NULL); \ (I) && ((B) = (const delta_t *)hash_get_value(I), 1); \ (I) = hash_next(I) \ ) /* * Returns a new delta template for revision . */ static inline delta_t * delta_new_template(const char *rev) { delta_t *delta; assert(rev); delta = MALLOC(1, delta_t); delta->template = 1; delta->revision = rev; delta->log = NULL; delta->text = NULL; return delta; } /* * Completes delta template using the specified values. may * be a delta template. */ static inline void delta_complete_template_nocopy(delta_t *delta, time_t date, char *author, char *state, hash_t *branches, const delta_t *next ) { assert(delta && delta->template); assert(date >= 0); assert(author); assert(state); delta->template = 0; delta->date = date; delta->author = author; delta->state = state; delta->branches = branches; delta->next = next; } /* * Completes the log and text fields in delta . must not be * a template. */ static inline void delta_complete_text_nocopy(delta_t *delta, char *log, lines_t *text) { assert(delta && !delta->template); assert(log); assert(text); delta->log = log; delta->text = text; } delta_t * delta_dup PARAMS((const delta_t *)); void delta_free PARAMS((delta_t *)); /* * Dup and free functions for data structures that should not own the delta_t. */ static inline const delta_t * delta_ref_dup(const delta_t *delta) { return delta; } static inline void delta_ref_free(const delta_t *delta _UNUSED) {} /* * Returns true iff is a template. */ static inline int delta_is_template(const delta_t *delta) { assert(delta); return delta->template; } /* * Returns the revision field in . */ static inline const char * delta_get_revision(const delta_t *delta) { assert(delta && delta->revision); return delta->revision; } /* * Returns the date field in . */ static inline time_t delta_get_date(const delta_t *delta) { assert(delta && !delta_is_template(delta)); return delta->date; } /* * Returns the author field in . */ static inline const char * delta_get_author(const delta_t *delta) { assert(delta && !delta_is_template(delta)); return delta->author; } /* * Returns the state field in . */ static inline const char * delta_get_state(const delta_t *delta) { assert(delta && !delta_is_template(delta)); return delta->state; } /* * Returns the base of branch in , or NULL if it doesn't * exist. */ static inline const delta_t * delta_get_branch(const delta_t *delta, const char *branch) { const delta_t **base; assert(delta && !delta_is_template(delta)); base = (const delta_t **)hash_get(delta->branches, branch); return (base ? *base : NULL); } /* * Returns the log field in . */ static inline const char * delta_get_log(const delta_t *delta) { assert(delta && !delta_is_template(delta)); return delta->log; } /* * Returns the text field in . */ static inline const lines_t * delta_get_text(const delta_t *delta) { assert(delta && !delta_is_template(delta)); return delta->text; } /* * Returns the next delta after the specified , or NULL if is * a branch tip or the base of the trunk. */ static inline const delta_t * delta_get_next(const delta_t *delta) { assert(delta && !delta_is_template(delta)); return delta->next; } #endif /* _DELTA_H */ blame-1.3.1/src/hash.h0000664000076400007640000000634710151073611011417 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _HASH_H #define _HASH_H #include #include #include /* * A hash table entry. */ typedef struct { /* Local copies of the hash table's dup and free functions. */ dup_fn_t dup_fn; free_fn_t free_fn; char *key; /* The (immutable) key for this entry. */ unsigned int hash; /* The key's hash value. */ void *value; /* The entry's value. */ } hash_entry_t; /* * A hash table. * * Each slot in the hash table consists of a linked list. */ typedef struct { dup_fn_t dup_fn; free_fn_t free_fn; unsigned int capacity; /* Number of slots in hash table. */ unsigned int count; /* Number of entries in hash table. */ vector_t **data; /* The slot array. */ } hash_t; hash_t * hash_new PARAMS((dup_fn_t, free_fn_t)); hash_t * hash_dup PARAMS((const hash_t *)); void hash_expand PARAMS((hash_t *, unsigned int)); void hash_insert_nocopy PARAMS((hash_t *, const char *, void *)); /* * Maps to in the hash table . and are * both duplicated. */ static inline void hash_insert(hash_t *hash, const char *key, const void *value) { assert(hash); if (hash->dup_fn) hash_insert_nocopy(hash, key, (hash->dup_fn)(value)); else hash_insert_nocopy(hash, key, (void *)value); } void ** hash_get(hash_t *, const char *); void hash_free(hash_t *); /* * Returns the number of entries in . */ static inline unsigned int hash_count(const hash_t *hash) { assert(hash); return hash->count; } /* * A hash table interator. * * This points to the current slot, the end of the slot array, and the * current element in the current slot. */ typedef struct { vector_t **base; vector_t **end; unsigned int i; } hash_iter_struct_t; typedef hash_iter_struct_t *hash_iter_t; hash_iter_t hash_iter PARAMS((hash_t *)); /* * Returns the key of the hash table element pointed to by . */ static inline const char * hash_get_key(hash_iter_t iter) { assert(iter); return ((hash_entry_t *)vector_get(*iter->base, iter->i))->key; } /* * Returns the value of the hash table element pointed to by . */ static inline void * hash_get_value(hash_iter_t iter) { assert(iter); return ((hash_entry_t *)vector_get(*iter->base, iter->i))->value; } hash_iter_t hash_next(hash_iter_t); /* * Frees (for use when the last element may or may not have been * reached through hash_next). */ static inline void hash_iter_free(hash_iter_t iter) { if (iter) FREE(iter); } #endif /* _HASH_H */ blame-1.3.1/src/lines.c0000664000076400007640000001222410414731304011572 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #define DEFAULT_LINES_CAPACITY 200 extern obstack_t blame_lines_obstack; /* * Ensures can contain at least entries. */ static void _lines_expand(lines_t *lines, unsigned int c) { assert(lines); if (c <= lines->capacity) return; lines->capacity = c * 2; lines->lines = REALLOC(lines->lines, lines->capacity, line_t *); } /* * Returns a new line buffer. */ lines_t * lines_new() { lines_t *lines = lines_new_with_capacity(DEFAULT_LINES_CAPACITY); return lines; } /* * Returns a new line buffer. */ lines_t * lines_new_with_capacity(unsigned int capacity) { lines_t *lines; lines = MALLOC(1, lines_t); lines->capacity = capacity; lines->count = 0; lines->lines = MALLOC(capacity, line_t *); return lines; } /* * Returns a duplicate of . */ lines_t * lines_dup(const lines_t *lines, unsigned int capacity) { lines_t *result; assert(lines); result = MALLOC(1, lines_t); result->capacity = capacity; result->count = lines->count; result->lines = MALLOC(capacity, line_t *); memcpy(result->lines, lines->lines, result->count * sizeof(line_t *)); return result; } /* * Frees the line buffer . */ void lines_free(lines_t *lines) { assert(lines && lines->lines); FREE(lines->lines); FREE(lines); } /* * Appends (of length ) to . This should only be called on * line buffers created with lines_new (not lines_dup). */ void lines_append_nocopy(lines_t *lines, const char *text, size_t len) { line_t *line; assert(lines); assert(text); line = OALLOC(&blame_lines_obstack, 1, line_t); line->delta = NULL; /* Need this? */ line->text = text; line->len = len; _lines_expand(lines, lines_count(lines) + 1); lines->lines[lines->count++] = line; } /* * Applies the changes between and to , placing the * output in . If we are on the trunk, should be true. This * should only be called on line buffers created with lines_dup (not * lines_new). */ int lines_apply( const lines_t *in, lines_t *out, const delta_t *prev, const delta_t *delta, int on_trunk ) { const lines_t *cmds; line_t * const *cmd, * const *last, * const *from; line_t **to; unsigned int from_line; assert(in); assert(out); assert(delta); assert(!on_trunk || prev); /* Otherwise we don't know who owned deleted lines */ cmds = delta_get_text(delta); cmd = cmds->lines; last = cmd + lines_count(cmds); from = in->lines; from_line = 0; to = out->lines; while (cmd < last) { const char *x; if (!(*cmd)->len) break; x = (*cmd++)->text; switch (*x++) { case 'a': { unsigned int line, count; line = 0; while (*x >= '0' && *x <= '9') { line *= 10; line += *x++ - '0'; } x++; count = 0; while (*x >= '0' && *x <= '9') { count *= 10; count += *x++ - '0'; } memcpy(to, from + from_line, (line - from_line) * sizeof(line_t *)); to += line - from_line; if (on_trunk) { memcpy(to, cmd, count * sizeof(line_t *)); to += count; cmd += count; } else while (count--) { assert(!(*cmd)->delta); (*cmd)->delta = delta; *to++ = *cmd++; } from_line = line; } break; case 'd': { unsigned int line, count; line = 0; while (*x >= '0' && *x <= '9') { line *= 10; line += *x++ - '0'; } line--; x++; count = 0; while (*x >= '0' && *x <= '9') { count *= 10; count += *x++ - '0'; } memcpy(to, from + from_line, (line - from_line) * sizeof(line_t *)); to += line - from_line; from_line = line + count; if (on_trunk) { line_t * const *temp = from + line; while (count--) { assert(!(*temp)->delta); (*temp++)->delta = prev; } } } break; default: return -1; } } memcpy(to, from + from_line, (lines_count(in) - from_line) * sizeof(line_t *)); out->count = (to - out->lines) + (lines_count(in) - from_line); return 0; } /* * Sets all unaccounted lines in to refer to . This should only * be called on line buffers created with lines_dup (not lines_new). */ void lines_finalize(lines_t *lines, const delta_t *delta) { unsigned int i; assert(lines); assert(delta); for (i = lines_count(lines); i--; ) { line_t *line = lines_get(lines, i); if (!line->delta) line->delta = delta; } } blame-1.3.1/src/parser.y0000664000076400007640000002330710414731304012006 00000000000000%{ /* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include extern int yylex PARAMS((void)); static void yyerror PARAMS((const char *, rcs_t *, char const *)); static int _parser_count_deltalist PARAMS((const rcs_t *, const delta_t *, hash_t *)); typedef struct { unsigned int line; off_t off; off_t next; } loc_t; #define YYLTYPE loc_t #define YYLLOC_DEFAULT(Current, Rhs, N) \ ((Current).line = (Rhs)[1].line, \ (Current).off = (Rhs)[1].off, \ (Current).next = (Rhs)[N].next) static unsigned int lines; %} %union { char *s; unsigned int i; time_t date; hash_t *hash; vector_t *vector; lines_t *lines; delta_t *delta; struct { delta_t *head; hash_t *branches; } trunk; expand_t expand; } %locations %error-verbose %parse-param {const char *filename} %parse-param {rcs_t *rcs} %token NUM %token ID %token SYM %token STR %token STR_FINAL %token HEAD %token BRANCH %token ACCESS %token SYMBOLS %token LOCKS %token STRICT %token COMMENT %token EXPAND %token DATE %token AUTHOR %token STATE %token BRANCHES %token NEXT %token DESC %token LOG %token TEXT %type admin_head admin_branch admin_comment %type delta_author delta_state deltatext_log id_or_sym %type admin_strict deltatext_log_bit %type delta_date %type admin_access id_list %type deltatext_text deltatext_text_string %type admin_symbols admin_locks delta_branches %type num_list id_num_list sym_num_list %type delta delta_next %type admin_expand %% rcstext: { yylloc.line = 1; yylloc.off = yylloc.next = 0; lines = 0; rcs->delta_list = hash_new((dup_fn_t)delta_dup, (free_fn_t)delta_free); } admin_head admin_branch admin_access admin_symbols admin_locks admin_strict admin_comment admin_expand newphrase_list delta_list { if ($2) { int count; $$.head = (delta_t *)rcs_get_delta(rcs, $2); if (!$$.head) { yyerror(filename, rcs, "head revision is missing"); YYERROR; } $$.branches = hash_new(NULL, NULL); count = _parser_count_deltalist(rcs, $$.head, $$.branches); if (count < 0) { yyerror(filename, rcs, "delta tree is malformed"); YYERROR; } if ((unsigned)count != hash_count(rcs->delta_list)) { yyerror(filename, rcs, "unreachable deltas exist"); YYERROR; } } else { $$.head = NULL; $$.branches = NULL; } } desc deltatext_list { rcs->head = $12.head; rcs->branch = ($3 ? strdup($3) : ($2 ? rcs_rev_to_branch($2) : NULL)); rcs->branches = $12.branches; rcs->access = $4; rcs->symbols = $5; rcs->locks = $6; rcs->strict = $7; rcs->comment = $8; rcs->expand = $9; rcs->lines = lines; } ; admin_head: HEAD NUM ';' { $$ = rcs->start + @2.off; *($$ + $2) = '\0'; } | HEAD ';' { $$ = NULL; } ; admin_branch: /* empty */ { $$ = NULL; } | BRANCH NUM ';' { $$ = rcs->start + @2.off; *($$ + $2) = '\0'; } | BRANCH ';' { $$ = NULL; } ; admin_access: ACCESS id_list ';' { $$ = $2; } ; admin_symbols: SYMBOLS sym_num_list ';' { $$ = $2; } ; admin_locks: LOCKS id_num_list ';' { $$ = $2; } ; admin_strict: /* empty */ { $$ = 0; } | STRICT ';' { $$ = 1; } ; admin_comment: /* empty */ { $$ = NULL; } | COMMENT STR_FINAL ';' { $$ = rcs->start + @2.off; *($$ + $2) = '\0'; } | COMMENT ';' { $$ = NULL; } ; admin_expand: /* empty */ { $$ = EXPAND_UNDEFINED; } | EXPAND STR_FINAL ';' { if (!strncmp(rcs->start + @2.off, "kv", $2)) $$ = EXPAND_KEY_VALUE; else if (!strncmp(rcs->start + @2.off, "kvl", $2)) $$ = EXPAND_KEY_VALUE_LOCKER; else if (!strncmp(rcs->start + @2.off, "k", $2)) $$ = EXPAND_KEY_ONLY; else if (!strncmp(rcs->start + @2.off, "o", $2)) $$ = EXPAND_OLD_STRING; else if (!strncmp(rcs->start + @2.off, "b", $2)) $$ = EXPAND_BINARY_STRING; else if (!strncmp(rcs->start + @2.off, "v", $2)) $$ = EXPAND_VALUE_ONLY; else { yyerror(filename, rcs, "invalid keyword expansion type"); YYERROR; } } | EXPAND ';' { $$ = EXPAND_UNDEFINED; } ; delta_list: /* empty */ | delta_list delta ; delta: NUM delta_date delta_author delta_state delta_branches delta_next newphrase_list { char *num = rcs->start + @1.off; *(num + $1) = '\0'; $$ = rcs_get_delta_template(rcs, num); if (!delta_is_template($$)) { yyerror(filename, rcs, "delta is multiply defined"); YYERROR; } delta_complete_template_nocopy($$, $2, $3, $4, $5, $6); } ; delta_date: DATE NUM ';' { char *num = rcs->start + @2.off; *(num + $2) = '\0'; $$ = date_parse_rev(num); if ($$ < 0) { yyerror(filename, rcs, "invalid date"); YYERROR; } } ; delta_author: AUTHOR id_or_sym ';' { $$ = $2; } ; delta_state: STATE id_or_sym ';' { $$ = $2; } | STATE ';' { $$ = NULL; } ; delta_branches: BRANCHES num_list ';' { $$ = $2; } | BRANCHES ';' { $$ = NULL; } ; delta_next: NEXT NUM ';' { char *num = rcs->start + @2.off; *(num + $2) = '\0'; $$ = rcs_get_delta_template(rcs, num); } | NEXT ';' { $$ = NULL; } ; desc: DESC gobble_string ; deltatext_list: /* empty */ | deltatext_list deltatext ; deltatext: NUM { const delta_t *delta; char *num = rcs->start + @1.off; *(num + $1) = '\0'; delta = rcs_get_delta(rcs, num); if (delta && !delta_is_template(delta)) $$ = (delta_t *)delta; else { yyerror(filename, rcs, "invalid delta revision"); YYERROR; } } deltatext_log newphrase_list deltatext_text { delta_complete_text_nocopy($2, $3, $5); } ; deltatext_log: LOG deltatext_log_bit STR_FINAL { /* Sigh... Can't rely on @2 because the empty rule below * screws up the location stack. */ rcs->start[@3.off + $3] = '\0'; $$ = rcs->start + @3.off - $2; } ; deltatext_log_bit: /* empty */ { $$ = 0; } | deltatext_log_bit STR { $$ = $1 + $2; } ; deltatext_text: TEXT deltatext_text_string STR_FINAL { $$ = $2; lines_append_nocopy($$, rcs->start + @3.off, $3); lines++; } ; deltatext_text_string: /* empty */ { $$ = lines_new(); } | deltatext_text_string STR { lines_append_nocopy($$, rcs->start + @2.off, $2); lines++; } ; id_list: /* empty */ { $$ = vector_new(NULL, NULL); } | id_list id_or_sym { vector_append_nocopy($$, $2); } ; num_list: NUM { char *branch, *num; $$ = hash_new(NULL, NULL); num = rcs->start + @1.off; *(num + $1) = '\0'; branch = rcs_rev_to_branch(num); hash_insert_nocopy($$, branch, rcs_get_delta_template(rcs, num)); FREE(branch); } | num_list NUM { char *branch, *num; num = rcs->start + @2.off; *(num + $2) = '\0'; if (!rcs_rev_is_valid(num)) { yyerror(filename, rcs, "branch revision is malformed"); YYERROR; } branch = rcs_rev_to_branch(num); hash_insert_nocopy($$, branch, rcs_get_delta_template(rcs, num)); FREE(branch); } ; id_num_list: /* empty */ { $$ = hash_new(NULL, NULL); } | id_num_list id_or_sym ':' NUM { char *num = rcs->start + @4.off; *(num + $4) = '\0'; hash_insert_nocopy($$, $2, rcs_get_delta_template(rcs, num)); } ; sym_num_list: /* empty */ { $$ = hash_new(NULL, NULL); } | sym_num_list SYM ':' NUM { char *sym, *num; sym = rcs->start + @2.off; *(sym + $2) = '\0'; num = rcs->start + @4.off; *(num + $4) = '\0'; hash_insert_nocopy($$, sym, num); } ; newphrase_list: /* empty */ | id_or_sym word_list ';' ; word_list: /* empty */ | word_list word ; word: ID | NUM | gobble_string | ':' ; id_or_sym: ID { $$ = rcs->start + @1.off; *($$ + $1) = '\0'; } | SYM { $$ = rcs->start + @1.off; *($$ + $1) = '\0'; } ; gobble_string: gobble_string_bit STR_FINAL ; gobble_string_bit: /* empty */ | gobble_string_bit STR ; %% static void yyerror( const char *filename, __attribute__((unused)) rcs_t *rcs, char const *err ) { assert(filename); assert(rcs); assert(err); error(0, 0, "%s: %s at line %u", filename, err, yylloc.line); } /* * Returns the number of reachable revisions from in . * If a loop is detected, -1 is returned. */ static int _parser_count_deltalist(const rcs_t *rcs, const delta_t *delta, hash_t *branches) { int count; const char *prev; if (delta_is_template(delta)) return -1; prev = NULL; count = 0; while (delta) { const delta_t *base; hash_iter_t iter; count++; if (branches) { const char *rev, *dot; rev = delta_get_revision(delta); dot = strrchr(rev, '.'); assert(dot); if (!prev || strncmp(prev, rev, dot - rev + 1)) { char *copy = strndup(rev, dot - rev); hash_insert(branches, copy, delta); FREE(copy); prev = rev; } } for_each_branch_base(base, delta, iter) { int c; assert(base); if ((c = _parser_count_deltalist(rcs, base, NULL)) < 0) { hash_iter_free(iter); return -1; } count += c; } hash_iter_free(iter); delta = delta_get_next(delta); } return count; } blame-1.3.1/src/Makefile.am0000644000076400007640000000114410260233415012344 00000000000000# Process this file with automake to produce a Makefile. bin_PROGRAMS = blame blame_SOURCES = \ blame.c \ data.h \ date.c date.h \ delta.c delta.h \ hash.c hash.h \ keyword.c keyword.h \ lexer.l \ lines.c lines.h \ parser.y \ rcs.c rcs.h \ system.h \ util.c util.h \ vector.c vector.h \ working.c working.h blame_LDADD = $(top_builddir)/lib/libmisc.a AM_YFLAGS = -d AM_LFLAGS = -f -8 AM_CFLAGS = -Wall if GCC AM_CFLAGS += -W -Wno-format-y2k endif AM_CPPFLAGS = -I$(top_srcdir)/lib BUILT_SOURCES = parser.h AUTOMAKE_OPTIONS = $(top_builddir)/lib/ansi2knr MAINTAINERCLEANFILES = lexer.c parser.c blame-1.3.1/src/working.h0000664000076400007640000000165110151073741012151 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _WORKING_H #define _WORKING_H #include char * working_extract_revision PARAMS((const char *)); #endif /* _WORKING_H */ blame-1.3.1/src/keyword.c0000644000076400007640000003460710527562403012162 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004, 2005 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include extern unsigned int rcs_emulation; /* * Returns a newly allocated string containing unescaped. */ static char * _keyword_unescape(const char *s) { const char *end, *escape; char *output; assert(s); end = s + strlen(s); output = SALLOC(end - s); while ( (escape = strchr(s, '\\')) ) { strncat(output, s, escape - s); switch (escape[1]) { case 't': strcat(output, "\t"); s = escape + 2; break; case 'n': strcat(output, "\n"); s = escape + 2; break; case '\\': strcat(output, "\\"); s = escape + 2; break; case '0': if ( (escape + 3 < end) && (escape[2] == '4') && (escape[3] == '0') ) { strcat(output, " "); s = escape + 4; } else if ( (escape + 3 < end) && (escape[2] == '4') && (escape[3] == '4') ) { strcat(output, "$"); s = escape + 4; } break; } } strcat(output, s); return output; } /* * Returns a newly allocated string containing escaped. */ static char * _keyword_escape(const char *s) { const char *magic; char *output; size_t capacity, len; assert(s); capacity = strlen(s); output = SALLOC(capacity); len = 0; while ( (magic = strpbrk(s, (rcs_emulation >= 5 ? "\t\n $\\" : "\t\n $"))) ) { len += magic - s; switch (*magic) { case '\t': len += 2; if (len > capacity) { capacity = len + 16; output = REALLOC(output, capacity + 1, char); } strncat(output, s, magic - s); strcat(output, "\\t"); break; case '\n': len += 2; if (len > capacity) { capacity = len + 16; output = REALLOC(output, capacity + 1, char); } strncat(output, s, magic - s); strcat(output, "\\n"); break; case ' ': len += 4; if (len > capacity) { capacity = len + 16; output = REALLOC(output, capacity + 1, char); } strncat(output, s, magic - s); strcat(output, "\\040"); break; case '$': len += 4; if (len > capacity) { capacity = len + 16; output = REALLOC(output, capacity + 1, char); } strncat(output, s, magic - s); strcat(output, "\\044"); break; case '\\': len += 2; if (len > capacity) { capacity = len + 16; output = REALLOC(output, capacity + 1, char); } strncat(output, s, magic - s); strcat(output, "\\\\"); break; } s = magic + 1; } len += strlen(s); if (len > capacity) { capacity = len + 16; output = REALLOC(output, capacity + 1, char); } strcat(output, s); return output; } /* * Looks for a revision in of length . Returns a newly allocated * string, or NULL if no revision was found. */ char * keyword_extract_revision(const char *line, size_t len) { const char *end, *dollar; char *buffer, *rev; assert(line); end = line + len; rev = NULL; buffer = ALLOCA(256, char); while ( !rev && line && (dollar = (const char *)memchr(line, '$', end - line)) ) { if (sscanf(dollar, "$Id: %*s %255s %*s %*s %*s $", buffer) == 1) rev = _keyword_unescape(buffer); else if (sscanf(dollar, "$Id: %*s %255s %*s %*s %*s %*s $", buffer) == 1) rev = _keyword_unescape(buffer); else if (sscanf(dollar, "$Header: %*s %255s %*s %*s %*s $", buffer) == 1) rev = _keyword_unescape(buffer); else if ( sscanf(dollar, "$Header: %*s %255s %*s %*s %*s %*s $", buffer) == 1 ) rev = _keyword_unescape(buffer); else if (sscanf(dollar, "$Revision: %255s $", buffer) == 1) rev = _keyword_unescape(buffer); else if (sscanf(dollar, "$Name: %255s $", buffer) == 1) rev = _keyword_unescape(buffer); dollar = (const char *)memchr(dollar + 1, '$', end - dollar - 1); if (dollar) dollar++; line = dollar; } return rev; } /* * Outputs , of length , to stdout, replacing each occurence of * @@ with @. */ static inline void _keyword_shrink_output(const void *data, size_t len) { assert(data); while (len) { char *at = memchr(data, '@', len); if (!at) break; fwrite(data, VOIDP_DIFF(at, data) + 1, 1, stdout); if (*(char *)VOIDP_OFFSET(at, 1) == '@') { len -= VOIDP_DIFF(at, data) + 2; data = VOIDP_OFFSET(at, 2); } else { len -= VOIDP_DIFF(at, data) + 1; data = VOIDP_OFFSET(at, 1); } } if (len) fwrite(data, len, 1, stdout); } /* * Annotates and outputs it to stdout. */ void keyword_annotate( const line_t *line, const struct rcs *rcs, expand_t expand, const char *symbol, long zone_offset ) { const void *current, *end, *log_start, *log_end; size_t len; char prefix[36]; int do_prefix; assert(line); assert(rcs); sprintf(prefix, "%-12s (%-8.8s ", delta_get_revision(line->delta), delta_get_author(line->delta) ); date_sprintf_prefix(delta_get_date(line->delta), prefix + 23, 10); strcat(prefix, "): "); current = line->text; len = line->len; end = VOIDP_OFFSET(current, len); do_prefix = 1; if (rcs_emulation >= 5) { log_start = current; log_end = NULL; } else { log_start = rcs_get_comment(rcs); log_end = VOIDP_OFFSET(log_start, strlen((char *)log_start)); } while (current < end) { size_t chunk_len; const void *delim, *delim2, *next; if (do_prefix) { fputs(prefix, stdout); do_prefix = 0; } chunk_len = strcspn(current, ( expand == EXPAND_OLD_STRING || expand == EXPAND_BINARY_STRING ? "@\n" : "$@\n" )); delim = VOIDP_OFFSET(current, chunk_len); switch (*(char *)delim) { case '$': fwrite(current, chunk_len, 1, stdout); delim2 = memchr(VOIDP_OFFSET(delim, 1), '$', VOIDP_DIFF(end, delim) - 1); if (!delim2) { putchar('$'); current = VOIDP_OFFSET(delim, 1); break; } if (!memcmp(delim, "$Author", 7)) { if (expand != EXPAND_VALUE_ONLY) fputs("$Author", stdout); if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) fputs(": ", stdout); if (expand != EXPAND_KEY_ONLY) fputs(delta_get_author(line->delta), stdout); if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) putchar(' '); if (expand != EXPAND_VALUE_ONLY) putchar('$'); } else if (!memcmp(delim, "$Date", 5)) { if (expand != EXPAND_VALUE_ONLY) fputs("$Date", stdout); if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) fputs(": ", stdout); if (expand != EXPAND_KEY_ONLY) { char *t = date_sprintf(delta_get_date(line->delta), zone_offset); fputs(t, stdout); FREE(t); } if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) putchar(' '); if (expand != EXPAND_VALUE_ONLY) putchar('$'); } else if (!memcmp(delim, "$Header", 7) || !memcmp(delim, "$Id", 3)) { if (expand != EXPAND_VALUE_ONLY) { if (*(char *)VOIDP_OFFSET(delim, 1) == 'H') fputs("$Header", stdout); else fputs("$Id", stdout); } if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) fputs(": ", stdout); if (expand != EXPAND_KEY_ONLY) { char *t1 = _keyword_escape( (*(char *)VOIDP_OFFSET(delim, 1) == 'H') && (rcs_emulation >= 4) ? rcs_get_full_filename(rcs) : rcs_get_short_filename(rcs) ); char *t2 = date_sprintf(delta_get_date(line->delta), zone_offset); const char *t3; printf( "%s %s %s %s ", t1, delta_get_revision(line->delta), t2, delta_get_author(line->delta) ); FREE(t1); FREE(t2); switch (rcs_emulation) { case 3: if (rcs_get_locker(rcs, delta_get_revision(line->delta))) fputs("Locked", stdout); break; case 4: fputs(delta_get_state(line->delta), stdout); if ( (t3 = rcs_get_locker(rcs, delta_get_revision(line->delta))) ) printf(" Locker: %s", t3); break; default: fputs(delta_get_state(line->delta), stdout); if ( expand == EXPAND_KEY_VALUE_LOCKER && (t3 = rcs_get_locker(rcs, delta_get_revision(line->delta))) ) printf(" %s", t3); break; } } if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) putchar(' '); if (expand != EXPAND_VALUE_ONLY) putchar('$'); } else if (!memcmp(delim, "$Locker", 7)) { if (expand != EXPAND_VALUE_ONLY) fputs("$Locker", stdout); if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) fputs(": ", stdout); if (rcs_emulation <= 4 || expand == EXPAND_KEY_VALUE_LOCKER) { const char *t = rcs_get_locker(rcs, delta_get_revision(line->delta)); if (t) fputs(t, stdout); } if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) putchar(' '); if (expand != EXPAND_VALUE_ONLY) putchar('$'); } else if (!memcmp(delim, "$Log", 4)) { char *t; const char *log, *n; int local_log_prefix = 0; if (expand != EXPAND_VALUE_ONLY) fputs("$Log", stdout); if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) { if (rcs_emulation >= 5) fputs(": ", stdout); else fputs(":\t", stdout); } if (expand != EXPAND_KEY_ONLY) { t = _keyword_escape(rcs_get_short_filename(rcs)); fputs(t, stdout); FREE(t); } if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) putchar(' '); if (expand != EXPAND_VALUE_ONLY) putchar('$'); /* Strangely, rcs outputs the log even with if -kk is specified... */ if (rcs_emulation >= 5) { const void *t2; log_end = delim; for (t2 = log_start; t2 < log_end; t2 = VOIDP_OFFSET(t2, 1)) if (!ISSPACE(*(char *)t2)) break; if ( t2 < log_end - 2 && (*(char *)t2 == '/' || *(char *)t2 == '(') && *(char *)VOIDP_OFFSET(t2, 1) == '*' ) { void *t3; local_log_prefix = 1; t3 = MALLOC(log_end - log_start, char); memcpy(t3, log_start, log_end - log_start); *(char *)VOIDP_OFFSET(t3, t2 - log_start) = ' '; log_end = VOIDP_OFFSET(t3, log_end - log_start); log_start = t3; } } printf("\n%s", prefix); _keyword_shrink_output(log_start, VOIDP_DIFF(log_end, log_start)); printf("Revision %s ", delta_get_revision(line->delta)); t = date_sprintf(delta_get_date(line->delta), zone_offset); if (rcs_emulation >= 5) { fputs(t, stdout); } else { char *t2 = strchrnul(t, ' '); if (*t2) *t2++ = '\0'; printf("%s %s", t, t2); } FREE(t); printf(" %s\n%s", delta_get_author(line->delta), prefix); log = delta_get_log(line->delta); while ( (n = strchr(log, '\n')) ) { _keyword_shrink_output(log_start, VOIDP_DIFF(log_end, log_start)); _keyword_shrink_output(log, n - log + 1); fputs(prefix, stdout); log = n + 1; } _keyword_shrink_output(log_start, VOIDP_DIFF(log_end, log_start)); fputs(log, stdout); if (rcs_emulation >= 5) { if (local_log_prefix) { void *alias = (void *)log_start; FREE(alias); } current = delim2; do { current = VOIDP_OFFSET(current, 1); } while ( *(char *)current && ISSPACE(*(char *)current) && *(char *)current != '\n' ); continue; } } else if (!memcmp(delim, "$Name", 5)) { if (expand != EXPAND_VALUE_ONLY) fputs("$Name", stdout); if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) fputs(": ", stdout); if (expand != EXPAND_KEY_ONLY && symbol) fputs(symbol, stdout); if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) putchar(' '); if (expand != EXPAND_VALUE_ONLY) putchar('$'); } else if (!memcmp(delim, "$RCSfile", 8)) { if (expand != EXPAND_VALUE_ONLY) fputs("$RCSfile", stdout); if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) fputs(": ", stdout); if (expand != EXPAND_KEY_ONLY) { char *t = _keyword_escape(rcs_get_short_filename(rcs)); fputs(t, stdout); FREE(t); } if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) putchar(' '); if (expand != EXPAND_VALUE_ONLY) putchar('$'); } else if (!memcmp(delim, "$Revision", 9)) { if (expand != EXPAND_VALUE_ONLY) fputs("$Revision", stdout); if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) fputs(": ", stdout); if (expand != EXPAND_KEY_ONLY) fputs(delta_get_revision(line->delta), stdout); if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) putchar(' '); if (expand != EXPAND_VALUE_ONLY) putchar('$'); } else if (!memcmp(delim, "$Source", 7)) { if (expand != EXPAND_VALUE_ONLY) fputs("$Source", stdout); if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) fputs(": ", stdout); if (expand != EXPAND_KEY_ONLY) { char *t = _keyword_escape(rcs_get_full_filename(rcs)); fputs(t, stdout); FREE(t); } if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) putchar(' '); if (expand != EXPAND_VALUE_ONLY) putchar('$'); } else if (!memcmp(delim, "$State", 6)) { if (expand != EXPAND_VALUE_ONLY) fputs("$State", stdout); if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) fputs(": ", stdout); if (expand != EXPAND_KEY_ONLY) fputs(delta_get_state(line->delta), stdout); if (expand != EXPAND_KEY_ONLY && expand != EXPAND_VALUE_ONLY) putchar(' '); if (expand != EXPAND_VALUE_ONLY) putchar('$'); } else { putchar('$'); delim2 = delim; } current = VOIDP_OFFSET(delim2, 1); break; case '@': if (delim >= end) { fwrite(current, chunk_len, 1, stdout); return; } next = VOIDP_OFFSET(delim, 1); fwrite(current, VOIDP_DIFF(next, current), 1, stdout); current = (*(char *)next == '@' ? VOIDP_OFFSET(next, 1) : next); break; case '\n': fwrite(current, chunk_len + 1, 1, stdout); current = VOIDP_OFFSET(delim, 1); do_prefix = 1; break; case '\0': fwrite(current, chunk_len + 1, 1, stdout); current = VOIDP_OFFSET(delim, 1); break; } } } blame-1.3.1/src/vector.h0000664000076400007640000000401310151073735011771 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _VECTOR_H #define _VECTOR_H #include #include /* * A vector. */ typedef struct { dup_fn_t dup_fn; free_fn_t free_fn; unsigned int capacity; /* Number of slots in vector. */ unsigned int count; /* Number of entries in vector. */ void **data; /* The slot array. */ } vector_t; vector_t * vector_new PARAMS((dup_fn_t, free_fn_t)); vector_t * vector_dup PARAMS((const vector_t *)); void vector_expand PARAMS((vector_t *, unsigned int)); void vector_append_nocopy PARAMS((vector_t *, void *)); /* * Appends a duplication of to . */ static inline void vector_append(vector_t *vector, const void *x) { assert(vector); if (vector->dup_fn) vector_append_nocopy(vector, (vector->dup_fn)(x)); else vector_append_nocopy(vector, (void *)x); } void vector_free PARAMS((vector_t *)); void vector_free_nofree PARAMS((vector_t *)); /* * Returns the number of entries in . */ static inline unsigned int vector_count(const vector_t *vector) { assert(vector); return vector->count; } /* * Returns the -th vector entry in . */ static inline void * vector_get(vector_t *vector, unsigned int i) { assert(vector); return vector->data[i]; } #endif /* _VECTOR_H */ blame-1.3.1/src/date.h0000664000076400007640000000237510260750073011413 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004, 2005 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _DATE_H #define _DATE_H #include #define TM_UNDEFINED_ZONE ((long) -24 * 60 * 60) #define TM_LOCAL_ZONE (TM_UNDEFINED_ZONE - 1) const char * date_parse_zone PARAMS((const char *, long *)); time_t date_parse PARAMS((const char *, int, long)); time_t date_parse_rev PARAMS((const char *)); char * date_format PARAMS((time_t)); char * date_sprintf PARAMS((time_t, long)); size_t date_sprintf_prefix PARAMS((time_t, char *, size_t)); #endif /* _DATE_H */ blame-1.3.1/src/lexer.l0000644000076400007640000001237710260253040011612 00000000000000%{ /* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #define YY_NO_UNPUT typedef struct { unsigned int line; off_t off; off_t next; } loc_t; #define YYLTYPE loc_t #define YY_DECL int yylex YY_PROTO((void)) #include #include #include #include #include YYSTYPE yylval; YYLTYPE yylloc; %} %option noyywrap %option never-interactive /* * Each string returned as STR or STR_FINAL is actually just a single line. * STR is returned when a newline is read; STR_FINAL is returned at the * terminate "@". * The SA state is active when the lexer is at the start of a string line. */ %x SA STRING ([^@\n]*@@)*[^@\n]* %% head { yylloc.off = yylloc.next; yylloc.next += 4; return HEAD; } branch { yylloc.off = yylloc.next; yylloc.next += 6; return BRANCH; } access { yylloc.off = yylloc.next; yylloc.next += 6; return ACCESS; } symbols { yylloc.off = yylloc.next; yylloc.next += 7; return SYMBOLS; } locks { yylloc.off = yylloc.next; yylloc.next += 5; return LOCKS; } strict { yylloc.off = yylloc.next; yylloc.next += 6; return STRICT; } comment { yylloc.off = yylloc.next; yylloc.next += 7; return COMMENT; } expand { yylloc.off = yylloc.next; yylloc.next += 6; return EXPAND; } date { yylloc.off = yylloc.next; yylloc.next += 4; return DATE; } author { yylloc.off = yylloc.next; yylloc.next += 6; return AUTHOR; } state { yylloc.off = yylloc.next; yylloc.next += 5; return STATE; } branches { yylloc.off = yylloc.next; yylloc.next += 8; return BRANCHES; } next { yylloc.off = yylloc.next; yylloc.next += 4; return NEXT; } desc { yylloc.off = yylloc.next; yylloc.next += 4; return DESC; } log { yylloc.off = yylloc.next; yylloc.next += 3; return LOG; } text { yylloc.off = yylloc.next; yylloc.next += 4; return TEXT; } [^@[:space:];:]+ { char *temp; unsigned int count; int dot = 0, idchar = 0; yylloc.off = yylloc.next; yylloc.next += yyleng; yylval.i = count = yyleng; for (temp = yytext; count--; temp++) { switch (*temp) { case '.': dot = 1; break; case '$': case ',': case ':': case ';': case '@': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: idchar = 1; break; } } return (idchar ? (dot ? ID : SYM) : NUM); } @{STRING}\n { BEGIN(SA); yylloc.line++; yylloc.off = yylloc.next + 1; yylloc.next += yyleng; yylval.i = yyleng - 1; return STR; } @{STRING}@ { yylloc.off = yylloc.next + 1; yylloc.next += yyleng; yylval.i = yyleng - 2; return STR_FINAL; } @{STRING} { /* Has to be at EOF */ yylloc.line++; yylloc.off = yylloc.next + 1; yylloc.next += yyleng; yylval.i = yyleng - 1; return STR_FINAL; } {STRING}\n { yylloc.line++; yylloc.off = yylloc.next; yylloc.next += yyleng; yylval.i = yyleng; return STR; } {STRING}@ { BEGIN(INITIAL); yylloc.line++; yylloc.off = yylloc.next; yylloc.next += yyleng; yylval.i = yyleng - 1; return STR_FINAL; } {STRING} { /* Has to be at EOF */ BEGIN(INITIAL); yylloc.line++; yylloc.off = yylloc.next; yylloc.next += yyleng; yylval.i = yyleng; return STR_FINAL; } [;:] { yylloc.off = yylloc.next; yylloc.next++; return yytext[0]; } [ \f\r\t\v]*\n { yylloc.line++; yylloc.next += yyleng; } [ \f\r\t\v]* { yylloc.next += yyleng; } blame-1.3.1/src/lexer.c0000664000076400007640000061250410260254637011616 00000000000000/* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #include #include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define YY_USE_CONST #define YY_USE_PROTOS #endif #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif #ifdef YY_USE_PROTOS #define YY_PROTO(proto) proto #else #define YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define YY_BUF_SIZE 16384 typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int yy_size_t; struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define YY_CURRENT_BUFFER yy_current_buffer /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) #define yywrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext static yyconst short yy_nxt[][256] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 8, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 9, 9, 6, 6, 6, 6, 10, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 11, 12, 13, 14, 15, 6, 6, 16, 6, 6, 6, 17, 6, 18, 6, 6, 6, 6, 19, 20, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }, { 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 8, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 9, 9, 6, 6, 6, 6, 10, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 11, 12, 13, 14, 15, 6, 6, 16, 6, 6, 6, 17, 6, 18, 6, 6, 6, 6, 19, 20, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }, { 5, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 23, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21 }, { 5, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 23, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21 }, { -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -6, -6, -6, -6, -6, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -6, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -6, -6, 24, 24, 24, 24, -6, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, -7, -7, -7, -7, -7, -7, -7, -7, 25, 26, 25, 25, 25, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, 25, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7 }, { 5, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8 }, { 5, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9 }, { 5, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 29, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -11, -11, -11, -11, -11, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -11, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -11, -11, 24, 24, 24, 24, -11, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 30, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 31, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -12, -12, -12, -12, -12, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -12, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -12, -12, 24, 24, 24, 24, -12, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 32, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -13, -13, -13, -13, -13, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -13, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -13, -13, 24, 24, 24, 24, -13, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 33, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -14, -14, -14, -14, -14, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -14, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -14, -14, 24, 24, 24, 24, -14, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 34, 24, 24, 24, 35, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -15, -15, -15, -15, -15, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -15, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -15, -15, 24, 24, 24, 24, -15, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 36, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -16, -16, -16, -16, -16, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -16, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -16, -16, 24, 24, 24, 24, -16, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 37, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -17, -17, -17, -17, -17, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -17, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -17, -17, 24, 24, 24, 24, -17, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 38, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -18, -18, -18, -18, -18, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -18, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -18, -18, 24, 24, 24, 24, -18, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 39, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -19, -19, -19, -19, -19, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -19, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -19, -19, 24, 24, 24, 24, -19, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 40, 24, 24, 24, 24, 41, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -20, -20, -20, -20, -20, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -20, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -20, -20, 24, 24, 24, 24, -20, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 42, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 43, 43, 43, 43, 43, 43, 43, 43, 43, 44, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 45, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43 }, { 5, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22 }, { 5, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 46, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -24, -24, -24, -24, -24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -24, -24, 24, 24, 24, 24, -24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, -25, -25, -25, -25, -25, -25, -25, -25, 25, 26, 25, 25, 25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25 }, { 5, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26 }, { 5, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 29, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27 }, { 5, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28 }, { 5, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 47, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -30, -30, -30, -30, -30, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -30, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -30, -30, 24, 24, 24, 24, -30, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 48, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -31, -31, -31, -31, -31, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -31, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -31, -31, 24, 24, 24, 24, -31, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 49, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -32, -32, -32, -32, -32, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -32, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -32, -32, 24, 24, 24, 24, -32, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 50, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -33, -33, -33, -33, -33, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -33, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -33, -33, 24, 24, 24, 24, -33, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 51, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -34, -34, -34, -34, -34, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -34, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -34, -34, 24, 24, 24, 24, -34, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 52, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -35, -35, -35, -35, -35, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -35, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -35, -35, 24, 24, 24, 24, -35, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 53, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -36, -36, -36, -36, -36, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -36, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -36, -36, 24, 24, 24, 24, -36, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 54, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -37, -37, -37, -37, -37, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -37, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -37, -37, 24, 24, 24, 24, -37, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 55, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -38, -38, -38, -38, -38, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -38, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -38, -38, 24, 24, 24, 24, -38, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 56, 24, 24, 24, 57, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -39, -39, -39, -39, -39, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -39, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -39, -39, 24, 24, 24, 24, -39, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 58, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -40, -40, -40, -40, -40, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -40, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -40, -40, 24, 24, 24, 24, -40, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 59, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 60, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -41, -41, -41, -41, -41, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -41, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -41, -41, 24, 24, 24, 24, -41, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 61, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -42, -42, -42, -42, -42, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -42, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -42, -42, 24, 24, 24, 24, -42, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 62, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 43, 43, 43, 43, 43, 43, 43, 43, 43, 44, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 45, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43 }, { 5, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44 }, { 5, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, 46, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45 }, { 5, 43, 43, 43, 43, 43, 43, 43, 43, 43, 44, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 45, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43 }, { 5, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 29, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -48, -48, -48, -48, -48, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -48, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -48, -48, 24, 24, 24, 24, -48, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 63, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -49, -49, -49, -49, -49, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -49, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -49, -49, 24, 24, 24, 24, -49, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 64, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -50, -50, -50, -50, -50, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -50, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -50, -50, 24, 24, 24, 24, -50, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 65, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -51, -51, -51, -51, -51, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -51, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -51, -51, 24, 24, 24, 24, -51, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 66, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -52, -52, -52, -52, -52, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -52, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -52, -52, 24, 24, 24, 24, -52, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 67, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -53, -53, -53, -53, -53, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -53, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -53, -53, 24, 24, 24, 24, -53, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 68, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -54, -54, -54, -54, -54, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -54, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -54, -54, 24, 24, 24, 24, -54, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 69, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -55, -55, -55, -55, -55, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -55, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -55, -55, 24, 24, 24, 24, -55, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 70, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -56, -56, -56, -56, -56, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -56, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -56, -56, 24, 24, 24, 24, -56, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 71, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -57, -57, -57, -57, -57, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -57, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -57, -57, 24, 24, 24, 24, -57, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -58, -58, -58, -58, -58, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -58, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -58, -58, 24, 24, 24, 24, -58, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 72, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -59, -59, -59, -59, -59, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -59, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -59, -59, 24, 24, 24, 24, -59, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 73, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -60, -60, -60, -60, -60, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -60, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -60, -60, 24, 24, 24, 24, -60, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 74, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -61, -61, -61, -61, -61, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -61, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -61, -61, 24, 24, 24, 24, -61, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 75, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -62, -62, -62, -62, -62, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -62, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -62, -62, 24, 24, 24, 24, -62, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 76, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -63, -63, -63, -63, -63, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -63, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -63, -63, 24, 24, 24, 24, -63, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 77, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -64, -64, -64, -64, -64, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -64, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -64, -64, 24, 24, 24, 24, -64, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 78, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -65, -65, -65, -65, -65, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -65, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -65, -65, 24, 24, 24, 24, -65, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 79, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -66, -66, -66, -66, -66, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -66, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -66, -66, 24, 24, 24, 24, -66, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 80, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -67, -67, -67, -67, -67, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -67, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -67, -67, 24, 24, 24, 24, -67, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -68, -68, -68, -68, -68, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -68, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -68, -68, 24, 24, 24, 24, -68, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -69, -69, -69, -69, -69, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -69, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -69, -69, 24, 24, 24, 24, -69, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 81, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -70, -70, -70, -70, -70, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -70, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -70, -70, 24, 24, 24, 24, -70, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -71, -71, -71, -71, -71, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -71, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -71, -71, 24, 24, 24, 24, -71, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 82, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -72, -72, -72, -72, -72, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -72, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -72, -72, 24, 24, 24, 24, -72, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -73, -73, -73, -73, -73, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -73, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -73, -73, 24, 24, 24, 24, -73, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 83, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -74, -74, -74, -74, -74, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -74, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -74, -74, 24, 24, 24, 24, -74, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 84, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -75, -75, -75, -75, -75, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -75, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -75, -75, 24, 24, 24, 24, -75, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 85, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -76, -76, -76, -76, -76, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -76, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -76, -76, 24, 24, 24, 24, -76, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -77, -77, -77, -77, -77, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -77, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -77, -77, 24, 24, 24, 24, -77, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 86, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -78, -78, -78, -78, -78, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -78, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -78, -78, 24, 24, 24, 24, -78, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 87, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -79, -79, -79, -79, -79, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -79, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -79, -79, 24, 24, 24, 24, -79, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 88, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -80, -80, -80, -80, -80, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -80, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -80, -80, 24, 24, 24, 24, -80, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 89, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -81, -81, -81, -81, -81, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -81, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -81, -81, 24, 24, 24, 24, -81, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 90, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -82, -82, -82, -82, -82, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -82, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -82, -82, 24, 24, 24, 24, -82, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -83, -83, -83, -83, -83, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -83, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -83, -83, 24, 24, 24, 24, -83, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -84, -84, -84, -84, -84, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -84, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -84, -84, 24, 24, 24, 24, -84, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 91, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -85, -85, -85, -85, -85, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -85, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -85, -85, 24, 24, 24, 24, -85, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 92, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -86, -86, -86, -86, -86, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -86, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -86, -86, 24, 24, 24, 24, -86, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -87, -87, -87, -87, -87, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -87, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -87, -87, 24, 24, 24, 24, -87, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -88, -88, -88, -88, -88, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -88, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -88, -88, 24, 24, 24, 24, -88, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 93, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -89, -89, -89, -89, -89, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -89, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -89, -89, 24, 24, 24, 24, -89, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 94, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -90, -90, -90, -90, -90, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -90, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -90, -90, 24, 24, 24, 24, -90, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -91, -91, -91, -91, -91, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -91, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -91, -91, 24, 24, 24, 24, -91, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -92, -92, -92, -92, -92, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -92, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -92, -92, 24, 24, 24, 24, -92, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 95, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -93, -93, -93, -93, -93, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -93, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -93, -93, 24, 24, 24, 24, -93, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 96, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -94, -94, -94, -94, -94, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -94, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -94, -94, 24, 24, 24, 24, -94, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -95, -95, -95, -95, -95, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -95, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -95, -95, 24, 24, 24, 24, -95, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 5, 24, 24, 24, 24, 24, 24, 24, 24, -96, -96, -96, -96, -96, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -96, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -96, -96, 24, 24, 24, 24, -96, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, } ; static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; #define YY_NUM_RULES 27 #define YY_END_OF_BUFFER 28 static yyconst short int yy_accept[97] = { 0, 26, 26, 23, 23, 28, 17, 26, 25, 24, 20, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 23, 21, 22, 17, 26, 25, 20, 18, 19, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 23, 21, 22, 23, 20, 17, 17, 17, 17, 17, 17, 17, 17, 17, 15, 17, 17, 17, 17, 17, 17, 17, 17, 17, 9, 14, 17, 1, 17, 13, 17, 17, 17, 16, 17, 17, 17, 17, 17, 5, 11, 17, 17, 3, 10, 2, 17, 8, 6, 17, 17, 7, 4, 12 } ; static yyconst yy_state_type yy_NUL_trans[97] = { 0, 6, 6, 21, 21, 0, 24, 0, 0, 0, 27, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 43, 0, 0, 24, 0, 0, 27, 0, 0, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 43, 0, 0, 43, 27, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 } ; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "lexer.l" #define INITIAL 0 #line 2 "lexer.l" /* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #define YY_NO_UNPUT typedef struct { unsigned int line; off_t off; off_t next; } loc_t; #define YYLTYPE loc_t #define YY_DECL int yylex YY_PROTO((void)) #include #include #include #include #include YYSTYPE yylval; YYLTYPE yylloc; #define YY_NEVER_INTERACTIVE 1 /* * Each string returned as STR or STR_FINAL is actually just a single line. * STR is returned when a newline is read; STR_FINAL is returned at the * terminate "@". * The SA state is active when the lexer is at the start of a string line. */ #define SA 1 #line 3446 "lexer.c" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap YY_PROTO(( void )); #else extern int yywrap YY_PROTO(( void )); #endif #endif #ifndef YY_NO_UNPUT static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); #else static int input YY_PROTO(( void )); #endif #endif #if YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE static void yy_push_state YY_PROTO(( int new_state )); #endif #ifndef YY_NO_POP_STATE static void yy_pop_state YY_PROTO(( void )); #endif #ifndef YY_NO_TOP_STATE static int yy_top_state YY_PROTO(( void )); #endif #else #define YY_NO_PUSH_STATE 1 #define YY_NO_POP_STATE 1 #define YY_NO_TOP_STATE 1 #endif #ifdef YY_MALLOC_DECL YY_MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL int yylex YY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; #line 53 "lexer.l" #line 3587 "lexer.c" if ( yy_init ) { yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yy_c_buf_p; /* Support of yytext. */ *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yy_start; yy_match: while ( (yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)]) > 0 ) ++yy_cp; yy_current_state = -yy_current_state; yy_find_action: yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 1: YY_RULE_SETUP #line 55 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 4; return HEAD; } YY_BREAK case 2: YY_RULE_SETUP #line 56 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 6; return BRANCH; } YY_BREAK case 3: YY_RULE_SETUP #line 57 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 6; return ACCESS; } YY_BREAK case 4: YY_RULE_SETUP #line 58 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 7; return SYMBOLS; } YY_BREAK case 5: YY_RULE_SETUP #line 59 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 5; return LOCKS; } YY_BREAK case 6: YY_RULE_SETUP #line 60 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 6; return STRICT; } YY_BREAK case 7: YY_RULE_SETUP #line 61 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 7; return COMMENT; } YY_BREAK case 8: YY_RULE_SETUP #line 62 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 6; return EXPAND; } YY_BREAK case 9: YY_RULE_SETUP #line 63 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 4; return DATE; } YY_BREAK case 10: YY_RULE_SETUP #line 64 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 6; return AUTHOR; } YY_BREAK case 11: YY_RULE_SETUP #line 65 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 5; return STATE; } YY_BREAK case 12: YY_RULE_SETUP #line 66 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 8; return BRANCHES; } YY_BREAK case 13: YY_RULE_SETUP #line 67 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 4; return NEXT; } YY_BREAK case 14: YY_RULE_SETUP #line 68 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 4; return DESC; } YY_BREAK case 15: YY_RULE_SETUP #line 69 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 3; return LOG; } YY_BREAK case 16: YY_RULE_SETUP #line 70 "lexer.l" { yylloc.off = yylloc.next; yylloc.next += 4; return TEXT; } YY_BREAK case 17: YY_RULE_SETUP #line 72 "lexer.l" { char *temp; unsigned int count; int dot = 0, idchar = 0; yylloc.off = yylloc.next; yylloc.next += yyleng; yylval.i = count = yyleng; for (temp = yytext; count--; temp++) { switch (*temp) { case '.': dot = 1; break; case '$': case ',': case ':': case ';': case '@': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: idchar = 1; break; } } return (idchar ? (dot ? ID : SYM) : NUM); } YY_BREAK case 18: YY_RULE_SETUP #line 95 "lexer.l" { BEGIN(SA); yylloc.line++; yylloc.off = yylloc.next + 1; yylloc.next += yyleng; yylval.i = yyleng - 1; return STR; } YY_BREAK case 19: YY_RULE_SETUP #line 103 "lexer.l" { yylloc.off = yylloc.next + 1; yylloc.next += yyleng; yylval.i = yyleng - 2; return STR_FINAL; } YY_BREAK case 20: YY_RULE_SETUP #line 109 "lexer.l" { /* Has to be at EOF */ yylloc.line++; yylloc.off = yylloc.next + 1; yylloc.next += yyleng; yylval.i = yyleng - 1; return STR_FINAL; } YY_BREAK case 21: YY_RULE_SETUP #line 117 "lexer.l" { yylloc.line++; yylloc.off = yylloc.next; yylloc.next += yyleng; yylval.i = yyleng; return STR; } YY_BREAK case 22: YY_RULE_SETUP #line 124 "lexer.l" { BEGIN(INITIAL); yylloc.line++; yylloc.off = yylloc.next; yylloc.next += yyleng; yylval.i = yyleng - 1; return STR_FINAL; } YY_BREAK case 23: YY_RULE_SETUP #line 132 "lexer.l" { /* Has to be at EOF */ BEGIN(INITIAL); yylloc.line++; yylloc.off = yylloc.next; yylloc.next += yyleng; yylval.i = yyleng; return STR_FINAL; } YY_BREAK case 24: YY_RULE_SETUP #line 142 "lexer.l" { yylloc.off = yylloc.next; yylloc.next++; return yytext[0]; } YY_BREAK case 25: YY_RULE_SETUP #line 148 "lexer.l" { yylloc.line++; yylloc.next += yyleng; } YY_BREAK case 26: YY_RULE_SETUP #line 152 "lexer.l" { yylloc.next += yyleng; } YY_BREAK case 27: YY_RULE_SETUP #line 155 "lexer.l" ECHO; YY_BREAK #line 3849 "lexer.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(SA): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yy_n_chars = yy_current_buffer->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yy_c_buf_p; goto yy_find_action; } } else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; yy_n_chars += number_to_move; yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = yy_start; for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { if ( *yy_cp ) { yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)]; } else yy_current_state = yy_NUL_trans[yy_current_state]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ #ifdef YY_USE_PROTOS static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) #else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { register int yy_is_jam; yy_current_state = yy_NUL_trans[yy_current_state]; yy_is_jam = (yy_current_state == 0); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif { register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; yytext_ptr = yy_bp; yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } #endif /* ifndef YY_NO_UNPUT */ #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput() #else static int input() #endif { int c; *yy_c_buf_p = yy_hold_char; if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ *yy_c_buf_p = '\0'; else { /* need more input */ int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) return EOF; if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; } } } c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ *yy_c_buf_p = '\0'; /* preserve yytext */ yy_hold_char = *++yy_c_buf_p; return c; } #endif /* YY_NO_INPUT */ #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) #else void yyrestart( input_file ) FILE *input_file; #endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_init_buffer( yy_current_buffer, input_file ); yy_load_buffer_state(); } #ifdef YY_USE_PROTOS void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) #else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif { if ( yy_current_buffer == new_buffer ) return; if ( yy_current_buffer ) { /* Flush out information for old buffer. */ *yy_c_buf_p = yy_hold_char; yy_current_buffer->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; } yy_current_buffer = new_buffer; yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yy_did_buffer_switch_on_eof = 1; } #ifdef YY_USE_PROTOS void yy_load_buffer_state( void ) #else void yy_load_buffer_state() #endif { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; yyin = yy_current_buffer->yy_input_file; yy_hold_char = *yy_c_buf_p; } #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) #else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; #endif { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } #ifdef YY_USE_PROTOS void yy_delete_buffer( YY_BUFFER_STATE b ) #else void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yy_flex_free( (void *) b->yy_ch_buf ); yy_flex_free( (void *) b ); } #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) #else void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; #endif { yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef YY_USE_PROTOS void yy_flush_buffer( YY_BUFFER_STATE b ) #else void yy_flush_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == yy_current_buffer ) yy_load_buffer_state(); } #ifndef YY_NO_SCAN_BUFFER #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) #else YY_BUFFER_STATE yy_scan_buffer( base, size ) char *base; yy_size_t size; #endif { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } #endif #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) #else YY_BUFFER_STATE yy_scan_string( yy_str ) yyconst char *yy_str; #endif { int len; for ( len = 0; yy_str[len]; ++len ) ; return yy_scan_bytes( yy_str, len ); } #endif #ifndef YY_NO_SCAN_BYTES #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) #else YY_BUFFER_STATE yy_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) yy_flex_alloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #endif #ifndef YY_NO_PUSH_STATE #ifdef YY_USE_PROTOS static void yy_push_state( int new_state ) #else static void yy_push_state( new_state ) int new_state; #endif { if ( yy_start_stack_ptr >= yy_start_stack_depth ) { yy_size_t new_size; yy_start_stack_depth += YY_START_STACK_INCR; new_size = yy_start_stack_depth * sizeof( int ); if ( ! yy_start_stack ) yy_start_stack = (int *) yy_flex_alloc( new_size ); else yy_start_stack = (int *) yy_flex_realloc( (void *) yy_start_stack, new_size ); if ( ! yy_start_stack ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } yy_start_stack[yy_start_stack_ptr++] = YY_START; BEGIN(new_state); } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() { if ( --yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(yy_start_stack[yy_start_stack_ptr]); } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() { return yy_start_stack[yy_start_stack_ptr - 1]; } #endif #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif #ifdef YY_USE_PROTOS static void yy_fatal_error( yyconst char msg[] ) #else static void yy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef yytext_ptr #ifdef YY_USE_PROTOS static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; yyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN #ifdef YY_USE_PROTOS static int yy_flex_strlen( yyconst char *s ) #else static int yy_flex_strlen( s ) yyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) #else static void *yy_flex_alloc( size ) yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) #else static void yy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if YY_MAIN int main() { yylex(); return 0; } #endif #line 155 "lexer.l" blame-1.3.1/src/lines.h0000664000076400007640000000361210414731304011600 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _LINES_H #define _LINES_H #include /* * A line in a line buffer. */ typedef struct { const struct _delta_t *delta; /* The delta that owns this line. */ const char *text; /* The text on this line. */ size_t len; /* The length of the line. */ } line_t; /* * A line buffer is a vector. The standard vector_t type isn't used * since we don't need (or want) any fancy memory management business. */ typedef struct { unsigned int capacity; unsigned int count; line_t **lines; /* The line pointers in the buffer. */ } lines_t; lines_t * lines_new PARAMS(()); lines_t * lines_new_with_capacity PARAMS((unsigned int)); lines_t * lines_dup PARAMS((const lines_t *, unsigned int)); void lines_free PARAMS((lines_t *)); void lines_append_nocopy PARAMS((lines_t *, const char *, size_t)); int lines_apply PARAMS((const lines_t *, lines_t *, const struct _delta_t *, const struct _delta_t *, int)); void lines_finalize PARAMS((lines_t *, const struct _delta_t *)); #define lines_count(L) ((L)->count) #define lines_get(L, X) ((line_t *)((L)->lines[X])) #endif /* _LINES_H */ blame-1.3.1/src/util.h0000664000076400007640000000217010151073716011445 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _UTIL_H #define _UTIL_H #include int does_working_filename_match_rcs_filename PARAMS((const char *, const char *)); int is_rcs_filename PARAMS((const char *)); char * find_matching_rcs_filename PARAMS((const char *)); char * find_matching_working_filename PARAMS((const char *)); extern char *suffixes; #endif /* _UTIL_H */ blame-1.3.1/src/delta.c0000664000076400007640000000340510414731303011551 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include /* * Returns a deep duplicate of . */ delta_t * delta_dup(const delta_t *delta) { delta_t *result; assert(delta); result = MALLOC(1, delta_t); result->template = delta->template; result->revision = delta->revision; if (!delta->template) { result->date = delta->date; result->author = delta->author; result->state = delta->state; result->branches = (delta->branches ? hash_dup(delta->branches) : NULL); result->log = delta->log; result->text = (delta->text ? lines_dup(delta->text, delta->text->capacity) : NULL); result->next = (delta->next ? delta_ref_dup(delta->next) : NULL); } return result; } /* * Deeply free . */ void delta_free(delta_t *delta) { assert(delta); assert(delta->revision); if (!delta->template) { if (delta->branches) hash_free(delta->branches); if (delta->text) lines_free(delta->text); if (delta->next) delta_ref_free(delta->next); } FREE(delta); } blame-1.3.1/src/rcs.c0000644000076400007640000003146110530050504011244 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004, 2005 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include typedef unsigned int yy_size_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyparse PARAMS((const char *, rcs_t *)); extern void yy_switch_to_buffer PARAMS((YY_BUFFER_STATE)); extern void yy_delete_buffer PARAMS((YY_BUFFER_STATE)); extern YY_BUFFER_STATE yy_scan_bytes PARAMS((char *, yy_size_t)); #define YY_CURRENT_BUFFER yy_current_buffer /* * Parses and returns the RCS file specified by . */ rcs_t * rcs_parse(const char *rcs_filename) { rcs_t *rcs; FILE *stream; struct stat stat_buf; YY_BUFFER_STATE current_buffer; assert(rcs_filename); stream = fopen(rcs_filename, "r"); if (!stream) { error(0, errno, "%s", rcs_filename); return NULL; } rcs = CALLOC(1, rcs_t); rcs->filename = strdup(rcs_filename); rcs->full_filename = canonicalize_file_name(rcs_filename); if (!rcs->full_filename) { FREE(rcs->filename); FREE(rcs); error(0, errno, "%s", rcs_filename); return NULL; } rcs->short_filename = base_name(rcs_filename); if (fstat(fileno(stream), &stat_buf)) { FREE(rcs->full_filename); FREE(rcs->filename); FREE(rcs); error(0, errno, "Could not stat %s", rcs_filename); return NULL; } rcs->length = stat_buf.st_size; rcs->start = (char *)mmap( NULL, rcs->length, PROT_WRITE | PROT_READ, MAP_PRIVATE, fileno(stream), 0 ); if (!rcs->start) { FREE(rcs->full_filename); FREE(rcs->filename); FREE(rcs); error(0, errno, "Could not mmap %s", rcs_filename); return NULL; } current_buffer = yy_scan_bytes(rcs->start, (yy_size_t)rcs->length); yy_switch_to_buffer(current_buffer); if (yyparse(rcs_filename, rcs)) { if (fclose(stream)) error(0, errno, "%s", rcs_filename); rcs_free(rcs); return NULL; } yy_delete_buffer(current_buffer); if (fclose(stream)) error(0, errno, "%s", rcs_filename); if (!rcs->head) return rcs; return rcs; } /* * Deeply frees . */ void rcs_free(rcs_t *rcs) { assert(rcs); assert(rcs->filename); assert(rcs->full_filename); assert(rcs->short_filename); FREE(rcs->filename); FREE(rcs->short_filename); FREE(rcs->full_filename); if (rcs->head) delta_ref_free(rcs->head); if (rcs->branch) FREE(rcs->branch); if (rcs->branches) hash_free(rcs->branches); if (rcs->access) vector_free(rcs->access); if (rcs->symbols) hash_free(rcs->symbols); if (rcs->locks) hash_free(rcs->locks); if (rcs->delta_list) hash_free(rcs->delta_list); munmap(rcs->start, rcs->length); FREE(rcs); } /* * Returns true iff is a valid RCS ID character. */ static inline int _isidchar(char c) { return ISGRAPH(c) && !ISDIGIT(c) && (c != '$') && (c != ',') && (c != '.') && (c != ':') && (c != ';') && (c != '@'); } /* * Returns true iff is a valid RCS revision. */ int rcs_rev_is_valid(const char *rev) { unsigned int dots; const char *c; assert(rev); dots = 0; for (c = rev; *c; c++) if (*c == '.') dots++; else if (!ISDIGIT(*c)) return 0; return dots % 2; } /* * Returns true iff is a valid RCS branch. */ int rcs_branch_is_valid(const char *branch) { unsigned int dots; const char *c; assert(branch); dots = 0; for (c = branch; *c; c++) if (*c == '.') dots++; else if (!ISDIGIT(*c)) return 0; return !(dots % 2); } /* * Returns the branch on which revision is found. */ char * rcs_rev_to_branch(const char *rev) { char *branch; assert(rev && rcs_rev_is_valid(rev)); branch = strdup(rev); *(strrchr(branch, '.')) = '\0'; return branch; } /* * Returns the base of branch in RCS file . */ static const delta_t * _rcs_get_base(const rcs_t *rcs, const char *branch) { char *rev, *dot; const delta_t *result; assert(rcs); assert(branch && rcs_branch_is_valid(branch)); result = NULL; rev = strdup(branch); dot = strrchr(rev, '.'); if (dot) { const delta_t *from, **base; *dot = '\0'; from = rcs_get_delta(rcs, rev); if (!from) { error(0, 0, "%s: revision %s absent", rcs->filename, rev); FREE(rev); return NULL; } FREE(rev); if (from->branches) { base = (const delta_t **)hash_get(from->branches, branch); if (base) result = *base; } } else { const delta_t **base; FREE(rev); base = (const delta_t **)hash_get( rcs->branches, branch ); if (base) result = *base; } if (!result) error(0, 0, "%s: branch %s absent", rcs->filename, branch); return result; } /* * Returns the earliest revision on branch in RCS file that has * date equal or after (if it is not -1), author (if it is not * NULL), and state (if it is not NULL). Returns NULL if no such * revision is found. */ static char * _rcs_find_rev( const rcs_t *rcs, const char *branch, time_t date, const char *author, const char *state, long zone_offset ) { const delta_t *delta, *result; int trunk; char *cond; size_t len; assert(rcs && rcs->delta_list); assert(branch && rcs_branch_is_valid(branch)); /* The trunk is in reverse. */ trunk = (strchr(branch, '.') == NULL); delta = _rcs_get_base(rcs, branch); if (!delta) return NULL; result = NULL; while (delta && (!trunk || !result)) { int ok = ((date == -1) || (delta_get_date(delta) <= date)); ok = ok && (!author || !strcmp(delta_get_author(delta), author)); ok = ok && (!state || !strcmp(delta_get_state(delta), state)); if (ok) result = delta; delta = delta_get_next(delta); } if (result) return strdup(delta_get_revision(result)); cond = SALLOC(1); len = 0; if ((date >= 0) || author || state) { len += 5; cond = SREALLOC(cond, len); strcat(cond, " has"); } if (date >= 0) { char *date_str = date_sprintf(date, zone_offset); len += 15 + strlen(date_str); cond = SREALLOC(cond, len); strcat(cond, " a date before "); strcat(cond, date_str); FREE(date_str); } if (author) { if (date >= 0) len += 4; len += 8 + strlen(author); cond = SREALLOC(cond, len); if (date >= 0) strcat(cond, " and"); strcat(cond, " author "); strcat(cond, author); } if (state) { if ((date >= 0) || author) len += 4; len += 7 + strlen(state); cond = SREALLOC(cond, len); if ((date >= 0) || author) strcat(cond, " and"); strcat(cond, " state "); strcat(cond, state); } error(0, 0, "%s: no revision on branch %s%s", rcs->filename, branch, cond); FREE(cond); return NULL; } /* * Compares revision numbers and . */ static inline int _revcmp(const char *a, const char *b) { long int d = 0; while (a && b && !(d = strtoul(a, NULL, 0) - strtoul(b, NULL, 0)) ) { a = strchr(a, '.'); if (a) a++; b = strchr(b, '.'); if (b) b++; } return d; } /* * Returns the latest revision on or before in RCS file . */ static const delta_t * _rcs_find_rev_before(const rcs_t *rcs, const char *rev) { char *branch; const delta_t *delta, *result; int trunk; assert(rcs && rcs->delta_list); assert(rev && rcs_rev_is_valid(rev)); branch = rcs_rev_to_branch(rev); /* The trunk is in reverse. */ trunk = (strchr(branch, '.') == NULL); delta = _rcs_get_base(rcs, branch); FREE(branch); if (!delta) return NULL; result = NULL; while (delta && (!trunk || !result)) { const char *r, *dot; r = delta_get_revision(delta); dot = strrchr(r, '.'); assert(dot); if (strncmp(rev, r, dot - r + 1)) break; if (_revcmp(r, rev) <= 0) result = delta; delta = delta_get_next(delta); } if (!result) error(0, 0, "%s: revision %s is too low", rcs->filename, rev); return result; } /* * Returns if it is not a valid symbol in RCS file , or the * corresponding revision if it is. In the last case it also checks that * consists only of valid RCS ID characters. */ static const char * _rcs_resolve_symbol(const rcs_t *rcs, const char *symbol) { const char *rev, *c; assert(rcs); assert(rcs->symbols); assert(symbol); rev = rcs_get_symbol(rcs, symbol); if (rev) return rev; for (c = symbol; *c && !_isidchar(*c); c++) ; if (*c) return NULL; return symbol; } /* * Appends the resolved value of symbol to , updating length * *. RCS file is used to look up the . Returns -1 on error, * otherwise 0. */ static int _rcs_append_component( const rcs_t *rcs, const char *symbol, char **rev, size_t *len ) { const char *r; assert(rcs); assert(symbol); assert(rev && *rev); assert(len); r = _rcs_resolve_symbol(rcs, symbol); if (!r) return -1; *len += strlen(r) + ((*rev)[0] ? 1 : 0); *rev = REALLOC(*rev, *len + 1, char); if ((*rev)[0]) strcat(*rev, "."); strcat(*rev, r); return 0; } /* * Returns the locker of revision for RCS file , or NULL if that * revision is not locked. */ const char * rcs_get_locker(const rcs_t *rcs, const char *rev) { hash_iter_t iter; assert(rcs); assert(rev && rcs_rev_is_valid(rev)); for (iter = hash_iter(rcs->locks); iter; iter = hash_next(iter)) if ( !strcmp(rev, delta_get_revision((const delta_t *)hash_get_value(iter))) ) { const char *locker = hash_get_key(iter); hash_iter_free(iter); return locker; } hash_iter_free(iter); return NULL; } /* * Returns a resolved version of RCS revision for RCS file , given * additional restrictions , and , or NULL on error. */ char * rcs_resolve_tag( const rcs_t *rcs, const char *tag, time_t date, long zone_offset, const char *author, const char *state ) { char *rev; int is_branch; assert(rcs); is_branch = 0; if (!tag || !*tag) { /* If tag wasn't specified, choose the default branch. */ rev = strdup(rcs->branch); is_branch = 1; } else { char *copy, *dot, *start, *end; size_t len; if (tag[0] == '.') { /* Start with the default branch. */ rev = strdup(rcs->branch); len = strlen(rev); tag++; } else { /* Start with nothing. */ rev = strdup(""); len = 0; } /* * We're going to inch our way along tag, marking off each * component in turn. */ start = copy = strdup(tag); end = copy + strlen(copy); for (start = copy; (dot = strchr(start, '.')); start = dot + 1) { *dot = '\0'; if (_rcs_append_component(rcs, start, &rev, &len)) { error(0, 0, "%s: could not resolve symbol %s", rcs->filename, start); FREE(copy); FREE(rev); return NULL; } } /* * We're at the last component. If it's not empty, resolve * it, then extract the branch. */ if (start != end) { if (_rcs_append_component(rcs, start, &rev, &len)) { error(0, 0, "%s: could not resolve symbol %s", rcs->filename, start); FREE(copy); FREE(rev); return NULL; } is_branch = rcs_branch_is_valid(rev); } else { /* * Otherwise, we have any empty final component. The rev * is only valid if we have collected a branch so far. */ if (!rcs_branch_is_valid(rev)) { error(0, 0, "%s: %s is not a valid branch", rcs->filename, rev); FREE(copy); FREE(rev); return NULL; } is_branch = 1; } FREE(copy); } /* * If it's a branch, find the appropriate rev. */ if (is_branch) { char *result = _rcs_find_rev(rcs, rev, date, author, state, zone_offset); FREE(rev); return result; } else { const delta_t *delta; delta = rcs_get_delta(rcs, rev); if (!delta) { delta = _rcs_find_rev_before(rcs, rev); if (!delta) { FREE(rev); return NULL; } } if ((date >= 0) && (delta_get_date(delta) > date)) { char *date_str = date_sprintf(delta_get_date(delta), zone_offset); error( 0, 0, "%s: revision %s has date %s", rcs->filename, rev, date_str ); FREE(date_str); FREE(rev); return NULL; } if (author && strcmp(delta_get_author(delta), author)) { error( 0, 0, "%s: revision %s has author %s", rcs->filename, rev, delta_get_author(delta) ); FREE(rev); return NULL; } if (state && strcmp(delta_get_state(delta), state)) { error( 0, 0, "%s: revision %s has state %s", rcs->filename, rev, delta_get_state(delta) ); FREE(rev); return NULL; } FREE(rev); return strdup(delta_get_revision(delta)); } } blame-1.3.1/src/date.c0000644000076400007640000006602310530051353011377 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004, 2005 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * I've taken this from RCS v5.7, cleaned it up (a bit), bugfixed it (a bit) * and simplified it (a bit). Still don't fully understood though. * * Original copyright: * Copyright 1993, 1994, 1995 Paul Eggert * Distributed under license by the Free Software Foundation, Inc. */ #include #if HAVE_LANGINFO_H # include #endif /* HAVE_LANGINFO_H */ #include #include #include #define TM_UNDEFINED (-1) #define TM_DEFINED(x) (0 <= (x)) #define TM_YEAR_ORIGIN 1900 extern unsigned int rcs_emulation; struct parse_state { struct tm tm; int ymodulus; int yweek; long zone; }; struct time_zone { const char *name; int offset; }; /* Taken from PostgreSQL docs, merged with original RCS list. */ static const struct time_zone zones[] = { { "NZDT", +1300 }, { "IDLE", +1200 }, { "NZST", +1200 }, { "NZT", +1200 }, { "AESST", +1100 }, { "ACSST", +1030 }, { "CADT", +1030 }, { "SADT", +1030 }, { "AEST", +1000 }, { "EAST", +1000 }, { "GST", +1000 }, { "LIGT", +1000 }, { "JDT", +1000 }, { "KDT", +900 }, { "SAST", +930 }, { "CAST", +930 }, { "AWSST", +900 }, { "JST", +900 }, { "KST", +900 }, { "MHT", +900 }, { "WDT", +900 }, { "MT", +830 }, { "AWST", +800 }, { "CCT", +800 }, { "WADT", +800 }, { "WST", +800 }, { "JT", +730 }, { "ALMST", +700 }, { "WAST", +700 }, { "CXT", +700 }, { "MMT", +630 }, { "ALMT", +600 }, { "MAWT", +600 }, { "IOT", +500 }, { "MVT", +500 }, { "TFT", +500 }, { "AFT", +430 }, { "EAST", +400 }, { "MUT", +400 }, { "RET", +400 }, { "SCT", +400 }, { "IRT", +330 }, { "IT", +330 }, { "EAT", +300 }, { "BT", +300 }, { "HMT", +300 }, { "BDST", +200 }, { "CEST", +200 }, { "EET", +200 }, { "FWT", +200 }, { "IST", +200 }, { "MEST", +200 }, { "SST", +200 }, { "BST", +100 }, { "CET", +100 }, { "DNT", +100 }, { "FST", +100 }, { "MET", +100 }, { "MEWT", +100 }, { "MEZ", +100 }, { "NOR", +100 }, { "SET", +100 }, { "SWT", +100 }, { "BST", 000 }, { "GMT", 000 }, { "UT", 000 }, { "UTC", 000 }, { "CUT", 000 }, { "Z", 000 }, { "ZULU", 000 }, { "WET", 000 }, { "WAT", -100 }, { "FNST", -100 }, { "FNT", -200 }, { "BRST", -200 }, { "NDT", -230 }, { "ADT", -300 }, { "AWT", -300 }, { "BRT", -300 }, { "NFT", -330 }, { "NST", -330 }, { "AST", -400 }, { "ACST", -400 }, { "EDT", -400 }, { "ACT", -500 }, { "CDT", -500 }, { "EST", -500 }, { "CST", -600 }, { "MDT", -600 }, { "MST", -700 }, { "PDT", -700 }, { "AKDT", -800 }, { "PST", -800 }, { "YDT", -800 }, { "AKST", -900 }, { "HDT", -900 }, { "HADT", -900 }, { "YST", -900 }, { "MART", -930 }, { "AHST", -1000 }, { "HST", -1000 }, { "HAST", -1000 }, { "CAT", -1000 }, { "NT", -1100 }, { "IDLW", -1200 }, { "LT", 1 }, { NULL, 0 } }; #if ! HAVE_NL_LANGINFO static const char * const standard_months[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", 0 }; static const char * const standard_ab_months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", 0 }; static const char * const standard_days[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", 0 }; static const char * const standard_ab_days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", 0 }; #endif /* ! HAVE_NL_LANGINFO */ /* * Array of patterns to look for in a date string. * Order is important: we look for the first matching pattern * whose values do not contradict values that we already know about. * See `parse_pattern_letter' below for the meaning of the pattern codes. */ static const char * const patterns[] = { /* * These traditional patterns must come first, * to prevent an ISO 8601 format from misinterpreting their prefixes. */ "E_n_y", "x", /* RFC 822 */ "E_n", "n_E", "n", "t:m:s_A", "t:m_A", "t_A", /* traditional */ "y/N/D$", /* traditional RCS */ /* ISO 8601:1988 formats, generalized a bit. */ "y-N-D$", "4ND$", "Y-N$", "RND$", "-R=N$", "-R$", "--N=D$", "N=DT", "--N$", "---D$", "DT", "Y-d$", "4d$", "R=d$", "-d$", "dT", "y-W-X", "yWX", "y=W", "-r-W-X", "r-W-XT", "-rWX", "rWXT", "-W=X", "W=XT", "-W", "-w-X", "w-XT", "---X$", "XT", "4$", "T", "h:m:s$", "hms$", "h:m$", "hm$", "h$", "-m:s$", "-ms$", "-m$", "--s$", "Y", "Z", NULL }; /* * Parse an initial prefix of S of length DIGITS; it must be a number. * Store the parsed number into *RES. * Return the first character after the prefix, or 0 if it couldn't be parsed. */ static const char * _date_parse_fixed(const char *s, int digits, int *res) { int n; char const *lim; assert(s); assert(res); n = 0; lim = s + digits; while (s < lim) { unsigned int d = *s++ - '0'; if (9 < d) return 0; n = 10 * n + d; } *res = n; return s; } /* * Parse an initial prefix of S of length DIGITS; * it must be a number in the range LO through HI. * Store the parsed number into *RES. * Return the first character after the prefix, or 0 if it couldn't be parsed. */ static const char * _date_parse_ranged(const char *s, int digits, int lo, int hi, int *res) { assert(s); assert(res); s = _date_parse_fixed(s, digits, res); return (s && lo <= *res && *res <= hi) ? s : 0; } /* * Parse an initial prefix of S of length DIGITS; * it must be a number in the range LO through HI * and it may be followed by a fraction that is to be computed using RESOLUTION. * Store the parsed number into *RES; store the fraction times RESOLUTION, * rounded to the nearest integer, into *FRES. * Return the first character after the prefix, or 0 if it couldn't be parsed. */ static const char * _date_parse_decimal( const char *s, int digits, int lo, int hi, int resolution, int *res, int *fres ) { const char *dp; size_t dpl; assert(s); assert(res); assert(fres); #if HAVE_NL_LANGINFO # ifdef NL_LANGINFO_DP dp = nl_langinfo(NL_LANGINFO_DP); # else /* ! defined(NL_LANGINFO_DP) */ dp = "."; # endif /* ! defined(NL_LANGINFO_DP) */ #else /* ! HAVE_NL_LANGINFO */ dp = "."; #endif /* ! HAVE_NL_LANGINFO */ dpl = strlen(dp); s = _date_parse_fixed(s, digits, res); if (s && lo <= *res && *res <= hi) { int f = 0; if (*dp && !strncasecmp(s, dp, dpl) && ISDIGIT(s[dpl])) { const char *s1 = s + dpl; int num10 = 0, denom10 = 10, product; s = s1; while (ISDIGIT(*++s)) denom10 *= 10; s = _date_parse_fixed(s1, s - s1, &num10); product = num10 * resolution; f = (product + (denom10 >> 1)) / denom10; f -= f & (product % denom10 == denom10 >> 1); /* round to even */ if (f < 0 || product / resolution != num10) return 0; /* overflow */ } *fres = f; return s; } return 0; } /* * Parse an initial prefix of S; it must denote a time zone. * Set *ZONE to the number of seconds east of GMT, * or to TM_LOCAL_ZONE if it is the local time zone. * Return the first character after the prefix, or 0 if it couldn't be parsed. */ const char * date_parse_zone(const char *s, long *zone) { char sign; int hh, mm, ss; int minutesEastOfUTC; long offset, z; const struct time_zone *tz; assert(s); assert(zone); /* * The formats are LT, n, n DST, nDST, no, o * where n is a time zone name * and o is a time zone offset of the form [-+]hh[:mm[:ss]]. */ switch (*s) { case '-': case '+': z = 0; break; default: minutesEastOfUTC = -1; for (tz = zones; tz->name; tz++) { if (!strncasecmp(s, tz->name, strlen(tz->name))) { s += strlen(tz->name); #define hr60nonnegative(t) ((t) / 100 * 60 + (t)%100) #define hr60(t) ((t) < 0 ? -hr60nonnegative(-(t)) : hr60nonnegative(t)) minutesEastOfUTC = hr60(tz->offset); break; } } if (minutesEastOfUTC == -1) return NULL; /* Don't bother to check rest of spelling. */ while (ISALPHA(*s)) s++; /* Don't modify LT. */ if (minutesEastOfUTC == 1) { *zone = TM_LOCAL_ZONE; return s; } z = minutesEastOfUTC * 60L; /* Look for trailing " DST". */ if ( (s[-1]=='T' || s[-1]=='t') && (s[-2]=='S' || s[-2]=='s') && (s[-3]=='D' || s[-3]=='t') ) goto TRAILING_DST; while (ISSPACE(*s)) s++; if ( (s[0]=='D' || s[0]=='d') && (s[1]=='S' || s[1]=='s') && (s[2]=='T' || s[2]=='t') ) { s += 3; TRAILING_DST: *zone = z + 60*60; return s; } *zone = z; switch (*s) { case '-': case '+': break; default: return s; } } sign = *s++; if (!(s = _date_parse_ranged(s, 2, 0, 23, &hh))) return NULL; mm = ss = 0; if (*s == ':') s++; if (ISDIGIT(*s)) { if (!(s = _date_parse_ranged(s, 2, 0, 59, &mm))) return NULL; if (*s == ':' && s[-3] == ':' && ISDIGIT(s[1])) { if (!(s = _date_parse_ranged(s + 1, 2, 0, 59, &ss))) return NULL; } } if (ISDIGIT(*s)) return NULL; offset = (hh * 60 + mm) * 60L + ss; *zone = z + (sign == '-' ? -offset : offset); /* * ?? Are fractions allowed here? * If so, they're not implemented. */ return s; } #if ! HAVE_NL_LANGINFO # define nl_item int # define MON_1 1 # define MON_12 11 # define ABMON_1 1 # define ABMON_12 11 # define DAY_1 1 # define DAY_7 7 # define ABDAY_1 1 # define ABDAY_7 7 #endif /* ! HAVE_NL_LANGINFO */ static const char * parse_pattern_letter(const char *s, char c, struct parse_state *state) { assert(s); assert(c); assert(state); switch (c) { case '$': /* The next character must be a non-digit. */ if (ISDIGIT(*s)) return NULL; break; case '-': case '/': case ':': /* These characters stand for themselves. */ if (*s++ != c) return NULL; break; case '4': /* 4-digit year */ s = _date_parse_fixed(s, 4, &state->tm.tm_year); break; case '=': /* optional '-' */ s += *s == '-'; break; case 'A': /* AM or PM */ /* * This matches either enough of AM_STR or PM_STR to be unambiguous, * or the whole lot. */ { #if HAVE_NL_LANGINFO const char *am = nl_langinfo(AM_STR); const char *pm = nl_langinfo(PM_STR); #else /* ! HAVE_NL_LANGINFO */ const char *am = NULL; const char *pm = NULL; #endif /* ! HAVE_NL_LANGINFO */ size_t aml, pml, length; if (!am || !*am) am = "AM"; if (!pm || !*pm) pm = "PM"; aml = strlen(am); pml = strlen(pm); /* Find unambiguous length */ for (length = 1; am[length - 1] == pm[length - 1]; length++) ; if (!strncasecmp(s, am, aml)) { if (state->tm.tm_hour == 12) state->tm.tm_hour = 0; s += aml; } else if (!strncasecmp(s, pm, pml)) { if (state->tm.tm_hour < 12) state->tm.tm_hour += 12; s += pml; } else if (!strncasecmp(s, am, length)) { if (state->tm.tm_hour == 12) state->tm.tm_hour = 0; s += length; } else if (!strncasecmp(s, pm, length)) { if (state->tm.tm_hour < 12) state->tm.tm_hour += 12; s += length; } else return NULL; if (ISALNUM(*s)) return NULL; } break; case 'D': /* day of month [01-31] */ s = _date_parse_ranged(s, 2, 1, 31, &state->tm.tm_mday); break; case 'd': /* day of year [001-366] */ s = _date_parse_ranged(s, 3, 1, 366, &state->tm.tm_yday); state->tm.tm_yday--; break; case 'E': /* extended day of month [1-9, 01-31] */ s = _date_parse_ranged(s, ( ISDIGIT(s[0]) && ISDIGIT(s[1]) ) + 1, 1, 31, &state->tm.tm_mday); break; case 'h': /* hour [00-23 followed by optional fraction] */ { int frac; s = _date_parse_decimal(s, 2, 0, 23, 60 * 60, &state->tm.tm_hour, &frac); state->tm.tm_min = frac / 60; state->tm.tm_sec = frac % 60; } break; case 'm': /* minute [00-59 followed by optional fraction] */ s = _date_parse_decimal( s, 2, 0, 59, 60, &state->tm.tm_min, &state->tm.tm_sec ); break; case 'n': /* month name [e.g. "Jan"] */ { nl_item item; int found; found = 0; for (item = MON_1; item <= MON_12; item++) { #if HAVE_NL_LANGINFO const char *month = nl_langinfo(item); #else /* ! HAVE_NL_LANGINFO */ const char *month = standard_months[item - MON_1]; #endif /* ! HAVE_NL_LANGINFO */ if (!*month) continue; if (!strncasecmp(s, month, strlen(month))) { s += strlen(month); state->tm.tm_mon = item - MON_1; found = 1; break; } } if (found) { if (ISALPHA(*s)) return NULL; break; } found = 0; for (item = ABMON_1; item <= ABMON_12; item++) { #if HAVE_NL_LANGINFO const char *month = nl_langinfo(item); #else /* ! HAVE_NL_LANGINFO */ const char *month = standard_ab_months[item - ABMON_1]; #endif /* ! HAVE_NL_LANGINFO */ if (!*month) continue; if (!strncasecmp(s, month, strlen(month))) { s += strlen(month); state->tm.tm_mon = item - ABMON_1; found = 1; break; } } if (found) { if (ISALPHA(*s)) return NULL; break; } return NULL; } assert(0); case 'N': /* month [01-12] */ s = _date_parse_ranged(s, 2, 1, 12, &state->tm.tm_mon); state->tm.tm_mon--; break; case 'r': /* year % 10 (remainder in origin-0 decade) [0-9] */ s = _date_parse_fixed(s, 1, &state->tm.tm_year); state->ymodulus = 10; break; CASE_R: case 'R': /* year % 100 (remainder in origin-0 century) [00-99] */ s = _date_parse_fixed(s, 2, &state->tm.tm_year); state->ymodulus = 100; break; case 's': /* second [00-60 followed by optional fraction] */ { int frac; s = _date_parse_decimal(s, 2, 0, 60, 1, &state->tm.tm_sec, &frac); state->tm.tm_sec += frac; } break; case 'T': /* 'T' or 't' */ switch (*s++) { case 'T': case 't': break; default: return NULL; } break; case 't': /* traditional hour [1-9 or 01-12] */ s = _date_parse_ranged(s, ( ISDIGIT(s[0]) && ISDIGIT(s[1]) ) + 1, 1, 12, &state->tm.tm_hour); break; case 'w': /* 'W' or 'w' only (stands for current week) */ switch (*s++) { case 'W': case 'w': break; default: return NULL; } break; case 'W': /* 'W' or 'w', followed by a week of year [00-53] */ switch (*s++) { case 'W': case 'w': break; default: return NULL; } s = _date_parse_ranged(s, 2, 0, 53, &state->yweek); break; case 'X': /* weekday (1=Mon ... 7=Sun) [1-7] */ s = _date_parse_ranged(s, 1, 1, 7, &state->tm.tm_wday); state->tm.tm_wday--; break; case 'x': /* weekday name [e.g. "Sun"] */ { nl_item item; int found; found = 0; for (item = DAY_1; item <= DAY_7; item++) { #if HAVE_NL_LANGINFO const char *day = nl_langinfo(item); #else /* ! HAVE_NL_LANGINFO */ const char *day = standard_days[item - DAY_1]; #endif /* ! HAVE_NL_LANGINFO */ if (!*day) continue; if (!strncasecmp(s, day, strlen(day))) { s += strlen(day); state->tm.tm_wday = item - DAY_1; found = 1; break; } } if (found) { if (ISALPHA(*s)) return NULL; break; } found = 0; for (item = ABDAY_1; item <= ABDAY_7; item++) { #if HAVE_NL_LANGINFO const char *day = nl_langinfo(item); #else /* ! HAVE_NL_LANGINFO */ const char *day = standard_ab_days[item - ABDAY_1]; #endif /* ! HAVE_NL_LANGINFO */ if (!*day) continue; if (!strncasecmp(s, day, strlen(day))) { s += strlen(day); state->tm.tm_wday = item - ABDAY_1; found = 1; break; } } if (found) { if (ISALPHA(*s)) return NULL; break; } return NULL; } assert(0); case 'y': /* either R or Y */ if ( ISDIGIT(s[0]) && ISDIGIT(s[1]) && !ISDIGIT(s[2]) ) goto CASE_R; /* fall through */ case 'Y': /* year in full [4 or more digits] */ { int len = 0; while (ISDIGIT(s[len])) len++; if (len < 4) return NULL; s = _date_parse_fixed(s, len, &state->tm.tm_year); } break; case 'Z': /* time zone */ s = date_parse_zone(s, &state->zone); break; case '_': /* possibly empty sequence of non-alphanumerics */ while (!ISALNUM(*s) && *s) s++; break; default: /* bad pattern */ return NULL; } return s; } static inline void undefine(struct parse_state *state) { state->tm.tm_sec = state->tm.tm_min = state->tm.tm_hour = state->tm.tm_mday = state->tm.tm_mon = state->tm.tm_year = state->tm.tm_wday = state->tm.tm_yday = state->ymodulus = state->yweek = state->tm.tm_isdst = TM_UNDEFINED; state->zone = TM_UNDEFINED_ZONE; } static int const month_yday[] = { /* days in year before start of months 0-12 */ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; static int isleap(int y) { return (y & 3) == 0 && (y % 100 != 0 || y % 400 == 0); } /* * Convert UNIXTIME to struct tm form. * Use gmtime if available and if !LOCALZONE, localtime otherwise. */ static struct tm * time2tm(time_t unixtime, int localzone) { struct tm *tm; if (localzone || !(tm = gmtime(&unixtime))) tm = localtime(&unixtime); return tm; } /* Yield A - B, measured in seconds. */ static time_t difftm(const struct tm *a, const struct tm *b) { int ay = a->tm_year + (TM_YEAR_ORIGIN - 1); int by = b->tm_year + (TM_YEAR_ORIGIN - 1); int difference_in_day_of_year = a->tm_yday - b->tm_yday; int intervening_leap_days = ( ((ay >> 2) - (by >> 2)) - (ay / 100 - by / 100) + ((ay / 100 >> 2) - (by / 100 >> 2)) ); time_t difference_in_years = ay - by; time_t difference_in_days = ( difference_in_years * 365 + (intervening_leap_days + difference_in_day_of_year) ); return ( ( 24 * difference_in_days + (a->tm_hour - b->tm_hour) ) * 60 + (a->tm_min - b->tm_min) ) * 60 + (a->tm_sec - b->tm_sec); } /* * Convert TM to time_t, using localtime if LOCALZONE and gmtime otherwise. * Use only TM's year, mon, mday, hour, min, and sec members. * Ignore TM's old tm_yday and tm_wday, but fill in their correct values. * Yield -1 on failure (e.g. a member out of range). * Posix 1003.1-1990 doesn't allow leap seconds, but some implementations * have them anyway, so allow them if localtime/gmtime does. */ static time_t tm2time(struct tm *tm, int localzone) { /* Cache the most recent t,tm pairs; 1 for gmtime, 1 for localtime. */ static time_t t_cache[2]; static struct tm tm_cache[2]; time_t d, gt; const struct tm *gtm; /* * The maximum number of iterations should be enough to handle any * combinations of leap seconds, time zone rule changes, and solar time. * 4 is probably enough; we use a bigger number just to be safe. */ int remaining_tries = 8; /* Avoid subscript errors. */ if (12 <= (unsigned int)tm->tm_mon) return -1; tm->tm_yday = month_yday[tm->tm_mon] + tm->tm_mday - (tm->tm_mon < 2 || !isleap(tm->tm_year + TM_YEAR_ORIGIN)); /* Make a first guess. */ gt = t_cache[localzone]; gtm = gt ? &tm_cache[localzone] : time2tm(gt, localzone); /* Repeatedly use the error from the guess to improve the guess. */ while ((d = difftm(tm, gtm)) != 0) { if (--remaining_tries == 0) return -1; gt += d; gtm = time2tm(gt,localzone); } t_cache[localzone] = gt; tm_cache[localzone] = *gtm; /* * Check that the guess actually matches; * overflow can cause difftm to yield 0 even on differing times, * or tm may have members out of range (e.g. bad leap seconds). */ if ((tm->tm_year ^ gtm->tm_year) | (tm->tm_mon ^ gtm->tm_mon) | (tm->tm_mday ^ gtm->tm_mday) | (tm->tm_hour ^ gtm->tm_hour) | (tm->tm_min ^ gtm->tm_min) | (tm->tm_sec ^ gtm->tm_sec)) return -1; tm->tm_wday = gtm->tm_wday; return gt; } /* Yield the number of days in TM's month. */ static int month_days(const struct tm *tm) { int m = tm->tm_mon; return month_yday[m+1] - month_yday[m] + (m == 1 && isleap(tm->tm_year + TM_YEAR_ORIGIN)); } /* * Adjust time T by adding SECONDS. SECONDS must be at most 24 hours' worth. * Adjust only T's year, mon, mday, hour, min and sec members; * plus adjust wday if it is defined. */ static void adjzone(register struct tm *t, long seconds) { /* * This code can be off by a second if SECONDS is not a multiple of 60, * if T is local time, and if a leap second happens during this minute. * But this bug has never occurred, and most likely will not ever occur. * Liberia, the last country for which SECONDS % 60 was nonzero, * switched to UTC in May 1972; the first leap second was in June 1972. */ int leap_second = t->tm_sec == 60; long sec = seconds + (t->tm_sec - leap_second); if (sec < 0) { if ((t->tm_min -= (59 - sec) / 60) < 0) { if ((t->tm_hour -= (59 - t->tm_min) / 60) < 0) { t->tm_hour += 24; if (TM_DEFINED(t->tm_wday) && --t->tm_wday < 0) t->tm_wday = 6; if (--t->tm_mday <= 0) { if (--t->tm_mon < 0) { --t->tm_year; t->tm_mon = 11; } t->tm_mday = month_days(t); } } t->tm_min += 24 * 60; } sec += 24L * 60 * 60; } else if (60 <= (t->tm_min += sec / 60)) if (24 <= (t->tm_hour += t->tm_min / 60)) { t->tm_hour -= 24; if (TM_DEFINED(t->tm_wday) && ++t->tm_wday == 7) t->tm_wday = 0; if (month_days(t) < ++t->tm_mday) { if (11 < ++t->tm_mon) { ++t->tm_year; t->tm_mon = 0; } t->tm_mday = 1; } } t->tm_min %= 60; t->tm_sec = (int)(sec % 60) + leap_second; } time_t date_parse(const char *s, int use_zone_offset, long zone_offset) { struct parse_state state; struct tm tm, *tm0; int localzone, wday; time_t r; assert(s); if (!use_zone_offset) zone_offset = (rcs_emulation < 5 ? TM_LOCAL_ZONE : 0); memset(&state, '\0', sizeof(state)); undefine(&state); while (*s) { char c; const char * const *pattern; for (; !ISALNUM(c = *s) && c && c != '-' && c != '+'; s++) ; if (!c) break; /* Find first pattern that can merge successfully */ for (pattern = patterns; *pattern; pattern++) { struct parse_state temp; const char *s2, *c2; s2 = s; undefine(&temp); for (c2 = *pattern; s2 && *c2; c2++) s2 = parse_pattern_letter(s2, *c2, &temp); if (s2) { /* The pattern was fully matched */ #define conflict(a,b) ((a) != (b) && TM_DEFINED(a) && TM_DEFINED(b)) #define merge(a,b) do { if (TM_DEFINED(b)) (a) = (b); } while (0) if ( !conflict(state.tm.tm_sec, temp.tm.tm_sec) && !conflict(state.tm.tm_min, temp.tm.tm_min) && !conflict(state.tm.tm_hour, temp.tm.tm_hour) && !conflict(state.tm.tm_mday, temp.tm.tm_mday) && !conflict(state.tm.tm_mon, temp.tm.tm_mon) && !conflict(state.tm.tm_year, temp.tm.tm_year) && !conflict(state.tm.tm_wday, temp.tm.tm_wday) && !conflict(state.tm.tm_yday, temp.tm.tm_yday) && !conflict(state.ymodulus, temp.ymodulus) && !conflict(state.yweek, temp.yweek) && !( state.zone != temp.zone && state.zone != TM_UNDEFINED_ZONE && temp.zone != TM_UNDEFINED_ZONE ) ) { /* The pattern does not conflict */ s = s2; merge(state.tm.tm_sec, temp.tm.tm_sec); merge(state.tm.tm_min, temp.tm.tm_min); merge(state.tm.tm_hour, temp.tm.tm_hour); merge(state.tm.tm_mday, temp.tm.tm_mday); merge(state.tm.tm_mon, temp.tm.tm_mon); merge(state.tm.tm_year, temp.tm.tm_year); merge(state.tm.tm_wday, temp.tm.tm_wday); merge(state.tm.tm_yday, temp.tm.tm_yday); merge(state.ymodulus, temp.ymodulus); merge(state.yweek, temp.yweek); if (temp.zone != TM_UNDEFINED_ZONE) state.zone = temp.zone; goto OUTER; } } #undef conflict #undef merge } return -1; OUTER: ; } if (state.zone == TM_UNDEFINED_ZONE) state.zone = zone_offset; tm0 = NULL; localzone = state.zone == TM_LOCAL_ZONE; tm = state.tm; if (TM_DEFINED(state.ymodulus) || !TM_DEFINED(tm.tm_year)) { /* Get tm corresponding to current time. */ tm0 = time2tm(time(NULL), localzone); if (!localzone) adjzone(tm0, state.zone); } if (TM_DEFINED(state.ymodulus)) tm.tm_year += (tm0->tm_year + TM_YEAR_ORIGIN) / state.ymodulus * state.ymodulus; else if (!TM_DEFINED(tm.tm_year)) { /* Set default year, month, day from current time. */ tm.tm_year = tm0->tm_year + TM_YEAR_ORIGIN; if (!TM_DEFINED(tm.tm_mon)) { tm.tm_mon = tm0->tm_mon; if (!TM_DEFINED(tm.tm_mday)) tm.tm_mday = tm0->tm_mday; } } /* Convert from partime year (Gregorian) to Posix year. */ tm.tm_year -= TM_YEAR_ORIGIN; /* Set remaining default fields to be their minimum values. */ if (!TM_DEFINED(tm.tm_mon)) tm.tm_mon = 0; if (!TM_DEFINED(tm.tm_mday)) tm.tm_mday = 1; if (!TM_DEFINED(tm.tm_hour)) tm.tm_hour = 0; if (!TM_DEFINED(tm.tm_min)) tm.tm_min = 0; if (!TM_DEFINED(tm.tm_sec)) tm.tm_sec = 0; if (!localzone) adjzone(&tm, -state.zone); wday = tm.tm_wday; /* Convert and fill in the rest of the tm. */ r = tm2time(&tm, localzone); /* Check weekday. */ if (r != -1 && TM_DEFINED(wday) && wday != tm.tm_wday) return -1; return r; } time_t date_parse_rev(const char *rev) { struct tm tm; assert(rev); if ( sscanf(rev, "%d.%d.%d.%d.%d.%d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec ) == 6 ) { char *tz; time_t result; /* Dates can be on the form "99.12.15.08.09.04" before year 2000, * only subtract 1900 years if year >= 1900 */ if (tm.tm_year >= 1900) { tm.tm_year -= 1900; } tm.tm_mon--; tm.tm_wday = tm.tm_yday = tm.tm_isdst = 0; tz = getenv("TZ"); if (setenv("TZ", "UTC", 1)) return -1; tzset(); result = mktime(&tm); if (tz) setenv("TZ", tz, 1); else unsetenv("TZ"); return result; } else return -1; } char * date_format(time_t date) { struct tm *tm; char *result; assert(date >= 0); tm = gmtime(&date); /* if RCS version < 5 then localtime ? */ result = MALLOC(20, char); sprintf(result, "%04d.%02d.%02d.%02d.%02d.%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, (tm->tm_sec > 60 ? 60 : tm->tm_sec) ); return result; } char * date_sprintf(time_t date, long zone) { struct tm tm; char *result; size_t len; assert(date >= 0); result = MALLOC(40, char); switch (zone) { case TM_UNDEFINED_ZONE: /* if RCS version < 5 then localtime ? */ strftime(result, 40, "%Y/%m/%d %H:%M:%S", gmtime(&date)); break; case TM_LOCAL_ZONE: #if HAVE_TM_GMTOFF memcpy(&tm, localtime(&date), sizeof(struct tm)); zone = tm.tm_gmtoff; goto format_time; #else /* ! HAVE_TM_GMTOFF */ zone = -timezone; /* Huh? timezone is seconds west of UTC! */ #endif /* ! HAVE_TM_GMTOFF */ /* Fall through */ default: memcpy(&tm, gmtime(&date), sizeof(struct tm)); adjzone(&tm, zone); format_time: _UNUSED_LABEL len = strftime(result, 40, "%Y-%m-%d %H:%M:%S", &tm); if (zone >= 0) len += sprintf(result + len, "+%02ld", zone / 3600); else { zone = -zone; len += sprintf(result + len, "-%02ld", zone / 3600); } zone %= 3600; if (zone) { len += sprintf(result + len, ":%02ld", zone / 60); zone %= 60; } if (zone) len += sprintf(result + len, ":%02ld", zone); break; } return result; } size_t date_sprintf_prefix(time_t date, char *buffer, size_t len) { assert(date >= 0); /* if RCS version < 5 then localtime ? */ return strftime(buffer, len, "%d-%b-%y", gmtime(&date)); } blame-1.3.1/src/rcs.h0000644000076400007640000001055710151073670011264 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _RCS_H #define _RCS_H #include #include #include #include #include /* * An RCS file. */ typedef struct rcs { char *filename; /* Absolute/relative RCS filename. */ char *full_filename; /* Absolute RCS filename. */ char *short_filename; /* Last component of RCS filename. */ char *start; size_t length; delta_t *head; /* The head revision; NULL if RCS file is empty. */ char *branch; /* The default branch (NULL if RCS file is empty). */ hash_t *branches; /* Branches on the trunk. */ vector_t *access; /* Access list; parsed but not used. */ hash_t *symbols; /* Symbol table. */ hash_t *locks; /* Lock table; parsed but not used. */ int strict; /* Strict locking; parsed but not used. */ const char *comment; /* Comment prefix. */ expand_t expand; /* Default expansion mode. */ hash_t *delta_list; /* Mapping of revision to delta. */ unsigned int lines; } rcs_t; rcs_t * rcs_parse PARAMS((const char *)); void rcs_free PARAMS((rcs_t *)); /* * Returns the filename field in . */ static inline const char * rcs_get_filename(const rcs_t *rcs) { assert(rcs); return rcs->filename; } /* * Returns the full_filename field in . */ static inline const char * rcs_get_full_filename(const rcs_t *rcs) { assert(rcs); return rcs->full_filename; } /* * Returns the short_filename field in . */ static inline const char * rcs_get_short_filename(const rcs_t *rcs) { assert(rcs); return rcs->short_filename; } /* * Returns this RCS file's head revision. */ static inline const delta_t * rcs_get_head(const rcs_t *rcs) { assert(rcs); return rcs->head; } /* * Returns the branch field in . */ static inline const char * rcs_get_branch(const rcs_t *rcs) { assert(rcs); return rcs->branch; } /* * Returns the revision for symbol in , if it exists. */ static inline const char * rcs_get_symbol(const rcs_t *rcs, const char *symbol) { const char **rev; assert(rcs); assert(symbol); rev = (const char **)hash_get(rcs->symbols, symbol); return (rev ? *rev : NULL); } const char * rcs_get_locker PARAMS((const rcs_t *, const char *)); /* * Returns the comment field in . */ static inline const char * rcs_get_comment(const rcs_t *rcs) { assert(rcs); return rcs->comment; } /* * Returns the expand field in . */ static inline expand_t rcs_get_expand(const rcs_t *rcs) { assert(rcs); return rcs->expand; } /* * Returns delta in , if it exists. */ static inline const delta_t * rcs_get_delta(const rcs_t *rcs, const char *rev) { const delta_t **d; assert(rcs); assert(rev); d = (const delta_t **)hash_get(rcs->delta_list, rev); return (d ? *d : NULL); } /* * Returns a new delta template for delta in , * or an existing delta if it already exists. */ static inline delta_t * rcs_get_delta_template(const rcs_t *rcs, const char *rev) { delta_t **d, *delta; assert(rcs); assert(rev); d = (delta_t **)hash_get(rcs->delta_list, rev); if (d) return *d; delta = delta_new_template(rev); hash_insert_nocopy(rcs->delta_list, rev, delta); return delta; } char * rcs_resolve_tag PARAMS(( const rcs_t *, const char *, time_t, long, const char *, const char * )); int rcs_rev_is_valid PARAMS((const char *)); int rcs_branch_is_valid PARAMS((const char *)); char * rcs_rev_to_branch PARAMS((const char *)); #endif /* _RCS_H */ blame-1.3.1/src/system.h0000644000076400007640000000737610527563305012034 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004, 2005 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _SYSTEM_H #define _SYSTEM_H #if HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ /* * These headers should exist. Even gnulib assumes they do... */ #include #include #include #include #ifndef errno extern int errno; #endif #include #include #include #include #include #include #include #include #include #include #include #include #if TM_IN_SYS_TIME # if TIME_WITH_SYS_TIME # include # include # else /* ! TIME_WITH_SYS_TIME */ # if HAVE_SYS_TIME_H # include # else /* ! HAVE_SYS_TIME_H */ # include # endif /* ! HAVE_SYS_TIME_H */ # endif /* ! HAVE_SYS_TIME_H */ #else /* ! TIME_WITH_SYS_TIME */ # include #endif /* ! TM_IN_SYS_TIME */ #if HAVE_UNISTD_H # include #endif /* ! HAVE_UNISTD_H */ #define ALLOCA(C, T) ((T *)alloca((C) * sizeof(T))) #define MALLOC(C, T) ((T *)malloc((C) * sizeof(T))) #define MALLOC_VOIDP(C) ((void *)malloc(C)) #define CALLOC(C, T) ((T *)calloc((C), sizeof(T))) #define REALLOC(P, C, T) ((T *)realloc((P), (C) * sizeof(T))) static inline char * SALLOC(size_t c) { char *p; assert(c); p = MALLOC(c + 1, char); *p = *(p + c) = '\0'; return p; } static inline char * SREALLOC(char *p, size_t c) { assert(c); p = REALLOC(p, c + 1, char); *(p + c) = '\0'; return p; } #define obstack_chunk_alloc malloc #define obstack_chunk_free free typedef struct obstack obstack_t; #define OINIT(O) obstack_init(O) static inline void * _OALLOC(obstack_t *o, size_t s) { assert(o); return obstack_alloc(o, s); } #define OALLOC(O, C, T) ((T *)_OALLOC((O), (C) * sizeof(T))) #ifdef NDEBUG #define xfree(P) free(P) #else /* ! NDEBUG */ #define xfree(P) do { assert(P); free(P); (P) = NULL; } while (0) #endif /* ! NDEBUG */ #define FREE(P) xfree(P) #define OFREEALL(O) obstack_free((O), NULL) #define VOIDP_DIFF(P, Q) ((ptrdiff_t)((char *)(P) - (char *)(Q))) #define VOIDP_OFFSET(P, O) ((void *)((char *)(P) + (ptrdiff_t)(O))) /* No, we don't handle EOF. */ #define ISALNUM(C) isalnum((unsigned char)(C)) #define ISALPHA(C) isalpha((unsigned char)(C)) #define ISDIGIT(C) isdigit((unsigned char)(C)) #define ISGRAPH(C) isgraph((unsigned char)(C)) #define ISSPACE(C) isspace((unsigned char)(C)) #if defined __GNUC__ && defined __GNUC_MINOR__ # define __GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) #else # define __GNUC_PREREQ(maj, min) 0 #endif #if __GNUC_PREREQ(2, 4) && !defined(__STRICTANSI__) # define _UNUSED __attribute__((unused)) #else /* !__GNUC_PREREQ(2, 4) || defined(__STRICTANSI__) */ # define _UNUSED #endif /* !__GNUC_PREREQ(2, 4) || defined(__STRICTANSI__) */ #if __GNUC_PREREQ(3, 0) /* I think */ # define _UNUSED_LABEL __attribute__((unused)) #else /* ! __GNUC_PREREQ(3, 0) */ # define _UNUSED_LABEL #endif /* ! __GNUC_PREREQ(3, 0) */ #endif /* _SYSTEM_H */ blame-1.3.1/src/hash.c0000664000076400007640000001462510150607633011416 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #define DEFAULT_HASH_CAPACITY 50 /* * Returns a hash for . */ static inline unsigned int hash_fn(const char *key) { unsigned int h, t; h = 0; if (key) { while (*key) { t = h & 0xf8000000; h <<= 5; h ^= t >> 27; h ^= *key++; } } return h; } /* * Returns a new hash table with the specified dup and free functions. */ hash_t * hash_new(dup_fn_t dup_fn, free_fn_t free_fn) { hash_t *hash; hash = MALLOC(1, hash_t); hash->dup_fn = dup_fn; hash->free_fn = free_fn; hash->capacity = DEFAULT_HASH_CAPACITY; hash->count = 0; hash->data = CALLOC(hash->capacity, vector_t *); return hash; } /* * Returns a deep duplicate of . */ hash_t * hash_dup(const hash_t *hash) { hash_t *result; unsigned int i; assert(hash && hash->data); result = MALLOC(1, hash_t); result->dup_fn = hash->dup_fn; result->free_fn = hash->free_fn; result->capacity = hash->capacity; result->count = hash->count; result->data = MALLOC(hash->capacity, vector_t *); for (i = 0; i < hash->capacity; i++) result->data[i] = (hash->data[i] ? vector_dup(hash->data[i]) : NULL); return result; } /* * Returns a new hash table entry. */ static hash_entry_t * _hash_entry_new( dup_fn_t dup_fn, free_fn_t free_fn, const char *key, void *value ) { hash_entry_t *entry; entry = MALLOC(1, hash_entry_t); entry->dup_fn = dup_fn; entry->free_fn = free_fn; entry->key = (key ? strdup(key) : NULL); entry->hash = hash_fn(key); entry->value = value; return entry; } /* * Returns a deep duplicate of . */ static hash_entry_t * _hash_entry_dup(const hash_entry_t *entry) { hash_entry_t *result; assert(entry); result = MALLOC(1, hash_entry_t); result->dup_fn = entry->dup_fn; result->free_fn = entry->free_fn; result->key = (entry->key ? strdup(entry->key) : NULL); result->hash = entry->hash; result->value = ( entry->dup_fn ? (entry->dup_fn)(entry->value) : entry->value ); return result; } /* * Deeply frees . */ static void _hash_entry_free(hash_entry_t *entry) { assert(entry); if (entry->key) FREE(entry->key); if (entry->free_fn) (entry->free_fn)(entry->value); FREE(entry); } /* * Inserts a duplicate of into . */ #define _hash_insert_entry(HASH, ENTRY) \ _hash_insert_entry_nocopy((HASH), _hash_entry_dup(ENTRY)) /* * Inserts a into without duplicating. */ static void _hash_insert_entry_nocopy(hash_t *hash, hash_entry_t *entry) { unsigned int slot; unsigned int i; hash_entry_t *e; assert(hash); assert(hash->data); assert(entry); slot = entry->hash % hash->capacity; if (!hash->data[slot]) hash->data[slot] = vector_new( (dup_fn_t)_hash_entry_dup, (free_fn_t)_hash_entry_free ); for (i = 0; i < vector_count(hash->data[slot]); i++) { e = (hash_entry_t *)vector_get(hash->data[slot], i); if ( e->hash == entry->hash && ( (e->key == entry->key) || ( e->key && entry->key && !strcmp(e->key, entry->key) ) ) ) { if (hash->free_fn) (hash->free_fn)(e->value); e->value = entry->value; if (entry->key) FREE(entry->key); FREE(entry); return; } } vector_append_nocopy(hash->data[slot], entry); } /* * Ensures can contain at least entries. */ void hash_expand(hash_t *hash, unsigned int c) { unsigned int i, j, cap; vector_t **data; assert(hash); assert(hash->data); if (c <= hash->capacity) return; cap = hash->capacity; hash->capacity = c; data = hash->data; hash->data = CALLOC(hash->capacity, vector_t *); for (i = 0; i < cap; i++) if (data[i]) { for (j = 0; j < vector_count(data[i]); j++) _hash_insert_entry_nocopy(hash, (hash_entry_t *)vector_get(data[i], j)); vector_free_nofree(data[i]); } FREE(data); } /* * Maps to in the hash table without duplicating . * is duplicated, however. */ void hash_insert_nocopy(hash_t *hash, const char *key, void *value) { hash_entry_t *entry; assert(hash); if (hash->count++ * 2 > hash->capacity) hash_expand(hash, hash->capacity * 2); entry = _hash_entry_new(hash->dup_fn, hash->free_fn, key, value); _hash_insert_entry_nocopy(hash, entry); } /* * Returns a pointer to a pointer to the value in with key , or * NULL if no such entry exists. */ void ** hash_get(hash_t *hash, const char *key) { unsigned int h, i, slot; hash_entry_t *e; assert(hash); assert(hash->data); h = hash_fn(key); slot = h % hash->capacity; if (!hash->data[slot]) return NULL; for (i = 0; i < vector_count(hash->data[slot]); i++) { e = (hash_entry_t *)vector_get(hash->data[slot], i); if ( e->hash == h && ( (e->key == key) || (e->key && key && !strcmp(e->key, key)) ) ) return &e->value; } return NULL; } /* * Deeply frees . */ void hash_free(hash_t *hash) { unsigned int i; assert(hash); assert(hash->data); for (i = 0; i < hash->capacity; i++) if (hash->data[i]) vector_free(hash->data[i]); FREE(hash->data); FREE(hash); } /* * Returns a new iterator on . */ hash_iter_t hash_iter(hash_t *hash) { unsigned int i; hash_iter_struct_t *iter; assert(hash); assert(hash->data); for (i = 0; i < hash->capacity; i++) if (hash->data[i]) { iter = MALLOC(1, hash_iter_struct_t); iter->base = &hash->data[i]; iter->end = &hash->data[hash->capacity]; iter->i = 0; return iter; } return NULL; } /* * Advances and returns the iterator . */ hash_iter_t hash_next(hash_iter_t iter) { assert(iter); if (++iter->i < vector_count(*iter->base)) return iter; while (++iter->base != iter->end) if (*iter->base) { iter->i = 0; return iter; } FREE(iter); return NULL; } blame-1.3.1/src/working.c0000664000076400007640000000313410125542443012143 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include /* * Extracts and returns a revision number out of the working file . * Returns NULL on error or if no revision was found. On an error, an error * message is printed. */ char * working_extract_revision(const char *filename) { FILE *stream; char *rev, *line; size_t len; ssize_t read; assert(filename); stream = fopen(filename, "r"); if (!stream) { error(0, errno, "%s", filename); return NULL; } rev = NULL; line = NULL; len = 0; while ( (read = getline(&line, &len, stream)) != -1) if ( (rev = keyword_extract_revision(line, read)) ) break; if (line) FREE(line); if (!rev) error(0, 0, "%s: no revision found", filename); if (fclose(stream)) error(0, errno, "%s", filename); return rev; } blame-1.3.1/src/util.c0000644000076400007640000001012410530051146011426 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include /* * Returns true iff and constitute a valid * working file/RCS file pair. */ int does_working_filename_match_rcs_filename( const char *working_filename, const char *rcs_filename ) { const char *from, *to; char *a, *b; size_t al, bl; int result; assert(working_filename && rcs_filename); a = base_name(working_filename); al = base_len(a); b = base_name(rcs_filename); bl = base_len(b); result = 1; from = (suffixes ? suffixes : SUFFIXES); while (1) { to = strchrnul(from, DIRECTORY_SEPARATOR); if (al + (to - from) == bl && !strncmp(a, b, al) && !strncmp(from, b + bl - (to - from), to - from)) goto out; if (!*to) break; from = to + 1; } result = 0; out: FREE(a); FREE(b); return result; } /* * Returns true iff is a valid RCS filename. */ int is_rcs_filename(const char *filename) { const char *from, *to; assert(filename); from = (suffixes ? suffixes : SUFFIXES); while (1) { to = strchrnul(from, DIRECTORY_SEPARATOR); if (from == to) { if (!strncmp(filename, "RCS" SSLASH, 4)) return 1; if (strstr(filename, SSLASH "RCS" SSLASH)) return 1; } else { if (!strncmp(from, filename + strlen(filename) - (to - from), to - from)) return 1; } if (!*to) break; from = to + 1; } return 0; } /* * Returns the RCS filename that best matches , or NULL if * it could not be found. This function will print any error messages. */ char * find_matching_rcs_filename(const char *working_filename) { const char *from, *to, *a; char *first; int first_error; assert(working_filename); a = last_component(working_filename); first = NULL; first_error = 0; from = (suffixes ? suffixes : SUFFIXES); while (1) { char *buffer; size_t length; to = strchrnul(from, DIRECTORY_SEPARATOR); length = strlen(working_filename) + (to - from) + 4; buffer = SALLOC(length); strncat(buffer, working_filename, (a - working_filename)); strcat(buffer, "RCS" SSLASH); strncat(buffer, a, base_len(a)); strncat(buffer, from, to - from); if (!access(buffer, F_OK)) { if (first) FREE(first); return buffer; } if (!first) { first_error = errno; first = strdup(buffer); } if (from != to) { memset(buffer, '\0', length); strncpy(buffer, working_filename, (a - working_filename)); strncat(buffer, a, base_len(a)); strncat(buffer, from, to - from); if (!access(buffer, F_OK)) { if (first) FREE(first); return buffer; } } FREE(buffer); if (!*to) break; from = to + 1; } assert(first); assert(first_error); error(0, first_error, first); FREE(first); return NULL; } /* * Returns the working filename that best matches , or NULL if * it could not be determined. */ char * find_matching_working_filename(const char *rcs_filename) { const char *from, *to; char *a; size_t al; assert(rcs_filename); a = base_name(rcs_filename); al = base_len(a); from = (suffixes ? suffixes : SUFFIXES); while (1) { to = strchrnul(from, DIRECTORY_SEPARATOR); if (!strncmp(from, a + al - (to - from), to - from)) { char *result = strndup(a, al - (to - from)); FREE(a); return result; } if (!*to) break; from = to + 1; } FREE(a); return NULL; } blame-1.3.1/src/blame.c0000664000076400007640000005017610414731303011547 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004, 2005 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #if HAVE_LOCALE_H # include #endif /* HAVE_LOCALE_H */ #include #include #include #include #include #include #include #include #include #include /* * Program name for errors. */ const char *program_name; /* * Package name/bug address for argp */ const char *argp_program_version = PACKAGE_STRING "; emulating RCS version 5"; const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; /* * A slash-separated list of RCS suffixes. * If NULL, the macro SUFFIXES will be used instead. */ char *suffixes; /* * The version of RCS to emulate. */ unsigned int rcs_emulation; /* * A global obstack for lines read in from RCS files. */ obstack_t blame_lines_obstack; /* * The time zone to use for date parsing and printing. * If NULL, use localtime. */ static char *zone; static vector_t *filenames; /* Non-option arguments */ static char *tag_arg; /* Argument to -r, --rev */ static char *date_arg; /* Argument to -d, --date */ static char *author_arg; /* Argument to -w, --author */ static char *state_arg; /* Argument to -s, --state */ static expand_t expand; /* Argument to -k, --expand */ static char *symbol; /* Argument to -r, --rev (only if it was a single symbol) */ static time_t date; /* Parsed value of date_arg */ static long zone_offset; /* Parsed value of zone */ static int failures; /* True iff a failure occurred */ static int parsing_rcsinit; /* True iff argument parsing is not strict */ /* * Whether we should free everything at the end. */ static int cleanup; /* * Annotate revision of (with working filename ). * Returns -1 on error, 0 otherwise. */ static int annotate_revision(const char *filename, const rcs_t *rcs, const char *rev) { char *copy, *dot; size_t length, total_length; const delta_t *delta, *save, *target; lines_t *lines, *spare, *dup; unsigned int i; expand_t rcs_expand; int result; result = -1; assert(rcs); assert(rev && rcs_rev_is_valid(rev)); rcs_expand = expand; if (rcs_expand == EXPAND_UNDEFINED) rcs_expand = rcs_get_expand(rcs); if (rcs_expand == EXPAND_UNDEFINED) rcs_expand = EXPAND_KEY_VALUE; /* * Print the banner immediately after parsing the RCS file. * TODO: Add a -q, --quiet option? */ fprintf(stderr, "\nAnnotations for %s\n***************\n", filename); total_length = strlen(rev); copy = strdup(rev); /* * Find the second dot (or end-of-string). All deltas with a single dot * are on the trunk. */ dot = strchr(copy, '.'); assert(dot); /* since rcs_rev_is_valid(rev) */ dot = strchrnul(dot + 1, '.'); *dot = '\0'; length = dot - copy; /* * Start from the head revision. */ delta = rcs_get_head(rcs); lines = lines_dup(delta->text, rcs->lines); spare = lines_new_with_capacity(rcs->lines); target = rcs_get_delta(rcs, copy); while (delta != target) { lines_t *temp; const delta_t *next = delta_get_next(delta); assert(next); /* since rev exists and is reachable */ if (lines_apply(lines, spare, delta, next, 1)) { error( 0, 0, "%s: could not apply diff between revisions %s and %s", rcs_get_filename(rcs), delta_get_revision(delta), delta_get_revision(next) ); goto fail; } temp = lines; lines = spare; spare = temp; delta = next; } /* * We've found the branch point. Duplicate the line buffer, and continue * on the trunk until we hit the end. This will update the original line * buffer with ownership info for each line. */ dup = lines_dup(lines, rcs->lines); save = delta; while (delta) { const delta_t *next = delta_get_next(delta); if (next) { lines_t *temp; if (lines_apply(dup, spare, delta, next, 1)) { error( 0, 0, "%s: could not apply diff between revisions %s and %s", rcs_get_filename(rcs), delta_get_revision(delta), delta_get_revision(next) ); lines_free(dup); goto fail; } temp = dup; dup = spare; spare = temp; } else lines_finalize(dup, delta); delta = next; } lines_free(dup); delta = save; /* * Back to the branch point. */ while (length != total_length) { lines_t *temp; const delta_t *next; *dot = '.'; dot = strchr(dot + 1, '.'); assert(dot); /* since rcs_rev_is_valid(rev) */ /* * Look up the branch. */ *dot = '\0'; next = delta_get_branch(delta, copy); assert(next); /* since rev exists and is reachable */ if (lines_apply(lines, spare, delta, next, 0)) { error( 0, 0, "%s: could not apply diff between revisions %s and %s", rcs_get_filename(rcs), delta_get_revision(delta), delta_get_revision(next) ); goto fail; } temp = lines; lines = spare; spare = temp; delta = next; *dot = '.'; dot = strchrnul(dot + 1, '.'); *dot = '\0'; length = dot - copy; /* * Continue along this branch until we find the correct revision or another * branch point. */ target = rcs_get_delta(rcs, copy); while (delta != target) { next = delta_get_next(delta); if (lines_apply(lines, spare, delta, next, 0)) { error( 0, 0, "%s: could not apply diff between revisions %s and %s", rcs_get_filename(rcs), delta_get_revision(delta), delta_get_revision(next) ); goto fail; } temp = lines; lines = spare; spare = temp; delta = next; } } /* * OK, should have ownership info for each line in the selected revision. * For each line, we print out the owner's revision, author and date, * followed by an expanded version of the line. */ for (i = 0; i < lines_count(lines); i++) { const line_t *line = lines_get(lines, i); /* * If the final line is empty, don't print anything. */ if ((i + 1 == lines_count(lines)) && !line->len) break; keyword_annotate(line, rcs, rcs_expand, symbol, zone_offset); } result = 0; fail: if (cleanup) { lines_free(lines); lines_free(spare); FREE(copy); } return result; } /* * Annotate / (one of which must be specified). * Returns -1 on error, 0 otherwise. */ static int annotate(const char *working_filename, const char *rcs_filename) { rcs_t *rcs; char *working_filename2, *rcs_filename2; char *tag, *rev; int result; OINIT(&blame_lines_obstack); result = -1; assert(working_filename || rcs_filename); rcs = NULL; working_filename2 = rcs_filename2 = NULL; tag = rev = NULL; /* * Resolve a missing working_filename or rcs_filename. */ if (!rcs_filename) rcs_filename2 = find_matching_rcs_filename(working_filename); else rcs_filename2 = strdup(rcs_filename); if (!rcs_filename2) goto fail; if (!working_filename) working_filename2 = find_matching_working_filename(rcs_filename); else working_filename2 = strdup(working_filename); assert(is_rcs_filename(rcs_filename2)); assert(!is_rcs_filename(working_filename2)); /* * If a tag is specified, extract it from the working file if it is "$". * The value in the working file can have symbols in it, but it can't * contain "..". */ tag = NULL; if (tag_arg) { if (!strcmp(tag_arg, "$")) { tag = working_extract_revision(working_filename2); if (!tag) goto fail; if (!rcs_rev_is_valid(tag)) { error(0, 0, "%s: %s is not a revision number", working_filename2, tag); goto fail; } } else tag = strdup(tag_arg); } /* * Read in the RCS file. If this succeeds, the delta tree is guaranteed to * be valid (no loops, all deltas reachable, branches on appropriate * deltas, etc.). */ rcs = rcs_parse(rcs_filename2); if (!rcs) goto fail; /* * If there's no head revision, the RCS file is empty (created with * "rcs -i"). No point in going any further. */ if (!rcs_get_head(rcs)) { error(0, 0, "%s: no revisions present", working_filename2); goto fail; } /* * Try to resolve the specified tag. */ rev = rcs_resolve_tag(rcs, tag, date, zone_offset, author_arg, state_arg); if (!rev) goto fail; /* * Save the tag if it was a single symbol. We need this in case we expand * any Symbol keywords. */ if (tag && rcs_get_symbol(rcs, tag)) symbol = tag; else symbol = NULL; /* * We know the numerical revision we want, and we know it's somewhere in * delta tree. Annotate it. */ result = annotate_revision(working_filename2, rcs, rev); fail: if (cleanup) { if (rcs) rcs_free(rcs); if (working_filename2) FREE(working_filename2); if (rcs_filename2) FREE(rcs_filename2); if (tag) FREE(tag); if (rev) FREE(rev); OFREEALL(&blame_lines_obstack); } return result; } /* * Parse command line option , with argument . Current parser state * is in . */ static error_t parse_options(int key, char *arg, struct argp_state *state) { static const char *working_filename; static const char *rcs_filename; switch (key) { case '?': argp_state_help(state, state->out_stream, ARGP_HELP_STD_HELP); break; case 0x80: argp_state_help(state, state->out_stream, ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK); break; case 'V': if (arg) { switch (*arg) { case '3': case '4': case '5': if (!*(arg + 1)) { rcs_emulation = *arg - '0'; break; } default: argp_failure( state, EXIT_FAILURE, 0, "invalid RCS emulation version %s", arg ); assert(parsing_rcsinit); break; } } else { fprintf(state->out_stream, "%s\n", argp_program_version); if (!(state->flags & ARGP_NO_EXIT)) exit(EXIT_SUCCESS); } break; case 'r': /* --rev */ if (tag_arg) { argp_failure( state, EXIT_FAILURE, 0, "multiple revision options may not be specified" ); assert(parsing_rcsinit); FREE(tag_arg); } tag_arg = (arg ? strdup(arg) : strdup("")); break; case 'd': /* --date */ assert(arg); /* argument is mandatory */ if (date_arg) { argp_failure( state, EXIT_FAILURE, 0, "multiple date options may not be specified" ); assert(parsing_rcsinit); FREE(date_arg); } date_arg = strdup(arg); break; case 'w': /* --author */ if (author_arg) { argp_failure( state, EXIT_FAILURE, 0, "multiple author options may not be specified" ); assert(parsing_rcsinit); FREE(author_arg); author_arg = NULL; } if (arg) author_arg = strdup(arg); else { struct passwd *pw; /* * Use the user's username. */ pw = getpwuid(getuid()); if (!pw) { /* They've probably disappeared out of /etc/passwd. */ argp_failure(state, EXIT_FAILURE, 0, "could not determine username"); break; } author_arg = strdup(pw->pw_name); } break; case 's': /* --state */ assert(arg); /* argument is mandatory */ if (state_arg) { argp_failure( state, EXIT_FAILURE, 0, "multiple state options may not be specified" ); assert(parsing_rcsinit); FREE(state_arg); } state_arg = strdup(arg); break; case 'x': /* --suffixes */ assert(arg); /* argument is mandatory */ if (suffixes) { argp_failure( state, EXIT_FAILURE, 0, "multiple suffixes options may not be specified" ); assert(parsing_rcsinit); FREE(suffixes); } suffixes = strdup(arg); break; case 'z': /* --zone */ assert(arg); /* argument is mandatory */ if (zone) { argp_failure( state, EXIT_FAILURE, 0, "multiple default time zone options may not be specified" ); assert(parsing_rcsinit); FREE(zone); } zone = strdup(arg); break; case 'k': /* --expand */ assert(arg); /* argument is mandatory */ if (expand != EXPAND_UNDEFINED) { argp_failure( state, EXIT_FAILURE, 0, "multiple keyword substitution types may not be specified" ); assert(parsing_rcsinit); } if (!strcmp(arg, "kv")) { expand = EXPAND_KEY_VALUE; break; } else if (!strcmp(arg, "kvl")) { expand = EXPAND_KEY_VALUE_LOCKER; break; } else if (!strcmp(arg, "k")) { expand = EXPAND_KEY_ONLY; break; } else if (!strcmp(arg, "o")) { expand = EXPAND_OLD_STRING; break; } else if (!strcmp(arg, "b")) { expand = EXPAND_BINARY_STRING; break; } else if (!strcmp(arg, "v")) { expand = EXPAND_VALUE_ONLY; break; } else { argp_failure( state, EXIT_FAILURE, 0, "invalid keyword substitution type %s", arg ); break; } case ARGP_KEY_ARG: assert(arg); /* argument is mandatory */ vector_append(filenames, arg); break; case ARGP_KEY_END: if (!parsing_rcsinit) { unsigned int i; if (!vector_count(filenames)) { argp_failure(state, EXIT_FAILURE, 0, "no files specified"); assert(0); } /* * Resolve the zone, if it was specified. */ zone_offset = TM_UNDEFINED_ZONE; if (zone && !date_parse_zone(zone, &zone_offset)) { argp_failure(state, EXIT_FAILURE, 0, "invalid time zone: %s", zone); break; } /* * Check the tag doesn't contain "..", if it was specified. */ if (tag_arg) { if (strstr(tag_arg, "..")) { argp_failure( state, EXIT_FAILURE, 0, "missing tag component: %s", tag_arg ); break; } } /* * Resolve the date, if it was specified. */ if (date_arg) { date = date_parse(date_arg, !!zone, zone_offset); if (date < 0) { argp_failure(state, EXIT_FAILURE, 0, "invalid date: %s", date_arg); break; } } /* * If a matching working filename and RCS filename are beside each * other on the command line, we pair them together. */ for (i = 0; i < vector_count(filenames); i++) { const char *filename; filename = (const char *)vector_get(filenames, i); assert(filename); if (is_rcs_filename(filename)) { if (rcs_filename) failures |= annotate(NULL, rcs_filename); rcs_filename = filename; if (working_filename) { if ( does_working_filename_match_rcs_filename( working_filename, rcs_filename ) ) { #if FASTEXIT if (i == vector_count(filenames) - 1) cleanup = 0; #endif /* FASTEXIT */ failures |= annotate(working_filename, rcs_filename); working_filename = rcs_filename = NULL; } else { failures |= annotate(working_filename, NULL); working_filename = NULL; } } } else { if (working_filename) failures |= annotate(working_filename, NULL); working_filename = filename; if (rcs_filename) { if ( does_working_filename_match_rcs_filename( working_filename, rcs_filename ) ) { #if FASTEXIT if (i == vector_count(filenames) - 1) cleanup = 0; #endif /* FASTEXIT */ failures |= annotate(working_filename, rcs_filename); working_filename = rcs_filename = NULL; } else { failures |= annotate(NULL, rcs_filename); rcs_filename = NULL; } } } /* * If we had both working_filename and rcs_filename we should * have processed at least one of them. */ assert(!working_filename || !rcs_filename); } /* * Handle any remaining working filename or RCS filename. */ #if FASTEXIT cleanup = 0; #endif /* FASTEXIT */ if (working_filename) failures |= annotate(working_filename, NULL); if (rcs_filename) failures |= annotate(NULL, rcs_filename); } break; default: return ARGP_ERR_UNKNOWN; } return 0; } int main(int argc, char **argv) { char *rcsinit; struct argp_option options[] = { { NULL, 0, NULL, 0, "Revision specification options:", 0 }, { "revision", 'r', "REV", OPTION_ARG_OPTIONAL, "Revision to annotate", 0 }, { "rev", 0, NULL, OPTION_HIDDEN | OPTION_ALIAS, NULL, 0 }, { "date", 'd', "DATE", 0, "Date of revision to annotate", 0 }, { "author", 'w', "LOGIN", OPTION_ARG_OPTIONAL, "Author of revision to annotate", 0 }, { "state", 's', "STATE", 0, "State of revision to annotate", 0 }, { NULL, 0, NULL, 0, "Keyword substitution options:", 0 }, { "expand", 'k', "SUBST", 0, "Substitutions performed (kv, kvl, k, o, b, v)", 0 }, { NULL, 0, NULL, 0, "Other options:", 0 }, { "suffixes", 'x', "SUFFIXES", 0, SSLASH "-separated list of RCS suffixes (default: '" SUFFIXES "')", 0 }, { "zone", 'z', "ZONE", 0, "Default time zone (default: 'UTC')", 0 }, { NULL, 0, NULL, 0, "Help options:", -1 }, { "help", '?', NULL, 0, "Give this help list", -1 }, { "usage", 0x80, NULL, 0, "Give a short usage message", -1 }, { "version", 'V', "VER", OPTION_ARG_OPTIONAL, "Print program version; or\n" "Emulate RCS version (default: 5)", -1 }, { NULL, '\0', NULL, 0, NULL, 0 } }; struct argp parser = { NULL, parse_options, "FILE ...", "Annotate RCS files with the last revision where each line was modified.", NULL, NULL, NULL }; parser.options = options; #if HAVE_LOCALE_H && HAVE_SETLOCALE /* * Use the environment's locale, not "C". */ setlocale(LC_ALL, ""); #endif /* HAVE_LOCALE_H && HAVE_SETLOCALE */ set_program_name(argv[0]); argp_err_exit_status = EXIT_FAILURE; failures = 0; rcs_emulation = 5; filenames = vector_new((dup_fn_t)string_dup, (free_fn_t)string_free); tag_arg = date_arg = author_arg = state_arg = NULL; expand = EXPAND_UNDEFINED; suffixes = zone = NULL; date = (time_t)(-1); cleanup = 1; /* * Parse RCSINIT environment variable first, if it exists. * We try to ignore arguments we don't expect. */ parsing_rcsinit = 1; if ( (rcsinit = getenv("RCSINIT")) ) { char *copy, **rcsinit_argv; char *a, *b, *c; int escape, rcsinit_argc; unsigned int spaces = 0; copy = strdup(rcsinit); /* Count spaces */ for (c = copy; *c; c++) if (ISSPACE(*c)) spaces++; rcsinit_argv = MALLOC(spaces + 2, char *); rcsinit_argv[0] = argv[0]; rcsinit_argc = 1; escape = 0; a = b = c = copy; while (1) { if (!*b) { if (a != c) rcsinit_argv[rcsinit_argc++] = c; *a = '\0'; break; } else if (!escape && ISSPACE(*b)) { if (a != c) rcsinit_argv[rcsinit_argc++] = c; *a++ = '\0'; c = a; } else if (!escape && *b == '\\') { escape = 1; } else { escape = 0; *a++ = *b; } b++; } argp_parse( &parser, rcsinit_argc, rcsinit_argv, ARGP_NO_HELP | ARGP_NO_EXIT, /* Warn but don't exit on argp_failure */ NULL, NULL ); /* ignore errors */ FREE(rcsinit_argv); FREE(copy); } parsing_rcsinit = 0; /* * Annotations occur in the parser function's ARGP_KEY_END state. */ failures |= argp_parse(&parser, argc, argv, ARGP_NO_HELP, NULL, NULL); if (cleanup) { vector_free(filenames); if (suffixes) FREE(suffixes); if (zone) FREE(zone); if (tag_arg) FREE(tag_arg); if (date_arg) FREE(date_arg); if (author_arg) FREE(author_arg); if (state_arg) FREE(state_arg); } return (failures ? EXIT_FAILURE : EXIT_SUCCESS); } blame-1.3.1/src/vector.c0000664000076400007640000000536710135204066011774 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #define DEFAULT_VECTOR_CAPACITY 50 #include #include /* * Returns a new vector with the specified dup and free functions. */ vector_t * vector_new(dup_fn_t dup_fn, free_fn_t free_fn) { vector_t *vector; vector = MALLOC(1, vector_t); vector->dup_fn = dup_fn; vector->free_fn = free_fn; vector->capacity = DEFAULT_VECTOR_CAPACITY; vector->count = 0; vector->data = MALLOC(vector->capacity, void *); return vector; } /* * Returns a deep duplicate of . */ vector_t * vector_dup(const vector_t *vector) { vector_t *result; unsigned int i; assert(vector); result = MALLOC(1, vector_t); result->dup_fn = vector->dup_fn; result->free_fn = vector->free_fn; result->capacity = vector->capacity; result->count = vector->count; result->data = MALLOC(result->capacity, void *); if (result->dup_fn) for (i = 0; i < result->count; i++) result->data[i] = (result->dup_fn)(vector->data[i]); else memcpy(result->data, vector->data, result->count * sizeof(void *)); return result; } /* * Ensures can contain at least entries. */ void vector_expand(vector_t *vector, unsigned int c) { assert(vector); if (c <= vector->capacity) return; vector->capacity = c; vector->data = REALLOC(vector->data, vector->capacity, void *); } /* * Appends to without duplicating. */ void vector_append_nocopy(vector_t *vector, void *x) { assert(vector); if (vector->count == vector->capacity) vector_expand(vector, 2 * vector->count); vector->data[vector->count] = x; vector->count++; } /* * Deeply frees . */ void vector_free(vector_t *vector) { unsigned int i; assert(vector); if (vector->free_fn) for (i = 0; i < vector->count; i++) (vector->free_fn)(vector->data[i]); FREE(vector->data); FREE(vector); } /* * Frees , but DOES NOT free each entry. Use with caution. */ void vector_free_nofree(vector_t *vector) { assert(vector); FREE(vector->data); FREE(vector); } blame-1.3.1/src/parser.h0000644000076400007640000000651410527553345012000 00000000000000/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { NUM = 258, ID = 259, SYM = 260, STR = 261, STR_FINAL = 262, HEAD = 263, BRANCH = 264, ACCESS = 265, SYMBOLS = 266, LOCKS = 267, STRICT = 268, COMMENT = 269, EXPAND = 270, DATE = 271, AUTHOR = 272, STATE = 273, BRANCHES = 274, NEXT = 275, DESC = 276, LOG = 277, TEXT = 278 }; #endif /* Tokens. */ #define NUM 258 #define ID 259 #define SYM 260 #define STR 261 #define STR_FINAL 262 #define HEAD 263 #define BRANCH 264 #define ACCESS 265 #define SYMBOLS 266 #define LOCKS 267 #define STRICT 268 #define COMMENT 269 #define EXPAND 270 #define DATE 271 #define AUTHOR 272 #define STATE 273 #define BRANCHES 274 #define NEXT 275 #define DESC 276 #define LOG 277 #define TEXT 278 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE #line 43 "parser.y" { char *s; unsigned int i; time_t date; hash_t *hash; vector_t *vector; lines_t *lines; delta_t *delta; struct { delta_t *head; hash_t *branches; } trunk; expand_t expand; } /* Line 1529 of yacc.c. */ #line 110 "parser.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval; #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED typedef struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; } YYLTYPE; # define yyltype YYLTYPE /* obsolescent; will be withdrawn */ # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif extern YYLTYPE yylloc; blame-1.3.1/src/keyword.h0000664000076400007640000000260510414731304012153 00000000000000/* * Blame - An RCS file annotator * Copyright (C) 2004, 2005 Michael Chapman * * 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 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _KEYWORD_H #define _KEYWORD_H #include #include struct rcs; /* * Various types of keyword expansion. EXPAND_BINARY_STING is essentially * synonmyous with EXPAND_OLD_STRING since we're always writing on stdout. */ typedef enum { EXPAND_UNDEFINED, EXPAND_KEY_VALUE, EXPAND_KEY_VALUE_LOCKER, EXPAND_KEY_ONLY, EXPAND_OLD_STRING, EXPAND_BINARY_STRING, EXPAND_VALUE_ONLY } expand_t; char * keyword_extract_revision PARAMS((const char *, size_t)); void keyword_annotate PARAMS(( const line_t *, const struct rcs *, expand_t, const char *, long )); #endif /* _KEYWORD_H */ blame-1.3.1/missing0000775000076400007640000002466610125542443011144 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2003-09-02.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: