#include <utmpx.h>
static struct utmpx utdummy;
#define PACCT "/var/adm/pacct"
#define HOLFILE "/etc/acct/holidays"
#define NHOLIDAYS 200
#define NSYS 200
#define NFILE 100
#ifdef uts
#define CSIZE 10001
#define MAXUSERS 5003
#define A_SSIZE 60001
#define A_TSIZE 10001
#define A_USIZE 20001
#else
#define CSIZE 5001
#define MAXUSERS 3001
#define A_SSIZE 6001
#define A_TSIZE 1001
#define A_USIZE 2001
#endif
#define TSIZE1 100
#define USIZE1 100
#define MAXIGN 10
#define UNUSED -1
#define FAIL -1
#define SUCCEED 0
#define TRUE 1
#define FALSE 0
#define PRIME 0
#define NONPRIME 1
#define MEANSIZE 01
#define KCOREMIN 02
#define HOGFACTOR 04
#define SEPTIME 010
#define CPUFACTOR 020
#define IORW 040
#define ROOT 0
#define ERR (-1)
#define OK 0
#define NOGOOD 1
#define VALID 0
#define INVALID 1
#define MAX_SRCH_DEPTH 4
#define LSZ (MAX_SRCH_DEPTH * sizeof (utdummy.ut_line))
#define MAX_DEV_PATH (LSZ + 5)
#define NSZ (sizeof (utdummy.ut_name))
#define LINESZ (sizeof (utdummy.ut_line))
#define OUTPUT_NSZ 8
#define OUTPUT_LSZ 12
#define MYKIND(flag) ((flag & ACCTF) == 0)
#define SU(flag) ((flag & ASU) == ASU)
#define TOTAL(a) (a[PRIME] + a[NONPRIME])
#define okay(time) ((time/100>=0) && (time/100<=24) \
&& (time%100>=0) && (time%100<60))
#define pf(dble) fprintf(stdout, " %7.2lf", dble)
#define ps(s) fprintf(stdout, "%8.8s", s)
#define diag(string) fprintf(stderr, "\t%s\n", string)
#define DATE_FMT "%a %b %e %H:%M:%S %Y\n"
#define DATE_FMT1 " %H:%M:%S"
#define CBEMPTY (ctab[i].ct_sess == 0)
#define UBEMPTY (ub[i].ut_pc == 0 && ub[i].ut_cpu[0] == 0 && \
ub[i].ut_cpu[1] == 0 && ub[i].ut_kcore[0] ==0 && ub[i].ut_kcore[1] == 0)
#define EQN(s1, s2) (strncmp(s1, s2, sizeof(s1)) == 0)
#define CPYN(s1, s2) (void) strncpy(s1, s2 ? s2 : "", sizeof(s1))
#define SECSINDAY 86400L
#define SECS(tics) ((double) tics)/HZ
#define MINS(secs) ((double) secs)/60
#define MINT(tics) ((double) tics)/(60*HZ)
#include <unistd.h>
#if UTS
#define KCORE(clicks) ((double) BSIZE * (clicks/1024.0))
#else
#define KCORE(clicks) ((double) (sysconf(_SC_PAGESIZE) >> 10) *clicks)
#endif
struct tacct {
uid_t ta_uid;
char ta_name[NSZ];
float ta_cpu[2];
float ta_kcore[2];
float ta_con[2];
float ta_du;
long ta_pc;
unsigned short ta_sc;
unsigned short ta_dc;
unsigned short ta_fee;
};
struct ctmp {
dev_t ct_tty;
uid_t ct_uid;
char ct_name[NSZ];
long ct_con[2];
time_t ct_start;
};
struct ptmp {
uid_t pt_uid;
char pt_name[NSZ];
ulong_t pt_cpu[2];
unsigned pt_mem;
};