#ifndef WH_CLIENT_H_c73250c3_ #define WH_CLIENT_H_c73250c3_ #include #include typedef struct wstr WSTR; typedef struct scip SCIP; typedef struct server SERVER; typedef struct cstr CSTR; typedef struct ohline OHLINE; #include "proto.h" typedef unsigned long long int TSTAMP; #define TS_SECONDS ((TSTAMP)1000000ULL) // # of tv_usec per tv_sec struct cstr { const char *text; int len; } ; #define NO_CSTR ((CSTR){.text=0,.len=0}) struct wstr { char *text; int len; } ; #define NO_WSTR ((WSTR){.text=0,.len=0}) struct server { SERVER *link; char *stext; WSTR tag; char *host; char *port; WSTR nick; int nchan; char **chans; int s; char *ctext; AIO_OQ oq; int pid; int bid; WSTR servname; SCIP *scip; TSTAMP lastping; TSTAMP lastpong; int pingid; int reconn_delay; const PROTOOPS *ops; void *priv; } ; // Flags for line types' flags fields #define OHLF_ACTION 0x00000001 extern int debug; extern int debugn; extern char *login; extern char *fullname; extern char *pass; extern OHLINE *hlprintf_srv(SERVER *, const char *, ...) __attribute__((__format__(__printf__,2,3))); extern TSTAMP ts_now(void); extern OHLINE *ohl_append_server(SERVER *, const char *, int, const char *, int); extern WSTR wstr_copy_cstr(CSTR); extern void rerender_hist(void); extern CSTR wstr_as_cstr(WSTR); extern FILE *hline_open(SERVER *); extern void record_joined(SERVER *, const char *, int); extern void record_parted(SERVER *, const char *, int); extern OHLINE *ohl_append_private(SERVER *, const char *, int, const char *, int, const char *, int, unsigned int ); extern OHLINE *ohl_append_channel(SERVER *, const char *, int, const char *, int, const char *, int, const char *, int, unsigned int); extern void print_timeunits(FILE *, unsigned int); extern void print_unixtime(FILE *, time_t); extern char *blk_to_nt(const char *, int); extern WSTR nt_to_wstr(const char *); extern OHLINE *hlprintf_int(const char *, ...) __attribute__((__format__(__printf__,1,2))); extern void server_fatal(SERVER *); extern void *ohl_get_proto_priv(OHLINE *); extern void ohl_set_proto_priv(OHLINE *, void *, void (*)(void *)); extern void ohl_set_deleted(OHLINE *, int); extern int ohlines_scan(int (*)(OHLINE *, void *), void *); extern void set_modeline_note(const char *); extern int ohl_isset_deleted(OHLINE *); extern int ohl_isset_hidden(OHLINE *); #endif