#ifndef SUDOERS_IOLOG_H
#define SUDOERS_IOLOG_H
#ifdef HAVE_ZLIB_H
# include <zlib.h>
#endif
#define IO_EVENT_STDIN 0
#define IO_EVENT_STDOUT 1
#define IO_EVENT_STDERR 2
#define IO_EVENT_TTYIN 3
#define IO_EVENT_TTYOUT 4
#define IO_EVENT_WINSIZE 5
#define IO_EVENT_TTYOUT_1_8_7 6
#define IO_EVENT_SUSPEND 7
#define IO_EVENT_COUNT 8
#define SESSID_MAX 2176782336U
union io_fd {
FILE *f;
#ifdef HAVE_ZLIB_H
gzFile g;
#endif
void *v;
};
struct log_info {
char *cwd;
char *user;
char *runas_user;
char *runas_group;
char *tty;
char *cmd;
time_t tstamp;
int rows;
int cols;
};
struct timing_closure {
const char *decimal;
struct timespec *max_delay;
union io_fd fd;
int event;
union {
struct {
int rows;
int cols;
} winsize;
size_t nbytes; int signo;
} u;
};
bool parse_timing(const char *buf, struct timespec *delay, struct timing_closure *timing);
char *parse_delay(const char *cp, struct timespec *delay, const char *decimal_point);
struct log_info *parse_logfile(const char *logfile);
void free_log_info(struct log_info *li);
void adjust_delay(struct timespec *delay, struct timespec *max_delay, double scale_factor);
#endif