[7d4fbcd] | 1 | #ifndef INC_OWL_H |
---|
| 2 | #define INC_OWL_H |
---|
| 3 | |
---|
| 4 | #include <curses.h> |
---|
| 5 | #include <sys/param.h> |
---|
| 6 | #include <EXTERN.h> |
---|
| 7 | #include <netdb.h> |
---|
| 8 | #include <regex.h> |
---|
[d09e5a1] | 9 | #include <time.h> |
---|
[c9e72d1] | 10 | #include <signal.h> |
---|
[d09e5a1] | 11 | #include <libfaim/aim.h> |
---|
[7d4fbcd] | 12 | #include "config.h" |
---|
[be0a79f] | 13 | #ifdef HAVE_LIBZEPHYR |
---|
[373b7e7] | 14 | #include <zephyr/zephyr.h> |
---|
[be0a79f] | 15 | #endif |
---|
[e6449bc] | 16 | #ifdef HAVE_COM_ERR_H |
---|
| 17 | #include <com_err.h> |
---|
| 18 | #endif |
---|
| 19 | |
---|
[1aee7d9] | 20 | static const char owl_h_fileIdent[] = "$Id$"; |
---|
| 21 | |
---|
[c9e72d1] | 22 | #define OWL_VERSION 2.0.13-pre-2 |
---|
| 23 | #define OWL_VERSION_STRING "2.0.13-pre-2" |
---|
[2a2bb60] | 24 | |
---|
| 25 | /* Feature that is being tested to redirect stderr through a pipe. |
---|
| 26 | * There may still be some portability problems with this. */ |
---|
| 27 | #define OWL_STDERR_REDIR 1 |
---|
[7d4fbcd] | 28 | |
---|
| 29 | #define OWL_DEBUG 0 |
---|
| 30 | #define OWL_DEBUG_FILE "/var/tmp/owldebug" |
---|
| 31 | |
---|
[bd3f232] | 32 | #define OWL_CONFIG_DIR "/.owl" /* this is relative to the user's home directory */ |
---|
[38cf544c] | 33 | #define OWL_STARTUP_FILE "/.owl/startup" /* this is relative to the user's home directory */ |
---|
| 34 | |
---|
[7d4fbcd] | 35 | #define OWL_FMTEXT_ATTR_NONE 0 |
---|
| 36 | #define OWL_FMTEXT_ATTR_BOLD 1 |
---|
| 37 | #define OWL_FMTEXT_ATTR_REVERSE 2 |
---|
| 38 | #define OWL_FMTEXT_ATTR_UNDERLINE 4 |
---|
| 39 | |
---|
| 40 | #define OWL_COLOR_BLACK 0 |
---|
| 41 | #define OWL_COLOR_RED 1 |
---|
| 42 | #define OWL_COLOR_GREEN 2 |
---|
| 43 | #define OWL_COLOR_YELLOW 3 |
---|
| 44 | #define OWL_COLOR_BLUE 4 |
---|
| 45 | #define OWL_COLOR_MAGENTA 5 |
---|
| 46 | #define OWL_COLOR_CYAN 6 |
---|
| 47 | #define OWL_COLOR_WHITE 7 |
---|
| 48 | #define OWL_COLOR_DEFAULT 8 |
---|
| 49 | |
---|
| 50 | #define OWL_EDITWIN_STYLE_MULTILINE 0 |
---|
| 51 | #define OWL_EDITWIN_STYLE_ONELINE 1 |
---|
| 52 | |
---|
[f4d0975] | 53 | #define OWL_PROTOCOL_ZEPHYR 0 |
---|
| 54 | #define OWL_PROTOCOL_AIM 1 |
---|
| 55 | #define OWL_PROTOCOL_JABBER 2 |
---|
| 56 | #define OWL_PROTOCOL_ICQ 3 |
---|
| 57 | #define OWL_PROTOCOL_YAHOO 4 |
---|
| 58 | #define OWL_PROTOCOL_MSN 5 |
---|
| 59 | |
---|
[4b464a4] | 60 | #define OWL_MESSAGE_TYPE_ADMIN 0 |
---|
| 61 | #define OWL_MESSAGE_TYPE_GENERIC 1 |
---|
| 62 | #define OWL_MESSAGE_TYPE_ZEPHYR 2 |
---|
[d0d65df] | 63 | #define OWL_MESSAGE_TYPE_AIM 3 |
---|
| 64 | #define OWL_MESSAGE_TYPE_JABBER 4 |
---|
| 65 | #define OWL_MESSAGE_TYPE_ICQ 5 |
---|
| 66 | #define OWL_MESSAGE_TYPE_YAHOO 6 |
---|
| 67 | #define OWL_MESSAGE_TYPE_MSN 7 |
---|
[37eab7f] | 68 | #define OWL_MESSAGE_TYPE_LOOPBACK 8 |
---|
[7d4fbcd] | 69 | |
---|
[4b464a4] | 70 | #define OWL_MESSAGE_DIRECTION_NONE 0 |
---|
| 71 | #define OWL_MESSAGE_DIRECTION_IN 1 |
---|
| 72 | #define OWL_MESSAGE_DIRECTION_OUT 2 |
---|
[7d4fbcd] | 73 | |
---|
| 74 | #define OWL_DIRECTION_NONE 0 |
---|
| 75 | #define OWL_DIRECTION_DOWNWARDS 1 |
---|
| 76 | #define OWL_DIRECTION_UPWARDS 2 |
---|
| 77 | |
---|
[12c35df] | 78 | #define OWL_LOGGING_DIRECTION_BOTH 0 |
---|
| 79 | #define OWL_LOGGING_DIRECTION_IN 1 |
---|
| 80 | #define OWL_LOGGING_DIRECTION_OUT 2 |
---|
| 81 | |
---|
[88736cb] | 82 | #define OWL_SCROLLMODE_NORMAL 0 |
---|
| 83 | #define OWL_SCROLLMODE_TOP 1 |
---|
| 84 | #define OWL_SCROLLMODE_NEARTOP 2 |
---|
| 85 | #define OWL_SCROLLMODE_CENTER 3 |
---|
| 86 | #define OWL_SCROLLMODE_PAGED 4 |
---|
[aa2f33b3] | 87 | #define OWL_SCROLLMODE_PAGEDCENTER 5 |
---|
| 88 | |
---|
[bd3f232] | 89 | #define OWL_STYLE_TYPE_INTERNAL 0 |
---|
| 90 | #define OWL_STYLE_TYPE_PERL 1 |
---|
| 91 | |
---|
[7d4fbcd] | 92 | #define OWL_TAB 3 /* This *HAS* to be the size of TABSTR below */ |
---|
| 93 | #define OWL_TABSTR " " |
---|
| 94 | #define OWL_MSGTAB 7 |
---|
| 95 | #define OWL_TYPWIN_SIZE 8 |
---|
| 96 | #define OWL_HISTORYSIZE 50 |
---|
| 97 | |
---|
| 98 | /* Indicate current state, as well as what is allowed */ |
---|
| 99 | #define OWL_CTX_ANY 0xffff |
---|
| 100 | /* Only one of these may be active at a time... */ |
---|
| 101 | #define OWL_CTX_MODE_BITS 0x000f |
---|
| 102 | #define OWL_CTX_STARTUP 0x0001 |
---|
| 103 | #define OWL_CTX_READCONFIG 0x0002 |
---|
| 104 | #define OWL_CTX_INTERACTIVE 0x0004 |
---|
| 105 | /* Only one of these may be active at a time... */ |
---|
| 106 | #define OWL_CTX_ACTIVE_BITS 0xfff0 |
---|
| 107 | #define OWL_CTX_POPWIN 0x00f0 |
---|
| 108 | #define OWL_CTX_POPLESS 0x0010 |
---|
| 109 | #define OWL_CTX_RECWIN 0x0f00 |
---|
| 110 | #define OWL_CTX_RECV 0x0100 |
---|
| 111 | #define OWL_CTX_TYPWIN 0xf000 |
---|
[cf83b7a] | 112 | #define OWL_CTX_EDIT 0x7000 |
---|
[7d4fbcd] | 113 | #define OWL_CTX_EDITLINE 0x1000 |
---|
| 114 | #define OWL_CTX_EDITMULTI 0x2000 |
---|
[cf83b7a] | 115 | #define OWL_CTX_EDITRESPONSE 0x4000 |
---|
[7d4fbcd] | 116 | |
---|
| 117 | #define OWL_USERCLUE_NONE 0 |
---|
| 118 | #define OWL_USERCLUE_CLASSES 1 |
---|
| 119 | #define OWL_USERCLUE_FOOBAR 2 |
---|
| 120 | #define OWL_USERCLUE_BAZ 4 |
---|
| 121 | |
---|
| 122 | #define OWL_WEBBROWSER_NONE 0 |
---|
| 123 | #define OWL_WEBBROWSER_NETSCAPE 1 |
---|
| 124 | #define OWL_WEBBROWSER_GALEON 2 |
---|
[ae9e6be] | 125 | #define OWL_WEBBROWSER_OPERA 3 |
---|
[7d4fbcd] | 126 | |
---|
| 127 | #define OWL_VARIABLE_OTHER 0 |
---|
| 128 | #define OWL_VARIABLE_INT 1 |
---|
| 129 | #define OWL_VARIABLE_BOOL 2 |
---|
| 130 | #define OWL_VARIABLE_STRING 3 |
---|
| 131 | |
---|
| 132 | #define OWL_FILTER_MAX_DEPTH 300 |
---|
| 133 | |
---|
[4b464a4] | 134 | #define OWL_KEYMAP_MAXSTACK 20 |
---|
[7d4fbcd] | 135 | |
---|
[4b464a4] | 136 | #define OWL_KEYBINDING_COMMAND 1 /* command string */ |
---|
| 137 | #define OWL_KEYBINDING_FUNCTION 2 /* function taking no args */ |
---|
[7d4fbcd] | 138 | |
---|
[4b464a4] | 139 | #define OWL_DEFAULT_ZAWAYMSG "I'm sorry, but I am currently away from the terminal and am\nnot able to receive your message.\n" |
---|
[7d4fbcd] | 140 | |
---|
[4b464a4] | 141 | #define OWL_INCLUDE_REG_TESTS 1 /* whether to build in regression tests */ |
---|
[7d4fbcd] | 142 | |
---|
[1c7a4e0] | 143 | #define OWL_CMD_ALIAS_SUMMARY_PREFIX "command alias to: " |
---|
[7d4fbcd] | 144 | |
---|
[e7cc1c3] | 145 | #define OWL_WEBZEPHYR_PRINCIPAL "daemon.webzephyr" |
---|
[1d3e925] | 146 | #define OWL_WEBZEPHYR_CLASS "webzephyr" |
---|
| 147 | #define OWL_WEBZEPHYR_OPCODE "webzephyr" |
---|
[e7cc1c3] | 148 | |
---|
[bc08664] | 149 | #define OWL_REGEX_QUOTECHARS "+*.?[]^\\" |
---|
| 150 | #define OWL_REGEX_QUOTEWITH "\\" |
---|
| 151 | |
---|
[0435c7d] | 152 | #if defined(HAVE_DES_STRING_TO_KEY) && defined(HAVE_DES_KEY_SCHED) && defined(HAVE_DES_ECB_ENCRYPT) |
---|
[c86a35c] | 153 | #define OWL_ENABLE_ZCRYPT 1 |
---|
[c269e22] | 154 | #endif |
---|
| 155 | |
---|
[f87c490] | 156 | #define OWL_META(key) ((key)|0200) |
---|
| 157 | /* OWL_CTRL is definied in kepress.c */ |
---|
[7d4fbcd] | 158 | |
---|
| 159 | #define LINE 2048 |
---|
| 160 | |
---|
| 161 | typedef struct _owl_variable { |
---|
| 162 | char *name; |
---|
| 163 | int type; /* OWL_VARIABLE_* */ |
---|
| 164 | void *pval_default; /* for types other and string */ |
---|
| 165 | int ival_default; /* for types int and bool */ |
---|
| 166 | char *validsettings; /* documentation of valid settings */ |
---|
[aa2f33b3] | 167 | char *summary; /* summary of usage */ |
---|
| 168 | char *description; /* detailed description */ |
---|
[7d4fbcd] | 169 | void *val; /* current value */ |
---|
| 170 | int (*validate_fn)(struct _owl_variable *v, void *newval); |
---|
| 171 | /* returns 1 if newval is valid */ |
---|
| 172 | int (*set_fn)(struct _owl_variable *v, void *newval); |
---|
| 173 | /* sets the variable to a value |
---|
| 174 | * of the appropriate type. |
---|
| 175 | * unless documented, this |
---|
| 176 | * should make a copy. |
---|
| 177 | * returns 0 on success. */ |
---|
| 178 | int (*set_fromstring_fn)(struct _owl_variable *v, char *newval); |
---|
| 179 | /* sets the variable to a value |
---|
| 180 | * of the appropriate type. |
---|
| 181 | * unless documented, this |
---|
| 182 | * should make a copy. |
---|
| 183 | * returns 0 on success. */ |
---|
| 184 | void *(*get_fn)(struct _owl_variable *v); |
---|
| 185 | /* returns a reference to the current value. |
---|
| 186 | * WARNING: this approach is hard to make |
---|
| 187 | * thread-safe... */ |
---|
| 188 | int (*get_tostring_fn)(struct _owl_variable *v, |
---|
| 189 | char *buf, int bufsize, void *val); |
---|
| 190 | /* converts val to a string |
---|
| 191 | * and puts into buf */ |
---|
| 192 | void (*free_fn)(struct _owl_variable *v); |
---|
| 193 | /* frees val as needed */ |
---|
| 194 | } owl_variable; |
---|
| 195 | |
---|
| 196 | typedef struct _owl_fmtext { |
---|
| 197 | int textlen; |
---|
| 198 | char *textbuff; |
---|
| 199 | char *fmbuff; |
---|
| 200 | char *colorbuff; |
---|
| 201 | } owl_fmtext; |
---|
| 202 | |
---|
| 203 | typedef struct _owl_list { |
---|
| 204 | int size; |
---|
| 205 | int avail; |
---|
| 206 | void **list; |
---|
| 207 | } owl_list; |
---|
| 208 | |
---|
| 209 | typedef struct _owl_dict_el { |
---|
| 210 | char *k; /* key */ |
---|
| 211 | void *v; /* value */ |
---|
| 212 | } owl_dict_el; |
---|
| 213 | |
---|
| 214 | typedef struct _owl_dict { |
---|
| 215 | int size; |
---|
| 216 | int avail; |
---|
| 217 | owl_dict_el *els; /* invariant: sorted by k */ |
---|
| 218 | } owl_dict; |
---|
| 219 | typedef owl_dict owl_vardict; /* dict of variables */ |
---|
| 220 | typedef owl_dict owl_cmddict; /* dict of commands */ |
---|
| 221 | |
---|
| 222 | typedef struct _owl_context { |
---|
| 223 | int mode; |
---|
| 224 | void *data; /* determined by mode */ |
---|
| 225 | } owl_context; |
---|
| 226 | |
---|
| 227 | typedef struct _owl_cmd { /* command */ |
---|
| 228 | char *name; |
---|
| 229 | |
---|
| 230 | char *summary; /* one line summary of command */ |
---|
| 231 | char *usage; /* usage synopsis */ |
---|
| 232 | char *description; /* long description of command */ |
---|
| 233 | |
---|
| 234 | int validctx; /* bitmask of valid contexts */ |
---|
| 235 | |
---|
| 236 | /* we should probably have a type here that says which of |
---|
| 237 | * the following is valid, and maybe make the below into a union... */ |
---|
| 238 | |
---|
| 239 | /* Only one of these may be non-NULL ... */ |
---|
| 240 | |
---|
| 241 | char *cmd_aliased_to; /* what this command is aliased to... */ |
---|
| 242 | |
---|
| 243 | /* These don't take any context */ |
---|
| 244 | char *(*cmd_args_fn)(int argc, char **argv, char *buff); |
---|
| 245 | /* takes argv and the full command as buff. |
---|
| 246 | * caller must free return value if !NULL */ |
---|
| 247 | void (*cmd_v_fn)(void); /* takes no args */ |
---|
| 248 | void (*cmd_i_fn)(int i); /* takes an int as an arg */ |
---|
| 249 | |
---|
| 250 | /* The following also take the active context if it's valid */ |
---|
| 251 | char *(*cmd_ctxargs_fn)(void *ctx, int argc, char **argv, char *buff); |
---|
| 252 | /* takes argv and the full command as buff. |
---|
| 253 | * caller must free return value if !NULL */ |
---|
| 254 | void (*cmd_ctxv_fn)(void *ctx); /* takes no args */ |
---|
| 255 | void (*cmd_ctxi_fn)(void *ctx, int i); /* takes an int as an arg */ |
---|
| 256 | } owl_cmd; |
---|
| 257 | |
---|
| 258 | |
---|
| 259 | typedef struct _owl_zwrite { |
---|
[ce7db4d] | 260 | char *class; |
---|
| 261 | char *inst; |
---|
| 262 | char *realm; |
---|
| 263 | char *opcode; |
---|
[56330ff] | 264 | char *zsig; |
---|
[ce7db4d] | 265 | char *message; |
---|
[7d4fbcd] | 266 | owl_list recips; |
---|
| 267 | int cc; |
---|
| 268 | int noping; |
---|
| 269 | } owl_zwrite; |
---|
| 270 | |
---|
[d0d65df] | 271 | typedef struct _owl_pair { |
---|
| 272 | void *key; |
---|
| 273 | void *value; |
---|
| 274 | } owl_pair; |
---|
| 275 | |
---|
[7d4fbcd] | 276 | typedef struct _owl_message { |
---|
| 277 | int id; |
---|
| 278 | int type; |
---|
[4b464a4] | 279 | int direction; |
---|
[be0a79f] | 280 | #ifdef HAVE_LIBZEPHYR |
---|
[7d4fbcd] | 281 | ZNotice_t notice; |
---|
[be0a79f] | 282 | #endif |
---|
[bd3f232] | 283 | owl_fmtext fmtext; /* this is now only a CACHED copy */ |
---|
| 284 | int invalid_format; /* indicates whether fmtext needs to be regenerated */ |
---|
[7d4fbcd] | 285 | int delete; |
---|
[6e05655] | 286 | char hostname[MAXHOSTNAMELEN+1]; |
---|
[65ad073] | 287 | owl_list attributes; /* this is a list of pairs */ |
---|
[25dd31a] | 288 | char *timestr; |
---|
| 289 | time_t time; |
---|
[7d4fbcd] | 290 | char *zwriteline; |
---|
| 291 | } owl_message; |
---|
| 292 | |
---|
[bd3f232] | 293 | typedef struct _owl_style { |
---|
| 294 | char *name; |
---|
[f1e629d] | 295 | char *description; |
---|
[bd3f232] | 296 | int type; |
---|
| 297 | char *perlfuncname; |
---|
| 298 | void (*formatfunc) (owl_fmtext *fm, owl_message *m); |
---|
| 299 | } owl_style; |
---|
| 300 | |
---|
[7d4fbcd] | 301 | typedef struct _owl_mainwin { |
---|
| 302 | int curtruncated; |
---|
[f2e36b5] | 303 | int lasttruncated; |
---|
[7d4fbcd] | 304 | int lastdisplayed; |
---|
| 305 | } owl_mainwin; |
---|
| 306 | |
---|
| 307 | typedef struct _owl_viewwin { |
---|
| 308 | owl_fmtext fmtext; |
---|
| 309 | int textlines; |
---|
| 310 | int topline; |
---|
| 311 | int rightshift; |
---|
| 312 | int winlines, wincols; |
---|
| 313 | WINDOW *curswin; |
---|
| 314 | } owl_viewwin; |
---|
| 315 | |
---|
| 316 | typedef struct _owl_popwin { |
---|
| 317 | WINDOW *borderwin; |
---|
| 318 | WINDOW *popwin; |
---|
| 319 | int lines; |
---|
| 320 | int cols; |
---|
| 321 | int active; |
---|
| 322 | int needsfirstrefresh; |
---|
| 323 | void (*handler) (int ch); |
---|
| 324 | } owl_popwin; |
---|
| 325 | |
---|
| 326 | typedef struct _owl_messagelist { |
---|
| 327 | owl_list list; |
---|
| 328 | } owl_messagelist; |
---|
| 329 | |
---|
| 330 | typedef struct _owl_regex { |
---|
| 331 | int negate; |
---|
| 332 | char *string; |
---|
| 333 | regex_t re; |
---|
| 334 | } owl_regex; |
---|
| 335 | |
---|
| 336 | typedef struct _owl_filterelement { |
---|
| 337 | int type; |
---|
| 338 | char *field; |
---|
| 339 | owl_regex re; |
---|
| 340 | } owl_filterelement; |
---|
| 341 | |
---|
| 342 | typedef struct _owl_filter { |
---|
| 343 | char *name; |
---|
| 344 | int polarity; |
---|
| 345 | owl_list fes; /* filterelements */ |
---|
| 346 | int color; |
---|
[59cf91c] | 347 | int cachedmsgid; /* cached msgid: should move into view eventually */ |
---|
[7d4fbcd] | 348 | } owl_filter; |
---|
| 349 | |
---|
| 350 | typedef struct _owl_view { |
---|
[c3ab155] | 351 | char *name; |
---|
[7d4fbcd] | 352 | owl_filter *filter; |
---|
| 353 | owl_messagelist ml; |
---|
[c3ab155] | 354 | owl_style *style; |
---|
[7d4fbcd] | 355 | } owl_view; |
---|
| 356 | |
---|
| 357 | typedef struct _owl_history { |
---|
| 358 | owl_list hist; |
---|
| 359 | int cur; |
---|
| 360 | int touched; |
---|
| 361 | int partial; |
---|
[12c35df] | 362 | int repeats; |
---|
[7d4fbcd] | 363 | } owl_history; |
---|
| 364 | |
---|
[10b866d] | 365 | typedef struct _owl_editwin { |
---|
| 366 | char *buff; |
---|
| 367 | owl_history *hist; |
---|
| 368 | int bufflen; |
---|
| 369 | int allocated; |
---|
| 370 | int buffx, buffy; |
---|
| 371 | int topline; |
---|
| 372 | int winlines, wincols, fillcol, wrapcol; |
---|
| 373 | WINDOW *curswin; |
---|
| 374 | int style; |
---|
| 375 | int lock; |
---|
| 376 | int dotsend; |
---|
[c9334b1] | 377 | int echochar; |
---|
[10b866d] | 378 | } owl_editwin; |
---|
| 379 | |
---|
[7d4fbcd] | 380 | typedef struct _owl_keybinding { |
---|
| 381 | int *j; /* keypress stack (0-terminated) */ |
---|
| 382 | int type; /* command or function? */ |
---|
| 383 | char *desc; /* description (or "*user*") */ |
---|
| 384 | char *command; /* command, if of type command */ |
---|
| 385 | void (*function_fn)(void); /* function ptr, if of type function */ |
---|
| 386 | } owl_keybinding; |
---|
| 387 | |
---|
| 388 | typedef struct _owl_keymap { |
---|
| 389 | char *name; /* name of keymap */ |
---|
| 390 | char *desc; /* description */ |
---|
| 391 | owl_list bindings; /* key bindings */ |
---|
| 392 | struct _owl_keymap *submap; /* submap */ |
---|
| 393 | void (*default_fn)(int j); /* default action (takes a keypress) */ |
---|
| 394 | void (*prealways_fn)(int j); /* always called before a keypress is received */ |
---|
| 395 | void (*postalways_fn)(int j); /* always called after keypress is processed */ |
---|
| 396 | } owl_keymap; |
---|
| 397 | |
---|
| 398 | typedef struct _owl_keyhandler { |
---|
| 399 | owl_dict keymaps; /* dictionary of keymaps */ |
---|
| 400 | owl_keymap *active; /* currently active keymap */ |
---|
| 401 | int in_esc; /* escape pressed? */ |
---|
| 402 | int kpstack[OWL_KEYMAP_MAXSTACK+1]; /* current stack of keypresses */ |
---|
| 403 | int kpstackpos; /* location in stack (-1 = none) */ |
---|
| 404 | } owl_keyhandler; |
---|
| 405 | |
---|
[f4d0975] | 406 | typedef struct _owl_buddy { |
---|
| 407 | int proto; |
---|
| 408 | char *name; |
---|
| 409 | int isidle; |
---|
| 410 | int idlesince; |
---|
| 411 | } owl_buddy; |
---|
| 412 | |
---|
[aa5f725] | 413 | typedef struct _owl_buddylist { |
---|
| 414 | owl_list buddies; |
---|
| 415 | } owl_buddylist; |
---|
| 416 | |
---|
[6a415e9] | 417 | typedef struct _owl_timer { |
---|
| 418 | int direction; |
---|
| 419 | time_t starttime; |
---|
| 420 | int start; |
---|
| 421 | } owl_timer; |
---|
[aa5f725] | 422 | |
---|
[ec6ff52] | 423 | typedef struct _owl_errqueue { |
---|
| 424 | owl_list errlist; |
---|
| 425 | } owl_errqueue; |
---|
| 426 | |
---|
[7d4fbcd] | 427 | typedef struct _owl_global { |
---|
| 428 | owl_mainwin mw; |
---|
| 429 | owl_popwin pw; |
---|
[10b866d] | 430 | owl_history cmdhist; /* command history */ |
---|
| 431 | owl_history msghist; /* outgoing message history */ |
---|
[7d4fbcd] | 432 | owl_keyhandler kh; |
---|
| 433 | owl_list filterlist; |
---|
| 434 | owl_list puntlist; |
---|
| 435 | owl_vardict vars; |
---|
| 436 | owl_cmddict cmds; |
---|
| 437 | owl_context ctx; |
---|
[ec6ff52] | 438 | owl_errqueue errqueue; |
---|
[7d4fbcd] | 439 | int lines, cols; |
---|
| 440 | int curmsg, topmsg; |
---|
| 441 | int curmsg_vert_offset; |
---|
| 442 | owl_view current_view; |
---|
| 443 | owl_messagelist msglist; |
---|
| 444 | WINDOW *recwin, *sepwin, *msgwin, *typwin; |
---|
| 445 | int needrefresh; |
---|
| 446 | int rightshift; |
---|
| 447 | int resizepending; |
---|
| 448 | int recwinlines; |
---|
| 449 | int typwinactive; |
---|
[a8938c7] | 450 | char *thishost; |
---|
| 451 | char *homedir; |
---|
[7d4fbcd] | 452 | int direction; |
---|
| 453 | int zaway; |
---|
| 454 | char *cur_zaway_msg; |
---|
| 455 | int haveconfig; |
---|
| 456 | int config_format; |
---|
[a8938c7] | 457 | char *buffercommand; |
---|
[7d4fbcd] | 458 | owl_editwin tw; |
---|
| 459 | owl_viewwin vw; |
---|
| 460 | void *perl; |
---|
| 461 | int debug; |
---|
| 462 | int starttime; |
---|
[a8938c7] | 463 | char *startupargs; |
---|
[7d4fbcd] | 464 | int userclue; |
---|
| 465 | int nextmsgid; |
---|
| 466 | int hascolors; |
---|
| 467 | int colorpairs; |
---|
[1fd0b25] | 468 | int searchactive; |
---|
[700c712] | 469 | int newmsgproc_pid; |
---|
[8262340] | 470 | int malloced, freed; |
---|
[1fd0b25] | 471 | char *searchstring; |
---|
[7d4fbcd] | 472 | owl_filterelement fe_true; |
---|
| 473 | owl_filterelement fe_false; |
---|
| 474 | owl_filterelement fe_null; |
---|
[d09e5a1] | 475 | aim_session_t aimsess; |
---|
[c15bbfb] | 476 | aim_conn_t bosconn; |
---|
[6a415e9] | 477 | owl_timer aim_noop_timer; |
---|
| 478 | owl_timer aim_ignorelogin_timer; |
---|
[de03334] | 479 | owl_timer aim_buddyinfo_timer; |
---|
[bd3f232] | 480 | int aim_loggedin; /* true if currently logged into AIM */ |
---|
[a352335c] | 481 | int aim_doprocessing; /* true if we should process AIM events (like pending login) */ |
---|
[bd3f232] | 482 | char *aim_screenname; /* currently logged in AIM screen name */ |
---|
| 483 | owl_buddylist buddylist; /* list of logged in AIM buddies */ |
---|
| 484 | owl_list messagequeue; /* for queueing up aim and other messages */ |
---|
[f1e629d] | 485 | owl_dict styledict; /* global dictionary of available styles */ |
---|
[cf83b7a] | 486 | char *response; /* response to the last question asked */ |
---|
[09489b89] | 487 | int havezephyr; |
---|
| 488 | int haveaim; |
---|
[c9e72d1] | 489 | int got_err_signal; /* 1 if we got an unexpected signal */ |
---|
| 490 | siginfo_t err_signal_info; |
---|
[7d4fbcd] | 491 | } owl_global; |
---|
| 492 | |
---|
| 493 | /* globals */ |
---|
[b2b0773] | 494 | extern owl_global g; |
---|
[7d4fbcd] | 495 | |
---|
| 496 | #include "owl_prototypes.h" |
---|
| 497 | |
---|
| 498 | /* these are missing from the zephyr includes for some reason */ |
---|
[be0a79f] | 499 | #ifdef HAVE_LIBZEPHYR |
---|
[7d4fbcd] | 500 | int ZGetSubscriptions(ZSubscription_t *, int *); |
---|
| 501 | int ZGetLocations(ZLocations_t *,int *); |
---|
[be0a79f] | 502 | #endif |
---|
[7d4fbcd] | 503 | |
---|
| 504 | #endif /* INC_OWL_H */ |
---|