source: owl.h @ 96c3265

release-1.10release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since 96c3265 was a01ed7c, checked in by Alejandro R. Sedeño <asedeno@mit.edu>, 14 years ago
Merge branch 'io_dispatch_rewrite'
  • Property mode set to 100644
File size: 17.5 KB
RevLine 
[23e1110]1/*  Copyright (c) 2006-2009 The BarnOwl Developers. All rights reserved.
[81001c0]2 *  Copyright (c) 2004 James Kretchmar. All rights reserved.
[5ca5f8e]3 *
[81001c0]4 *  This program is free software. You can redistribute it and/or
5 *  modify under the terms of the Sleepycat License. See the COPYING
6 *  file included with the distribution for more information.
[5ca5f8e]7 */
8
[7d4fbcd]9#ifndef INC_OWL_H
10#define INC_OWL_H
11
[1bdffcb]12#ifndef OWL_PERL
13#include <curses.h>
14#endif
[7d4fbcd]15#include <sys/param.h>
16#include <EXTERN.h>
17#include <netdb.h>
18#include <regex.h>
[d09e5a1]19#include <time.h>
[c9e72d1]20#include <signal.h>
[8232149]21#include <termios.h>
[731dd1e]22#include "libfaim/aim.h"
[dd24b6a]23#include <wchar.h>
[7d4fbcd]24#include "config.h"
[34509d5]25#include "glib.h"
[be0a79f]26#ifdef HAVE_LIBZEPHYR
[373b7e7]27#include <zephyr/zephyr.h>
[be0a79f]28#endif
[e6449bc]29#ifdef HAVE_COM_ERR_H
30#include <com_err.h>
31#endif
32
[6922edd]33/* Perl and curses don't play nice. */
34#ifdef OWL_PERL
35typedef void WINDOW;
[18e28a4]36/* logout is defined in FreeBSD. */
37#define logout logout_
[88dc766]38/* aim.h defines bool */
39#define HAS_BOOL
[6922edd]40#include <perl.h>
[120291c]41#include "owl_perl.h"
[18e28a4]42#undef logout
[6922edd]43#include "XSUB.h"
44#else
45typedef void SV;
[68c572a]46typedef void AV;
47typedef void HV;
[6922edd]48#endif
49
[37f27bc]50#define OWL_VERSION_STRING PACKAGE_VERSION
[2a2bb60]51
52/* Feature that is being tested to redirect stderr through a pipe.
53 * There may still be some portability problems with this. */
54#define OWL_STDERR_REDIR 1
[7d4fbcd]55
56#define OWL_DEBUG 0
57#define OWL_DEBUG_FILE "/var/tmp/owldebug"
58
[bd3f232]59#define OWL_CONFIG_DIR "/.owl"             /* this is relative to the user's home directory */
[38cf544c]60#define OWL_STARTUP_FILE "/.owl/startup"   /* this is relative to the user's home directory */
61
[7d4fbcd]62#define OWL_FMTEXT_ATTR_NONE      0
63#define OWL_FMTEXT_ATTR_BOLD      1
64#define OWL_FMTEXT_ATTR_REVERSE   2
65#define OWL_FMTEXT_ATTR_UNDERLINE 4
66
[9866c3a]67#define OWL_FMTEXT_UC_BASE 0x100000 /* Unicode Plane 16 - Supplementary Private Use Area-B*/
68#define OWL_FMTEXT_UC_ATTR ( OWL_FMTEXT_UC_BASE | 0x800 )
69#define OWL_FMTEXT_UC_ATTR_MASK 0x7
70#define OWL_FMTEXT_UC_COLOR_BASE ( OWL_FMTEXT_UC_BASE | 0x400 )
71#define OWL_FMTEXT_UC_FGCOLOR OWL_FMTEXT_UC_COLOR_BASE
72#define OWL_FMTEXT_UC_BGCOLOR ( OWL_FMTEXT_UC_COLOR_BASE | 0x200 )
73#define OWL_FMTEXT_UC_DEFAULT_COLOR 0x100
74#define OWL_FMTEXT_UC_FGDEFAULT ( OWL_FMTEXT_UC_FGCOLOR | OWL_FMTEXT_UC_DEFAULT_COLOR )
75#define OWL_FMTEXT_UC_BGDEFAULT ( OWL_FMTEXT_UC_BGCOLOR | OWL_FMTEXT_UC_DEFAULT_COLOR )
76#define OWL_FMTEXT_UC_COLOR_MASK 0xFF
77#define OWL_FMTEXT_UC_ALLCOLOR_MASK ( OWL_FMTEXT_UC_COLOR_MASK | OWL_FMTEXT_UC_DEFAULT_COLOR | 0x200)
78#define OWL_FMTEXT_UC_STARTBYTE_UTF8 '\xf4'
79
80#define OWL_FMTEXT_UTF8_ATTR_NONE "\xf4\x80\xa0\x80"
81#define OWL_FMTEXT_UTF8_FGDEFAULT "\xf4\x80\x94\x80"
[6f6330b]82#define OWL_FMTEXT_UTF8_BGDEFAULT "\xf4\x80\x9C\x80"
[9866c3a]83
[7d4fbcd]84#define OWL_COLOR_BLACK     0
85#define OWL_COLOR_RED       1
86#define OWL_COLOR_GREEN     2
87#define OWL_COLOR_YELLOW    3
88#define OWL_COLOR_BLUE      4
89#define OWL_COLOR_MAGENTA   5
90#define OWL_COLOR_CYAN      6
91#define OWL_COLOR_WHITE     7
[c2c5c77]92#define OWL_COLOR_DEFAULT   -1
[601733d]93#define OWL_COLOR_INVALID   -2
[7d4fbcd]94
95#define OWL_EDITWIN_STYLE_MULTILINE 0
96#define OWL_EDITWIN_STYLE_ONELINE   1
97
[f4d0975]98#define OWL_PROTOCOL_ZEPHYR         0
99#define OWL_PROTOCOL_AIM            1
100#define OWL_PROTOCOL_JABBER         2
101#define OWL_PROTOCOL_ICQ            3
102#define OWL_PROTOCOL_YAHOO          4
103#define OWL_PROTOCOL_MSN            5
104
[4b464a4]105#define OWL_MESSAGE_DIRECTION_NONE  0
106#define OWL_MESSAGE_DIRECTION_IN    1
107#define OWL_MESSAGE_DIRECTION_OUT   2
[7d4fbcd]108
[df0138f]109#define OWL_IO_READ   1
110#define OWL_IO_WRITE  2
111#define OWL_IO_EXCEPT 4
[afbf668]112
[7d4fbcd]113#define OWL_DIRECTION_NONE      0
114#define OWL_DIRECTION_DOWNWARDS 1
115#define OWL_DIRECTION_UPWARDS   2
116
[12c35df]117#define OWL_LOGGING_DIRECTION_BOTH 0
118#define OWL_LOGGING_DIRECTION_IN   1
119#define OWL_LOGGING_DIRECTION_OUT  2
120
[88736cb]121#define OWL_SCROLLMODE_NORMAL      0
122#define OWL_SCROLLMODE_TOP         1
123#define OWL_SCROLLMODE_NEARTOP     2
124#define OWL_SCROLLMODE_CENTER      3
125#define OWL_SCROLLMODE_PAGED       4
[aa2f33b3]126#define OWL_SCROLLMODE_PAGEDCENTER 5
127
[7d4fbcd]128#define OWL_TAB               3  /* This *HAS* to be the size of TABSTR below */
129#define OWL_TABSTR        "   "
130#define OWL_MSGTAB            7
131#define OWL_TYPWIN_SIZE       8
132#define OWL_HISTORYSIZE       50
133
134/* Indicate current state, as well as what is allowed */
135#define OWL_CTX_ANY          0xffff
136/* Only one of these may be active at a time... */
137#define OWL_CTX_MODE_BITS    0x000f
138#define OWL_CTX_STARTUP      0x0001
139#define OWL_CTX_READCONFIG   0x0002
140#define OWL_CTX_INTERACTIVE  0x0004
141/* Only one of these may be active at a time... */
142#define OWL_CTX_ACTIVE_BITS  0xfff0
143#define OWL_CTX_POPWIN       0x00f0
144#define OWL_CTX_POPLESS      0x0010
145#define OWL_CTX_RECWIN       0x0f00
146#define OWL_CTX_RECV         0x0100
147#define OWL_CTX_TYPWIN       0xf000
[cf83b7a]148#define OWL_CTX_EDIT         0x7000
[7d4fbcd]149#define OWL_CTX_EDITLINE     0x1000
150#define OWL_CTX_EDITMULTI    0x2000
[cf83b7a]151#define OWL_CTX_EDITRESPONSE 0x4000
[7d4fbcd]152
153#define OWL_USERCLUE_NONE       0
154#define OWL_USERCLUE_CLASSES    1
155#define OWL_USERCLUE_FOOBAR     2
156#define OWL_USERCLUE_BAZ        4
157
158#define OWL_WEBBROWSER_NONE     0
159#define OWL_WEBBROWSER_NETSCAPE 1
160#define OWL_WEBBROWSER_GALEON   2
[ae9e6be]161#define OWL_WEBBROWSER_OPERA    3
[7d4fbcd]162
163#define OWL_VARIABLE_OTHER      0
164#define OWL_VARIABLE_INT        1
165#define OWL_VARIABLE_BOOL       2
166#define OWL_VARIABLE_STRING     3
167
168#define OWL_FILTER_MAX_DEPTH    300
169
[4b464a4]170#define OWL_KEYMAP_MAXSTACK     20
[7d4fbcd]171
[4b464a4]172#define OWL_KEYBINDING_COMMAND  1   /* command string */
173#define OWL_KEYBINDING_FUNCTION 2   /* function taking no args */
[7d4fbcd]174
[4b464a4]175#define OWL_DEFAULT_ZAWAYMSG    "I'm sorry, but I am currently away from the terminal and am\nnot able to receive your message.\n"
[4b660cc]176#define OWL_DEFAULT_AAWAYMSG    "I'm sorry, but I am currently away from the terminal and am\nnot able to receive your message.\n"
[7d4fbcd]177
[1c7a4e0]178#define OWL_CMD_ALIAS_SUMMARY_PREFIX "command alias to: "
[7d4fbcd]179
[e7cc1c3]180#define OWL_WEBZEPHYR_PRINCIPAL "daemon.webzephyr"
[1d3e925]181#define OWL_WEBZEPHYR_CLASS     "webzephyr"
182#define OWL_WEBZEPHYR_OPCODE    "webzephyr"
[e7cc1c3]183
[80e54a7]184#define OWL_REGEX_QUOTECHARS    "+*.?[]^\\${}()"
[bc08664]185#define OWL_REGEX_QUOTEWITH     "\\"
186
[0435c7d]187#if defined(HAVE_DES_STRING_TO_KEY) && defined(HAVE_DES_KEY_SCHED) && defined(HAVE_DES_ECB_ENCRYPT)
[c86a35c]188#define OWL_ENABLE_ZCRYPT 1
[c269e22]189#endif
190
[62fdd29]191#define OWL_META(key) ((key)|010000)
[f87c490]192/* OWL_CTRL is definied in kepress.c */
[7d4fbcd]193
194#define LINE 2048
195
[712caac]196#ifdef HAVE_LIBZEPHYR
[6337cb5]197/* libzephyr doesn't use const, so we appease the type system with this kludge.
198 * This just casts const char * to char * in a way that doesn't yield a warning
199 * from gcc -Wcast-qual. */
[712caac]200static inline char *zstr(const char *str)
201{
[6337cb5]202  union { char *rw; const char *ro; } u;
203  u.ro = str;
204  return u.rw;
[712caac]205}
206#endif
207
[e19eb97]208/* Convert char *const * into const char *const *.  This conversion is safe,
[c529ac8]209 * and implicit in C++ (conv.qual 4) but for some reason not in C. */
[e19eb97]210static inline const char *const *strs(char *const *pstr)
[c529ac8]211{
[e19eb97]212  return (const char *const *)pstr;
[c529ac8]213}
214
[7d4fbcd]215typedef struct _owl_variable {
216  char *name;
217  int   type;  /* OWL_VARIABLE_* */
218  void *pval_default;  /* for types other and string */
219  int   ival_default;  /* for types int and bool     */
220  char *validsettings;          /* documentation of valid settings */
[aa2f33b3]221  char *summary;                /* summary of usage */
222  char *description;            /* detailed description */
[7d4fbcd]223  void *val;                    /* current value */
[64735f0]224  int  (*validate_fn)(const struct _owl_variable *v, const void *newval);
[7d4fbcd]225                                /* returns 1 if newval is valid */
[e19eb97]226  int  (*set_fn)(struct _owl_variable *v, const void *newval); 
[7d4fbcd]227                                /* sets the variable to a value
228                                 * of the appropriate type.
229                                 * unless documented, this
230                                 * should make a copy.
231                                 * returns 0 on success. */
[e19eb97]232  int  (*set_fromstring_fn)(struct _owl_variable *v, const char *newval);
[7d4fbcd]233                                /* sets the variable to a value
234                                 * of the appropriate type.
235                                 * unless documented, this
236                                 * should make a copy.
237                                 * returns 0 on success. */
[64735f0]238  const void *(*get_fn)(const struct _owl_variable *v);
[7d4fbcd]239                                /* returns a reference to the current value.
240                                 * WARNING:  this approach is hard to make
241                                 * thread-safe... */
[64735f0]242  int  (*get_tostring_fn)(const struct _owl_variable *v, 
[e19eb97]243                          char *buf, int bufsize, const void *val); 
[7d4fbcd]244                                /* converts val to a string
245                                 * and puts into buf */
246  void  (*free_fn)(struct _owl_variable *v);
247                                /* frees val as needed */
248} owl_variable;
249
[428834d]250typedef struct _owl_input {
251  int ch;
252  gunichar uch;
253} owl_input;
254
[7d4fbcd]255typedef struct _owl_fmtext {
256  int textlen;
[a387d12e]257  int bufflen;
[7d4fbcd]258  char *textbuff;
[9866c3a]259  char default_attrs;
260  short default_fgcolor;
261  short default_bgcolor;
[7d4fbcd]262} owl_fmtext;
263
264typedef struct _owl_list {
265  int size;
266  int avail;
267  void **list;
268} owl_list;
269
270typedef struct _owl_dict_el {
271  char *k;                      /* key   */
272  void *v;                      /* value */
273} owl_dict_el;
274
275typedef struct _owl_dict {
276  int size;
277  int avail;
278  owl_dict_el *els;             /* invariant: sorted by k */
279} owl_dict;
280typedef owl_dict owl_vardict;   /* dict of variables */
281typedef owl_dict owl_cmddict;   /* dict of commands */
282
283typedef struct _owl_context {
284  int   mode;
285  void *data;           /* determined by mode */
286} owl_context;
287
288typedef struct _owl_cmd {       /* command */
289  char *name;
290
291  char *summary;                /* one line summary of command */
292  char *usage;                  /* usage synopsis */
293  char *description;            /* long description of command */
294
295  int validctx;                 /* bitmask of valid contexts */
296
297  /* we should probably have a type here that says which of
298   * the following is valid, and maybe make the below into a union... */
299
300  /* Only one of these may be non-NULL ... */
301
302  char *cmd_aliased_to;         /* what this command is aliased to... */
303 
304  /* These don't take any context */
[e19eb97]305  char *(*cmd_args_fn)(int argc, const char *const *argv, const char *buff); 
[7d4fbcd]306                                /* takes argv and the full command as buff.
307                                 * caller must free return value if !NULL */
308  void (*cmd_v_fn)(void);       /* takes no args */
309  void (*cmd_i_fn)(int i);      /* takes an int as an arg */
310
311  /* The following also take the active context if it's valid */
[e19eb97]312  char *(*cmd_ctxargs_fn)(void *ctx, int argc, const char *const *argv, const char *buff); 
[7d4fbcd]313                                /* takes argv and the full command as buff.
314                                 * caller must free return value if !NULL */
315  void (*cmd_ctxv_fn)(void *ctx);               /* takes no args */
316  void (*cmd_ctxi_fn)(void *ctx, int i);        /* takes an int as an arg */
[6922edd]317  SV *cmd_perl;                                /* Perl closure that takes a list of args */
[7d4fbcd]318} owl_cmd;
319
320
321typedef struct _owl_zwrite {
[24ccc01]322  char *zwriteline;
[ce7db4d]323  char *class;
324  char *inst;
325  char *realm;
326  char *opcode;
[56330ff]327  char *zsig;
[ce7db4d]328  char *message;
[7d4fbcd]329  owl_list recips;
330  int cc;
331  int noping;
332} owl_zwrite;
333
[d0d65df]334typedef struct _owl_pair {
[e19eb97]335  const char *key;
[de1c8a5]336  char *value;
[d0d65df]337} owl_pair;
338
[a387d12e]339struct _owl_fmtext_cache;
340
[7d4fbcd]341typedef struct _owl_message {
342  int id;
[4b464a4]343  int direction;
[be0a79f]344#ifdef HAVE_LIBZEPHYR
[7d4fbcd]345  ZNotice_t notice;
[be0a79f]346#endif
[a387d12e]347  struct _owl_fmtext_cache * fmtext;
[7d4fbcd]348  int delete;
[e19eb97]349  const char *hostname;
[65ad073]350  owl_list attributes;            /* this is a list of pairs */
[25dd31a]351  char *timestr;
352  time_t time;
[7d4fbcd]353} owl_message;
354
[a387d12e]355#define OWL_FMTEXT_CACHE_SIZE 1000
356/* We cache the saved fmtexts for the last bunch of messages we
357   rendered */
358typedef struct _owl_fmtext_cache {
359    owl_message * message;
360    owl_fmtext fmtext;
361} owl_fmtext_cache;
362
[bd3f232]363typedef struct _owl_style {
364  char *name;
[120291c]365  SV *perlobj;
[bd3f232]366} owl_style;
367
[7d4fbcd]368typedef struct _owl_mainwin {
369  int curtruncated;
[f2e36b5]370  int lasttruncated;
[7d4fbcd]371  int lastdisplayed;
372} owl_mainwin;
373
374typedef struct _owl_viewwin {
375  owl_fmtext fmtext;
376  int textlines;
377  int topline;
378  int rightshift;
379  int winlines, wincols;
380  WINDOW *curswin;
[afbf668]381  void (*onclose_hook) (struct _owl_viewwin *vwin, void *data);
382  void *onclose_hook_data;
[7d4fbcd]383} owl_viewwin;
384 
385typedef struct _owl_popwin {
386  WINDOW *borderwin;
387  WINDOW *popwin;
388  int lines;
389  int cols;
390  int active;
391  int needsfirstrefresh;
392} owl_popwin;
393
394typedef struct _owl_messagelist {
395  owl_list list;
396} owl_messagelist;
397
398typedef struct _owl_regex {
399  int negate;
400  char *string;
401  regex_t re;
402} owl_regex;
403
404typedef struct _owl_filterelement {
[bd65108]405  int (*match_message)(const struct _owl_filterelement *fe, const owl_message *m);
[cb769bb]406  /* Append a string representation of the filterelement onto buf*/
[bd65108]407  void (*print_elt)(const struct _owl_filterelement *fe, GString *buf);
[cb769bb]408  /* Operands for and,or,not*/
409  struct _owl_filterelement *left, *right;
410  /* For regex filters*/
[7d4fbcd]411  owl_regex re;
[cb769bb]412  /* Used by regexes, filter references, and perl */
413  char *field;
[7d4fbcd]414} owl_filterelement;
415
416typedef struct _owl_filter {
417  char *name;
[cb769bb]418  owl_filterelement * root;
[8fa9562]419  int fgcolor;
420  int bgcolor;
[59cf91c]421  int cachedmsgid;  /* cached msgid: should move into view eventually */
[7d4fbcd]422} owl_filter;
423
424typedef struct _owl_view {
[c3ab155]425  char *name;
[7d4fbcd]426  owl_filter *filter;
427  owl_messagelist ml;
[1fdab04]428  const owl_style *style;
[7d4fbcd]429} owl_view;
430
431typedef struct _owl_history {
432  owl_list hist;
433  int cur;
434  int touched;
435  int partial;
[12c35df]436  int repeats;
[7d4fbcd]437} owl_history;
438
[a556caa]439typedef struct _owl_editwin owl_editwin;
[a88f35a]440typedef struct _owl_editwin_excursion owl_editwin_excursion;
[10b866d]441
[7d4fbcd]442typedef struct _owl_keybinding {
[e1b136bf]443  int  *keys;                   /* keypress stack */
444  int   len;                    /* length of stack */
[7d4fbcd]445  int   type;                   /* command or function? */
446  char *desc;                   /* description (or "*user*") */
447  char *command;                /* command, if of type command */
448  void (*function_fn)(void);    /* function ptr, if of type function */
449} owl_keybinding;
450
451typedef struct _owl_keymap {
452  char     *name;               /* name of keymap */
453  char     *desc;               /* description */
454  owl_list  bindings;           /* key bindings */
[afa200a]455  const struct _owl_keymap *submap;     /* submap */
[428834d]456  void (*default_fn)(owl_input j);      /* default action (takes a keypress) */
457  void (*prealways_fn)(owl_input  j);   /* always called before a keypress is received */
458  void (*postalways_fn)(owl_input  j);  /* always called after keypress is processed */
[7d4fbcd]459} owl_keymap;
460
461typedef struct _owl_keyhandler {
462  owl_dict  keymaps;            /* dictionary of keymaps */
[afa200a]463  const owl_keymap *active;             /* currently active keymap */
[7d4fbcd]464  int       in_esc;             /* escape pressed? */
465  int       kpstack[OWL_KEYMAP_MAXSTACK+1]; /* current stack of keypresses */
466  int       kpstackpos;         /* location in stack (-1 = none) */
467} owl_keyhandler;
468
[f4d0975]469typedef struct _owl_buddy {
470  int proto;
471  char *name;
472  int isidle;
473  int idlesince;
474} owl_buddy;
475
[aa5f725]476typedef struct _owl_buddylist {
477  owl_list buddies;
478} owl_buddylist;
479
[5a95b69]480typedef struct _owl_zbuddylist {
481  owl_list zusers;
482} owl_zbuddylist;
483
[6a415e9]484typedef struct _owl_timer {
[b7bb454]485  time_t time;
486  int interval;
487  void (*callback)(struct _owl_timer *, void *);
[c675b39]488  void (*destroy)(struct _owl_timer *);
[b7bb454]489  void *data;
[6a415e9]490} owl_timer;
[aa5f725]491
[ec6ff52]492typedef struct _owl_errqueue {
493  owl_list errlist;
494} owl_errqueue;
495
[8fa9562]496typedef struct _owl_colorpair_mgr {
[99c7549]497  int next;
[c2c5c77]498  short **pairs;
[8fa9562]499} owl_colorpair_mgr;
500
[124aebc]501typedef struct _owl_obarray {
502  owl_list strings;
503} owl_obarray;
504
[df0138f]505typedef struct _owl_io_dispatch {
506  int fd;                                     /* FD to watch for dispatch. */
507  int mode;
[1895c29]508  int needs_gc;
[df0138f]509  void (*callback)(const struct _owl_io_dispatch *, void *); /* C function to dispatch to. */
510  void (*destroy)(const struct _owl_io_dispatch *);  /* Destructor */
[f36cd97]511  void *data;
[df0138f]512} owl_io_dispatch;
[9c7a701]513
[4f2166b]514typedef struct _owl_ps_action {
515  int needs_gc;
516  int (*callback)(struct _owl_ps_action *, void *);
517  void (*destroy)(struct _owl_ps_action *);
518  void *data;
519} owl_ps_action;
520
[40c6657]521typedef struct _owl_popexec {
522  int refcount;
523  owl_viewwin *vwin;
524  int winactive;
[0e5afa2]525  pid_t pid;                    /* or 0 if it has terminated */
[18fdd5f9]526  const owl_io_dispatch *dispatch;
[40c6657]527} owl_popexec;
528
[7d4fbcd]529typedef struct _owl_global {
530  owl_mainwin mw;
531  owl_popwin pw;
[10b866d]532  owl_history cmdhist;          /* command history */
533  owl_history msghist;          /* outgoing message history */
[7d4fbcd]534  owl_keyhandler kh;
535  owl_list filterlist;
536  owl_list puntlist;
537  owl_vardict vars;
538  owl_cmddict cmds;
539  owl_context ctx;
[ec6ff52]540  owl_errqueue errqueue;
[7d4fbcd]541  int lines, cols;
[bd783db]542  int curmsg, topmsg;
[70110286]543  int markedmsgid;              /* for finding the marked message when it has moved. */
[7d4fbcd]544  int curmsg_vert_offset;
545  owl_view current_view;
546  owl_messagelist msglist;
547  WINDOW *recwin, *sepwin, *msgwin, *typwin;
548  int needrefresh;
549  int rightshift;
550  int resizepending;
551  int recwinlines;
552  int typwinactive;
[a8938c7]553  char *thishost;
554  char *homedir;
[b363d83]555  char *confdir;
556  char *startupfile;
[7d4fbcd]557  int direction;
558  int zaway;
559  char *cur_zaway_msg;
560  int haveconfig;
561  int config_format;
[1b6b2f3]562  void *buffercbdata;
[a556caa]563  owl_editwin *tw;
[7d4fbcd]564  owl_viewwin vw;
565  void *perl;
566  int debug;
[7f792c1]567  time_t starttime;
568  time_t lastinputtime;
[a8938c7]569  char *startupargs;
[7d4fbcd]570  int userclue;
571  int nextmsgid;
572  int hascolors;
573  int colorpairs;
[8fa9562]574  owl_colorpair_mgr cpmgr;
[0e5afa2]575  pid_t newmsgproc_pid;
[8262340]576  int malloced, freed;
[41c9a96]577  owl_regex search_re;
[d09e5a1]578  aim_session_t aimsess;
[c15bbfb]579  aim_conn_t bosconn;
[6a415e9]580  owl_timer aim_noop_timer;
581  owl_timer aim_ignorelogin_timer;
[bd3f232]582  int aim_loggedin;         /* true if currently logged into AIM */
[a352335c]583  int aim_doprocessing;     /* true if we should process AIM events (like pending login) */
[bd3f232]584  char *aim_screenname;     /* currently logged in AIM screen name */
[81655f8]585  char *aim_screenname_for_filters;     /* currently logged in AIM screen name */
[bd3f232]586  owl_buddylist buddylist;  /* list of logged in AIM buddies */
587  owl_list messagequeue;    /* for queueing up aim and other messages */
[f1e629d]588  owl_dict styledict;       /* global dictionary of available styles */
[cf83b7a]589  char *response;           /* response to the last question asked */
[09489b89]590  int havezephyr;
591  int haveaim;
[b7bb454]592  int ignoreaimlogin;
[c9e72d1]593  int got_err_signal;       /* 1 if we got an unexpected signal */
[5a95b69]594  siginfo_t err_signal_info;
595  owl_zbuddylist zbuddies;
596  owl_timer zephyr_buddycheck_timer;
[8232149]597  struct termios startup_tio;
[8e401cae]598  owl_obarray obarray;
[df0138f]599  owl_list io_dispatch_list;
[4f2166b]600  owl_list psa_list;
[58d1f8a]601  GList *timerlist;
[b7bb454]602  owl_timer *aim_nop_timer;
[52a0f14]603  int load_initial_subs;
[adee9cc]604  int interrupted;
[40bda84]605  int got_sigtstp;
[7d4fbcd]606} owl_global;
607
608/* globals */
[b2b0773]609extern owl_global g;
[7d4fbcd]610
611#include "owl_prototypes.h"
612
613/* these are missing from the zephyr includes for some reason */
[be0a79f]614#ifdef HAVE_LIBZEPHYR
[7d4fbcd]615int ZGetSubscriptions(ZSubscription_t *, int *);
616int ZGetLocations(ZLocations_t *,int *);
[be0a79f]617#endif
[7d4fbcd]618
619#endif /* INC_OWL_H */
Note: See TracBrowser for help on using the repository browser.