/* config.h.in.  Generated from configure.ac by autoheader.  */

/* Define if you have a getaddrinfo that fails for the all-zeros IPv6 address
   */
#undef AIX_GETNAMEINFO_HACK

/* Define if your AIX loginfailed() function takes 4 arguments (AIX >= 5.2) */
#undef AIX_LOGINFAILED_4ARG

/* System only supports IPv4 audit records */
#undef AU_IPv4

/* Define if your resolver libs need this for getrrsetbyname */
#undef BIND_8_COMPAT

/* The system has incomplete BSM API */
#undef BROKEN_BSM_API

/* Define if cmsg_type is not passed correctly */
#undef BROKEN_CMSG_TYPE

/* getaddrinfo is broken (if present) */
#undef BROKEN_GETADDRINFO

/* getgroups(0,NULL) will return -1 */
#undef BROKEN_GETGROUPS

/* FreeBSD glob does not do what we need */
#undef BROKEN_GLOB

/* Define if you system's inet_ntoa is busted (e.g. Irix gcc issue) */
#undef BROKEN_INET_NTOA

/* ia_uinfo routines not supported by OS yet */
#undef BROKEN_LIBIAF

/* Ultrix mmap can't map files */
#undef BROKEN_MMAP

/* Define if your struct dirent expects you to allocate extra space for d_name
   */
#undef BROKEN_ONE_BYTE_DIRENT_D_NAME

/* Can't do comparisons on readv */
#undef BROKEN_READV_COMPARISON

/* NetBSD read function is sometimes redirected, breaking atomicio comparisons
   against it */
#undef BROKEN_READ_COMPARISON

/* realpath does not work with nonexistent files */
#undef BROKEN_REALPATH

/* Needed for NeXT */
#undef BROKEN_SAVED_UIDS

/* Define if your setregid() is broken */
#undef BROKEN_SETREGID

/* Define if your setresgid() is broken */
#undef BROKEN_SETRESGID

/* Define if your setresuid() is broken */
#undef BROKEN_SETRESUID

/* Define if your setreuid() is broken */
#undef BROKEN_SETREUID

/* LynxOS has broken setvbuf() implementation */
#undef BROKEN_SETVBUF

/* QNX shadow support is broken */
#undef BROKEN_SHADOW_EXPIRE

/* Define if your snprintf is busted */
#undef BROKEN_SNPRINTF

/* FreeBSD strnvis argument order is swapped compared to OpenBSD */
#undef BROKEN_STRNVIS

/* tcgetattr with ICANON may hang */
#undef BROKEN_TCGETATTR_ICANON

/* updwtmpx is broken (if present) */
#undef BROKEN_UPDWTMPX

/* Define if you have BSD auth support */
#undef BSD_AUTH

/* Define if you want to specify the path to your lastlog file */
#undef CONF_LASTLOG_FILE

/* Define if you want to specify the path to your utmp file */
#undef CONF_UTMP_FILE

/* Define if you want to specify the path to your wtmpx file */
#undef CONF_WTMPX_FILE

/* Define if you want to specify the path to your wtmp file */
#undef CONF_WTMP_FILE

/* Define if your platform needs to skip post auth file descriptor passing */
#undef DISABLE_FD_PASSING

/* Define if you don't want to use lastlog */
#undef DISABLE_LASTLOG

/* Define if you don't want to use your system's login() call */
#undef DISABLE_LOGIN

/* Define if you don't want to use pututline() etc. to write [uw]tmp */
#undef DISABLE_PUTUTLINE

/* Define if you don't want to use pututxline() etc. to write [uw]tmpx */
#undef DISABLE_PUTUTXLINE

/* Define if you want to disable shadow passwords */
#undef DISABLE_SHADOW

/* Define if you don't want to use utmp */
#undef DISABLE_UTMP

/* Define if you don't want to use utmpx */
#undef DISABLE_UTMPX

/* Define if you don't want to use wtmp */
#undef DISABLE_WTMP

/* Define if you don't want to use wtmpx */
#undef DISABLE_WTMPX

/* Enable for PKCS#11 support */
#undef ENABLE_PKCS11

/* File names may not contain backslash characters */
#undef FILESYSTEM_NO_BACKSLASH

/* fsid_t has member val */
#undef FSID_HAS_VAL

/* fsid_t has member __val */
#undef FSID_HAS___VAL

/* Define to 1 if the `getpgrp' function requires zero arguments. */
#undef GETPGRP_VOID

/* Conflicting defs for getspnam */
#undef GETSPNAM_CONFLICTING_DEFS

/* Define if your system glob() function has the GLOB_ALTDIRFUNC extension */
#undef GLOB_HAS_ALTDIRFUNC

/* Define if your system glob() function has gl_matchc options in glob_t */
#undef GLOB_HAS_GL_MATCHC

/* Define if your system glob() function has gl_statv options in glob_t */
#undef GLOB_HAS_GL_STATV

/* Define this if you want GSSAPI support in the version 2 protocol */
#undef GSSAPI

/* Define if you want to use shadow password expire field */
#undef HAS_SHADOW_EXPIRE

/* Define if your system uses access rights style file descriptor passing */
#undef HAVE_ACCRIGHTS_IN_MSGHDR

/* Define if you have ut_addr in utmp.h */
#undef HAVE_ADDR_IN_UTMP

/* Define if you have ut_addr in utmpx.h */
#undef HAVE_ADDR_IN_UTMPX

/* Define if you have ut_addr_v6 in utmp.h */
#undef HAVE_ADDR_V6_IN_UTMP

/* Define if you have ut_addr_v6 in utmpx.h */
#undef HAVE_ADDR_V6_IN_UTMPX

/* Define to 1 if you have the `arc4random' function. */
#undef HAVE_ARC4RANDOM

/* Define to 1 if you have the `arc4random_buf' function. */
#undef HAVE_ARC4RANDOM_BUF

/* Define to 1 if you have the `arc4random_stir' function. */
#undef HAVE_ARC4RANDOM_STIR

/* Define to 1 if you have the `arc4random_uniform' function. */
#undef HAVE_ARC4RANDOM_UNIFORM

/* Define to 1 if you have the `asprintf' function. */
#undef HAVE_ASPRINTF

/* OpenBSD's gcc has bounded */
#undef HAVE_ATTRIBUTE__BOUNDED__

/* Have attribute nonnull */
#undef HAVE_ATTRIBUTE__NONNULL__

/* OpenBSD's gcc has sentinel */
#undef HAVE_ATTRIBUTE__SENTINEL__

/* Define to 1 if you have the `aug_get_machine' function. */
#undef HAVE_AUG_GET_MACHINE

/* Define to 1 if you have the `b64_ntop' function. */
#undef HAVE_B64_NTOP

/* Define to 1 if you have the `b64_pton' function. */
#undef HAVE_B64_PTON

/* Define if you have the basename function. */
#undef HAVE_BASENAME

/* Define to 1 if you have the `bcopy' function. */
#undef HAVE_BCOPY

/* Define to 1 if you have the `bcrypt_pbkdf' function. */
#undef HAVE_BCRYPT_PBKDF

/* Define to 1 if you have the `bindresvport_sa' function. */
#undef HAVE_BINDRESVPORT_SA

/* Define to 1 if you have the `blf_enc' function. */
#undef HAVE_BLF_ENC

/* Define to 1 if you have the <blf.h> header file. */
#undef HAVE_BLF_H

/* Define to 1 if you have the `Blowfish_expand0state' function. */
#undef HAVE_BLOWFISH_EXPAND0STATE

/* Define to 1 if you have the `Blowfish_expandstate' function. */
#undef HAVE_BLOWFISH_EXPANDSTATE

/* Define to 1 if you have the `Blowfish_initstate' function. */
#undef HAVE_BLOWFISH_INITSTATE

/* Define to 1 if you have the `Blowfish_stream2word' function. */
#undef HAVE_BLOWFISH_STREAM2WORD

/* Define to 1 if you have the `BN_is_prime_ex' function. */
#undef HAVE_BN_IS_PRIME_EX

/* Define to 1 if you have the <bsd/libutil.h> header file. */
#undef HAVE_BSD_LIBUTIL_H

/* Define to 1 if you have the <bsm/audit.h> header file. */
#undef HAVE_BSM_AUDIT_H

/* Define to 1 if you have the <bstring.h> header file. */
#undef HAVE_BSTRING_H

/* Define to 1 if you have the `cap_rights_limit' function. */
#undef HAVE_CAP_RIGHTS_LIMIT

/* Define to 1 if you have the `clock' function. */
#undef HAVE_CLOCK

/* Have clock_gettime */
#undef HAVE_CLOCK_GETTIME

/* define if you have clock_t data type */
#undef HAVE_CLOCK_T

/* Define to 1 if you have the `closefrom' function. */
#undef HAVE_CLOSEFROM

/* Define if gai_strerror() returns const char * */
#undef HAVE_CONST_GAI_STRERROR_PROTO

/* Define if your system uses ancillary data style file descriptor passing */
#undef HAVE_CONTROL_IN_MSGHDR

/* Define to 1 if you have the `crypt' function. */
#undef HAVE_CRYPT

/* Define to 1 if you have the <crypto/sha2.h> header file. */
#undef HAVE_CRYPTO_SHA2_H

/* Define to 1 if you have the <crypt.h> header file. */
#undef HAVE_CRYPT_H

/* Define if you are on Cygwin */
#undef HAVE_CYGWIN

/* Define if your libraries define daemon() */
#undef HAVE_DAEMON

/* Define to 1 if you have the declaration of `AI_NUMERICSERV', and to 0 if
   you don't. */
#undef HAVE_DECL_AI_NUMERICSERV

/* Define to 1 if you have the declaration of `authenticate', and to 0 if you
   don't. */
#undef HAVE_DECL_AUTHENTICATE

/* Define to 1 if you have the declaration of `GLOB_NOMATCH', and to 0 if you
   don't. */
#undef HAVE_DECL_GLOB_NOMATCH

/* Define to 1 if you have the declaration of `GSS_C_NT_HOSTBASED_SERVICE',
   and to 0 if you don't. */
#undef HAVE_DECL_GSS_C_NT_HOSTBASED_SERVICE

/* Define to 1 if you have the declaration of `howmany', and to 0 if you
   don't. */
#undef HAVE_DECL_HOWMANY

/* Define to 1 if you have the declaration of `h_errno', and to 0 if you
   don't. */
#undef HAVE_DECL_H_ERRNO

/* Define to 1 if you have the declaration of `loginfailed', and to 0 if you
   don't. */
#undef HAVE_DECL_LOGINFAILED

/* Define to 1 if you have the declaration of `loginrestrictions', and to 0 if
   you don't. */
#undef HAVE_DECL_LOGINRESTRICTIONS

/* Define to 1 if you have the declaration of `loginsuccess', and to 0 if you
   don't. */
#undef HAVE_DECL_LOGINSUCCESS

/* Define to 1 if you have the declaration of `MAXSYMLINKS', and to 0 if you
   don't. */
#undef HAVE_DECL_MAXSYMLINKS

/* Define to 1 if you have the declaration of `NFDBITS', and to 0 if you
   don't. */
#undef HAVE_DECL_NFDBITS

/* Define to 1 if you have the declaration of `offsetof', and to 0 if you
   don't. */
#undef HAVE_DECL_OFFSETOF

/* Define to 1 if you have the declaration of `O_NONBLOCK', and to 0 if you
   don't. */
#undef HAVE_DECL_O_NONBLOCK

/* Define to 1 if you have the declaration of `passwdexpired', and to 0 if you
   don't. */
#undef HAVE_DECL_PASSWDEXPIRED

/* Define to 1 if you have the declaration of `setauthdb', and to 0 if you
   don't. */
#undef HAVE_DECL_SETAUTHDB

/* Define to 1 if you have the declaration of `SHUT_RD', and to 0 if you
   don't. */
#undef HAVE_DECL_SHUT_RD

/* Define to 1 if you have the declaration of `writev', and to 0 if you don't.
   */
#undef HAVE_DECL_WRITEV

/* Define to 1 if you have the declaration of `_getlong', and to 0 if you
   don't. */
#undef HAVE_DECL__GETLONG

/* Define to 1 if you have the declaration of `_getshort', and to 0 if you
   don't. */
#undef HAVE_DECL__GETSHORT

/* Define to 1 if you have the `DES_crypt' function. */
#undef HAVE_DES_CRYPT

/* Define if you have /dev/ptmx */
#undef HAVE_DEV_PTMX

/* Define if you have /dev/ptc */
#undef HAVE_DEV_PTS_AND_PTC

/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H

/* Define to 1 if you have the `dirfd' function. */
#undef HAVE_DIRFD

/* Define to 1 if you have the `dirname' function. */
#undef HAVE_DIRNAME

/* Define to 1 if you have the `DSA_generate_parameters_ex' function. */
#undef HAVE_DSA_GENERATE_PARAMETERS_EX

/* Define to 1 if you have the <elf.h> header file. */
#undef HAVE_ELF_H

/* Define to 1 if you have the `endgrent' function. */
#undef HAVE_ENDGRENT

/* Define to 1 if you have the <endian.h> header file. */
#undef HAVE_ENDIAN_H

/* Define to 1 if you have the `endutent' function. */
#undef HAVE_ENDUTENT

/* Define to 1 if you have the `endutxent' function. */
#undef HAVE_ENDUTXENT

/* Define if your system has /etc/default/login */
#undef HAVE_ETC_DEFAULT_LOGIN

/* Define if libcrypto has EVP_CIPHER_CTX_ctrl */
#undef HAVE_EVP_CIPHER_CTX_CTRL

/* Define to 1 if you have the `EVP_DigestFinal_ex' function. */
#undef HAVE_EVP_DIGESTFINAL_EX

/* Define to 1 if you have the `EVP_DigestInit_ex' function. */
#undef HAVE_EVP_DIGESTINIT_EX

/* Define to 1 if you have the `EVP_MD_CTX_cleanup' function. */
#undef HAVE_EVP_MD_CTX_CLEANUP

/* Define to 1 if you have the `EVP_MD_CTX_copy_ex' function. */
#undef HAVE_EVP_MD_CTX_COPY_EX

/* Define to 1 if you have the `EVP_MD_CTX_init' function. */
#undef HAVE_EVP_MD_CTX_INIT

/* Define to 1 if you have the `EVP_ripemd160' function. */
#undef HAVE_EVP_RIPEMD160

/* Define to 1 if you have the `EVP_sha256' function. */
#undef HAVE_EVP_SHA256

/* Define if you have ut_exit in utmp.h */
#undef HAVE_EXIT_IN_UTMP

/* Define to 1 if you have the `explicit_bzero' function. */
#undef HAVE_EXPLICIT_BZERO

/* Define to 1 if you have the `fchmod' function. */
#undef HAVE_FCHMOD

/* Define to 1 if you have the `fchown' function. */
#undef HAVE_FCHOWN

/* Use F_CLOSEM fcntl for closefrom */
#undef HAVE_FCNTL_CLOSEM

/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H

/* Define to 1 if the system has the type `fd_mask'. */
#undef HAVE_FD_MASK

/* Define to 1 if you have the <features.h> header file. */
#undef HAVE_FEATURES_H

/* Define to 1 if you have the <floatingpoint.h> header file. */
#undef HAVE_FLOATINGPOINT_H

/* Define to 1 if you have the `fmt_scaled' function. */
#undef HAVE_FMT_SCALED

/* Define to 1 if you have the `freeaddrinfo' function. */
#undef HAVE_FREEADDRINFO

/* Define to 1 if the system has the type `fsblkcnt_t'. */
#undef HAVE_FSBLKCNT_T

/* Define to 1 if the system has the type `fsfilcnt_t'. */
#undef HAVE_FSFILCNT_T

/* Define to 1 if you have the `fstatfs' function. */
#undef HAVE_FSTATFS

/* Define to 1 if you have the `fstatvfs' function. */
#undef HAVE_FSTATVFS

/* Define to 1 if you have the `futimes' function. */
#undef HAVE_FUTIMES

/* Define to 1 if you have the `gai_strerror' function. */
#undef HAVE_GAI_STRERROR

/* Define to 1 if you have the `getaddrinfo' function. */
#undef HAVE_GETADDRINFO

/* Define to 1 if you have the `getaudit' function. */
#undef HAVE_GETAUDIT

/* Define to 1 if you have the `getaudit_addr' function. */
#undef HAVE_GETAUDIT_ADDR

/* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD

/* Define to 1 if you have the `getgrouplist' function. */
#undef HAVE_GETGROUPLIST

/* Define to 1 if you have the `getgrset' function. */
#undef HAVE_GETGRSET

/* Define to 1 if you have the `getlastlogxbyname' function. */
#undef HAVE_GETLASTLOGXBYNAME

/* Define to 1 if you have the `getluid' function. */
#undef HAVE_GETLUID

/* Define to 1 if you have the `getnameinfo' function. */
#undef HAVE_GETNAMEINFO

/* Define to 1 if you have the `getopt' function. */
#undef HAVE_GETOPT

/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H

/* Define if your getopt(3) defines and uses optreset */
#undef HAVE_GETOPT_OPTRESET

/* Define if your libraries define getpagesize() */
#undef HAVE_GETPAGESIZE

/* Define to 1 if you have the `getpeereid' function. */
#undef HAVE_GETPEEREID

/* Define to 1 if you have the `getpeerucred' function. */
#undef HAVE_GETPEERUCRED

/* Define to 1 if you have the `getpgid' function. */
#undef HAVE_GETPGID

/* Define to 1 if you have the `getpgrp' function. */
#undef HAVE_GETPGRP

/* Define to 1 if you have the `getpwanam' function. */
#undef HAVE_GETPWANAM

/* Define to 1 if you have the `getrlimit' function. */
#undef HAVE_GETRLIMIT

/* Define if getrrsetbyname() exists */
#undef HAVE_GETRRSETBYNAME

/* Define to 1 if you have the `getrusage' function. */
#undef HAVE_GETRUSAGE

/* Define to 1 if you have the `getseuserbyname' function. */
#undef HAVE_GETSEUSERBYNAME

/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY

/* Define to 1 if you have the `getttyent' function. */
#undef HAVE_GETTTYENT

/* Define to 1 if you have the `getutent' function. */
#undef HAVE_GETUTENT

/* Define to 1 if you have the `getutid' function. */
#undef HAVE_GETUTID

/* Define to 1 if you have the `getutline' function. */
#undef HAVE_GETUTLINE

/* Define to 1 if you have the `getutxent' function. */
#undef HAVE_GETUTXENT

/* Define to 1 if you have the `getutxid' function. */
#undef HAVE_GETUTXID

/* Define to 1 if you have the `getutxline' function. */
#undef HAVE_GETUTXLINE

/* Define to 1 if you have the `getutxuser' function. */
#undef HAVE_GETUTXUSER

/* Define to 1 if you have the `get_default_context_with_level' function. */
#undef HAVE_GET_DEFAULT_CONTEXT_WITH_LEVEL

/* Define to 1 if you have the `glob' function. */
#undef HAVE_GLOB

/* Define to 1 if you have the <glob.h> header file. */
#undef HAVE_GLOB_H

/* Define to 1 if you have the `group_from_gid' function. */
#undef HAVE_GROUP_FROM_GID

/* Define to 1 if you have the <gssapi_generic.h> header file. */
#undef HAVE_GSSAPI_GENERIC_H

/* Define to 1 if you have the <gssapi/gssapi_generic.h> header file. */
#undef HAVE_GSSAPI_GSSAPI_GENERIC_H

/* Define to 1 if you have the <gssapi/gssapi.h> header file. */
#undef HAVE_GSSAPI_GSSAPI_H

/* Define to 1 if you have the <gssapi/gssapi_krb5.h> header file. */
#undef HAVE_GSSAPI_GSSAPI_KRB5_H

/* Define to 1 if you have the <gssapi.h> header file. */
#undef HAVE_GSSAPI_H

/* Define to 1 if you have the <gssapi_krb5.h> header file. */
#undef HAVE_GSSAPI_KRB5_H

/* Define if HEADER.ad exists in arpa/nameser.h */
#undef HAVE_HEADER_AD

/* Define to 1 if you have the `HMAC_CTX_init' function. */
#undef HAVE_HMAC_CTX_INIT

/* Define if you have ut_host in utmp.h */
#undef HAVE_HOST_IN_UTMP

/* Define if you have ut_host in utmpx.h */
#undef HAVE_HOST_IN_UTMPX

/* Define to 1 if you have the <iaf.h> header file. */
#undef HAVE_IAF_H

/* Define to 1 if you have the <ia.h> header file. */
#undef HAVE_IA_H

/* Define if you have ut_id in utmp.h */
#undef HAVE_ID_IN_UTMP

/* Define if you have ut_id in utmpx.h */
#undef HAVE_ID_IN_UTMPX

/* Define to 1 if you have the `inet_aton' function. */
#undef HAVE_INET_ATON

/* Define to 1 if you have the `inet_ntoa' function. */
#undef HAVE_INET_NTOA

/* Define to 1 if you have the `inet_ntop' function. */
#undef HAVE_INET_NTOP

/* Define to 1 if you have the `innetgr' function. */
#undef HAVE_INNETGR

/* define if you have int64_t data type */
#undef HAVE_INT64_T

/* Define to 1 if the system has the type `intmax_t'. */
#undef HAVE_INTMAX_T

/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H

/* define if you have intxx_t data type */
#undef HAVE_INTXX_T

/* Define to 1 if the system has the type `in_addr_t'. */
#undef HAVE_IN_ADDR_T

/* Define to 1 if the system has the type `in_port_t'. */
#undef HAVE_IN_PORT_T

/* Define if you have isblank(3C). */
#undef HAVE_ISBLANK

/* Define to 1 if you have the `krb5_cc_new_unique' function. */
#undef HAVE_KRB5_CC_NEW_UNIQUE

/* Define to 1 if you have the `krb5_free_error_message' function. */
#undef HAVE_KRB5_FREE_ERROR_MESSAGE

/* Define to 1 if you have the `krb5_get_error_message' function. */
#undef HAVE_KRB5_GET_ERROR_MESSAGE

/* Define to 1 if you have the <lastlog.h> header file. */
#undef HAVE_LASTLOG_H

/* Define if you want ldns support */
#undef HAVE_LDNS

/* Define to 1 if you have the <libaudit.h> header file. */
#undef HAVE_LIBAUDIT_H

/* Define to 1 if you have the `bsm' library (-lbsm). */
#undef HAVE_LIBBSM

/* Define to 1 if you have the `crypt' library (-lcrypt). */
#undef HAVE_LIBCRYPT

/* Define to 1 if you have the `dl' library (-ldl). */
#undef HAVE_LIBDL

/* Define to 1 if you have the <libgen.h> header file. */
#undef HAVE_LIBGEN_H

/* Define if system has libiaf that supports set_id */
#undef HAVE_LIBIAF

/* Define to 1 if you have the `network' library (-lnetwork). */
#undef HAVE_LIBNETWORK

/* Define to 1 if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL

/* Define to 1 if you have the `pam' library (-lpam). */
#undef HAVE_LIBPAM

/* Define to 1 if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET

/* Define to 1 if you have the <libutil.h> header file. */
#undef HAVE_LIBUTIL_H

/* Define to 1 if you have the `xnet' library (-lxnet). */
#undef HAVE_LIBXNET

/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ

/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H

/* Define to 1 if you have the <linux/audit.h> header file. */
#undef HAVE_LINUX_AUDIT_H

/* Define to 1 if you have the <linux/filter.h> header file. */
#undef HAVE_LINUX_FILTER_H

/* Define to 1 if you have the <linux/if_tun.h> header file. */
#undef HAVE_LINUX_IF_TUN_H

/* Define to 1 if you have the <linux/seccomp.h> header file. */
#undef HAVE_LINUX_SECCOMP_H

/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H

/* Define to 1 if you have the `login' function. */
#undef HAVE_LOGIN

/* Define to 1 if you have the <login_cap.h> header file. */
#undef HAVE_LOGIN_CAP_H

/* Define to 1 if you have the `login_getcapbool' function. */
#undef HAVE_LOGIN_GETCAPBOOL

/* Define to 1 if you have the <login.h> header file. */
#undef HAVE_LOGIN_H

/* Define to 1 if you have the `logout' function. */
#undef HAVE_LOGOUT

/* Define to 1 if you have the `logwtmp' function. */
#undef HAVE_LOGWTMP

/* Define to 1 if the system has the type `long double'. */
#undef HAVE_LONG_DOUBLE

/* Define to 1 if the system has the type `long long'. */
#undef HAVE_LONG_LONG

/* Define to 1 if you have the <maillock.h> header file. */
#undef HAVE_MAILLOCK_H

/* Define to 1 if you have the `mblen' function. */
#undef HAVE_MBLEN

/* Define to 1 if you have the `md5_crypt' function. */
#undef HAVE_MD5_CRYPT

/* Define if you want to allow MD5 passwords */
#undef HAVE_MD5_PASSWORDS

/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE

/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H

/* Define to 1 if you have the `memset_s' function. */
#undef HAVE_MEMSET_S

/* Define to 1 if you have the `mkdtemp' function. */
#undef HAVE_MKDTEMP

/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP

/* define if you have mode_t data type */
#undef HAVE_MODE_T

/* Some systems put nanosleep outside of libc */
#undef HAVE_NANOSLEEP

/* Define to 1 if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H

/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H

/* Define to 1 if you have the <netgroup.h> header file. */
#undef HAVE_NETGROUP_H

/* Define to 1 if you have the <net/if_tun.h> header file. */
#undef HAVE_NET_IF_TUN_H

/* Define if you are on NeXT */
#undef HAVE_NEXT

/* Define to 1 if you have the `ngetaddrinfo' function. */
#undef HAVE_NGETADDRINFO

/* Define to 1 if you have the `nsleep' function. */
#undef HAVE_NSLEEP

/* Define to 1 if you have the `ogetaddrinfo' function. */
#undef HAVE_OGETADDRINFO

/* Define if you have an old version of PAM which takes only one argument to
   pam_strerror */
#undef HAVE_OLD_PAM

/* Define to 1 if you have the `openlog_r' function. */
#undef HAVE_OPENLOG_R

/* Define to 1 if you have the `openpty' function. */
#undef HAVE_OPENPTY

/* Define if your ssl headers are included with #include <openssl/header.h> */
#undef HAVE_OPENSSL

/* Define if you have Digital Unix Security Integration Architecture */
#undef HAVE_OSF_SIA

/* Define to 1 if you have the `pam_getenvlist' function. */
#undef HAVE_PAM_GETENVLIST

/* Define to 1 if you have the <pam/pam_appl.h> header file. */
#undef HAVE_PAM_PAM_APPL_H

/* Define to 1 if you have the `pam_putenv' function. */
#undef HAVE_PAM_PUTENV

/* Define to 1 if you have the <paths.h> header file. */
#undef HAVE_PATHS_H

/* Define if you have ut_pid in utmp.h */
#undef HAVE_PID_IN_UTMP

/* define if you have pid_t data type */
#undef HAVE_PID_T

/* Define to 1 if you have the `poll' function. */
#undef HAVE_POLL

/* Define to 1 if you have the <poll.h> header file. */
#undef HAVE_POLL_H

/* Define to 1 if you have the `prctl' function. */
#undef HAVE_PRCTL

/* Define if you have /proc/$pid/fd */
#undef HAVE_PROC_PID

/* Define to 1 if you have the `pstat' function. */
#undef HAVE_PSTAT

/* Define to 1 if you have the <pty.h> header file. */
#undef HAVE_PTY_H

/* Define to 1 if you have the `pututline' function. */
#undef HAVE_PUTUTLINE

/* Define to 1 if you have the `pututxline' function. */
#undef HAVE_PUTUTXLINE

/* Define to 1 if you have the `readpassphrase' function. */
#undef HAVE_READPASSPHRASE

/* Define to 1 if you have the <readpassphrase.h> header file. */
#undef HAVE_READPASSPHRASE_H

/* Define to 1 if you have the `reallocarray' function. */
#undef HAVE_REALLOCARRAY

/* Define to 1 if you have the `realpath' function. */
#undef HAVE_REALPATH

/* Define to 1 if you have the `recvmsg' function. */
#undef HAVE_RECVMSG

/* sys/resource.h has RLIMIT_NPROC */
#undef HAVE_RLIMIT_NPROC

/* Define to 1 if you have the <rpc/types.h> header file. */
#undef HAVE_RPC_TYPES_H

/* Define to 1 if you have the `rresvport_af' function. */
#undef HAVE_RRESVPORT_AF

/* Define to 1 if you have the `RSA_generate_key_ex' function. */
#undef HAVE_RSA_GENERATE_KEY_EX

/* Define to 1 if you have the `RSA_get_default_method' function. */
#undef HAVE_RSA_GET_DEFAULT_METHOD

/* Define to 1 if you have the <sandbox.h> header file. */
#undef HAVE_SANDBOX_H

/* Define to 1 if you have the `sandbox_init' function. */
#undef HAVE_SANDBOX_INIT

/* define if you have sa_family_t data type */
#undef HAVE_SA_FAMILY_T

/* Define to 1 if you have the `scan_scaled' function. */
#undef HAVE_SCAN_SCALED

/* Define if you have SecureWare-based protected password database */
#undef HAVE_SECUREWARE

/* Define to 1 if you have the <security/pam_appl.h> header file. */
#undef HAVE_SECURITY_PAM_APPL_H

/* Define to 1 if you have the `sendmsg' function. */
#undef HAVE_SENDMSG

/* Define to 1 if you have the `setauthdb' function. */
#undef HAVE_SETAUTHDB

/* Define to 1 if you have the `setdtablesize' function. */
#undef HAVE_SETDTABLESIZE

/* Define to 1 if you have the `setegid' function. */
#undef HAVE_SETEGID

/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV

/* Define to 1 if you have the `seteuid' function. */
#undef HAVE_SETEUID

/* Define to 1 if you have the `setgroupent' function. */
#undef HAVE_SETGROUPENT

/* Define to 1 if you have the `setgroups' function. */
#undef HAVE_SETGROUPS

/* Define to 1 if you have the `setlinebuf' function. */
#undef HAVE_SETLINEBUF

/* Define to 1 if you have the `setlogin' function. */
#undef HAVE_SETLOGIN

/* Define to 1 if you have the `setluid' function. */
#undef HAVE_SETLUID

/* Define to 1 if you have the `setpassent' function. */
#undef HAVE_SETPASSENT

/* Define to 1 if you have the `setpcred' function. */
#undef HAVE_SETPCRED

/* Define to 1 if you have the `setproctitle' function. */
#undef HAVE_SETPROCTITLE

/* Define to 1 if you have the `setregid' function. */
#undef HAVE_SETREGID

/* Define to 1 if you have the `setresgid' function. */
#undef HAVE_SETRESGID

/* Define to 1 if you have the `setresuid' function. */
#undef HAVE_SETRESUID

/* Define to 1 if you have the `setreuid' function. */
#undef HAVE_SETREUID

/* Define to 1 if you have the `setrlimit' function. */
#undef HAVE_SETRLIMIT

/* Define to 1 if you have the `setsid' function. */
#undef HAVE_SETSID

/* Define to 1 if you have the `setutent' function. */
#undef HAVE_SETUTENT

/* Define to 1 if you have the `setutxdb' function. */
#undef HAVE_SETUTXDB

/* Define to 1 if you have the `setutxent' function. */
#undef HAVE_SETUTXENT

/* Define to 1 if you have the `setvbuf' function. */
#undef HAVE_SETVBUF

/* Define to 1 if you have the `set_id' function. */
#undef HAVE_SET_ID

/* Define to 1 if you have the `SHA256_Update' function. */
#undef HAVE_SHA256_UPDATE

/* Define to 1 if you have the <sha2.h> header file. */
#undef HAVE_SHA2_H

/* Define to 1 if you have the <shadow.h> header file. */
#undef HAVE_SHADOW_H

/* Define to 1 if you have the `sigaction' function. */
#undef HAVE_SIGACTION

/* Define to 1 if you have the `sigvec' function. */
#undef HAVE_SIGVEC

/* Define to 1 if the system has the type `sig_atomic_t'. */
#undef HAVE_SIG_ATOMIC_T

/* define if you have size_t data type */
#undef HAVE_SIZE_T

/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF

/* Define to 1 if you have the `socketpair' function. */
#undef HAVE_SOCKETPAIR

/* Have PEERCRED socket option */
#undef HAVE_SO_PEERCRED

/* define if you have ssize_t data type */
#undef HAVE_SSIZE_T

/* Fields in struct sockaddr_storage */
#undef HAVE_SS_FAMILY_IN_SS

/* Define to 1 if you have the `statfs' function. */
#undef HAVE_STATFS

/* Define to 1 if you have the `statvfs' function. */
#undef HAVE_STATVFS

/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H

/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H

/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H

/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP

/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR

/* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME

/* Silly mkstemp() */
#undef HAVE_STRICT_MKSTEMP

/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H

/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H

/* Define to 1 if you have the `strlcat' function. */
#undef HAVE_STRLCAT

/* Define to 1 if you have the `strlcpy' function. */
#undef HAVE_STRLCPY

/* Define to 1 if you have the `strmode' function. */
#undef HAVE_STRMODE

/* Define to 1 if you have the `strnlen' function. */
#undef HAVE_STRNLEN

/* Define to 1 if you have the `strnvis' function. */
#undef HAVE_STRNVIS

/* Define to 1 if you have the `strptime' function. */
#undef HAVE_STRPTIME

/* Define to 1 if you have the `strsep' function. */
#undef HAVE_STRSEP

/* Define to 1 if you have the `strtoll' function. */
#undef HAVE_STRTOLL

/* Define to 1 if you have the `strtonum' function. */
#undef HAVE_STRTONUM

/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL

/* Define to 1 if you have the `strtoull' function. */
#undef HAVE_STRTOULL

/* define if you have struct addrinfo data type */
#undef HAVE_STRUCT_ADDRINFO

/* define if you have struct in6_addr data type */
#undef HAVE_STRUCT_IN6_ADDR

/* Define to 1 if `pw_change' is member of `struct passwd'. */
#undef HAVE_STRUCT_PASSWD_PW_CHANGE

/* Define to 1 if `pw_class' is member of `struct passwd'. */
#undef HAVE_STRUCT_PASSWD_PW_CLASS

/* Define to 1 if `pw_expire' is member of `struct passwd'. */
#undef HAVE_STRUCT_PASSWD_PW_EXPIRE

/* Define to 1 if `pw_gecos' is member of `struct passwd'. */
#undef HAVE_STRUCT_PASSWD_PW_GECOS

/* define if you have struct sockaddr_in6 data type */
#undef HAVE_STRUCT_SOCKADDR_IN6

/* Define to 1 if `sin6_scope_id' is member of `struct sockaddr_in6'. */
#undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID

/* define if you have struct sockaddr_storage data type */
#undef HAVE_STRUCT_SOCKADDR_STORAGE

/* Define to 1 if `st_blksize' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE

/* Define to 1 if the system has the type `struct timespec'. */
#undef HAVE_STRUCT_TIMESPEC

/* define if you have struct timeval */
#undef HAVE_STRUCT_TIMEVAL

/* Define to 1 if you have the `swap32' function. */
#undef HAVE_SWAP32

/* Define to 1 if you have the `sysconf' function. */
#undef HAVE_SYSCONF

/* Define if you have syslen in utmpx.h */
#undef HAVE_SYSLEN_IN_UTMPX

/* Define to 1 if you have the <sys/audit.h> header file. */
#undef HAVE_SYS_AUDIT_H

/* Define to 1 if you have the <sys/bitypes.h> header file. */
#undef HAVE_SYS_BITYPES_H

/* Define to 1 if you have the <sys/bsdtty.h> header file. */
#undef HAVE_SYS_BSDTTY_H

/* Define to 1 if you have the <sys/capability.h> header file. */
#undef HAVE_SYS_CAPABILITY_H

/* Define to 1 if you have the <sys/cdefs.h> header file. */
#undef HAVE_SYS_CDEFS_H

/* Define to 1 if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H

/* Define if your system defines sys_errlist[] */
#undef HAVE_SYS_ERRLIST

/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H

/* Define to 1 if you have the <sys/mount.h> header file. */
#undef HAVE_SYS_MOUNT_H

/* Define to 1 if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H

/* Define if your system defines sys_nerr */
#undef HAVE_SYS_NERR

/* Define to 1 if you have the <sys/poll.h> header file. */
#undef HAVE_SYS_POLL_H

/* Define to 1 if you have the <sys/prctl.h> header file. */
#undef HAVE_SYS_PRCTL_H

/* Define to 1 if you have the <sys/pstat.h> header file. */
#undef HAVE_SYS_PSTAT_H

/* Define to 1 if you have the <sys/ptms.h> header file. */
#undef HAVE_SYS_PTMS_H

/* Define to 1 if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H

/* Define to 1 if you have the <sys/statvfs.h> header file. */
#undef HAVE_SYS_STATVFS_H

/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H

/* Define to 1 if you have the <sys/stream.h> header file. */
#undef HAVE_SYS_STREAM_H

/* Define to 1 if you have the <sys/stropts.h> header file. */
#undef HAVE_SYS_STROPTS_H

/* Define to 1 if you have the <sys/strtio.h> header file. */
#undef HAVE_SYS_STRTIO_H

/* Force use of sys/syslog.h on Ultrix */
#undef HAVE_SYS_SYSLOG_H

/* Define to 1 if you have the <sys/sysmacros.h> header file. */
#undef HAVE_SYS_SYSMACROS_H

/* Define to 1 if you have the <sys/timers.h> header file. */
#undef HAVE_SYS_TIMERS_H

/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H

/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H

/* Define to 1 if you have the <sys/un.h> header file. */
#undef HAVE_SYS_UN_H

/* Define to 1 if you have the `tcgetpgrp' function. */
#undef HAVE_TCGETPGRP

/* Define to 1 if you have the `tcsendbreak' function. */
#undef HAVE_TCSENDBREAK

/* Define to 1 if you have the `time' function. */
#undef HAVE_TIME

/* Define to 1 if you have the <time.h> header file. */
#undef HAVE_TIME_H

/* Define if you have ut_time in utmp.h */
#undef HAVE_TIME_IN_UTMP

/* Define if you have ut_time in utmpx.h */
#undef HAVE_TIME_IN_UTMPX

/* Define to 1 if you have the `timingsafe_bcmp' function. */
#undef HAVE_TIMINGSAFE_BCMP

/* Define to 1 if you have the <tmpdir.h> header file. */
#undef HAVE_TMPDIR_H

/* Define to 1 if you have the `truncate' function. */
#undef HAVE_TRUNCATE

/* Define to 1 if you have the <ttyent.h> header file. */
#undef HAVE_TTYENT_H

/* Define if you have ut_tv in utmp.h */
#undef HAVE_TV_IN_UTMP

/* Define if you have ut_tv in utmpx.h */
#undef HAVE_TV_IN_UTMPX

/* Define if you have ut_type in utmp.h */
#undef HAVE_TYPE_IN_UTMP

/* Define if you have ut_type in utmpx.h */
#undef HAVE_TYPE_IN_UTMPX

/* Define to 1 if you have the <ucred.h> header file. */
#undef HAVE_UCRED_H

/* Define to 1 if the system has the type `uintmax_t'. */
#undef HAVE_UINTMAX_T

/* define if you have uintxx_t data type */
#undef HAVE_UINTXX_T

/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H

/* Define to 1 if you have the `unsetenv' function. */
#undef HAVE_UNSETENV

/* Define to 1 if the system has the type `unsigned long long'. */
#undef HAVE_UNSIGNED_LONG_LONG

/* Define to 1 if you have the `updwtmp' function. */
#undef HAVE_UPDWTMP

/* Define to 1 if you have the `updwtmpx' function. */
#undef HAVE_UPDWTMPX

/* Define to 1 if you have the <usersec.h> header file. */
#undef HAVE_USERSEC_H

/* Define to 1 if you have the `user_from_uid' function. */
#undef HAVE_USER_FROM_UID

/* Define to 1 if you have the `usleep' function. */
#undef HAVE_USLEEP

/* Define to 1 if you have the <util.h> header file. */
#undef HAVE_UTIL_H

/* Define to 1 if you have the `utimes' function. */
#undef HAVE_UTIMES

/* Define to 1 if you have the <utime.h> header file. */
#undef HAVE_UTIME_H

/* Define to 1 if you have the `utmpname' function. */
#undef HAVE_UTMPNAME

/* Define to 1 if you have the `utmpxname' function. */
#undef HAVE_UTMPXNAME

/* Define to 1 if you have the <utmpx.h> header file. */
#undef HAVE_UTMPX_H

/* Define to 1 if you have the <utmp.h> header file. */
#undef HAVE_UTMP_H

/* define if you have u_char data type */
#undef HAVE_U_CHAR

/* define if you have u_int data type */
#undef HAVE_U_INT

/* define if you have u_int64_t data type */
#undef HAVE_U_INT64_T

/* define if you have u_intxx_t data type */
#undef HAVE_U_INTXX_T

/* Define to 1 if you have the `vasprintf' function. */
#undef HAVE_VASPRINTF

/* Define if va_copy exists */
#undef HAVE_VA_COPY

/* Define to 1 if you have the <vis.h> header file. */
#undef HAVE_VIS_H

/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF

/* Define to 1 if you have the `waitpid' function. */
#undef HAVE_WAITPID

/* Define to 1 if you have the `_getlong' function. */
#undef HAVE__GETLONG

/* Define to 1 if you have the `_getpty' function. */
#undef HAVE__GETPTY

/* Define to 1 if you have the `_getshort' function. */
#undef HAVE__GETSHORT

/* Define if you have struct __res_state _res as an extern */
#undef HAVE__RES_EXTERN

/* Define to 1 if you have the `__b64_ntop' function. */
#undef HAVE___B64_NTOP

/* Define to 1 if you have the `__b64_pton' function. */
#undef HAVE___B64_PTON

/* Define if compiler implements __FUNCTION__ */
#undef HAVE___FUNCTION__

/* Define if libc defines __progname */
#undef HAVE___PROGNAME

/* Fields in struct sockaddr_storage */
#undef HAVE___SS_FAMILY_IN_SS

/* Define if __va_copy exists */
#undef HAVE___VA_COPY

/* Define if compiler implements __func__ */
#undef HAVE___func__

/* Define this if you are using the Heimdal version of Kerberos V5 */
#undef HEIMDAL

/* Define if you need to use IP address instead of hostname in $DISPLAY */
#undef IPADDR_IN_DISPLAY

/* Detect IPv4 in IPv6 mapped addresses and treat as IPv4 */
#undef IPV4_IN_IPV6

/* Define if your system choked on IP TOS setting */
#undef IP_TOS_IS_BROKEN

/* Define if you want Kerberos 5 support */
#undef KRB5

/* Define if pututxline updates lastlog too */
#undef LASTLOG_WRITE_PUTUTXLINE

/* Define to whatever link() returns for "not supported" if it doesn't return
   EOPNOTSUPP. */
#undef LINK_OPNOTSUPP_ERRNO

/* Adjust Linux out-of-memory killer */
#undef LINUX_OOM_ADJUST

/* max value of long long calculated by configure */
#undef LLONG_MAX

/* min value of long long calculated by configure */
#undef LLONG_MIN

/* Account locked with pw(1) */
#undef LOCKED_PASSWD_PREFIX

/* String used in /etc/passwd to denote locked account */
#undef LOCKED_PASSWD_STRING

/* String used in /etc/passwd to denote locked account */
#undef LOCKED_PASSWD_SUBSTR

/* Some versions of /bin/login need the TERM supplied on the commandline */
#undef LOGIN_NEEDS_TERM

/* Some systems need a utmpx entry for /bin/login to work */
#undef LOGIN_NEEDS_UTMPX

/* Define if your login program cannot handle end of options ("--") */
#undef LOGIN_NO_ENDOPT

/* If your header files don't define LOGIN_PROGRAM, then use this (detected)
   from environment and PATH */
#undef LOGIN_PROGRAM_FALLBACK

/* Set this to your mail directory if you do not have _PATH_MAILDIR */
#undef MAIL_DIRECTORY

/* Need setpgrp to acquire controlling tty */
#undef NEED_SETPGRP

/* compiler does not accept __attribute__ on return types */
#undef NO_ATTRIBUTE_ON_RETURN_TYPE

/* Define if the concept of ports only accessible to superusers isn't known */
#undef NO_IPPORT_RESERVED_CONCEPT

/* Define if you don't want to use lastlog in session.c */
#undef NO_SSH_LASTLOG

/* Define if X11 doesn't support AF_UNIX sockets on that system */
#undef NO_X11_UNIX_SOCKETS

/* Define if EVP_DigestUpdate returns void */
#undef OPENSSL_EVP_DIGESTUPDATE_VOID

/* OpenSSL has ECC */
#undef OPENSSL_HAS_ECC

/* libcrypto has NID_X9_62_prime256v1 */
#undef OPENSSL_HAS_NISTP256

/* libcrypto has NID_secp384r1 */
#undef OPENSSL_HAS_NISTP384

/* libcrypto has NID_secp521r1 */
#undef OPENSSL_HAS_NISTP521

/* libcrypto has EVP AES CTR */
#undef OPENSSL_HAVE_EVPCTR

/* libcrypto has EVP AES GCM */
#undef OPENSSL_HAVE_EVPGCM

/* libcrypto is missing AES 192 and 256 bit functions */
#undef OPENSSL_LOBOTOMISED_AES

/* Define if you want the OpenSSL internally seeded PRNG only */
#undef OPENSSL_PRNG_ONLY

/* 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 if you are using Solaris-derived PAM which passes pam_messages to
   the conversation function with an extra level of indirection */
#undef PAM_SUN_CODEBASE

/* Work around problematic Linux PAM modules handling of PAM_TTY */
#undef PAM_TTY_KLUDGE

/* must supply username to passwd */
#undef PASSWD_NEEDS_USERNAME

/* System dirs owned by bin (uid 2) */
#undef PLATFORM_SYS_DIR_UID

/* Port number of PRNGD/EGD random number socket */
#undef PRNGD_PORT

/* Location of PRNGD/EGD random number socket */
#undef PRNGD_SOCKET

/* read(1) can return 0 for a non-closed fd */
#undef PTY_ZEROREAD

/* Sandbox using capsicum */
#undef SANDBOX_CAPSICUM

/* Sandbox using Darwin sandbox_init(3) */
#undef SANDBOX_DARWIN

/* no privsep sandboxing */
#undef SANDBOX_NULL

/* Sandbox using setrlimit(2) */
#undef SANDBOX_RLIMIT

/* Sandbox using seccomp filter */
#undef SANDBOX_SECCOMP_FILTER

/* setrlimit RLIMIT_FSIZE works */
#undef SANDBOX_SKIP_RLIMIT_FSIZE

/* define if setrlimit RLIMIT_NOFILE breaks things */
#undef SANDBOX_SKIP_RLIMIT_NOFILE

/* Sandbox using systrace(4) */
#undef SANDBOX_SYSTRACE

/* Specify the system call convention in use */
#undef SECCOMP_AUDIT_ARCH

/* Define if your platform breaks doing a seteuid before a setuid */
#undef SETEUID_BREAKS_SETUID

/* The size of `int', as computed by sizeof. */
#undef SIZEOF_INT

/* The size of `long int', as computed by sizeof. */
#undef SIZEOF_LONG_INT

/* The size of `long long int', as computed by sizeof. */
#undef SIZEOF_LONG_LONG_INT

/* The size of `short int', as computed by sizeof. */
#undef SIZEOF_SHORT_INT

/* Define if you want S/Key support */
#undef SKEY

/* Define if your skeychallenge() function takes 4 arguments (NetBSD) */
#undef SKEYCHALLENGE_4ARG

/* Define as const if snprintf() can declare const char *fmt */
#undef SNPRINTF_CONST

/* Define to a Set Process Title type if your system is supported by
   bsd-setproctitle.c */
#undef SPT_TYPE

/* Define if sshd somehow reacquires a controlling TTY after setsid() */
#undef SSHD_ACQUIRES_CTTY

/* Define if pam_chauthtok wants real uid set to the unpriv'ed user */
#undef SSHPAM_CHAUTHTOK_NEEDS_RUID

/* Use audit debugging module */
#undef SSH_AUDIT_EVENTS

/* Windows is sensitive to read buffer size */
#undef SSH_IOBUFSZ

/* non-privileged user for privilege separation */
#undef SSH_PRIVSEP_USER

/* Use tunnel device compatibility to OpenBSD */
#undef SSH_TUN_COMPAT_AF

/* Open tunnel devices the FreeBSD way */
#undef SSH_TUN_FREEBSD

/* Open tunnel devices the Linux tun/tap way */
#undef SSH_TUN_LINUX

/* No layer 2 tunnel support */
#undef SSH_TUN_NO_L2

/* Open tunnel devices the OpenBSD way */
#undef SSH_TUN_OPENBSD

/* Prepend the address family to IP tunnel traffic */
#undef SSH_TUN_PREPEND_AF

/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS

/* Define if you want a different $PATH for the superuser */
#undef SUPERUSER_PATH

/* syslog_r function is safe to use in in a signal handler */
#undef SYSLOG_R_SAFE_IN_SIGHAND

/* Support passwords > 8 chars */
#undef UNIXWARE_LONG_PASSWORDS

/* Specify default $PATH */
#undef USER_PATH

/* Define this if you want to use libkafs' AFS support */
#undef USE_AFS

/* Use BSM audit module */
#undef USE_BSM_AUDIT

/* Use btmp to log bad logins */
#undef USE_BTMP

/* Use libedit for sftp */
#undef USE_LIBEDIT

/* Use Linux audit module */
#undef USE_LINUX_AUDIT

/* Enable OpenSSL engine support */
#undef USE_OPENSSL_ENGINE

/* Define if you want to enable PAM support */
#undef USE_PAM

/* Use PIPES instead of a socketpair() */
#undef USE_PIPES

/* Define if you have Solaris process contracts */
#undef USE_SOLARIS_PROCESS_CONTRACTS

/* Define if you have Solaris projects */
#undef USE_SOLARIS_PROJECTS

/* Define if you shouldn't strip 'tty' from your ttyname in [uw]tmp */
#undef WITH_ABBREV_NO_TTY

/* Define if you want to enable AIX4's authenticate function */
#undef WITH_AIXAUTHENTICATE

/* Define if you have/want arrays (cluster-wide session managment, not C
   arrays) */
#undef WITH_IRIX_ARRAY

/* Define if you want IRIX audit trails */
#undef WITH_IRIX_AUDIT

/* Define if you want IRIX kernel jobs */
#undef WITH_IRIX_JOBS

/* Define if you want IRIX project management */
#undef WITH_IRIX_PROJECT

/* use libcrypto for cryptography */
#undef WITH_OPENSSL

/* Define if you want SELinux support. */
#undef WITH_SELINUX

/* include SSH protocol version 1 support */
#undef WITH_SSH1

/* Define to 1 if your processor stores words with the most significant byte
   first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN

/* Define if xauth is found in your path */
#undef XAUTH_PATH

/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS

/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES

/* log for bad login attempts */
#undef _PATH_BTMP

/* Full path of your "passwd" program */
#undef _PATH_PASSWD_PROG

/* Specify location of ssh.pid */
#undef _PATH_SSH_PIDDIR

/* Define if we don't have struct __res_state in resolv.h */
#undef __res_state

/* 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

/* type to use in place of socklen_t if not defined */
#undef socklen_t


/*
Copyright 2014 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package flag

// StringFlag is a string flag compatible with flags and pflags that keeps track of whether it had a value supplied or not.
type StringFlag struct {
	// If Set has been invoked this value is true
	provided bool
	// The exact value provided on the flag
	value string
}

func NewStringFlag(defaultVal string) StringFlag {
	return StringFlag{value: defaultVal}
}

func (f *StringFlag) Default(value string) {
	f.value = value
}

func (f StringFlag) String() string {
	return f.value
}

func (f StringFlag) Value() string {
	return f.value
}

func (f *StringFlag) Set(value string) error {
	f.value = value
	f.provided = true

	return nil
}

func (f StringFlag) Provided() bool {
	return f.provided
}

func (f *StringFlag) Type() string {
	return "string"
}


/* GStreamer
 *
 * Copyright (C) 2019 Matthew Waters <matthew@centricular.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <gst/gst.h>
#include <gst/check/gstcheck.h>
#include <gst/vulkan/vulkan.h>

static GstVulkanInstance *instance;
static GstVulkanDevice *device;

static void
setup (void)
{
  instance = gst_vulkan_instance_new ();
  fail_unless (gst_vulkan_instance_open (instance, NULL));
  device = gst_vulkan_device_new_with_index (instance, 0);
  fail_unless (gst_vulkan_device_open (device, NULL));
}

static void
teardown (void)
{
  gst_object_unref (instance);
  gst_object_unref (device);
}

static void
check_size (GstMemory * mem, gsize at_least)
{
  gsize size, maxsize, offset;

  size = gst_memory_get_sizes (mem, &offset, &maxsize);
  fail_unless (size <= maxsize);
  fail_unless (size >= at_least);
}

GST_START_TEST (test_buffer_mem_allocate)
{
  VkBufferUsageFlags usage;
  GstVulkanBufferMemory *vk_mem;
  gsize orig_size = 1024, size, offset;
  GstMemory *mem;

  usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
  mem =
      gst_vulkan_buffer_memory_alloc (device, orig_size,
      usage, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
  fail_unless (gst_is_vulkan_buffer_memory (mem));
  vk_mem = (GstVulkanBufferMemory *) mem;

  fail_unless (vk_mem->device == device);
  fail_unless (vk_mem->usage == usage);
  fail_unless (vk_mem->vk_mem != NULL);

  size = gst_memory_get_sizes (mem, &offset, NULL);
  fail_unless (offset == 0);
  check_size (mem, orig_size);
  fail_unless (vk_mem->requirements.size >= size);

  size = gst_memory_get_sizes ((GstMemory *) vk_mem->vk_mem, &offset, NULL);
  fail_unless (offset == 0);
  check_size ((GstMemory *) vk_mem->vk_mem, orig_size);

  gst_memory_unref (mem);
}

GST_END_TEST;

static Suite *
vkmemory_suite (void)
{
  Suite *s = suite_create ("vkmemory");
  TCase *tc_basic = tcase_create ("general");
  gboolean have_instance;

  suite_add_tcase (s, tc_basic);
  tcase_add_checked_fixture (tc_basic, setup, teardown);

  /* FIXME: CI doesn't have a software vulkan renderer (and none exists currently) */
  instance = gst_vulkan_instance_new ();
  have_instance = gst_vulkan_instance_open (instance, NULL);
  gst_object_unref (instance);
  if (have_instance) {
    tcase_add_test (tc_basic, test_buffer_mem_allocate);
  }

  return s;
}

GST_CHECK_MAIN (vkmemory);


import { submitToUrl } from 'platform/forms-system/src/js/actions';
import { transformForSubmit } from 'platform/forms-system/src/js/helpers';
import recordEvent from 'platform/monitoring/record-event';

const submitForm = (form, formConfig) => {
  const { submitUrl, trackingPrefix } = formConfig;
  const body = formConfig.transformForSubmit
    ? formConfig.transformForSubmit(formConfig, form)
    : transformForSubmit(formConfig, form);

  // event data needed on successful submission
  const { sameOffice, informalConference } = form.data;
  let informalConf = 'no';
  if (informalConference !== 'no') {
    informalConf = informalConference === 'rep' ? 'yes-with-rep' : 'yes';
  }
  const eventData = {
    // or 'no'
    'decision-reviews-differentOffice': sameOffice ? 'yes' : 'no',
    // or 'no', or 'yes-with-rep'
    'decision-reviews-informalConf': informalConf,
  };
  // Submission attempt event
  recordEvent({
    event: `${trackingPrefix}-submission`,
    ...eventData,
  });
  return submitToUrl(body, submitUrl, trackingPrefix, eventData).catch(() => {
    recordEvent({
      event: `${trackingPrefix}-submission-failure`,
      ...eventData,
    });
  });
};

export default submitForm;


<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<!--

If you wish to turn off checking for a section of code, you can put a comment in the source
before and after the section, with the following syntax:

  // scalastyle:off
  ...  // stuff that breaks the styles
  // scalastyle:on

You can also disable only one rule, by specifying its rule id, as specified in:
  http://www.scalastyle.org/rules-0.7.0.html

  // scalastyle:off no.finalize
  override def finalize(): Unit = ...
  // scalastyle:on no.finalize

This file is divided into 3 sections:
 (1) rules that we enforce.
 (2) rules that we would like to enforce, but haven't cleaned up the codebase to turn on yet
     (or we need to make the scalastyle rule more configurable).
 (3) rules that we don't want to enforce.
-->

<!--
Reference: Spark scalastyle-config.xml (https://github.com/apache/spark/blob/master/scalastyle-config.xml)
-->

<scalastyle>
  <name>Scalastyle standard configuration</name>

  <!-- ================================================================================ -->
  <!--                               rules we enforce                                   -->
  <!-- ================================================================================ -->

  <check level="error" class="org.scalastyle.file.FileTabChecker" enabled="true"></check>

  <check level="error" class="org.scalastyle.file.HeaderMatchesChecker" enabled="true">
    <parameters>
       <parameter name="header"><![CDATA[/*
 * Copyright (c) Microsoft. All rights reserved.
 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
 */]]></parameter>
    </parameters>
  </check>

  <check level="error" class="org.scalastyle.scalariform.SpacesAfterPlusChecker" enabled="true"></check>

  <check level="error" class="org.scalastyle.scalariform.SpacesBeforePlusChecker" enabled="true"></check>

  <check level="error" class="org.scalastyle.file.WhitespaceEndOfLineChecker" enabled="true"></check>

  <check level="error" class="org.scalastyle.file.FileLineLengthChecker" enabled="true">
    <parameters>
      <parameter name="maxLineLength"><![CDATA[100]]></parameter>
      <parameter name="tabSize"><![CDATA[2]]></parameter>
      <parameter name="ignoreImports">true</parameter>
    </parameters>
  </check>

  <check level="error" class="org.scalastyle.scalariform.ClassNamesChecker" enabled="true">
    <parameters><parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter></parameters>
  </check>

  <check level="error" class="org.scalastyle.scalariform.ObjectNamesChecker" enabled="true">
    <parameters><parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter></parameters>
  </check>

  <check level="error" class="org.scalastyle.scalariform.PackageObjectNamesChecker" enabled="true">
    <parameters><parameter name="regex"><![CDATA[^[a-z][A-Za-z]*$]]></parameter></parameters>
  </check>

  <check level="error" class="org.scalastyle.scalariform.ParameterNumberChecker" enabled="true">
    <parameters><parameter name="maxParameters"><![CDATA[10]]></parameter></parameters>
  </check>

  <check level="error" class="org.scalastyle.scalariform.NoFinalizeChecker" enabled="true"></check>

  <check level="error" class="org.scalastyle.scalariform.CovariantEqualsChecker" enabled="true"></check>

  <check level="error" class="org.scalastyle.scalariform.StructuralTypeChecker" enabled="true"></check>

  <check level="error" class="org.scalastyle.scalariform.UppercaseLChecker" enabled="true"></check>

  <check level="error" class="org.scalastyle.scalariform.IfBraceChecker" enabled="true">
    <parameters>
      <parameter name="singleLineAllowed"><![CDATA[true]]></parameter>
      <parameter name="doubleLineAllowed"><![CDATA[true]]></parameter>
    </parameters>
  </check>

  <check level="error" class="org.scalastyle.scalariform.PublicMethodsHaveTypeChecker" enabled="true"></check>

  <check level="error" class="org.scalastyle.file.NewLineAtEofChecker" enabled="true"></check>

  <check level="error" class="org.scalastyle.scalariform.NonASCIICharacterChecker" enabled="true"></check>

  <check level="error" class="org.scalastyle.scalariform.SpaceAfterCommentStartChecker" enabled="true"></check>

  <check level="error" class="org.scalastyle.scalariform.EnsureSingleSpaceBeforeTokenChecker" enabled="true">
   <parameters>
     <parameter name="tokens">ARROW, EQUALS, ELSE, TRY, CATCH, FINALLY, LARROW, RARROW</parameter>
   </parameters>
  </check>

  <check level="error" class="org.scalastyle.scalariform.EnsureSingleSpaceAfterTokenChecker" enabled="true">
    <parameters>
     <parameter name="tokens">ARROW, EQUALS, COMMA, COLON, IF, ELSE, DO, WHILE, FOR, MATCH, TRY, CATCH, FINALLY, LARROW, RARROW</parameter>
    </parameters>
  </check>

  <!-- ??? usually shouldn't be checked into the code base. -->
  <check level="error" class="org.scalastyle.scalariform.NotImplementedErrorUsage" enabled="true"></check>

  <!-- As of SPARK-7558, all tests in Spark should extend o.a.s.SparkFunSuite instead of FunSuite directly -->
  <check customId="funsuite" level="error" class="org.scalastyle.scalariform.TokenChecker" enabled="true">
    <parameters><parameter name="regex">^FunSuite[A-Za-z]*$</parameter></parameters>
    <customMessage>Tests must extend org.apache.spark.SparkFunSuite instead.</customMessage>
  </check>

  <!-- As of SPARK-7977 all printlns need to be wrapped in '// scalastyle:off/on println' -->
  <check customId="println" level="error" class="org.scalastyle.scalariform.TokenChecker" enabled="true">
    <parameters><parameter name="regex">^println$</parameter></parameters>
    <customMessage><![CDATA[Are you sure you want to println? If yes, wrap the code block with
      // scalastyle:off println
      println(...)
      // scalastyle:on println]]></customMessage>
  </check>

  <check customId="visiblefortesting" level="error" class="org.scalastyle.file.RegexChecker" enabled="true">
    <parameters><parameter name="regex">@VisibleForTesting</parameter></parameters>
    <customMessage><![CDATA[
      @VisibleForTesting auses classpath issues. Please note this in the java doc instead (SPARK-11615).
    ]]></customMessage>
  </check>

  <check customId="classforname" level="error" class="org.scalastyle.file.RegexChecker" enabled="true">
    <parameters><parameter name="regex">Class\.forName</parameter></parameters>
    <customMessage><![CDATA[
      Are you sure that you want to use Class.forName? In most cases, you should use Utils.classForName instead.
      If you must use Class.forName, wrap the code block with
      // scalastyle:off classforname
      Class.forName(...)
      // scalastyle:on classforname
    ]]></customMessage>
  </check>

  <!-- As of SPARK-9613 JavaConversions should be replaced with JavaConverters -->
  <check customId="javaconversions" level="error" class="org.scalastyle.scalariform.TokenChecker" enabled="true">
    <parameters><parameter name="regex">JavaConversions</parameter></parameters>
    <customMessage>Instead of importing implicits in scala.collection.JavaConversions._, import
    scala.collection.JavaConverters._ and use .asScala / .asJava methods</customMessage>
  </check>

  <!-- As of SPARK-10330 JobContext methods should not be called directly -->
  <check customId="jobcontext" level="error" class="org.scalastyle.scalariform.TokenChecker" enabled="true">
    <parameters><parameter name="regex">^getConfiguration$|^getTaskAttemptID$</parameter></parameters>
    <customMessage>Instead of calling .getConfiguration() or .getTaskAttemptID() directly,
    use SparkHadoopUtil's getConfigurationFromJobContext() and getTaskAttemptIDFromTaskAttemptContext() methods.
    </customMessage>
  </check>

  <!-- ================================================================================ -->
  <!--       rules we'd like to enforce, but haven't cleaned up the codebase yet        -->
  <!-- ================================================================================ -->

  <!-- We cannot turn the following two on, because it'd fail a lot of string interpolation use cases. -->
  <!-- Ideally the following two rules should be configurable to rule out string interpolation. -->
  <check level="error" class="org.scalastyle.scalariform.NoWhitespaceBeforeLeftBracketChecker" enabled="false"></check>
  <check level="error" class="org.scalastyle.scalariform.NoWhitespaceAfterLeftBracketChecker" enabled="false"></check>

  <!-- This breaks symbolic method names so we don't turn it on. -->
  <!-- Maybe we should update it to allow basic symbolic names, and then we are good to go. -->
  <check level="error" class="org.scalastyle.scalariform.MethodNamesChecker" enabled="false">
    <parameters>
    <parameter name="regex"><![CDATA[^[a-z][A-Za-z0-9]*$]]></parameter>
    </parameters>
  </check>

  <!-- Should turn this on, but we have a few places that need to be fixed first -->
  <check level="error" class="org.scalastyle.scalariform.EqualsHashCodeChecker" enabled="false"></check>

  <!-- ================================================================================ -->
  <!--                               rules we don't want                                -->
  <!-- ================================================================================ -->

  <check level="error" class="org.scalastyle.scalariform.IllegalImportsChecker" enabled="false">
    <parameters><parameter name="illegalImports"><![CDATA[sun._,java.awt._]]></parameter></parameters>
  </check>

  <!-- We want the opposite of this: NewLineAtEofChecker -->
  <check level="error" class="org.scalastyle.file.NoNewLineAtEofChecker" enabled="false"></check>

  <!-- This one complains about all kinds of random things. Disable. -->
  <check level="error" class="org.scalastyle.scalariform.SimplifyBooleanExpressionChecker" enabled="false"></check>

  <!-- We use return quite a bit for control flows and guards -->
  <check level="error" class="org.scalastyle.scalariform.ReturnChecker" enabled="false"></check>

  <!-- We use null a lot in low level code and to interface with 3rd party code -->
  <check level="error" class="org.scalastyle.scalariform.NullChecker" enabled="false"></check>

  <!-- Doesn't seem super big deal here ... -->
  <check level="error" class="org.scalastyle.scalariform.NoCloneChecker" enabled="false"></check>

  <!-- Doesn't seem super big deal here ... -->
  <check level="error" class="org.scalastyle.file.FileLengthChecker" enabled="false">
    <parameters><parameter name="maxFileLength">800></parameter></parameters>
  </check>

  <!-- Doesn't seem super big deal here ... -->
  <check level="error" class="org.scalastyle.scalariform.NumberOfTypesChecker" enabled="false">
    <parameters><parameter name="maxTypes">30</parameter></parameters>
  </check>

  <!-- Doesn't seem super big deal here ... -->
  <check level="error" class="org.scalastyle.scalariform.CyclomaticComplexityChecker" enabled="false">
    <parameters><parameter name="maximum">10</parameter></parameters>
  </check>

  <!-- Doesn't seem super big deal here ... -->
  <check level="error" class="org.scalastyle.scalariform.MethodLengthChecker" enabled="false">
    <parameters><parameter name="maxLength">50</parameter></parameters>
  </check>

  <!-- Not exactly feasible to enforce this right now. -->
  <!-- It is also infrequent that somebody introduces a new class with a lot of methods. -->
  <check level="error" class="org.scalastyle.scalariform.NumberOfMethodsInTypeChecker" enabled="false">
    <parameters><parameter name="maxMethods"><![CDATA[30]]></parameter></parameters>
  </check>

  <!-- Doesn't seem super big deal here, and we have a lot of magic numbers ... -->
  <check level="error" class="org.scalastyle.scalariform.MagicNumberChecker" enabled="false">
    <parameters><parameter name="ignore">-1,0,1,2,3</parameter></parameters>
  </check>

</scalastyle>


/*
 *  actorio.cc - I/O for the Actor class.
 *
 *  Copyright (C) 2000-2013  The Exult Team
 *
 *  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.
 */

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <cstring>
#include "gamewin.h"
#include "chunks.h"
#include "gamemap.h"
#include "game.h"
#include "monsters.h"
#include "utils.h"
#include "egg.h"
#include "schedule.h"
#include "objiter.h"
#include "databuf.h"
#include "npctime.h"
#include "ucmachine.h"
#include "shapeinf.h"
#include "monstinf.h"
#include "array_size.h"

using std::ios;
using std::cout;
using std::endl;
using std::istream;
using std::ostream;

/*
 *  Read in actor from a given file.
 */

void Actor::read(
    IDataSource *nfile,      // 'npc.dat', generally.
    int num,            // NPC #, or -1.
    bool has_usecode,       // 1 if a 'type1' NPC.
    bool &fix_unused        // Old savegame, so 'unused' isn't
    //   valid.  Possibly set here.
    //June9,02:  +++++Fix_unused should go away in a few months.
) {
	npc_num = num;

	// This is used to get around parts of the files that we don't know
	// what the uses are. 'fix_first' is used fix issues in the originals
	// files that cause problems for the extra info we save.
	bool fix_first = Game::is_new_game();

	init();             // Clear rest of stuff.
	unsigned locx = nfile->read1(); // Get chunk/tile coords.
	unsigned locy = nfile->read1();
	// Read & set shape #, frame #.
	unsigned short shnum = nfile->read2();

	if (num == 0 && Game::get_game_type() != BLACK_GATE &&
	        (shnum & 0x3ff) < 12)
		set_shape((shnum & 0x3ff) | 0x400);
	else
		set_shape(shnum & 0x3ff);

	set_frame(shnum >> 10);

	int iflag1 = nfile->read2();    // Inventory flag.
	// We're going to use these bits.
	// iflag1:0 == has_contents.
	// iflag1:1 == sched. usecode follows,
	//   possibly empty.
	// iflag1:2 == usecode # assigned by
	//   ES, so always use it.
	// iflag1:3 == usecode fun name assigned
	//   by ES, so use it instead.
	// iflag1:4 == Extended skin number
	bool read_sched_usecode = !fix_first && (iflag1 & 2);
	bool usecode_name_used = !fix_first && (iflag1 & 8);
	if (usecode_name_used || (!fix_first && (iflag1 & 4)))
		usecode_assigned = true;
	bool extended_skin = !fix_first && (iflag1 & 16);

	int schunk = nfile->read1();    // Superchunk #.
	// For multi-map:
	int map_num = nfile->read1();
	if (fix_first)
		map_num = 0;
	Game_map *npcmap = gwin->get_map(map_num);
	int usefun = nfile->read2();    // Get usecode function #.
	set_lift(usefun >> 12);     // Lift is high 4 bits.
	usecode = usefun & 0xfff;
	// Need this for BG. (Not sure if SI.)
	if (npc_num >= 0 && npc_num < 256)
		usecode = 0x400 + npc_num;
	// Watch for new NPC's added.
	else if (usecode_name_used || (!has_usecode && !usecode_assigned &&
	                               usecode != 0x400 + npc_num) ||
	         usecode == 0xfff)
		usecode = -1;       // Let's try this.
	// Guessing:  !!  (Want to get signed.)
	int health_val = static_cast<int>(static_cast<char>(nfile->read1()));
	set_property(static_cast<int>(Actor::health), health_val);
	nfile->skip(3); // Skip 3 bytes.
	int iflag2 = nfile->read2();    // The 'used-in-game' flag.
	if (iflag2 == 0 && num >= 0 && !fix_unused) {
		if (num == 0)       // Old (bad) savegame?
			fix_unused = true;
		else
			unused = true;
#ifdef DEBUG
		cout << "NPC #" << num << " is unused" << endl;
#endif
	}

	bool has_contents = fix_first ? (iflag1 && !unused) : (iflag1 & 1) != 0;
	// Read first set of flags
	const int rflags = nfile->read2();

	if ((rflags >> 0x7) & 1) set_flag(Obj_flags::asleep);
	if ((rflags >> 0x8) & 1) set_flag(Obj_flags::charmed);
	if ((rflags >> 0x9) & 1) set_flag(Obj_flags::cursed);
	if ((rflags >> 0xB) & 1) set_flag(Obj_flags::in_party);
	if ((rflags >> 0xC) & 1) set_flag(Obj_flags::paralyzed);
	if ((rflags >> 0xD) & 1) set_flag(Obj_flags::poisoned);
	if ((rflags >> 0xE) & 1) set_flag(Obj_flags::protection);
	if (!fix_first && ((rflags >> 0xF) & 1))
		set_flag(Obj_flags::dead);

	// Guess
	if (((rflags >> 0xA) & 1))
		set_flag(Obj_flags::on_moving_barge);
	alignment = (rflags >> 3) & 3;

	// Unknown, using for is_temporary (only when not fix_first)
	if ((rflags >> 0x6) & 1 && !fix_first) set_flag(Obj_flags::is_temporary);

	/*  Not used by exult

	Unknown in U7tech
	if ((rflags >> 0x5) & 1) set_flag (Obj_flags::unknown);
	*/

	// Get char. atts.

	// In BG - Strength (0-5), skin colour(6-7)
	// In SI - Strength (0-4), skin colour(5-6), freeze (7)
	int strength_val = nfile->read1();

	if (Game::get_game_type() == BLACK_GATE) {
		set_property(static_cast<int>(Actor::strength), strength_val & 0x3F);

		if (num == 0) {
			if (!extended_skin) { // We will do it later for extended skins.
				if (Game::get_avskin() >= 0)
					set_skin_color(Game::get_avskin());
				else
					set_skin_color(((strength_val >> 6) - 1) & 0x3);
			}
		} else
			set_skin_color(-1);
	} else {
		set_property(static_cast<int>(Actor::strength), strength_val & 0x1F);

		if (num == 0) {
			if (!extended_skin) { // We will do it later for extended skins.
				if (Game::get_avskin() >= 0 && Game::get_avskin() <= 2)
					set_skin_color(Game::get_avskin());
				else
					set_skin_color((strength_val >> 5) & 0x3);
			}
		} else
			set_skin_color(-1);

		if ((strength_val >> 7) & 1) set_flag(Obj_flags::freeze);
	}

	if (is_dying() &&       // Now we know health, strength.
	        npc_num > 0)        // DON'T do this for Avatar!
		set_flag(Obj_flags::dead);  // Fixes older savegames.
	// Dexterity
	set_property(static_cast<int>(Actor::dexterity), nfile->read1());

	// Intelligence (0-4), read(5), Tournament (6), polymorph (7)
	int intel_val = nfile->read1();

	set_property(static_cast<int>(Actor::intelligence), intel_val & 0x1F);
	if ((intel_val >> 5) & 1) set_flag(Obj_flags::read);
	// Tournament.
	if ((intel_val >> 6) & 1)
		set_flag(Obj_flags::tournament);
	if ((intel_val >> 7) & 1) set_flag(Obj_flags::polymorph);

	// Combat skill (0-6), Petra (7)
	int combat_val = nfile->read1();
	set_property(static_cast<int>(Actor::combat), combat_val & 0x7F);
	if ((combat_val >> 7) & 1) set_flag(Obj_flags::petra);

	schedule_type = nfile->read1();
	int amode = nfile->read1(); // Default attack mode
	// Just stealing 2 spare bits:
	combat_protected = (amode & (1 << 4)) != 0;
	user_set_attack = (amode & (1 << 5)) != 0;
	attack_mode = static_cast<Attack_mode>(amode & 0xf);

	// Charmed flag has been read by now.
	if (fix_first || !get_flag(Obj_flags::charmed)) {
		nfile->skip(1);         // Unknown/irrelevant
		charmalign = alignment; // Sane default.
	} else
		charmalign = nfile->read1(); // Alignment when charmed.

	int unk0 = nfile->read1();  // We set high bit of this value.
	int unk1 = nfile->read1();
	int magic = 0;
	int mana = 0;
	int temp;
	int flags3;
	int ident = 0;
	if (fix_first || unk0 == 0) {   // How U7 stored things.
		// If NPC 0: MaxMagic (0-4), TempHigh (5-7) and Mana(0-4),
		//                      TempLow (5-7)
		// Else: ID# (0-4), TempHigh (5-7) and Met (0),
		//  No Spell Casting (1), Zombie (2), TempLow (5-7)
		int magic_val = nfile->read1();
		int mana_val = nfile->read1();
		temp = ((magic_val >> 2) & 0x38) + ((mana_val >> 5) & 7);
		if (num == 0) {
			magic = magic_val & 0x1f;
			mana = mana_val & 0x1f;
			flags3 = 1;     // Met.
		} else {
			ident = magic_val & 0x1f;
			flags3 = mana_val;
		}
	} else {            // Exult stores magic for all NPC's.
		magic = unk0 & 0x7f;
		mana = unk1;
		temp = nfile->read1();
		flags3 = nfile->read1();
		ident = flags3 >> 3;
		flags3 &= 0x7;
	}
	set_property(static_cast<int>(Actor::magic), magic);
	// Need to make sure that mana is less than magic
	set_property(static_cast<int>(Actor::mana), mana < magic ? mana : magic);
	set_temperature(temp);
	set_ident(ident);
	if ((flags3 >> 0) & 1)
		set_flag(Obj_flags::met);
	if ((flags3 >> 1) & 1)
		set_flag(Obj_flags::no_spell_casting);
	if ((flags3 >> 2) & 1)
		set_flag(Obj_flags::si_zombie);

	face_num = nfile->read2();  // NOTE:  Exult's using 2 bytes,
	if (fix_first)  // Not used in the original.
		//face_num &= 0xff; // Just 1 byte in orig.
		face_num = npc_num;
	else if (!face_num && npc_num > 0)  // Fix older savegames.
		face_num = npc_num;
	nfile->skip(1); // Unknown

	set_property(static_cast<int>(Actor::exp), nfile->read4());
	set_property(static_cast<int>(Actor::training), nfile->read1());

	nfile->skip(2);     // Primary Attacker
	nfile->skip(2);     // Secondary Attacker
	oppressor = nfile->read2(); // Oppressor NPC id.

	nfile->skip(4);     //I-Vr ??? (refer to U7tech.txt)

	schedule_loc.tx = nfile->read2();   //S-Vr Where npc is supposed to
	schedule_loc.ty = nfile->read2();   //be for schedule)

	// Type flags 2
	int tflags = nfile->read2();

	// First time round, all the flags are garbage
	if (fix_first) {
		set_type_flags(1 << Actor::tf_walk);
		// Correct for SI, no problems for BG:
		if (tflags & (1 << Actor::tf_sex))
			clear_type_flag(Actor::tf_sex);
		else
			set_type_flag(Actor::tf_sex);
	} else
		set_type_flags(tflags);

	if (num == 0 && Game::get_avsex() == 0) {
		clear_type_flag(Actor::tf_sex);
	} else if (num == 0 && Game::get_avsex() == 1) {
		set_type_flag(Actor::tf_sex);
	}

	nfile->skip(5);     // Unknown

	next_schedule = nfile->read1(); // Acty ????? what is this??

	nfile->skip(1);     // SN ????? (refer to U7tech.txt)
	nfile->skip(2);     // V1 ????? (refer to U7tech.txt)
	nfile->skip(2);     // V2 ????? (refer to U7tech.txt)

	// 16 Bit Shape Numbers, allows for shapes > 1023
	shnum = nfile->read2();
	if (!fix_first && shnum) {
		// ++++ Testing
		if (npc_num == 0)
			set_actor_shape();
		else
			set_shape(shnum);       // 16 Bit Shape Number

		shnum = static_cast<sint16>(nfile->read2());    // 16 Bit Polymorph Shape Number
		if (get_flag(Obj_flags::polymorph)) {
			// Try to fix messed-up flag.
			if (shnum != get_shapenum())
				set_polymorph(shnum);
			else
				clear_flag(Obj_flags::polymorph);
		}
	} else {
		nfile->skip(2);
		set_polymorph_default();
	}

	// More Exult stuff
	if (!fix_first) {
		uint32  f;

		// Flags
		f = nfile->read4();
		flags |= f;
		if (get_flag(Obj_flags::invisible)) /* Force timer. */
			need_timers()->start_invisibility();
		if (get_flag(Obj_flags::might)) /* Force timer. */
			need_timers()->start_might();

		// Was SIFlags -- now used for schedule z coord
		schedule_loc.tz = nfile->read1();
		nfile->skip(1);  // 1 free from old SIFLAGS

		// Flags2   But don't set polymorph.
		bool polym = get_flag(Obj_flags::polymorph);
		f = nfile->read4();
		flags2 |= f;
		if (!polym && get_flag(Obj_flags::polymorph))
			clear_flag(Obj_flags::polymorph);

		if (usecode_name_used) {
			// Support for named functions.
			int funsize = nfile->read1();
			char *nm = new char[funsize + 1];
			nfile->read(nm, funsize);
			nm[funsize] = 0;
			usecode_name = nm;
			usecode = ucmachine->find_function(nm);
			delete [] nm;
		}

		int skin = nfile->read1();
		if (extended_skin) {
			if (Game::get_avskin() >= 0)
				set_skin_color(Game::get_avskin());
			else
				set_skin_color(skin);
		}
	} else {
		// Flags
		nfile->skip(4);

		// SIFlags -- now used for schedule z coord
		nfile->skip(2);

		// Flags2
		nfile->skip(4);

		// Extended skins
		nfile->skip(1);
	}

	// Skip 14
	nfile->skip(14);

	// Get (signed) food level.
	int food_read = static_cast<int>(static_cast<char>(nfile->read1()));
	if (fix_first) food_read = 18;
	set_property(static_cast<int>(Actor::food_level), food_read);

	// Skip 7
	nfile->skip(7);

	unsigned char namebuf[17];
	nfile->read(namebuf, 16);

	for (int i = 0; i < 16; i++)
		if (namebuf[i] == 0)
			i = 16;
		else if ((namebuf[i] & 0x80u) != 0 || namebuf[i] < ' ') {
			namebuf[0] = 0;
			break;
		}

	namebuf[16] = 0;        // Be sure it's 0-delimited.
//	cout << "Actor " << namebuf << " has alignment " << alignment << endl;

	if (num == 0 && Game::get_avname()) {
		name = Game::get_avname();
	} else
		name = reinterpret_cast<char const *>(namebuf);     // Store copy of it.

	// Get abs. chunk. coords. of schunk.
	int scy = 16 * (schunk / 12);
	int scx = 16 * (schunk % 12);
	if (has_contents)       // Inventory?  Read.
		npcmap->read_ireg_objects(nfile, scx, scy, this);
	if (read_sched_usecode)     // Read in scheduled usecode.
		npcmap->read_special_ireg(nfile, this);
	int cx = locx >> 4;     // Get chunk indices within schunk.
	int cy = locy >> 4;
	// Get tile #'s.
	int tilex = locx & 0xf;
	int tiley = locy & 0xf;
	set_shape_pos(tilex, tiley);
	Map_chunk *olist = npcmap->get_chunk_safely(scx + cx, scy + cy);
	set_invalid();          // Not in world yet.
	if (olist && !is_dead() &&  // Valid & alive?  Put into chunk list.
	        !unused) {
		move((scx + cx)*c_tiles_per_chunk + tilex,
		     (scy + cy)*c_tiles_per_chunk + tiley,
		     get_lift(), map_num);
		if (this == gwin->get_main_actor())
			gwin->set_map(map_num);
	}

	// We do this here because we need the NPC's final shape.
	if (health_val <= 0 && !unused) {
		// If a monster can't die, force it to have at least 1 hit point,
		// but only if the monster is used.
		// Maybe we should restore it to full health?
		const Monster_info *minf = get_info().get_monster_info();
		if (minf && minf->cant_die())
			set_property(static_cast<int>(Actor::health),
			             get_property(static_cast<int>(Actor::strength)));
	}

	// Only do ready best weapon if we are in BG, this is the first time
	// and we are the Avatar or Iolo
	if (Game::get_game_type() == BLACK_GATE && Game::get_avname() && (num == 0 || num == 1))
		ready_best_weapon();
	// Force Avatar and all party members to be good
	if (get_flag(Obj_flags::in_party) || num == 0)
		set_alignment(good);
#if defined(DEBUG) && 0

	cout << get_npc_num() << " Creating ";

	if (name.empty()) cout << get_name();
	else cout << name;

	cout << ", shape = " <<
	     get_shapenum() <<
	     ", frame = " << get_framenum() << ", usecode = " <<
	     usefun << endl;

	cout << "Chunk coords are (" << scx + cx << ", " << scy + cy << "), lift is "
	     << get_lift() << endl;

	cout << "Type Flags: ";
	if (get_type_flag(tf_fly)) cout << "fly ";
	if (get_type_flag(tf_swim)) cout << "swim ";
	if (get_type_flag(tf_walk)) cout << "walk ";
	if (get_type_flag(tf_ethereal)) cout << "ethereal ";
	if (get_type_flag(tf_in_party)) cout << "in party ";
	if (get_type_flag(tf_sex)) cout << "female ";
	cout << endl;

#endif
}

/*
 *  Write out to given file.
 */

void Actor::write(
    ODataSource *nfile           // Generally 'npc.dat'.
) {
	int i;
	unsigned char buf4[4];      // Write coords., shape, frame.

	int old_shape = get_shapenum(); // Backup shape because we might change it
	set_shape(get_shape_real());     // Change the shape out non polymorph one
	int shapenum = get_shapenum();
	int framenum = get_framenum();
	buf4[0] = ((get_cx() % 16) << 4) | get_tx();
	buf4[1] = ((get_cy() % 16) << 4) | get_ty();
	// ++++++Is this even needed anymore? We already save 16-bit shapes below.
	buf4[2] = shapenum & 0xff;
	buf4[3] = ((shapenum >> 8) & 3) | (framenum << 2);

	nfile->write(reinterpret_cast<char *>(buf4), sizeof(buf4));

	set_shape(old_shape);        // Revert the shape to what it was

	// Inventory flag.
	// Bit0 = has_contents (our use).
	// Bit1 = our savegame, with sched.
	//   usecode script following this.
	// iflag1:2 == usecode # assigned by
	//   ES, so always use it.
	// iflag1:3 == usecode fun name assigned
	//   by ES, so use it instead.
	// iflag1:4 == Extended skin number
	int iflag1 = objects.is_empty() ? 0 : 1;
	iflag1 |= 2;            // We're always doing write_scheduled()
	if (usecode_assigned) { // # assigned by EStudio?
		// If we have a name, use it instead of the usecode #.
		if (!usecode_name.empty())
			iflag1 |= 8;        // Set bit 3.
		else
			iflag1 |= 4;        // Set bit 2.
	}
	iflag1 |= 16;   // Set bit 4.

	nfile->write2(iflag1);
	// Superchunk #.
	nfile->write1((get_cy() / 16) * 12 + get_cx() / 16);

	int map_num = get_map_num();
	if (map_num < 0)
		// we store all off-map actors in map 0
		map_num = 0;
	assert(map_num >= 0 && map_num < 256);
	nfile->write1(map_num);     // Borrowing for map #.
	// Usecode.
	int usefun = get_usecode() & 0xfff;
	// Lift is in high 4 bits.
	usefun |= ((get_lift() & 15) << 12);
	nfile->write2(usefun);
	nfile->write1(get_property(Actor::health));
	nfile->write1(0);           // Unknown 3 bytes.
	nfile->write2(0);
	nfile->write2(unused ? 0 : 1);  // Write 0 if unused.

	//Write first set of flags
	int iout = 0;

	if (get_flag(Obj_flags::asleep)) iout |= 1 << 0x7;
	if (get_flag(Obj_flags::charmed)) iout |= 1 << 0x8;
	if (get_flag(Obj_flags::cursed)) iout |= 1 << 0x9;
	if (get_flag(Obj_flags::in_party)) iout |= 1 << 0xB;
	if (get_flag(Obj_flags::paralyzed)) iout |= 1 << 0xC;
	if (get_flag(Obj_flags::poisoned)) iout |= 1 << 0xD;
	if (get_flag(Obj_flags::protection)) iout |= 1 << 0xE;

	// Guess
	if (get_flag(Obj_flags::on_moving_barge)) iout |= 1 << 0xA;
	// Alignment is bits 3-4.

	// Unknownm using for is_temp
	if (get_flag(Obj_flags::is_temporary)) iout |= 1 << 0x6;

	iout |= ((alignment & 3) << 3);

	nfile->write2(iout);

	// Write char. attributes.
	iout = get_property(Actor::strength);
	if (Game::get_game_type() != BLACK_GATE && npc_num == 0) iout |= (get_skin_color() & 3) << 5;
	else if (npc_num == 0) iout |= ((get_skin_color() + 1) & 3) << 6;

	if (get_flag(Obj_flags::freeze)) iout |= 1 << 7;
	nfile->write1(iout);

	nfile->write1(get_property(Actor::dexterity));

	iout = get_property(Actor::intelligence);
	if (get_flag(Obj_flags::read)) iout |= 1 << 5;
	// Tournament
	if (get_flag(Obj_flags::tournament)) iout |= 1 << 6;
	if (get_flag(Obj_flags::polymorph)) iout |= 1 << 7;
	nfile->write1(iout);

	iout = get_property(Actor::combat);
	if (get_flag(Obj_flags::petra)) iout |= 1 << 7;
	nfile->write1(iout);

	nfile->write1(get_schedule_type());
	unsigned char amode = attack_mode |
	                      (combat_protected ? (1 << 4) : 0) |
	                      (user_set_attack ? (1 << 5) : 0);
	nfile->write1(amode);
	nfile->write1(get_effective_alignment());       // Effective alignment
	// Exult is using the 2 unknown bytes to store magic, mana for all
	//   NPC's, and to store temperature more simply.
	int magic = get_property(static_cast<int>(Actor::magic));
	nfile->write1(magic | 0x80); // Set high bit to flag new format.
	nfile->write1(get_property(static_cast<int>(Actor::mana)));
	nfile->write1(get_temperature());
	int flags3 = 0;
	if (get_flag(Obj_flags::met)) flags3 |= 1;
	if (get_flag(Obj_flags::no_spell_casting)) flags3 |= 1 << 1;
	if (get_flag(Obj_flags::si_zombie)) flags3 |= 1 << 2;
	flags3 |= (get_ident() << 3);
	nfile->write1(flags3);

	nfile->write2(face_num);
	nfile->write1(0);       // Skip 2

	nfile->write4(get_property(Actor::exp));
	nfile->write1(get_property(Actor::training));
	// 0x40 unknown.

	nfile->write2(0);   // Skip 2*2
	nfile->write2(0);
	nfile->write2(oppressor);   // Oppressor.

	nfile->write4(0);   // Skip 2*2

	nfile->write2(old_schedule_loc.tx); //S-Vr Where npc is supposed to
	nfile->write2(old_schedule_loc.ty); //be for schedule)
	//nfile->write4(0);

	nfile->write2(get_type_flags());    // Typeflags

	nfile->write4(0);   // Skip 5
	nfile->write1(0);

	nfile->write1(next_schedule);   // Acty ????? what is this??

	nfile->write1(0);       // Skip 1
	nfile->write2(0);   // Skip 2
	nfile->write2(0);   // Skip 2

	// 16 Bit Shapes
	if (get_flag(Obj_flags::polymorph)) {
		nfile->write2(shape_save);  // 16 Bit Shape Num
		nfile->write2(get_shapenum());  // 16 Bit Polymorph Shape
	} else {
		nfile->write2(get_shapenum());  // 16 Bit Shape Num
		nfile->write2(0);       // 16 Bit Polymorph Shape
	}

	// Flags
	nfile->write4(flags);

	// was SIFlags -- now used for schedule z coord
	nfile->write1(old_schedule_loc.tz);
	nfile->write1(0); // 1 free from old SIFLAGS

	// flags2
	nfile->write4(flags2);

	if (usecode_assigned && !usecode_name.empty()) {
		// Support for named functions.
		int size = usecode_name.size();
		nfile->write1(size);
		char *nm = new char[size];
		std::strncpy(nm, usecode_name.c_str(), size);
		nfile->write(nm, size);
		delete [] nm;
	}

	nfile->write1(static_cast<char>(get_skin_color()));

	// Skip 14
	for (i = 0; i < 14; i++)
		nfile->write1(0);

	// Food
	nfile->write1(get_property(Actor::food_level));

	// Skip 7
	for (i = 0; i < 7; i++)
		nfile->write1(0);

	char namebuf[17];       // Write 16-byte name.
	std::memset(namebuf, 0, 16);
	if (name.empty()) {
		std::string namestr = Game_object::get_name();
		std::strncpy(namebuf, namestr.c_str(), 16);
	} else
		std::strncpy(namebuf, name.c_str(), 16);
	nfile->write(namebuf, 16);
	write_contents(nfile);      // Write what he holds.
	namebuf[16] = 0;
	if (atts) {
		Actor::Atts_vector attlist;
		get_attributes(attlist);
		Game_map::write_attributes(nfile, attlist);
	}
	// Write scheduled usecode.
	Game_map::write_scheduled(nfile, this, true);
}

/*
 *  Write out to given file.
 */

void Monster_actor::write(
    ODataSource *nfile           // Generally 'npc.dat'.
) {
	/*  // This is checked in Game_window::write_npcs.
	if (Actor::is_dead())       // Not alive?
	    return;
	*/
	Actor::write(nfile);        // Now write.
}

/*
 *  Write Inventory
 */

/*
 *  Write contents (if there is any).
 */

void Actor::write_contents(
    ODataSource *out
) {
	if (!objects.is_empty()) {  // Now write out what's inside.
		const int num_spots = static_cast<int>(array_size(spots));
		int i;

		for (i = 0; i < num_spots; ++i) {
			// Spot Increment
			if (spots[i]) {
				// Write 2 byte index id
				out->write1(0x02);
				out->write2(static_cast<uint8>(i));
				spots[i]->write_ireg(out);
			}
		}

		Game_object *obj;
		Object_iterator next(objects);

		while ((obj = next.get_next()) != nullptr) {
			for (i = 0; i < num_spots; ++i)
				if (spots[i] == obj)
					break;

			if (i == num_spots) {
				// Write 2 byte index id (-1 = no slot)
				i = -1;
				out->write1(0x02);
				out->write2(static_cast<uint8>(i));
				obj->write_ireg(out);
			}
		}
		out->write1(0x01);      // A 01 terminates the list.
	}
}


#  Boost string_algo library documentation Jamfile  ---------------------------------
#
#  Copyright Pavol Droba 2002-2003. Use, modification and
#  distribution is subject to the Boost Software License, Version
#  1.0. (See accompanying file LICENSE_1_0.txt or copy at
#  http://www.boost.org/LICENSE_1_0.txt)
#
#  See http://www.boost.org for updates, documentation, and revision history.

import toolset ;
toolset.using doxygen ;

boostbook string_algo : string_algo.xml autodoc
	:
        <xsl:param>boost.root=../../../../..
        <format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
	;

doxygen autodoc
    :
    [ glob ../../../../boost/algorithm/string.hpp ]
    [ glob ../../../../boost/algorithm/string_regex.hpp ]

    [ glob ../../../../boost/algorithm/string/classification.hpp ]
    [ glob ../../../../boost/algorithm/string/iterator_range.hpp ]
    [ glob ../../../../boost/algorithm/string/sequence_traits.hpp ]
    [ glob ../../../../boost/algorithm/string/std_containers_traits.hpp ]
    [ glob ../../../../boost/algorithm/string/concept.hpp ]
    [ glob ../../../../boost/algorithm/string/compare.hpp ]
    [ glob ../../../../boost/algorithm/string/constants.hpp ]
    [ glob ../../../../boost/algorithm/string/case_conv.hpp ]
    [ glob ../../../../boost/algorithm/string/find.hpp ]
    [ glob ../../../../boost/algorithm/string/finder.hpp ]
    [ glob ../../../../boost/algorithm/string/find_iterator.hpp ]
    [ glob ../../../../boost/algorithm/string/trim.hpp ]
    [ glob ../../../../boost/algorithm/string/predicate.hpp ]
    [ glob ../../../../boost/algorithm/string/split.hpp ]
    [ glob ../../../../boost/algorithm/string/iter_find.hpp ]
    [ glob ../../../../boost/algorithm/string/erase.hpp ]
    [ glob ../../../../boost/algorithm/string/join.hpp ]
    [ glob ../../../../boost/algorithm/string/replace.hpp ]
    [ glob ../../../../boost/algorithm/string/find_format.hpp ]
    [ glob ../../../../boost/algorithm/string/formatter.hpp ]
    [ glob ../../../../boost/algorithm/string/regex.hpp ]
    [ glob ../../../../boost/algorithm/string/regex_find_format.hpp ]
    [ glob ../../../../boost/algorithm/string/trim_all.hpp ]
    :
    <doxygen:param>HIDE_UNDOC_MEMBERS=YES
    <doxygen:param>EXTRACT_PRIVATE=NO
    <doxygen:param>ENABLE_PREPROCESSING=YES
    <doxygen:param>MACRO_EXPANSION=YES
    <doxygen:param>EXPAND_ONLY_PREDEF=YES
    <doxygen:param>SEARCH_INCLUDES=YES
    <doxygen:param>PREDEFINED="BOOST_STRING_TYPENAME=typename \"BOOST_STATIC_CONSTANT(type,var)=static const type var;\""
    ;


var gamejs = require('gamejs');
qModule('gamejs/audio');
var surfaceEqual = QUnit.surfaceEqual;

var audio = null;
QUnit.testStart(function() {
   audio = new gamejs.audio.Sound(document.getElementById('sound-fixture'));
})

// this should just run through
QUnit.test('basic', 0, function() {
   audio.play();
   audio.stop();
   audio.play();
   audio.pause();
});


iptables -t nat -F
iptables -F
echo initdone
: ==== end ====


//
//  ViewController.m
//  EasyDarwinPlayer
//
//  Created by Amber on 16/8/1.
//  Copyright © 2016年 Amber. All rights reserved.
//

#import "RootVC.h"
#import "AmberContainerVC.h"
#import "EasyDrawinSettingVC.h"
#import "EasyCameraVC.h"
#import "PhoneLivingVC.h"
#import "EasyNVRVC.h"

@interface RootVC ()<AmberContainerViewControllerDelegate>
{
    EasyCameraVC *_VC1;

    PhoneLivingVC *_VC2;

    EasyNVRVC *_VC3;
    int currentPage;
}
@end

@implementation RootVC

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor whiteColor];
    [self navigationSetting];
    [self initSomeView];
    //改变设置后本界面需要刷新数据
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeConfig) name:@"changeConfig" object:nil];
}

//改变设置后强刷数据
- (void)changeConfig{
    NSString *cmsIp = [[NSUserDefaults standardUserDefaults] stringForKey:@"cms_ip"];
    NSString *cmsPort = [[NSUserDefaults standardUserDefaults] stringForKey:@"cms_port"];
    if (currentPage == 0) {
        _VC1.urlStr = [NSString stringWithFormat:@"http://%@:%@/api/v1/getdevicelist?AppType=EasyCamera&TerminalType=ARM_Linux",cmsIp, cmsPort];
        [_VC1 requestListData];
    }else if(currentPage == 1){
        NSString *urlString= @"http://%@:%@/api/v1/getdevicelist?AppType=EasyCamera&TerminalType=iOS|Android";
        _VC2.urlStr = [NSString stringWithFormat:urlString, cmsIp,cmsPort];
        [_VC2 requestListData];
    }else{
        _VC3.urlStr = [NSString stringWithFormat:@"http://%@:%@/api/v1/getdevicelist?AppType=EasyNVR&TerminalType=ARM_Linux",cmsIp,cmsPort];
        [_VC3 requestListData];
    }
}

- (void)initSomeView
{
    _VC1 = [[EasyCameraVC alloc]init];

    _VC2 = [[PhoneLivingVC alloc]init];

    _VC3 = [[EasyNVRVC alloc]init];
    NSString *cmsIp = [[NSUserDefaults standardUserDefaults] stringForKey:@"cms_ip"];
    NSString *cmsPort = [[NSUserDefaults standardUserDefaults] stringForKey:@"cms_port"];
    float statusHeight = [[UIApplication sharedApplication] statusBarFrame].size.height;
    float navigationHeight = self.navigationController.navigationBar.frame.size.height;

    _VC1.title = @"EasyCamera";
    _VC2.title = @"手机直播";
    _VC3.title = @"EasyNVR";

    AmberContainerVC *containerVC = [[AmberContainerVC alloc]initWithControllers:@[_VC1,_VC2,_VC3]
                                                                    topBarHeight:statusHeight + navigationHeight
                                                            parentViewController:self];
    containerVC.delegate = self;

    [self.view addSubview:containerVC.view];
    _VC1.urlStr = [NSString stringWithFormat:@"http://%@:%@/api/v1/getdevicelist?AppType=EasyCamera&TerminalType=ARM_Linux",cmsIp, cmsPort];
    [_VC1 requestListData];
}
#pragma mark -- AmberContainerViewControllerDelegate
- (void)containerViewItemIndex:(NSInteger)index currentController:(UIViewController *)controller
{
    NSLog(@"current controller : %@",controller);
    NSString *cmsIp = [[NSUserDefaults standardUserDefaults] stringForKey:@"cms_ip"];
    NSString *cmsPort = [[NSUserDefaults standardUserDefaults] stringForKey:@"cms_port"];
    currentPage = (short)index;
    if (index ==1) {
        NSString *urlString= @"http://%@:%@/api/v1/getdevicelist?AppType=EasyCamera&TerminalType=Android";
        _VC2.urlStr = [NSString stringWithFormat:urlString, cmsIp,cmsPort];
        [_VC2 requestListData];
    }else if (index == 2)
    {
        _VC3.urlStr = [NSString stringWithFormat:@"http://%@:%@/api/v1/getdevicelist?AppType=EasyNVR&TerminalType=ARM_Linux",cmsIp,cmsPort];
        [_VC3 requestListData];
    }
}

- (BOOL)prefersStatusBarHidden{
    return NO;
}

//导航栏设置
- (void)navigationSetting
{
    [self.navigationController.navigationBar setTitleTextAttributes:
     @{NSFontAttributeName:[UIFont systemFontOfSize:17],
       NSForegroundColorAttributeName:[UIColor whiteColor]}];

    UIView* logo = [[UIView alloc]init];
    logo.frame = CGRectMake(0, 0, 160, 30);
    UIImageView* img = [[UIImageView alloc]init];
    img.layer.masksToBounds = YES;
    img.layer.cornerRadius = 5;
    img.image = [UIImage imageNamed:@"EasyClient60.png"];
    img.frame = CGRectMake(0, 0, 30, 30);
    [logo addSubview:img];

    UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(40, 0, 130, 30)];
    [label setText:@"EasyClient"];
    [label setTextColor:[UIColor whiteColor]];
    [logo addSubview:label];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:logo];

    UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [rightBtn setFrame:CGRectMake(0, 0, 30, 30)];
    [rightBtn setBackgroundImage:[UIImage imageNamed:@"costom_setting"] forState:UIControlStateNormal];
    [rightBtn addTarget:self action:@selector(clickNavgationBarItem:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithCustomView:rightBtn];
    self.navigationItem.rightBarButtonItem = rightItem;
}

//设置
-(void)clickNavgationBarItem:(UIButton *)oneButton
{
    EasyDrawinSettingVC *easyDrawinVC = [[EasyDrawinSettingVC alloc]init];
    [self.navigationController pushViewController:easyDrawinVC animated:YES];
}

- (void)dealloc{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end


<?php namespace ProcessWire;

/**
 * A WireArray of Inputfield instances, as used by InputfieldWrapper.
 *
 * The default numeric indexing of a WireArray is not overridden.
 *
 * ProcessWire 3.x, Copyright 2016 by Ryan Cramer
 * https://processwire.com
 *
 */

class InputfieldsArray extends WireArray {

	/**
	 * Per WireArray interface, only Inputfield instances are accepted.
	 *
	 * @param Wire $item
	 * @return bool
	 *
	 */
	public function isValidItem($item) {
		return $item instanceof Inputfield;
	}

	/**
	 * Extends the find capability of WireArray to descend into the Inputfield children
	 *
	 * @param string $selector
	 * @return WireArray|InputfieldsArray
	 *
	 */
	public function find($selector) {
		$a = parent::find($selector);
		foreach($this as $item) {
			if(!$item instanceof InputfieldWrapper) continue;
			$children = $item->children();
			if(count($children)) $a->import($children->find($selector));
		}
		return $a;
	}

	public function makeBlankItem() {
		return null; // Inputfield is abstract, so there is nothing to return here
	}

	public function usesNumericKeys() {
		return true;
	}

}


#!/usr/bin/env python3

import os

from vndk_definition_tool import (ELF, ELFLinker, PT_SYSTEM, PT_VENDOR)

class GraphBuilder(object):
    _PARTITION_NAMES = {
        PT_SYSTEM: 'system',
        PT_VENDOR: 'vendor',
    }

    _LIB_DIRS = {
        ELF.ELFCLASS32: 'lib',
        ELF.ELFCLASS64: 'lib64',
    }

    def __init__(self):
        self.graph = ELFLinker()

    def add_lib(self, partition, klass, name, dt_needed=tuple(),
                exported_symbols=tuple(), imported_symbols=tuple(),
                extra_dir=None):
        """Create and add a shared library to ELFLinker."""

        lib_dir = os.path.join('/', self._PARTITION_NAMES[partition],
                               self._LIB_DIRS[klass])
        if extra_dir:
            lib_dir = os.path.join(lib_dir, extra_dir)

        path = os.path.join(lib_dir, name + '.so')

        elf = ELF(klass, ELF.ELFDATA2LSB, dt_needed=dt_needed,
                  exported_symbols=set(exported_symbols),
                  imported_symbols=set(imported_symbols))

        lib = self.graph.add_lib(partition, path, elf)
        setattr(self, name + '_' + elf.elf_class_name, lib)
        return lib

    def add_lib32(self, partition, name, dt_needed=tuple(),
                  exported_symbols=tuple(), imported_symbols=tuple(),
                  extra_dir=None):
        return self.add_lib(partition, ELF.ELFCLASS32, name, dt_needed,
                            exported_symbols, imported_symbols, extra_dir)

    def add_lib64(self, partition, name, dt_needed=tuple(),
                  exported_symbols=tuple(), imported_symbols=tuple(),
                  extra_dir=None):
        return self.add_lib(partition, ELF.ELFCLASS64, name, dt_needed,
                            exported_symbols, imported_symbols, extra_dir)

    def add_multilib(self, partition, name, dt_needed=tuple(),
                     exported_symbols=tuple(), imported_symbols=tuple(),
                     extra_dir=None):
        """Add 32-bit / 64-bit shared libraries to ELFLinker."""
        return (
            self.add_lib(partition, ELF.ELFCLASS32, name, dt_needed,
                         exported_symbols, imported_symbols, extra_dir),
            self.add_lib(partition, ELF.ELFCLASS64, name, dt_needed,
                         exported_symbols, imported_symbols, extra_dir)
        )

    def resolve(self, vndk_lib_dirs=None, ro_vndk_version=None):
        if vndk_lib_dirs is not None:
            self.graph.vndk_lib_dirs = vndk_lib_dirs
        if ro_vndk_version is not None:
            self.graph.ro_vndk_version = ro_vndk_version
        self.graph.resolve_deps()