/* @configure_input@ */
/*****************************************************************
 * SQUID - a library of functions for biological sequence analysis
 * Copyright (C) 1992-2002 Washington University School of Medicine
 * 
 *     This source code is freely distributed under the terms of the
 *     GNU General Public License. See the files COPYRIGHT and LICENSE
 *     for details.
 *****************************************************************/

#ifndef SQUIDCONFH_INCLUDED
#define SQUIDCONFH_INCLUDED

/* squidconf.h
 * Captures #define's generated by the ./configure script;
 * this configuration information is #included at the start of
 * squid.h
 */

/*****************************************************************
 * Sizes of integer types.
 * various things are set by ./configure; the code
 * uses WORDS_BIGENDIAN and USE_HOST_BYTESWAP_FUNCTIONS.
 *****************************************************************/ 
#undef WORDS_BIGENDIAN
#define SIZEOF_UNSIGNED_SHORT      0
#define SIZEOF_UNSIGNED_INT        0
#define SIZEOF_UNSIGNED_LONG       0
#define SIZEOF_UNSIGNED_LONG_LONG  0
#undef HAVE_NTOHS		/* if defined, system provides ntohs() */
#undef HAVE_NTOHL		/* if defined, system provides ntohl() */
#undef HAVE_HTONS		/* if defined, system provides htons() */
#undef HAVE_HTONL		/* if defined, system provides htonl() */
#undef HAVE_STRTOUL		
#undef HAVE_STRTOULL
#if defined HAVE_NTOHL && defined HAVE_NTOHS && defined HAVE_HTONS && defined HAVE_HTONL
#define USE_HOST_BYTESWAP_FUNCTIONS 1
#endif

/* On 64-bit machines like Alphas, strtoull doesn't exist, strotul will work
 */
#if SIZEOF_UNSIGNED_LONG == 8 && defined HAVE_STRTOUL && ! defined HAVE_STRTOULL
#define strtoull strtoul
#endif

/*****************************************************************
 * Can we support arithmetic 64-bit file offsets?
 * four possible models checked for:
 *   1. ftello(), fseeko() with 64-bit off_t
 *   2. ftello64(), fseeko64() with 64-bit off64_t
 *   3. ftell64(), fseek64() with 64-bit integer
 *   4. fgetpos(), fsetpos() with an fpos_t that happens to be a 
 *      64-bit integer, even though ANSI says we're not supposed to know
 *      anything about fpos_t's internals.
 * Based on what ./configure tells us about these, we set
 * HAS_64BIT_FILE_OFFSETS or not. 
 *****************************************************************/
#undef HAVE_FTELLO
#undef HAVE_FSEEKO
#undef HAVE_FTELLO64
#undef HAVE_FSEEKO64
#undef HAVE_FTELL64
#undef HAVE_FSEEK64
#undef ARITHMETIC_FPOS_T
#undef HAVE_STAT64
#define SIZEOF_FPOS_T     -1
#define SIZEOF_OFF_T      -1
#define SIZEOF_OFF64_T    -1

#if   defined HAVE_FTELLO && defined HAVE_FSEEKO && SIZEOF_OFF_T == 8
#define HAS_64BIT_FILE_OFFSETS 1
#elif defined HAVE_FTELLO64 && defined HAVE_FSEEKO64 && SIZEOF_OFF64_T == 8
#define HAS_64BIT_FILE_OFFSETS 1
#elif defined HAVE_FTELL64 && defined HAVE_FSEEK64 
#define HAS_64BIT_FILE_OFFSETS 1
#elif defined ARITHMETIC_FPOS_T && SIZEOF_FPOS_T == 8
#define HAS_64BIT_FILE_OFFSETS 1
#else
#undef HAS_64BIT_FILE_OFFSETS 
#endif


/* Stuff to work around Tru64 not having strtoull() -
 * on systems with 64-bit longs, we can use strtoul()
 */
#undef HAVE_STRTOULL
#if ! defined HAVE_STRTOULL && SIZEOF_UNSIGNED_LONG == 8
#define strtoull strtoul
#endif

#endif /* SQUIDCONFH_INCLUDED */
