#ifndef ITYPES
#define ITYPES

struct list_structs {
  int min, max, public, private;
  int chop_only, ircop_only;
  char *str;
};

typedef int (*ROUTINE)(short);
struct itemlistcell {
  unsigned short buffer_length;
  unsigned short item_code;
  unsigned buffer_addr;
  unsigned return_addr;
};

struct iosb_type {
  unsigned short status;
  unsigned short length;
  short other[2];
};

typedef struct assign *assign_ptr;
struct assign {
  char *word;
  char *value;
  assign_ptr sub, next;
};

struct in_addr {
  union {
    struct { unsigned char s_b1, s_b2, s_b3, s_b4; } S_un_b;
    unsigned long S_addr;
  } S_un;
#define s_addr S_un.S_addr
};

typedef struct sockaddr_in_type SIN;
struct sockaddr_in_type {
  unsigned short sin_family;
  unsigned short sin_port;
  unsigned long sin_address;
  unsigned long sin_zero[2];
};

struct sockaddr {
  unsigned short sa_family;
  char sa_data[14];
};

/* ------------------------------------------------------------------------ */
typedef struct alias_struct *alias_ptr;
typedef struct {
  alias_ptr list;
} alias_header;

/* Holds all of the mode specific data */
typedef struct mm_data mm_data_type;
struct mm_data {
  alias_header alias_list;
  alias_header assign_list;
};

/* Once a mode is placed in the master list, it should never be deleted since
   major_mode_list's reference these list entries */
typedef struct mm_struct *major_mode;
struct mm_struct {
  char *major_mode_name;
  mm_data_type mode_data;
  major_mode next;
};

/* The mode list for a given win_mode */
typedef struct mm_list_struct *win_mode_ptr;
struct mm_list_struct {
  major_mode this_mode;
  win_mode_ptr next;
};

/* This is the list type that gets assigned to a window */
typedef struct win_mode_master_list_struct *win_mode;
struct win_mode_master_list_struct {
  char *overall_name;
  major_mode default_mode;
  win_mode_ptr modes;
  win_mode next;
};

typedef struct chan_node *chan_ptr;
typedef struct server *server_ptr;
typedef struct awin *win_ptr;

#endif
