#if !defined(LSOF_TEST_H)
#define LSOF_TEST_H 1
# if defined(__STDC__)
#define _PROTOTYPE(function, params) function params
# else
#define _PROTOTYPE(function, params) function()
# endif
# if defined(__GNUC__) && !(__GNUC__<2 || (__GNUC__==2 && __GNUC_MINOR__<7))
#define exiting __attribute__((__noreturn__))
# else
#define exiting
# endif
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#define USE_GETCWD
#define USE_LSOF_C_OPT
#undef USE_LSOF_X_OPT
# if defined(LT_DIAL_aix)
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/access.h>
#undef USE_LSOF_C_OPT
#define USE_LSOF_X_OPT
# endif
# if defined(LT_DIAL_bsdi)
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
# endif
# if defined(LT_DIAL_darwin)
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
#undef USE_LSOF_C_OPT
# endif
# if defined(LT_DIAL_du)
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
# if LT_VERS<50000
#define snprintf snpf
# endif
# endif
# if defined(LT_DIAL_freebsd)
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
# endif
# if defined(LT_DIAL_linux)
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
#undef USE_LSOF_C_OPT
# endif
# if defined(LT_DIAL_hpux)
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
# endif
# if defined(LT_DIAL_netbsd)
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
# endif
# if defined(LT_DIAL_openbsd)
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
# endif
# if defined(LT_DIAL_ou)
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
# endif
# if defined(LT_DIAL_osr)
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
# endif
# if defined(LT_DIAL_ns)
#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
#include <sys/wait.h>
typedef int pid_t;
#define snprintf snpf
#undef USE_GETCWD
# endif
# if defined(LT_DIAL_solaris)
#include <fcntl.h>
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
#include <sys/wait.h>
# if defined(LT_VPATH)
#undef USE_LSOF_C_OPT
#endif
# endif
# if defined(LT_DIAL_uw)
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
# endif
#define LT_DONT_DO_TEST "this test does not run on this dialect."
#define LT_DEF_LSOF_PATH "../lsof"
# if !defined(MAXPATHLEN)
#define MAXPATHLEN 1024
# endif
typedef struct LTdev {
unsigned int maj;
unsigned int min;
unsigned int unit;
} LTdev_t;
typedef struct LTfldo {
char ft;
char *v;
} LTfldo_t;
#define LT_FLDO_ALLOC 16
extern int LsofFd;
extern FILE *LsofFs;
extern char *LsofPath;
extern pid_t LsofPid;
extern int LTopt_h;
extern char *LTopt_p;
extern int MsgStat;
extern int errno;
_PROTOTYPE(extern char *CanRdKmem,(void));
_PROTOTYPE(extern char *ConvStatDev,(dev_t *dev, LTdev_t *ldev));
_PROTOTYPE(extern char *ConvLsofDev,(char *dev, LTdev_t *ldev));
_PROTOTYPE(extern char *ExecLsof,(char **opt));
_PROTOTYPE(extern char *IsLsofExec,(void));
_PROTOTYPE(extern void LTlibClean,(void));
_PROTOTYPE(extern char *MkStrCpy,(char *src, int *len));
_PROTOTYPE(extern LTfldo_t *RdFrLsof,(int *nf, char **em));
_PROTOTYPE(extern void PrtMsg,(char *mp, char *pn));
_PROTOTYPE(extern void PrtMsgX,(char *mp, char *pn, void (*f)(), int xv));
_PROTOTYPE(extern int ScanArg,(int ac, char *av[], char *opt, char *pn));
_PROTOTYPE(extern void StopLsof,(void));
#endif