source: owl.h

Last change on this file was 4fd3c04, checked in by Anders Kaseorg <andersk@mit.edu>, 7 years ago
Remove AIM support This code has received almost no security attention, and anyway, AIM is shutting down on December 15, 2017. https://aimemories.tumblr.com/post/166091776077/aimemories Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Property mode set to 100644
File size: 16.6 KB
RevLine 
[b03c714]1/*  Copyright (c) 2006-2011 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
[06adc25]9#ifndef INC_BARNOWL_OWL_H
10#define INC_BARNOWL_OWL_H
[7d4fbcd]11
[6249a88f]12#include <config.h>
[691d012]13
[12a6616]14#include "compat/compat.h"
15
[f8074e9]16#include <stdbool.h>
[75b0adb]17
[1bdffcb]18#ifndef OWL_PERL
[fe73d0c]19#define NCURSES_ENABLE_STDBOOL_H 1
[67e5ba36]20#include <ncursesw/curses.h>
21#include <ncursesw/panel.h>
[1bdffcb]22#endif
[7d4fbcd]23#include <sys/param.h>
[f271129]24#include <sys/types.h>
25#include <ctype.h>
26#include <errno.h>
[7d4fbcd]27#include <EXTERN.h>
[f271129]28#include <fcntl.h>
[7d4fbcd]29#include <netdb.h>
30#include <regex.h>
[d09e5a1]31#include <time.h>
[c9e72d1]32#include <signal.h>
[f271129]33#include <stdlib.h>
34#include <string.h>
[8232149]35#include <termios.h>
[f271129]36#include <unistd.h>
[dd24b6a]37#include <wchar.h>
[f271129]38#include <glib.h>
[be0a79f]39#ifdef HAVE_LIBZEPHYR
[373b7e7]40#include <zephyr/zephyr.h>
[be0a79f]41#endif
[e6449bc]42#ifdef HAVE_COM_ERR_H
43#include <com_err.h>
44#endif
45
[6922edd]46/* Perl and curses don't play nice. */
47#ifdef OWL_PERL
[c42a8d1]48typedef struct _owl_fake_WINDOW WINDOW;
49typedef struct _owl_fake_PANEL PANEL;
[18e28a4]50/* logout is defined in FreeBSD. */
51#define logout logout_
[88dc766]52#define HAS_BOOL
[6922edd]53#include <perl.h>
[120291c]54#include "owl_perl.h"
[18e28a4]55#undef logout
[6922edd]56#include "XSUB.h"
57#else
[c42a8d1]58typedef struct _owl_fake_SV SV;
59typedef struct _owl_fake_AV AV;
60typedef struct _owl_fake_HV HV;
[6922edd]61#endif
62
[e96b4ce]63#include "window.h"
64
[ca1fb26a]65extern const char *version;
[2a2bb60]66
67/* Feature that is being tested to redirect stderr through a pipe.
68 * There may still be some portability problems with this. */
69#define OWL_STDERR_REDIR 1
[7d4fbcd]70
71#define OWL_DEBUG 0
[26ad412]72#define OWL_DEBUG_FILE "/var/tmp/barnowl-debug"
[7d4fbcd]73
[bd3f232]74#define OWL_CONFIG_DIR "/.owl"             /* this is relative to the user's home directory */
[38cf544c]75
[7d4fbcd]76#define OWL_FMTEXT_ATTR_NONE      0
77#define OWL_FMTEXT_ATTR_BOLD      1
78#define OWL_FMTEXT_ATTR_REVERSE   2
79#define OWL_FMTEXT_ATTR_UNDERLINE 4
80
[9866c3a]81#define OWL_FMTEXT_UC_BASE 0x100000 /* Unicode Plane 16 - Supplementary Private Use Area-B*/
82#define OWL_FMTEXT_UC_ATTR ( OWL_FMTEXT_UC_BASE | 0x800 )
83#define OWL_FMTEXT_UC_ATTR_MASK 0x7
84#define OWL_FMTEXT_UC_COLOR_BASE ( OWL_FMTEXT_UC_BASE | 0x400 )
85#define OWL_FMTEXT_UC_FGCOLOR OWL_FMTEXT_UC_COLOR_BASE
86#define OWL_FMTEXT_UC_BGCOLOR ( OWL_FMTEXT_UC_COLOR_BASE | 0x200 )
87#define OWL_FMTEXT_UC_DEFAULT_COLOR 0x100
88#define OWL_FMTEXT_UC_FGDEFAULT ( OWL_FMTEXT_UC_FGCOLOR | OWL_FMTEXT_UC_DEFAULT_COLOR )
89#define OWL_FMTEXT_UC_BGDEFAULT ( OWL_FMTEXT_UC_BGCOLOR | OWL_FMTEXT_UC_DEFAULT_COLOR )
90#define OWL_FMTEXT_UC_COLOR_MASK 0xFF
91#define OWL_FMTEXT_UC_ALLCOLOR_MASK ( OWL_FMTEXT_UC_COLOR_MASK | OWL_FMTEXT_UC_DEFAULT_COLOR | 0x200)
92#define OWL_FMTEXT_UC_STARTBYTE_UTF8 '\xf4'
93
[7d4fbcd]94#define OWL_COLOR_BLACK     0
95#define OWL_COLOR_RED       1
96#define OWL_COLOR_GREEN     2
97#define OWL_COLOR_YELLOW    3
98#define OWL_COLOR_BLUE      4
99#define OWL_COLOR_MAGENTA   5
100#define OWL_COLOR_CYAN      6
101#define OWL_COLOR_WHITE     7
[c2c5c77]102#define OWL_COLOR_DEFAULT   -1
[601733d]103#define OWL_COLOR_INVALID   -2
[7d4fbcd]104
[2b83ad6]105#define OWL_TAB_WIDTH 8
106
[7d4fbcd]107#define OWL_EDITWIN_STYLE_MULTILINE 0
108#define OWL_EDITWIN_STYLE_ONELINE   1
109
[4b464a4]110#define OWL_MESSAGE_DIRECTION_NONE  0
111#define OWL_MESSAGE_DIRECTION_IN    1
112#define OWL_MESSAGE_DIRECTION_OUT   2
[7d4fbcd]113
114#define OWL_DIRECTION_NONE      0
115#define OWL_DIRECTION_DOWNWARDS 1
116#define OWL_DIRECTION_UPWARDS   2
117
[12c35df]118#define OWL_LOGGING_DIRECTION_BOTH 0
119#define OWL_LOGGING_DIRECTION_IN   1
120#define OWL_LOGGING_DIRECTION_OUT  2
121
[88736cb]122#define OWL_SCROLLMODE_NORMAL      0
123#define OWL_SCROLLMODE_TOP         1
124#define OWL_SCROLLMODE_NEARTOP     2
125#define OWL_SCROLLMODE_CENTER      3
126#define OWL_SCROLLMODE_PAGED       4
[aa2f33b3]127#define OWL_SCROLLMODE_PAGEDCENTER 5
128
[7d4fbcd]129#define OWL_TAB               3  /* This *HAS* to be the size of TABSTR below */
130#define OWL_TABSTR        "   "
131#define OWL_MSGTAB            7
132#define OWL_TYPWIN_SIZE       8
133#define OWL_HISTORYSIZE       50
134
135/* Indicate current state, as well as what is allowed */
136#define OWL_CTX_ANY          0xffff
137/* Only one of these may be active at a time... */
138#define OWL_CTX_MODE_BITS    0x000f
139#define OWL_CTX_STARTUP      0x0001
140#define OWL_CTX_READCONFIG   0x0002
141#define OWL_CTX_INTERACTIVE  0x0004
142/* Only one of these may be active at a time... */
143#define OWL_CTX_ACTIVE_BITS  0xfff0
144#define OWL_CTX_POPWIN       0x00f0
145#define OWL_CTX_POPLESS      0x0010
146#define OWL_CTX_RECWIN       0x0f00
147#define OWL_CTX_RECV         0x0100
148#define OWL_CTX_TYPWIN       0xf000
[cf83b7a]149#define OWL_CTX_EDIT         0x7000
[7d4fbcd]150#define OWL_CTX_EDITLINE     0x1000
151#define OWL_CTX_EDITMULTI    0x2000
[cf83b7a]152#define OWL_CTX_EDITRESPONSE 0x4000
[7d4fbcd]153
154#define OWL_VARIABLE_OTHER      0
155#define OWL_VARIABLE_INT        1
156#define OWL_VARIABLE_BOOL       2
157#define OWL_VARIABLE_STRING     3
158
[7ba9e0de]159#define OWL_OUTPUT_RETURN       0
160#define OWL_OUTPUT_POPUP        1
161#define OWL_OUTPUT_ADMINMSG     2
162
[7d4fbcd]163#define OWL_FILTER_MAX_DEPTH    300
164
[4b464a4]165#define OWL_KEYMAP_MAXSTACK     20
[7d4fbcd]166
[b13daa0]167#define OWL_KEYBINDING_NOOP     0   /* dummy binding that does nothing */
[4b464a4]168#define OWL_KEYBINDING_COMMAND  1   /* command string */
169#define OWL_KEYBINDING_FUNCTION 2   /* function taking no args */
[7d4fbcd]170
[4b464a4]171#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]172
[1c7a4e0]173#define OWL_CMD_ALIAS_SUMMARY_PREFIX "command alias to: "
[7d4fbcd]174
[1522e5d]175#define OWL_WEBZEPHYR_PRINCIPAL "daemon/webzephyr.mit.edu"
[1d3e925]176#define OWL_WEBZEPHYR_CLASS     "webzephyr"
177#define OWL_WEBZEPHYR_OPCODE    "webzephyr"
[e7cc1c3]178
[9d21120]179#define OWL_ZEPHYR_NOSTRIP_HOST         "host/"
180#define OWL_ZEPHYR_NOSTRIP_RCMD         "rcmd."
181#define OWL_ZEPHYR_NOSTRIP_DAEMON5      "daemon/"
182#define OWL_ZEPHYR_NOSTRIP_DAEMON4      "daemon."
183
[41f0cf3]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
[6829afc]191/* Annotate functions in which the caller owns the return value and is
192 * responsible for ensuring it is freed. */
193#define CALLER_OWN G_GNUC_WARN_UNUSED_RESULT
194
[62fdd29]195#define OWL_META(key) ((key)|010000)
[f87c490]196/* OWL_CTRL is definied in kepress.c */
[7d4fbcd]197
[712caac]198#ifdef HAVE_LIBZEPHYR
[6337cb5]199/* libzephyr doesn't use const, so we appease the type system with this kludge.
200 * This just casts const char * to char * in a way that doesn't yield a warning
201 * from gcc -Wcast-qual. */
[712caac]202static inline char *zstr(const char *str)
203{
[6337cb5]204  union { char *rw; const char *ro; } u;
205  u.ro = str;
206  return u.rw;
[712caac]207}
208#endif
209
[e19eb97]210/* Convert char *const * into const char *const *.  This conversion is safe,
[c529ac8]211 * and implicit in C++ (conv.qual 4) but for some reason not in C. */
[e19eb97]212static inline const char *const *strs(char *const *pstr)
[c529ac8]213{
[e19eb97]214  return (const char *const *)pstr;
[c529ac8]215}
216
[7d4fbcd]217typedef struct _owl_variable {
218  char *name;
219  int   type;  /* OWL_VARIABLE_* */
[353719a]220  char *default_str;            /* the default value as a string */
[5001a3d]221  char *validsettings;          /* documentation of valid settings */
[06e04a9]222  char *summary;                /* summary of usage */
223  char *description;            /* detailed description */
[3b9ca71]224  bool takes_on_off;            /* allow passing on/off in argument-less set/unset */
[353719a]225  GClosure *set_fromstring_fn;
[06e04a9]226                                /* sets the variable to a value
[bbc31e4]227                                 * of the appropriate type.
228                                 * unless documented, this
229                                 * should make a copy.
230                                 * returns 0 on success. */
[353719a]231  GClosure *get_tostring_fn;
232                                /* converts val to a string;
[bbc31e4]233                                 * caller must free the result */
[353719a]234
235  /* These are only valid for OWL_VARIABLE_{INT,BOOL,STRING} */
[69f74c2]236  GValue val;                   /* current value, if default get_fn/set_fn */
237
[353719a]238  GCallback get_fn;
[bbc31e4]239                                /* returns a reference to the current value.
240                                 * WARNING:  this approach is hard to make
241                                 * thread-safe... */
[353719a]242  GCallback validate_fn;
243                                /* returns 1 if newval is valid */
244  GCallback set_fn;
[06e04a9]245                                /* sets the variable to a value
[bbc31e4]246                                 * of the appropriate type.
247                                 * unless documented, this
248                                 * should make a copy.
249                                 * returns 0 on success. */
[06e04a9]250} owl_variable;
251
[7d4fbcd]252
[428834d]253typedef struct _owl_input {
254  int ch;
255  gunichar uch;
256} owl_input;
257
[7d4fbcd]258typedef struct _owl_fmtext {
[7e111f4]259  GString *buff;
[7d4fbcd]260} owl_fmtext;
261
262typedef struct _owl_dict_el {
263  char *k;                      /* key   */
264  void *v;                      /* value */
265} owl_dict_el;
266
267typedef struct _owl_dict {
268  int size;
269  int avail;
270  owl_dict_el *els;             /* invariant: sorted by k */
271} owl_dict;
272typedef owl_dict owl_vardict;   /* dict of variables */
273typedef owl_dict owl_cmddict;   /* dict of commands */
274
275typedef struct _owl_context {
276  int   mode;
277  void *data;           /* determined by mode */
[a999d9e]278  char *keymap;
[07b59ea]279  owl_window *cursor;
[1d74663]280  void (*deactivate_cb)(struct _owl_context*);
281  void (*delete_cb)(struct _owl_context*);
[fc5eef4]282  void *cbdata;
[7d4fbcd]283} owl_context;
284
285typedef struct _owl_cmd {       /* command */
286  char *name;
287
288  char *summary;                /* one line summary of command */
289  char *usage;                  /* usage synopsis */
290  char *description;            /* long description of command */
291
292  int validctx;                 /* bitmask of valid contexts */
293
294  /* we should probably have a type here that says which of
295   * the following is valid, and maybe make the below into a union... */
296
297  /* Only one of these may be non-NULL ... */
298
299  char *cmd_aliased_to;         /* what this command is aliased to... */
300 
301  /* These don't take any context */
[2560529]302  CALLER_OWN char *(*cmd_args_fn)(int argc, const char *const *argv, const char *buff);
[7d4fbcd]303                                /* takes argv and the full command as buff.
304                                 * caller must free return value if !NULL */
305  void (*cmd_v_fn)(void);       /* takes no args */
306  void (*cmd_i_fn)(int i);      /* takes an int as an arg */
307
308  /* The following also take the active context if it's valid */
[2560529]309  CALLER_OWN char *(*cmd_ctxargs_fn)(void *ctx, int argc, const char *const *argv, const char *buff);
[7d4fbcd]310                                /* takes argv and the full command as buff.
311                                 * caller must free return value if !NULL */
312  void (*cmd_ctxv_fn)(void *ctx);               /* takes no args */
313  void (*cmd_ctxi_fn)(void *ctx, int i);        /* takes an int as an arg */
[6922edd]314  SV *cmd_perl;                                /* Perl closure that takes a list of args */
[7d4fbcd]315} owl_cmd;
316
317
318typedef struct _owl_zwrite {
[987cf3f]319  char *cmd;
[24ccc01]320  char *zwriteline;
[ce7db4d]321  char *class;
322  char *inst;
323  char *realm;
324  char *opcode;
[56330ff]325  char *zsig;
[ce7db4d]326  char *message;
[12294d2]327  GPtrArray *recips;
[7d4fbcd]328  int cc;
329  int noping;
330} owl_zwrite;
331
[d0d65df]332typedef struct _owl_pair {
[e19eb97]333  const char *key;
[de1c8a5]334  char *value;
[d0d65df]335} owl_pair;
336
[a387d12e]337struct _owl_fmtext_cache;
338
[7d4fbcd]339typedef struct _owl_message {
340  int id;
[4b464a4]341  int direction;
[be0a79f]342#ifdef HAVE_LIBZEPHYR
[b9517cf]343  bool has_notice;
[7d4fbcd]344  ZNotice_t notice;
[be0a79f]345#endif
[a387d12e]346  struct _owl_fmtext_cache * fmtext;
[7d4fbcd]347  int delete;
[e19eb97]348  const char *hostname;
[f9df2f0]349  GPtrArray *attributes;          /* this is a list of pairs */
[25dd31a]350  char *timestr;
351  time_t time;
[7d4fbcd]352} owl_message;
353
[a387d12e]354#define OWL_FMTEXT_CACHE_SIZE 1000
355/* We cache the saved fmtexts for the last bunch of messages we
356   rendered */
357typedef struct _owl_fmtext_cache {
358    owl_message * message;
359    owl_fmtext fmtext;
360} owl_fmtext_cache;
361
[bd3f232]362typedef struct _owl_style {
363  char *name;
[120291c]364  SV *perlobj;
[bd3f232]365} owl_style;
366
[7d4fbcd]367typedef struct _owl_mainwin {
368  int curtruncated;
[f2e36b5]369  int lasttruncated;
[7d4fbcd]370  int lastdisplayed;
[40d1eef]371  owl_window *window;
[7d4fbcd]372} owl_mainwin;
373
[60c1386]374typedef struct _owl_editwin owl_editwin;
375typedef struct _owl_editwin_excursion owl_editwin_excursion;
376
[7d4fbcd]377typedef struct _owl_viewwin {
378  owl_fmtext fmtext;
379  int textlines;
380  int topline;
381  int rightshift;
[68f63a2]382  owl_window *window;
[afbf668]383  void (*onclose_hook) (struct _owl_viewwin *vwin, void *data);
384  void *onclose_hook_data;
[60c1386]385
386  gulong sig_resize_id;
387  owl_window *content;
388  gulong sig_content_redraw_id;
389  owl_window *status;
390  gulong sig_status_redraw_id;
[09ceee3]391  owl_window *cmdwin;
[7d4fbcd]392} owl_viewwin;
393 
394typedef struct _owl_popwin {
[68f63a2]395  owl_window *border;
396  owl_window *content;
[b3b1b05]397  gulong sig_redraw_id;
398  gulong sig_resize_id;
[7d4fbcd]399} owl_popwin;
[d70f45f]400 
401typedef struct _owl_msgwin {
402  char *msg;
403  owl_window *window;
404  gulong redraw_id;
405} owl_msgwin;
[7d4fbcd]406
407typedef struct _owl_messagelist {
[fc8a87a]408  GPtrArray *list;
[7d4fbcd]409} owl_messagelist;
410
411typedef struct _owl_regex {
412  int negate;
413  char *string;
414  regex_t re;
415} owl_regex;
416
417typedef struct _owl_filterelement {
[bd65108]418  int (*match_message)(const struct _owl_filterelement *fe, const owl_message *m);
[cb769bb]419  /* Append a string representation of the filterelement onto buf*/
[bd65108]420  void (*print_elt)(const struct _owl_filterelement *fe, GString *buf);
[cb769bb]421  /* Operands for and,or,not*/
422  struct _owl_filterelement *left, *right;
423  /* For regex filters*/
[7d4fbcd]424  owl_regex re;
[cb769bb]425  /* Used by regexes, filter references, and perl */
426  char *field;
[7d4fbcd]427} owl_filterelement;
428
429typedef struct _owl_filter {
430  char *name;
[cb769bb]431  owl_filterelement * root;
[8fa9562]432  int fgcolor;
433  int bgcolor;
[7d4fbcd]434} owl_filter;
435
436typedef struct _owl_view {
[c3ab155]437  char *name;
[7d4fbcd]438  owl_filter *filter;
[219f52c]439  owl_messagelist *ml;
[1fdab04]440  const owl_style *style;
[c3a47c9]441  int cachedmsgid;
[7d4fbcd]442} owl_view;
443
444typedef struct _owl_history {
[95b52d1]445  GQueue hist;
446  GList *cur;
[b470451]447  bool partial;
[7d4fbcd]448} owl_history;
449
[d2a4534]450typedef struct _owl_mainpanel {
451  owl_window *panel;
452  owl_window *typwin;
453  owl_window *sepwin;
454  owl_window *msgwin;
455  owl_window *recwin;
456  int recwinlines;
457} owl_mainpanel;
458
[7d4fbcd]459typedef struct _owl_keybinding {
[e1b136bf]460  int  *keys;                   /* keypress stack */
461  int   len;                    /* length of stack */
[7d4fbcd]462  int   type;                   /* command or function? */
463  char *desc;                   /* description (or "*user*") */
464  char *command;                /* command, if of type command */
465  void (*function_fn)(void);    /* function ptr, if of type function */
466} owl_keybinding;
467
468typedef struct _owl_keymap {
469  char     *name;               /* name of keymap */
470  char     *desc;               /* description */
[e4d7cb6]471  GPtrArray *bindings;          /* key bindings */
[44cc9ab]472  const struct _owl_keymap *parent;     /* parent */
[428834d]473  void (*default_fn)(owl_input j);      /* default action (takes a keypress) */
474  void (*prealways_fn)(owl_input  j);   /* always called before a keypress is received */
475  void (*postalways_fn)(owl_input  j);  /* always called after keypress is processed */
[7d4fbcd]476} owl_keymap;
477
478typedef struct _owl_keyhandler {
479  owl_dict  keymaps;            /* dictionary of keymaps */
[afa200a]480  const owl_keymap *active;             /* currently active keymap */
[7d4fbcd]481  int       in_esc;             /* escape pressed? */
482  int       kpstack[OWL_KEYMAP_MAXSTACK+1]; /* current stack of keypresses */
483  int       kpstackpos;         /* location in stack (-1 = none) */
484} owl_keyhandler;
485
[5a95b69]486typedef struct _owl_zbuddylist {
[7ed9bc6]487  GPtrArray *zusers;
[5a95b69]488} owl_zbuddylist;
489
[ec6ff52]490typedef struct _owl_errqueue {
[eb897c6]491  GPtrArray *errlist;
[ec6ff52]492} owl_errqueue;
493
[8fa9562]494typedef struct _owl_colorpair_mgr {
[99c7549]495  int next;
[c2c5c77]496  short **pairs;
[099597c]497  bool overflow;
[8fa9562]498} owl_colorpair_mgr;
499
[40c6657]500typedef struct _owl_popexec {
501  int refcount;
502  owl_viewwin *vwin;
503  int winactive;
[0e5afa2]504  pid_t pid;                    /* or 0 if it has terminated */
[a6a9ddb]505  guint io_watch;
[40c6657]506} owl_popexec;
507
[7d4fbcd]508typedef struct _owl_global {
[ab88b05]509  owl_mainwin *mw;
[03ca005]510  owl_popwin *pw;
[d70f45f]511  owl_msgwin msgwin;
[10b866d]512  owl_history cmdhist;          /* command history */
513  owl_history msghist;          /* outgoing message history */
[7d4fbcd]514  owl_keyhandler kh;
[129e609]515  owl_dict filters;
516  GList *filterlist;
[e6d7e4e]517  GPtrArray *puntlist;
[7d4fbcd]518  owl_vardict vars;
519  owl_cmddict cmds;
[a999d9e]520  GList *context_stack;
[ec6ff52]521  owl_errqueue errqueue;
[7d4fbcd]522  int lines, cols;
[bd783db]523  int curmsg, topmsg;
[70110286]524  int markedmsgid;              /* for finding the marked message when it has moved. */
[7d4fbcd]525  int curmsg_vert_offset;
526  owl_view current_view;
[219f52c]527  owl_messagelist *msglist;
[0881cdd]528  WINDOW *input_pad;
[d2a4534]529  owl_mainpanel mainpanel;
[f6fae8d]530  gulong typwin_erase_id;
[7d4fbcd]531  int rightshift;
[3535a6e]532  bool resizepending;
[a8938c7]533  char *homedir;
[b363d83]534  char *confdir;
535  char *startupfile;
[7d4fbcd]536  int direction;
537  int haveconfig;
538  int config_format;
[a556caa]539  owl_editwin *tw;
[9eb38bb]540  owl_viewwin *vw;
[7d4fbcd]541  void *perl;
542  int debug;
[7f792c1]543  time_t starttime;
544  time_t lastinputtime;
[120dac7]545  time_t last_wakeup_time;
[a8938c7]546  char *startupargs;
[7d4fbcd]547  int nextmsgid;
[8fa9562]548  owl_colorpair_mgr cpmgr;
[0e5afa2]549  pid_t newmsgproc_pid;
[41c9a96]550  owl_regex search_re;
[4fd3c04]551  GQueue *messagequeue;     /* for queueing up messages */
[f1e629d]552  owl_dict styledict;       /* global dictionary of available styles */
[cf83b7a]553  char *response;           /* response to the last question asked */
[09489b89]554  int havezephyr;
[5a95b69]555  owl_zbuddylist zbuddies;
[f25812b]556  GList *zaldlist;
557  int pseudologin_notify;
[8232149]558  struct termios startup_tio;
[52a0f14]559  int load_initial_subs;
[d12a8c7]560  FILE *debug_file;
[5f8ec6b]561  char *kill_buffer;
[47128d9]562  int interrupt_count;
[cb124fc6]563#if GLIB_CHECK_VERSION(2, 31, 0)
564  GMutex interrupt_lock;
565#else
[47128d9]566  GMutex *interrupt_lock;
[cb124fc6]567#endif
[7d4fbcd]568} owl_global;
569
570/* globals */
[b2b0773]571extern owl_global g;
[7d4fbcd]572
[6249a88f]573#include <owl_prototypes.h>
[7d4fbcd]574
[d127638]575/* These were missing from the Zephyr includes before Zephyr 3. */
576#if defined HAVE_LIBZEPHYR && defined ZCONST
[7d4fbcd]577int ZGetSubscriptions(ZSubscription_t *, int *);
578int ZGetLocations(ZLocations_t *,int *);
[be0a79f]579#endif
[7d4fbcd]580
[06e04a9]581/* We have to dynamically bind these ourselves */
582extern gboolean (*gvalue_from_sv) (GValue * value, SV * sv);
583extern SV * (*sv_from_gvalue) (const GValue * value);
584extern GClosure * (*perl_closure_new) (SV * callback, SV * data, gboolean swap);
585
586
[06adc25]587#endif /* INC_BARNOWL_OWL_H */
Note: See TracBrowser for help on using the repository browser.