
#ifdef __cplusplus
extern "C" {
#endif

/*x  ---------------- Public interface ---------------- */

int emsg_open(char *logfile);
/*	Opens the log file, this should be called before emsg,imsg,dmsg, */
void emsg_close(void);
/*	Closes the log file*/
int emsg(const char * arg_list, ...);
int imsg(const char * arg_list, ...);
int emsg_set_disable(int t);
int dmsg(const char * arg_list, ...);
/*	These are the logging functions, currently only imsg and emsg are shown
	in the log files
Bugs/todo:
	Add rotating of log file, add mechanism to set the loglevel to
	debug or error.
*/

/* ---------------- Private ------------------------------------*/
void emsg_do(int lvl, char *line);
void emsg_close(void);
char *emsg_fname(void);
void emsg_flush(void);
//void pmsg(char * arg_list, ...);
void emsg_setdebug(int x);
int emsg_isdebug(void);
char *elib_emsg_time(char *tstr);
int emsg_setprint(int x);
void emsg_showthread(int x);
void emsg_set_flush(int x);
int emsg_set_max(int x);
char *emsg_time(char *tstr);

int emsg_set_lf_terminate(int t);
int emsg_set_log_lvl(int t);
enum {D_ERROR,D_INFO,D_DEBUG};

void emsg_mutex_init(int enable);


#ifdef __cplusplus
}
#endif
