#ifndef EMSG_H
#define EMSG_H
#include <stdarg.h>
void echan_set(int e);
void trace_addmsg(char *msg);
void trace_show(void);
char *get_recent(void);
int tmsg(const char * arg_list, ...);
/*@printflike@*/ void status_recent(char * arg_list, ...);

/*@printflike@*/ void sucklog(char * arg_list, ...);
/*@printflike@*/ int wmsgf(char * arg_list, ...);
/*@printflike@*/ int imsgf(char * arg_list, ...);
/*@printflike@*/ void fimsg(char * arg_list, ...);
/*@printflike@*/ void inmsg(char * arg_list, ...);
/*@printflike@*/ void outmsg(char * arg_list, ...);
/*@printflike@*/ int emsg(char *arg_list, ...);
/*@printflike@*/ int wmsg(char *arg_list, ...);
/*@printflike@*/ int imsg(const char *arg_list, ...);
/*@printflike@*/ int filemsg(char *arg_list, ...);
/*@printflike@*/ int dmsg(char *arg_list, ...);
void emsg_flush(void);
void emsg_init(void);
void emsg_rotate_file(char *fname);
void emsg_rotate(void);
char *msg_reason(void);
void msg_show(char *s);

enum {D_ERROR, D_WARN, D_INFO, D_DEBUG, D_FLUSH, D_IN, D_OUT};

#ifdef IS_EMSG
        char *debug_names[]={"error", "warn", "info", "debug", "flush","in","out"};
        char debug_str[1000];
        int debug_lvl;
#else
        extern char *debug_names[];
        extern char debug_str[];
        extern int debug_lvl;
#endif

void log_str(int lvl, char *s);
void log_flush_lvl(int lvl);

void keeplog(char * arg_list, ...);

void msg_from(char *ipname);
void msg_id(char *mid);
void msg_group(char *group);
/*@printflike@*/ void msg_reject(char *arg_list, ...);
/*@printflike@*/ void msg_ok(char *arg_list, ...);
void msg_setlen(int len);

int log_spawn(const char * arg_list, ...);

#endif
