#include "notify.h"

#define FLAG_EVERCONNECTED 0x00000001
#define FLAG_AWAY          0x00000002

#define ever_connected(_xx) (_xx->flags & FLAG_EVERCONNECTED)
#define set_ever_connected(_xx) (_xx->flags |= FLAG_EVERCONNECTED)

#define is_away(_xx) (_xx->flags & FLAG_AWAY)
#define clear_away(_xx) { if (is_away(_xx)) _xx->flags -= FLAG_AWAY; }
#define set_away(_xx) _xx->flags |= FLAG_AWAY

struct server {
  unsigned short iochan, flags;
  unsigned event_flag;
  struct iosb_type iosb;
  char server_name[40];
  int port;
  char *redirect;
  char *last, buffer[MAXBRK];
  char incoming[8 * MAXBRK];
  int processing, modified_in_processing;
  int incoming_free, incoming_start_free, modified;
  int connected, welcomed, need_requeue;
  char *nick, *pass;
  chan_ptr chan_list;
  char *to_join;
  notify_ptr notify_list;
  server_ptr next;
};

