1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
#ifndef _COMMON_H_
#define _COMMON_H_
/*
* common.h
*
* a few simple things to make life easier
*
*/
#define MSTRUCT(x) ((x*)malloc(sizeof(x)))
typedef struct wuzzah_config {
const char *progname;
char *infile;
const char *buddy_msg;
const char *status_msg;
short write_users;
int sleep_interval;
char *whoami;
short no_newline;
const char *eventcmd;
short run_once;
short process_current;
short noloadfile;
char *extrabuddies;
short all_users;
} wuzzah_config_t;
extern wuzzah_config_t g_config;
extern int errno;
void process_args(int ac, char *av[], wuzzah_config_t *conf);
int string_to_argv(const char *str, char **av[]);
void bail(char *reason, int exitval);
#endif
|