Changes in / [e2cbbbe:9a7b4f2]


Ignore:
Files:
1 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r8a5b5a1 rd564c3d  
    1 #include <getopt.h>
    21#include <stdio.h>
    32#include <stdlib.h>
     
    9291              "Use 'show keymaps' to see the existing keymaps.\n"
    9392              "Key sequences may be things like M-C-t or NPAGE.\n\n"
    94               "Ex.: bindkey recv C-b command zwrite -c barnowl"
    95               "SEE ALSO: bindkey"),
    96 
    97   OWLCMD_ARGS("unbindkey", owl_command_unbindkey, OWL_CTX_ANY,
    98               "removes a binding in a keymap",
    99               "bindkey <keymap> <keyseq>",
    100               "Removes a binding of a key sequence within a keymap.\n"
    101               "Use 'show keymaps' to see the existing keymaps.\n"
    102               "Ex.: unbindkey recv H"
    103               "SEE ALSO: bindkey"),
     93              "Ex.: bindkey recv C-b command zwrite -c barnowl"),
    10494
    10595  OWLCMD_ARGS("zwrite", owl_command_zwrite, OWL_CTX_INTERACTIVE,
     
    593583  OWLCMD_ARGS("smartnarrow", owl_command_smartnarrow, OWL_CTX_INTERACTIVE,
    594584              "view only messages similar to the current message",
    595               "smartnarrow [-i | --instance]  [-r | --relatde]",
     585              "smartnarrow [-i | --instance]",
    596586              "If the curmsg is a personal message narrow\n"
    597587              "   to the conversation with that user.\n"
     
    601591              "    to the class.\n"
    602592              "If the curmsg is a class message and '-i' is specified\n"
    603               "    then narrow to the class and instance.\n"
    604               "If '-r' or '--related' is specified, behave as though the\n"
    605               "    'narrow-related' variable was inverted."),
     593              "    then narrow to the class and instance.\n"),
    606594
    607595  OWLCMD_ARGS("smartfilter", owl_command_smartfilter, OWL_CTX_INTERACTIVE,
     
    909897                  "", ""),
    910898
    911   OWLCMD_ALIAS   ("editline:done", "edit:done"),
    912   OWLCMD_ALIAS   ("editresponse:done", "edit:done"),
     899  OWLCMD_VOID_CTX("editline:done", owl_command_editline_done,
     900                  OWL_CTX_EDITLINE,
     901                  "completes the command (eg, executes command being composed)",
     902                  "", ""),
     903
     904  OWLCMD_VOID_CTX("editresponse:done", owl_command_editresponse_done,
     905                  OWL_CTX_EDITRESPONSE,
     906                  "completes the response to a question",
     907                  "", ""),
    913908
    914909  OWLCMD_VOID_CTX("edit:move-up-line", owl_editwin_key_up,
     
    923918
    924919  OWLCMD_VOID_CTX("edit:done", owl_command_edit_done,
    925                   OWL_CTX_EDIT,
    926                   "Finishes entering text in the editwin.",
     920                  OWL_CTX_EDITMULTI,
     921                  "completes the command (eg, sends message being composed)",
    927922                  "", ""),
    928923
     
    12411236      argc-=2; argv+=2;
    12421237    } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) {
    1243       filter = owl_function_smartfilter(0, 0);
     1238      filter = owl_function_smartfilter(0);
    12441239      argc-=2; argv+=2;
    12451240    } else if (argc>=2 && !strcmp(argv[1], "--smart-filter-instance")) {
    1246       filter = owl_function_smartfilter(1, 0);
     1241      filter = owl_function_smartfilter(1);
    12471242      argc-=2; argv+=2;
    12481243    } else {
     
    12711266      argc-=2; argv+=2;
    12721267    } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) {
    1273       filter = owl_function_smartfilter(0, 0);
     1268      filter = owl_function_smartfilter(0);
    12741269      argc-=2; argv+=2;
    12751270    } else if (argc>=2 && !strcmp(argv[1], "--smart-filter-instance")) {
    1276       filter = owl_function_smartfilter(1, 0);
     1271      filter = owl_function_smartfilter(1);
    12771272      argc-=2; argv+=2; 
    12781273   } else {
     
    12901285  char *filtname = NULL;
    12911286
    1292   char opt;
    1293   int instance = 0, related = 0, i;
    1294   char **tmp_argv = owl_malloc(sizeof(char *) * argc);
    1295 
    1296   for (i = 0; i < argc; i++)
    1297     tmp_argv[i] = owl_strdup(argv[i]);
    1298 
    1299   static struct option options[] = {
    1300     {"instance", 0, 0, 'i'},
    1301     {"related",  0, 0, 'r'},
    1302     {NULL,       0, 0, 0}};
    1303   while ((opt = getopt_long(argc, tmp_argv, "ir", options, NULL)) != -1) {
    1304     switch (opt) {
    1305       case 'i':
    1306         instance = 1;
    1307         break;
    1308       case 'r':
    1309         related = 1;
    1310         break;
    1311       default:
    1312         owl_function_makemsg("Wrong number of arguments for %s (%c)", argv[0], opt);
    1313         goto done;
    1314     }
    1315   }
    1316 
    1317   for (i = 0; i < argc; i++)
    1318     owl_free(tmp_argv[i]);
    1319   owl_free(tmp_argv);
    1320 
    1321   filtname = owl_function_smartfilter(instance, related);
    1322 
     1287  if (argc == 1) {
     1288    filtname = owl_function_smartfilter(0);
     1289  } else if (argc == 2 && (!strcmp(argv[1], "-i") || !strcmp(argv[1], "--instance"))) {
     1290    filtname = owl_function_smartfilter(1);
     1291  } else {
     1292    owl_function_makemsg("Wrong number of arguments for %s", argv[0]);   
     1293  }
    13231294  if (filtname) {
    13241295    owl_function_change_currentview_filter(filtname);
    13251296    owl_free(filtname);
    13261297  }
    1327 
    1328 done:
    1329   optind = 0; /* reset getopt */
    13301298  return NULL;
    13311299}
     
    13361304
    13371305  if (argc == 1) {
    1338     filtname = owl_function_smartfilter(0, 0);
     1306    filtname = owl_function_smartfilter(0);
    13391307  } else if (argc == 2 && (!strcmp(argv[1], "-i") || !strcmp(argv[1], "--instance"))) {
    1340     filtname = owl_function_smartfilter(1, 0);
     1308    filtname = owl_function_smartfilter(1);
    13411309  } else {
    13421310    owl_function_makemsg("Wrong number of arguments for %s", argv[0]);   
     
    17041672  return NULL;
    17051673}
    1706 
    1707 
    1708 char *owl_command_unbindkey(int argc, const char *const *argv, const char *buf)
    1709 {
    1710   owl_keymap *km;
    1711   int ret;
    1712 
    1713   if (argc < 3) {
    1714     owl_function_makemsg("Usage: bindkey <keymap> <binding>");
    1715     return NULL;
    1716   }
    1717   km = owl_keyhandler_get_keymap(owl_global_get_keyhandler(&g), argv[1]);
    1718   if (!km) {
    1719     owl_function_makemsg("No such keymap '%s'", argv[1]);
    1720     return NULL;
    1721   }
    1722   ret = owl_keymap_remove_binding(km, argv[2]);
    1723   if (ret == -1) {
    1724     owl_function_makemsg("Unable to unbind '%s' in keymap '%s'.",
    1725                          argv[2], argv[1]);
    1726     return NULL;
    1727   } else if (ret == -2) {
    1728     owl_function_makemsg("No such binding '%s' in keymap '%s'.",
    1729                          argv[2], argv[1]);
    1730   }
    1731   return NULL;
    1732 }
    1733 
    17341674
    17351675void owl_command_quit(void)
     
    22802220    return NULL;
    22812221  }
    2282   filtname = owl_function_classinstfilt(argv[1], NULL, owl_global_is_narrow_related(&g));
     2222  filtname = owl_function_classinstfilt(argv[1], NULL);
    22832223  owl_function_change_currentview_filter(filtname);
    22842224  owl_free(filtname);
     
    23922332  }
    23932333
    2394   filtname=owl_function_classinstfilt(argv[1], NULL, owl_global_is_narrow_related(&g));
     2334  filtname=owl_function_classinstfilt(argv[1], NULL);
    23952335  (void) owl_function_color_filter(filtname, argv[2], (argc == 4 ? argv[3] : NULL));
    23962336  return NULL;
     
    25842524  /* if we get two arguments, ask for the password */
    25852525  if (argc==2) {
    2586     owl_editwin *e = owl_function_start_password("AIM Password: ");
    2587     owl_editwin_set_cbdata(e, owl_strdup(argv[1]), owl_free);
    2588     owl_editwin_set_callback(e, owl_callback_aimlogin);
     2526    owl_global_set_buffercommand(&g, argv[1]);
     2527    owl_global_set_buffercallback(&g, &owl_callback_aimlogin);
     2528    owl_function_start_password("AIM Password: ");
    25892529    return(NULL);
    25902530  } else {
     
    27152655  }
    27162656
     2657  owl_editwin_fullclear(e);
    27172658  owl_global_set_needrefresh(&g);
     2659  owl_global_set_typwin_inactive(&g);
     2660  owl_editwin_new_style(e, OWL_EDITWIN_STYLE_ONELINE, NULL);
     2661
    27182662  owl_global_pop_context(&g);
    2719 
    2720   owl_global_set_typwin_inactive(&g);
    2721   owl_editwin_delete(e);
    27222663}
    27232664
     
    27692710}
    27702711
     2712void owl_command_editline_done(owl_editwin *e)
     2713{
     2714  owl_history *hist=owl_editwin_get_history(e);
     2715  char *rv, *cmd;
     2716
     2717  owl_history_store(hist, owl_editwin_get_text(e));
     2718  owl_history_reset(hist);
     2719  owl_global_set_typwin_inactive(&g);
     2720  owl_global_pop_context(&g);
     2721  cmd = owl_strdup(owl_editwin_get_text(e));
     2722  owl_editwin_fullclear(e);
     2723  rv = owl_function_command(cmd);
     2724  owl_free(cmd);
     2725
     2726  owl_global_set_needrefresh(&g);
     2727
     2728  if (rv) {
     2729    owl_function_makemsg("%s", rv);
     2730    owl_free(rv);
     2731  }
     2732}
     2733
     2734
     2735void owl_command_editresponse_done(owl_editwin *e)
     2736{
     2737  owl_function_run_buffercommand();
     2738
     2739  owl_global_set_typwin_inactive(&g);
     2740  owl_global_pop_context(&g);
     2741  owl_editwin_fullclear(e);
     2742  owl_global_set_needrefresh(&g);
     2743}
     2744
     2745
    27712746void owl_command_edit_done(owl_editwin *e)
    27722747{
    27732748  owl_history *hist=owl_editwin_get_history(e);
    27742749
    2775   if (hist) {
    2776     owl_history_store(hist, owl_editwin_get_text(e));
    2777     owl_history_reset(hist);
    2778   }
    2779 
     2750  owl_history_store(hist, owl_editwin_get_text(e));
     2751  owl_history_reset(hist);
     2752
     2753  owl_function_run_buffercommand();
     2754  owl_editwin_new_style(e, OWL_EDITWIN_STYLE_ONELINE, NULL);
     2755  owl_editwin_fullclear(e);
    27802756  owl_global_set_typwin_inactive(&g);
    27812757  owl_global_pop_context(&g);
    27822758  owl_global_set_needrefresh(&g);
    2783 
    2784   owl_editwin_do_callback(e);
    2785   owl_editwin_delete(e);
    27862759}
    27872760
  • configure.ac

    r9a7b4f2 r9a7b4f2  
    9898AC_MSG_NOTICE([Adding perl LIBS ${FOO}])
    9999LIBS=${LIBS}\ ${FOO}
    100 AC_CHECK_LIB([perl], [perl_alloc],, AC_MSG_ERROR([No libperl found]))
    101 
    102 AX_PROG_PERL_MODULES([Class::Accessor::Fast],,
    103                      [AC_MSG_ERROR([cannot find perl module Class::Accessor::Fast.])])
    104 AX_PROG_PERL_MODULES([PAR],,
    105                      [AC_MSG_WARN([PAR.pm not found. Loadable modules will be disabled.])])
    106100
    107101dnl Add CFLAGS and LDFLAGS for glib-2.0
     
    141135AC_PROG_INSTALL
    142136AC_PROG_RANLIB
    143 AC_CHECK_PROG([HAVE_ZIP], [zip], [yes], [no])
    144 if test "x${HAVE_ZIP}" = "xno"; then
    145    AC_MSG_ERROR([cannot find a 'zip' binary.])
    146 fi
    147137
    148138AC_CONFIG_FILES([Makefile libfaim/Makefile perl/Makefile perl/modules/Makefile])
  • editwin.c

    r21dd391 rf449096  
    3535  oe_excursion *excursions;
    3636
     37  char *command;
    3738  void (*callback)(struct _owl_editwin*);
    38   void (*destroy_cbdata)(void *);
    3939  void *cbdata;
    4040};
     
    4545static void oe_restore_excursion(owl_editwin *e, oe_excursion *x);
    4646static void oe_restore_mark_only(owl_editwin *e, oe_excursion *x);
     47static int oe_count_glyphs(const char *s);
    4748static int oe_char_width(gunichar c, int column);
    4849static int oe_region_width(owl_editwin *e, int start, int end, int width);
     
    5758static int oe_copy_region(owl_editwin *e);
    5859static char *oe_chunk(owl_editwin *e, int start, int end);
    59 static void oe_destroy_cbdata(owl_editwin *e);
    6060
    6161#define INCR 4096
     
    6363#define WHITESPACE " \n\t"
    6464
    65 static owl_editwin *owl_editwin_allocate(void)
     65owl_editwin *owl_editwin_allocate(void)
    6666{
    6767  owl_editwin *e;
     
    7575  owl_free(e->buff);
    7676  owl_free(e->killbuf);
     77  owl_free(e->command);
    7778  /* just in case someone forgot to clean up */
    7879  while (e->excursions) {
    7980    oe_release_excursion(e, e->excursions);
    8081  }
    81   oe_destroy_cbdata(e);
    8282
    8383  owl_free(e);
     84}
     85
     86static int oe_count_glyphs(const char *s)
     87{
     88  int count = 0;
     89  const char *p;
     90
     91  for(p = s; *p != 0; p = g_utf8_find_next_char(p, NULL))
     92    if (!g_unichar_ismark(g_utf8_get_char(p)))
     93      count++;
     94
     95  return count;
    8496}
    8597
     
    104116}
    105117
    106 static void _owl_editwin_init(owl_editwin *e,
    107                               WINDOW *win,
    108                               int winlines,
    109                               int wincols,
    110                               int style,
    111                               owl_history *hist)
     118/* initialize the editwin e.
     119 * 'win' is an already initialzed curses window that will be used by editwin
     120 */
     121void owl_editwin_init(owl_editwin *e, WINDOW *win, int winlines, int wincols, int style, owl_history *hist)
    112122{
    113123  e->buff=owl_malloc(INCR);
     
    135145  e->echochar='\0';
    136146
     147  /* We get initialized multiple times, but we need to hold on to
     148     the callbacks, so we can't NULL them here. */
     149  /*
     150    e->command = NULL;
     151    e->callback = NULL;
     152    e->cbdata = NULL;
     153  */
    137154  if (win) werase(win);
    138 }
    139 
    140 owl_editwin *owl_editwin_new(WINDOW *win, int winlines, int wincols, int style, owl_history *hist)
    141 {
    142   owl_editwin *e = owl_editwin_allocate();
    143 
    144   _owl_editwin_init(e, win, winlines, wincols, style, hist);
    145   return e;
    146155}
    147156
     
    179188}
    180189
     190void owl_editwin_set_command(owl_editwin *e, const char *command)
     191{
     192  if(e->command) owl_free(e->command);
     193  e->command = owl_strdup(command);
     194}
     195
     196const char *owl_editwin_get_command(owl_editwin *e)
     197{
     198  if(e->command) return e->command;
     199  return "";
     200}
     201
    181202void owl_editwin_set_callback(owl_editwin *e, void (*cb)(owl_editwin*))
    182203{
     
    189210}
    190211
    191 static void oe_destroy_cbdata(owl_editwin *e) {
    192   if (e->destroy_cbdata)
    193     e->destroy_cbdata(e->cbdata);
    194   e->cbdata = NULL;
    195   e->destroy_cbdata = NULL;
    196 }
    197 
    198 void owl_editwin_set_cbdata(owl_editwin *e, void *data, void (*destroy)(void *))
    199 {
    200   oe_destroy_cbdata(e);
     212void owl_editwin_set_cbdata(owl_editwin *e, void *data)
     213{
    201214  e->cbdata = data;
    202   e->destroy_cbdata = destroy;
    203215}
    204216
     
    247259}
    248260
     261void owl_editwin_new_style(owl_editwin *e, int newstyle, owl_history *h)
     262{
     263  e->hist = h;
     264
     265  if (e->style==newstyle) return;
     266
     267  if (newstyle==OWL_EDITWIN_STYLE_MULTILINE) {
     268    e->style=newstyle;
     269  } else if (newstyle==OWL_EDITWIN_STYLE_ONELINE) {
     270    e->style=newstyle;
     271
     272    /* nuke everything after the first line */
     273    owl_editwin_move_to_top(e);
     274    owl_editwin_move_to_end_of_line(e);
     275    owl_editwin_replace(e, oe_count_glyphs(e->buff + e->index),  "");
     276  }
     277}
     278
     279/* completly reinitialize the buffer */
     280void owl_editwin_fullclear(owl_editwin *e)
     281{
     282  owl_free(e->buff);
     283  owl_editwin_init(e, e->curswin, e->winlines, e->wincols, e->style, e->hist);
     284}
     285
    249286/* clear all text except for locktext and put the cursor at the
    250287 * beginning
     
    265302
    266303  owl_free(e->buff);
    267   _owl_editwin_init(e, e->curswin, e->winlines, e->wincols, e->style, e->hist);
     304  owl_editwin_init(e, e->curswin, e->winlines, e->wincols, e->style, e->hist);
    268305
    269306  if (lock > 0) {
  • functions.c

    r9a7b4f2 r9a7b4f2  
    278278}
    279279
    280 void owl_function_start_edit_win(const char *line, void (*callback)(owl_editwin *), void *data, void (*cleanup)(void *))
     280void owl_function_start_edit_win(const char *line, void (*callback)(owl_editwin *), void *data)
    281281{
    282282  owl_editwin *e;
     
    284284
    285285  /* create and setup the editwin */
    286   e = owl_global_set_typwin_active(&g, OWL_EDITWIN_STYLE_MULTILINE,
    287                                    owl_global_get_msg_history(&g));
     286  e = owl_global_get_typwin(&g);
     287  owl_editwin_new_style(e, OWL_EDITWIN_STYLE_MULTILINE,
     288                        owl_global_get_msg_history(&g));
     289  owl_editwin_clear(e);
    288290  owl_editwin_set_dotsend(e);
    289291  s = owl_sprintf("----> %s\n", line);
     
    291293  owl_free(s);
    292294
    293   owl_editwin_set_cbdata(e, data, cleanup);
    294   owl_editwin_set_callback(e, callback);
     295  /* make it active */
     296  owl_global_set_typwin_active(&g);
     297
     298  owl_editwin_set_cbdata(owl_global_get_typwin(&g), data);
     299  owl_global_set_buffercallback(&g, callback);
    295300  owl_global_push_context(&g, OWL_CTX_EDITMULTI, e, "editmulti");
    296301}
     
    308313                         noun);
    309314
    310   owl_function_start_edit_win(line, callback,
    311                               owl_strdup(line),
    312                               owl_free);
     315  owl_function_start_edit_win(line, callback, NULL);
     316  owl_global_set_buffercommand(&g, line);
    313317}
    314318
     
    346350
    347351void owl_callback_zwrite(owl_editwin *e) {
    348   char *command = owl_editwin_get_cbdata(e);
    349   owl_function_zwrite(command,
     352  owl_function_zwrite(owl_editwin_get_command(e),
    350353                      owl_editwin_get_text(e));
    351354}
     
    456459
    457460void owl_callback_aimwrite(owl_editwin *e) {
    458   char *command = owl_editwin_get_cbdata(e);
    459   owl_function_aimwrite(command,
     461  owl_function_aimwrite(owl_editwin_get_command(e),
    460462                        owl_editwin_get_text(e));
    461463}
     
    892894
    893895void owl_callback_aimlogin(owl_editwin *e) {
    894   char *user = owl_editwin_get_cbdata(e);
    895   owl_function_aimlogin(user,
     896  owl_function_aimlogin(owl_editwin_get_command(e),
    896897                        owl_editwin_get_text(e));
    897898}
     
    11921193{
    11931194  owl_global_set_resize_pending(&g);
     1195}
     1196
     1197void owl_function_run_buffercommand(void)
     1198{
     1199  owl_editwin_do_callback(owl_global_get_typwin(&g));
    11941200}
    11951201
     
    19111917}
    19121918
    1913 void owl_callback_command(owl_editwin *e)
    1914 {
    1915   char *rv;
    1916   const char *line = owl_editwin_get_text(e);
    1917 
    1918   rv = owl_function_command(line);
    1919    if (rv) {
    1920     owl_function_makemsg("%s", rv);
    1921     owl_free(rv);
    1922   }
    1923 }
    1924 
    19251919void owl_function_start_command(const char *line)
    19261920{
    19271921  owl_editwin *tw;
    19281922
    1929   tw = owl_global_set_typwin_active(&g, OWL_EDITWIN_STYLE_ONELINE, owl_global_get_cmd_history(&g));
     1923  tw=owl_global_get_typwin(&g);
     1924  owl_global_set_typwin_active(&g);
     1925  owl_editwin_new_style(tw, OWL_EDITWIN_STYLE_ONELINE,
     1926                        owl_global_get_cmd_history(&g));
    19301927
    19311928  owl_editwin_set_locktext(tw, "command: ");
     
    19361933
    19371934  owl_global_push_context(&g, OWL_CTX_EDITLINE, tw, "editline");
    1938   owl_editwin_set_callback(tw, owl_callback_command);
    1939 }
    1940 
    1941 owl_editwin *owl_function_start_question(const char *line)
     1935}
     1936
     1937void owl_function_start_question(const char *line)
    19421938{
    19431939  owl_editwin *tw;
    19441940
    1945   tw = owl_global_set_typwin_active(&g, OWL_EDITWIN_STYLE_ONELINE, owl_global_get_cmd_history(&g));
     1941  tw=owl_global_get_typwin(&g);
     1942  owl_global_set_typwin_active(&g);
     1943  owl_editwin_new_style(tw, OWL_EDITWIN_STYLE_ONELINE, owl_global_get_cmd_history(&g));
    19461944
    19471945  owl_editwin_set_locktext(tw, line);
     
    19501948  owl_editwin_redisplay(tw);
    19511949
    1952   owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse");
    1953   return tw;
    1954 }
    1955 
    1956 owl_editwin *owl_function_start_password(const char *line)
     1950  owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editline");
     1951}
     1952
     1953void owl_function_start_password(const char *line)
    19571954{
    19581955  owl_editwin *tw;
    19591956
    1960   tw = owl_global_set_typwin_active(&g, OWL_EDITWIN_STYLE_ONELINE, NULL);
    1961 
     1957  tw=owl_global_get_typwin(&g);
     1958  owl_global_set_typwin_active(&g);
     1959  owl_editwin_new_style(tw, OWL_EDITWIN_STYLE_ONELINE, owl_global_get_cmd_history(&g));
    19621960  owl_editwin_set_echochar(tw, '*');
    19631961
     
    19681966
    19691967  owl_global_push_context(&g, OWL_CTX_EDITRESPONSE, tw, "editresponse");
    1970   return tw;
    19711968}
    19721969
     
    22922289 * instance is NULL then catch all messgaes in the class.  Returns the
    22932290 * name of the filter, which the caller must free.
    2294  * If 'related' is nonzero, encompass unclasses and .d classes as well.
    22952291 */
    2296 char *owl_function_classinstfilt(const char *c, const char *i, int related)
     2292char *owl_function_classinstfilt(const char *c, const char *i)
    22972293{
    22982294  owl_filter *f;
     
    23012297  char *class, *instance = NULL;
    23022298
    2303   if (related) {
    2304     class = owl_util_baseclass(c);
    2305     if (i) {
    2306       instance = owl_util_baseclass(i);
    2307     }
    2308   } else {
    2309     class = owl_strdup(c);
    2310     if (i) {
    2311       instance = owl_strdup(i);
    2312     }
     2299  class = owl_util_baseclass(c);
     2300  if(i) {
     2301    instance = owl_util_baseclass(i);
    23132302  }
    23142303
    23152304  /* name for the filter */
    23162305  if (!instance) {
    2317     filtname = owl_sprintf("%sclass-%s", related ? "related-" : "", class);
    2318   } else {
    2319     filtname = owl_sprintf("%sclass-%s-instance-%s", related ? "related-" : "", class, instance);
     2306    filtname = owl_sprintf("class-%s", class);
     2307  } else {
     2308    filtname = owl_sprintf("class-%s-instance-%s", class, instance);
    23202309  }
    23212310  /* downcase it */
     
    23492338  }
    23502339
    2351   argbuff = owl_sprintf(related ? "class ^(un)*%s(\\.d)*$" : "class ^%s$", tmpclass);
     2340  argbuff = owl_sprintf("class ^(un)*%s(\\.d)*$", tmpclass);
    23522341  if (tmpinstance) {
    23532342    char *tmp = argbuff;
    2354     argbuff = owl_sprintf(related ? "%s and ( instance ^(un)*%s(\\.d)*$ )" : "%s and instance ^%s$", tmp, tmpinstance);
     2343    argbuff = owl_sprintf("%s and ( instance ^(un)*%s(\\.d)*$ )", tmp, tmpinstance);
    23552344    owl_free(tmp);
    23562345  }
     
    25232512 *    name to the AIM conversation with that user
    25242513 */
    2525 char *owl_function_smartfilter(int type, int invert_related)
     2514char *owl_function_smartfilter(int type)
    25262515{
    25272516  const owl_view *v;
    25282517  const owl_message *m;
    25292518  char *zperson, *filtname=NULL;
    2530   const char *argv[2];
    2531   int related = owl_global_is_narrow_related(&g) ^ invert_related;
    2532 
     2519  const char *argv[1];
     2520 
    25332521  v=owl_global_get_current_view(&g);
    25342522  m=owl_view_get_element(v, owl_global_get_curmsg(&g));
     
    25742562    /* narrow class MESSAGE, instance foo, recip * messages to class, inst */
    25752563    if (!strcasecmp(owl_message_get_class(m), "message")) {
    2576       filtname=owl_function_classinstfilt(owl_message_get_class(m), owl_message_get_instance(m), related);
     2564      filtname=owl_function_classinstfilt(owl_message_get_class(m), owl_message_get_instance(m));
    25772565      return(filtname);
    25782566    }
     
    25802568    /* otherwise narrow to the class */
    25812569    if (type==0) {
    2582       filtname=owl_function_classinstfilt(owl_message_get_class(m), NULL, related);
     2570      filtname=owl_function_classinstfilt(owl_message_get_class(m), NULL);
    25832571    } else if (type==1) {
    2584       filtname=owl_function_classinstfilt(owl_message_get_class(m), owl_message_get_instance(m), related);
     2572      filtname=owl_function_classinstfilt(owl_message_get_class(m), owl_message_get_instance(m));
    25852573    }
    25862574    return(filtname);
     
    25882576
    25892577  /* pass it off to perl */
    2590   argv[0] = type ? "1" : "0";
    2591   argv[1] = related ? "1" : "0";
    2592   return owl_perlconfig_message_call_method(m, "smartfilter", 2, argv);
     2578  if(type) {
     2579    argv[0] = "-i";
     2580  };
     2581  return owl_perlconfig_message_call_method(m, "smartfilter", type ? 1 : 0, argv);
    25932582}
    25942583
     
    34293418  int i, j;
    34303419  owl_list anyone;
     3420  owl_message *m;
    34313421  owl_zbuddylist *zbl;
    3432   GList **zaldlist;
    3433   GList *zaldptr;
    3434   ZAsyncLocateData_t *zald;
    34353422  const char *user;
     3423  ZLocations_t location[200];
     3424  int numlocs, ret;
    34363425
    34373426  if (!owl_global_is_havezephyr(&g)) return;
    3438   owl_global_set_pseudologin_notify(&g, notify);
    3439   zbl = owl_global_get_zephyr_buddylist(&g);
    3440   zaldlist = owl_global_get_zaldlist(&g);
    3441 
    3442   /* Clear the existing ZALDs first. */
    3443   zaldptr = g_list_first(*zaldlist);
    3444   while (zaldptr) {
    3445     ZFreeALD(zaldptr->data);
    3446     owl_free(zaldptr->data);
    3447     zaldptr = g_list_next(zaldptr);
    3448   }
    3449   g_list_free(*zaldlist);
    3450   *zaldlist = NULL;
     3427
     3428  zbl=owl_global_get_zephyr_buddylist(&g);
    34513429
    34523430  owl_list_create(&anyone);
    3453   owl_zephyr_get_anyone_list(&anyone, NULL);
    3454   j = owl_list_get_size(&anyone);
    3455   for (i = 0; i < j; i++) {
    3456     user = owl_list_get_element(&anyone, i);
    3457     zald = owl_malloc(sizeof(ZAsyncLocateData_t));
    3458     if (ZRequestLocations(zstr(user), zald, UNACKED, ZAUTH) == ZERR_NONE) {
    3459       *zaldlist = g_list_append(*zaldlist, zald);
    3460     } else {
    3461       owl_free(zald);
     3431  ret=owl_zephyr_get_anyone_list(&anyone, NULL);
     3432
     3433  j=owl_list_get_size(&anyone);
     3434  for (i=0; i<j; i++) {
     3435    user=owl_list_get_element(&anyone, i);
     3436    ret=ZLocateUser(zstr(user), &numlocs, ZAUTH);
     3437    if (ret!=ZERR_NONE) {
     3438      owl_function_error("Error getting location for %s", user);
     3439      continue;
     3440    }
     3441    numlocs=200;
     3442    ret=ZGetLocations(location, &numlocs);
     3443    if (ret==0) {
     3444      if ((numlocs>0) && !owl_zbuddylist_contains_user(zbl, user)) {
     3445        /* Send a PSEUDO LOGIN! */
     3446        if (notify) {
     3447          m=owl_malloc(sizeof(owl_message));
     3448          owl_message_create_pseudo_zlogin(m, 0, user, location[0].host, location[0].time, location[0].tty);
     3449          owl_global_messagequeue_addmsg(&g, m);
     3450        }
     3451        owl_zbuddylist_adduser(zbl, user);
     3452        owl_function_debugmsg("owl_function_zephyr_buddy_check: login for %s ", user);
     3453      } else if ((numlocs==0) && owl_zbuddylist_contains_user(zbl, user)) {
     3454        /* I don't think this ever happens (if there are 0 locations we should get an error from
     3455         * ZGetLocations)
     3456         */
     3457        owl_function_error("owl_function_zephyr_buddy_check: exceptional case logout for %s ",user);
     3458      }
     3459    } else if ((ret==ZERR_NOLOCATIONS) && owl_zbuddylist_contains_user(zbl, user)) {
     3460      /* Send a PSEUDO LOGOUT! */
     3461      if (notify) {
     3462        m=owl_malloc(sizeof(owl_message));
     3463        owl_message_create_pseudo_zlogin(m, 1, user, "", "", "");
     3464        owl_global_messagequeue_addmsg(&g, m);
     3465      }
     3466      owl_zbuddylist_deluser(zbl, user);
     3467      owl_function_debugmsg("owl_function_zephyr_buddy_check: logout for %s ",user);
    34623468    }
    34633469  }
  • global.c

    r98d296d r2ee9e8d  
    4545  g->rightshift=0;
    4646
    47   g->tw = NULL;
     47  g->tw = owl_editwin_allocate();
     48  owl_editwin_init(g->tw, NULL, owl_global_get_typwin_lines(g), g->cols, OWL_EDITWIN_STYLE_ONELINE, NULL);
    4849
    4950  owl_keyhandler_init(&g->kh);
     
    5758  g->curmsg_vert_offset=0;
    5859  g->resizepending=0;
     60  g->typwinactive=0;
    5961  g->direction=OWL_DIRECTION_DOWNWARDS;
    6062  g->zaway=0;
     
    109111  owl_zbuddylist_create(&(g->zbuddies));
    110112
    111   g->zaldlist = NULL;
    112   g->pseudologin_notify = 0;
    113 
    114113  owl_obarray_init(&(g->obarray));
    115114
     
    172171  _owl_panel_set_window(&g->typpan, newwin(typwin_lines, cols, g->recwinlines+2, 0));
    173172
    174   if (g->tw)
    175       owl_editwin_set_curswin(g->tw, owl_global_get_curs_typwin(g), typwin_lines, g->cols);
     173  owl_editwin_set_curswin(g->tw, owl_global_get_curs_typwin(g), typwin_lines, g->cols);
    176174
    177175  idlok(owl_global_get_curs_typwin(g), FALSE);
     
    326324}
    327325
     326/* buffercommand */
     327
     328void owl_global_set_buffercommand(owl_global *g, const char *command) {
     329  owl_editwin_set_command(owl_global_get_typwin(g), command);
     330}
     331
     332const char *owl_global_get_buffercommand(const owl_global *g) {
     333  return owl_editwin_get_command(owl_global_get_typwin(g));
     334}
     335
     336void owl_global_set_buffercallback(owl_global *g, void (*cb)(owl_editwin*)) {
     337  owl_editwin_set_callback(owl_global_get_typwin(g), cb);
     338}
     339
     340void (*owl_global_get_buffercallback(const owl_global *g))(owl_editwin*) {
     341  return owl_editwin_get_callback(owl_global_get_typwin(g));
     342}
     343
    328344/* refresh */
    329345
     
    365381/* typwin */
    366382
    367 owl_editwin *owl_global_set_typwin_active(owl_global *g, int style, owl_history *hist) {
    368   int d;
    369   d = owl_global_get_typewindelta(g);
    370   if (d > 0 && style == OWL_EDITWIN_STYLE_MULTILINE)
     383int owl_global_is_typwin_active(const owl_global *g) {
     384  if (g->typwinactive==1) return(1);
     385  return(0);
     386}
     387
     388void owl_global_set_typwin_active(owl_global *g) {
     389  int d = owl_global_get_typewindelta(g);
     390  if (d > 0)
    371391      owl_function_resize_typwin(owl_global_get_typwin_lines(g) + d);
    372392
    373   g->tw = owl_editwin_new(owl_global_get_curs_typwin(g),
    374                           owl_global_get_typwin_lines(g),
    375                           g->cols,
    376                           style,
    377                           hist);
    378   return g->tw;
     393  g->typwinactive=1;
    379394}
    380395
    381396void owl_global_set_typwin_inactive(owl_global *g) {
    382397  int d = owl_global_get_typewindelta(g);
    383   if (d > 0 && owl_editwin_get_style(g->tw) == OWL_EDITWIN_STYLE_MULTILINE)
     398  if (d > 0)
    384399      owl_function_resize_typwin(owl_global_get_typwin_lines(g) - d);
    385400
    386   werase(owl_global_get_curs_typwin(g));
    387   g->tw = NULL;
     401  g->typwinactive=0;
    388402}
    389403
     
    517531  owl_mainwin_redisplay(&(g->mw));
    518532  sepbar(NULL);
    519   if (g->tw)
    520       owl_editwin_redisplay(g->tw);
    521   else
    522     werase(owl_global_get_curs_typwin(g));
    523 
     533  owl_editwin_redisplay(g->tw);
    524534  owl_function_full_redisplay();
    525535
     
    958968}
    959969
    960 GList **owl_global_get_zaldlist(owl_global *g)
    961 {
    962   return &(g->zaldlist);
    963 }
    964 
    965 int owl_global_get_pseudologin_notify(owl_global *g)
    966 {
    967   return g->pseudologin_notify;
    968 }
    969 
    970 void owl_global_set_pseudologin_notify(owl_global *g, int notify)
    971 {
    972   g->pseudologin_notify = notify;
    973 }
    974 
    975970struct termios *owl_global_get_startup_tio(owl_global *g)
    976971{
  • keybinding.c

    r8a921b5 r920201c  
    1414int owl_keybinding_init(owl_keybinding *kb, const char *keyseq, const char *command, void (*function_fn)(void), const char *desc)
    1515{
     16  char **ktokens;
     17  int    nktokens, i;
     18 
    1619  owl_function_debugmsg("owl_keybinding_init: creating binding for <%s> with desc: <%s>", keyseq, desc);
    1720  if (command && !function_fn) {
     
    2225    return(-1);
    2326  }
    24 
    25   if (owl_keybinding_make_keys(kb, keyseq) != 0) {
    26     return(-1);
    27   }
    28 
    29   if (command) kb->command = owl_strdup(command);
    30   kb->function_fn = function_fn;
    31   if (desc) kb->desc = owl_strdup(desc);
    32   else kb->desc = NULL;
    33   return(0);
    34 }
    35 
    36 int owl_keybinding_make_keys(owl_keybinding *kb, const char *keyseq)
    37 {
    38   char **ktokens;
    39   int    nktokens, i;
    4027
    4128  ktokens = atokenize(keyseq, " ", &nktokens);
     
    5542  }
    5643  kb->len = nktokens;
     44
    5745  atokenize_delete(ktokens, nktokens);
     46
     47  if (command) kb->command = owl_strdup(command);
     48  kb->function_fn = function_fn;
     49  if (desc) kb->desc = owl_strdup(desc);
     50  else kb->desc = NULL;
    5851  return(0);
    5952}
  • keymap.c

    r8a921b5 rbb0d439  
    5151  }
    5252  return owl_list_append_element(&km->bindings, kb); 
    53 
    54 }
    55 
    56 /* removes the binding associated with the keymap */
    57 int owl_keymap_remove_binding(owl_keymap *km, const char *keyseq)
    58 {
    59   owl_keybinding *kb, *curkb;
    60   int i;
    61 
    62   if ((kb = owl_malloc(sizeof(owl_keybinding))) == NULL) return(-1);
    63   if (0 != owl_keybinding_make_keys(kb, keyseq)) {
    64     owl_free(kb);
    65     return(-1);
    66   }
    67 
    68   for (i = owl_list_get_size(&km->bindings)-1; i >= 0; i--) {
    69     curkb = owl_list_get_element(&km->bindings, i);
    70     if (owl_keybinding_equal(curkb, kb)) {
    71       owl_list_remove_element(&km->bindings, i);
    72       owl_keybinding_delete(curkb);
    73       return(0);
    74     }
    75   }
    76   return(-2);
    77 }
    78 
     53}
    7954
    8055/* returns a summary line describing this keymap.  the caller must free. */
  • keys.c

    r8a5b5a1 r8830df47  
    246246  BIND_CMD("M-n", "smartnarrow",      "narrow to a view based on the current message");
    247247  BIND_CMD("M-N", "smartnarrow -i",   "narrow to a view based on the current message, and consider instance pair");
    248   BIND_CMD("M-m", "smartnarrow -r",   "like M-n but with 'narrow-related' temporarily flipped.");
    249   BIND_CMD("M-M", "smartnarrow -ri",  "like M-N but with 'narrow-related' temporarily flipped.");
    250248  BIND_CMD("M-p", "view personal", "");
    251249 
  • owl.c

    r98d296d rf449096  
    629629      /* leave the cursor in the appropriate window */
    630630      if (!owl_popwin_is_active(owl_global_get_popwin(&g))
    631           && owl_global_get_typwin(&g)) {
     631          && owl_global_is_typwin_active(&g)) {
    632632        owl_function_set_cursor(typwin);
    633633      } else {
  • owl.h

    r98d296d r03c5bdd  
    559559  int resizepending;
    560560  int recwinlines;
     561  int typwinactive;
    561562  char *thishost;
    562563  char *homedir;
     
    603604  owl_zbuddylist zbuddies;
    604605  owl_timer zephyr_buddycheck_timer;
    605   GList *zaldlist;
    606   int pseudologin_notify;
    607606  struct termios startup_tio;
    608607  owl_obarray obarray;
  • perl/lib/BarnOwl/Style/Default.pm

    r0fe69d2 rad0dedd  
    168168    ? '@color(cyan)' : '';
    169169
    170   my $chars = $oneline ? qr/[[:cntrl:]]/ : qr/[^[:print:]\n]|[\r\cK\f]/;
     170  my $chars = $oneline ? qr/[[:cntrl:]]/ : qr/[^[:print:]]|[\r\cK\f]/;
    171171
    172172  $s =~ s/($chars)/
     
    179179
    180180As above, but always be conservative, and replace with a '?' instead
    181 of something more elaborate.
     181of something mmore elaborate.
    182182
    183183=cut
  • perlconfig.c

    r1b1cd2c r8f2d9bf  
    574574  FREETMPS;
    575575  LEAVE;
    576 }
    577 
    578 void owl_perlconfig_dec_refcnt(void *data)
    579 {
    580   SV *v = data;
    581   SvREFCNT_dec(v);
     576
     577  SvREFCNT_dec(cb);
     578  owl_editwin_set_cbdata(e, NULL);
    582579}
    583580
  • perlglue.xs

    r9186c75 r8c59178  
    172172        SV *callback
    173173        PREINIT:
    174                 owl_editwin *e;
    175174        CODE:
    176175        {
     
    178177                        croak("Callback must be a subref");
    179178
    180                 e = owl_function_start_question(line);
    181 
    182                 owl_editwin_set_cbdata(e,
    183                                        newSVsv(callback),
    184                                        owl_perlconfig_dec_refcnt);
    185                 owl_editwin_set_callback(e, owl_perlconfig_edit_callback);
     179                owl_function_start_question(line);
     180
     181                owl_editwin_set_cbdata(owl_global_get_typwin(&g), newSVsv(callback));
     182                owl_editwin_set_callback(owl_global_get_typwin(&g), owl_perlconfig_edit_callback);
    186183        }
    187184
     
    191188        SV *callback
    192189        PREINIT:
    193                 owl_editwin *e;
    194190        CODE:
    195191        {
     
    197193                        croak("Callback must be a subref");
    198194
    199                 e = owl_function_start_password(line);
    200 
    201                 owl_editwin_set_cbdata(e,
    202                                        newSVsv(callback),
    203                                        owl_perlconfig_dec_refcnt);
    204                 owl_editwin_set_callback(e, owl_perlconfig_edit_callback);
     195                owl_function_start_password(line);
     196
     197                owl_editwin_set_cbdata(owl_global_get_typwin(&g), newSVsv(callback));
     198                owl_editwin_set_callback(owl_global_get_typwin(&g), owl_perlconfig_edit_callback);
    205199        }
    206200
     
    214208                        croak("Callback must be a subref");
    215209
    216                 owl_function_start_edit_win(line,
    217                                             owl_perlconfig_edit_callback,
    218                                             newSVsv(callback),
    219                                             owl_perlconfig_dec_refcnt);
     210                owl_function_start_edit_win(line, owl_perlconfig_edit_callback, newSVsv(callback));
    220211        }
    221212
     
    551542        int count;
    552543        const char *string;
    553         PREINIT:
    554                 owl_editwin *e;
    555         CODE:
    556                 e = owl_global_get_typwin(&g);
    557                 if (e) {
    558                         RETVAL = owl_editwin_replace(e, count, string);
    559                 } else {
    560                         RETVAL = 0;
    561                 }
     544        CODE:
     545                RETVAL = owl_editwin_replace(owl_global_get_typwin(&g), count, string);
    562546        OUTPUT:
    563547                RETVAL
     
    566550point_move(delta)
    567551        int delta;
    568         PREINIT:
    569                 owl_editwin *e;
    570         CODE:
    571                 e = owl_global_get_typwin(&g);
    572                 if (e) {
    573                         RETVAL = owl_editwin_point_move(e, delta);
    574                 } else {
    575                         RETVAL = 0;
    576                 }
     552        CODE:
     553                RETVAL = owl_editwin_point_move(owl_global_get_typwin(&g), delta);
    577554        OUTPUT:
    578555                RETVAL
     
    581558replace_region(string)
    582559        const char *string;
    583         PREINIT:
    584                 owl_editwin *e;
    585         CODE:
    586                 e = owl_global_get_typwin(&g);
    587                 if (e) {
    588                         RETVAL = owl_editwin_replace_region(e, string);
    589                 } else {
    590                         RETVAL = 0;
    591                 }
     560        CODE:
     561                RETVAL = owl_editwin_replace_region(owl_global_get_typwin(&g), string);
    592562        OUTPUT:
    593563                RETVAL
     
    597567        PREINIT:
    598568                char *region;
    599                 owl_editwin *e;
    600         CODE:
    601                 e = owl_global_get_typwin(&g);
    602                 if (e) {
    603                         region = owl_editwin_get_region(owl_global_get_typwin(&g));
    604                 } else {
    605                         region = NULL;
    606                 }
     569        CODE:
     570                region = owl_editwin_get_region(owl_global_get_typwin(&g));
    607571                RETVAL = region;
    608572        OUTPUT:
     
    617581        PREINIT:
    618582                int count;
    619                 owl_editwin *e;
    620583                owl_editwin_excursion *x;
    621584        CODE:
    622585        {
    623                 e = owl_global_get_typwin(&g);
    624                 if(!e)
    625                         croak("The edit window is not currently active!");
    626 
    627586                x = owl_editwin_begin_excursion(owl_global_get_typwin(&g));
    628587                PUSHMARK(SP);
     
    646605int
    647606current_column()
    648         PREINIT:
    649                 owl_editwin *e;
    650         CODE:
    651                 e = owl_global_get_typwin(&g);
    652                 if (e) {
    653                         RETVAL = owl_editwin_current_column(e);
    654                 } else {
    655                         RETVAL = 0;
    656                 }
     607        CODE:
     608                RETVAL = owl_editwin_current_column(owl_global_get_typwin(&g));
    657609        OUTPUT:
    658610                RETVAL
     
    660612int
    661613point()
    662         PREINIT:
    663                 owl_editwin *e;
    664         CODE:
    665                 e = owl_global_get_typwin(&g);
    666                 if (e) {
    667                         RETVAL = owl_editwin_get_point(e);
    668                 } else {
    669                         RETVAL = 0;
    670                 }
     614        CODE:
     615                RETVAL = owl_editwin_get_point(owl_global_get_typwin(&g));
    671616        OUTPUT:
    672617                RETVAL
     
    674619int
    675620mark()
    676         PREINIT:
    677                 owl_editwin *e;
    678         CODE:
    679                 e = owl_global_get_typwin(&g);
    680                 if (e) {
    681                         RETVAL = owl_editwin_get_mark(e);
    682                 } else {
    683                         RETVAL = 0;
    684                 }
    685         OUTPUT:
    686                 RETVAL
     621        CODE:
     622                RETVAL = owl_editwin_get_mark(owl_global_get_typwin(&g));
     623        OUTPUT:
     624                RETVAL
  • popexec.c

    r125fd21 r4cca591  
    9696  if (!pe->pid && !pe->winactive) {
    9797    owl_select_remove_io_dispatch(d);
    98     pe->dispatch = NULL;
    9998    return;
    10099  }
     
    115114    }
    116115    owl_select_remove_io_dispatch(d);
    117     pe->dispatch = NULL;
    118116    return;
    119117  }
     
    159157
    160158  pe->winactive = 0;
    161   if (pe->dispatch) {
     159  if (pe->dispatch->fd > 0) {
    162160    owl_select_remove_io_dispatch(pe->dispatch);
    163     pe->dispatch = NULL;
    164161  }
    165162  if (pe->pid) {
  • scripts/add-changelog

    r51dbfb5 r68ab07c  
    11#!/bin/sh
    22version=$1; shift
    3 
    4 if [ -z "$version" ] || [ "$#" = 0 ];  then
    5     echo "Usage: $0 VERSION REV-LIST-ARGS" > &2
    6     exit 1;
    7 fi
    83
    94(
  • scripts/do-release

    r51dbfb5 rd771d1b  
    44    echo "$@" >&2
    55    exit 1
    6 }
    7 
    8 usage() {
    9     cat >&2 <<EOF
    10 Usage: %0 [options]
    11 Generate a barnowl release tarball.
    12 
    13 OPTIONS:
    14   -f            Don't require a changelog entry for the new release.
    15   --no-tag      Don't create and sign a git tag for the new release
    16   --git         Do a beta release for the current git revision.
    17 EOF
    186}
    197
     
    2715        --no-tag) no_tag=1 ;;
    2816        --git) git=1 ;;
    29         -h|--help) usage ;;
    3017    esac
    3118done
  • scripts/locker-build

    r51dbfb5 r2b6622a6  
    33#########################################################
    44# Build script to build BarnOwl for the locker.
     5
     6# Usage: locker-build [-n] [-o OUTPUT-TGZ] SOURCE-TARBALL
     7# -n is a dry-run, and drops to a shell in the build directory
     8# -o does the install into a temporary directory and tars it into the
     9#    specified tarball instead.
     10# SOURCE-TARBALL is a source tarball, created by do-release
     11
    512die() {
    613    echo "$@" 2>&1;
     
    1522
    1623usage () {
    17     cat >&2 <<EOF
    18 Usage: $0 [-n] [-o OUTPUT-TGZ] SOURCE-TARBALL
    19  -n is a dry-run, and drops to a shell in the build directory
    20  -o does the install into a temporary directory and tars it into the
    21     specified tarball instead.
    22 
    23 SOURCE-TARBALL is a source tarball, created by do-release.
    24 EOF
     24    echo "Usage: $0 [-n] [-o OUTPUT-TGZ] SOURCE-TARBALL"
    2525    exit 2;
    2626}
  • variable.c

    r66e409c r66a8cd6  
    358358               "normal,top,neartop,center,paged,pagedcenter" ),
    359359
    360   OWLVAR_BOOL( "narrow-related" /* %OwlVarStub:narrow_related */, 1,
    361                "Make smartnarrow use broader filters",
    362                "Causes smartfiler to narrow to messages \"related\" to \n"
    363                "the current message, as well as ones to the same place.\n\n"
    364                "for Zephyr, this controls whether to narrow to e.g. class-help or\n"
    365                "class-help.d alone, or to related-class-help, which includes\n"
    366                "help, unhelp, help.d, etc.\n\nDefault is true (include unclasses, etc.).\n" ),
    367360
    368361  OWLVAR_BOOL( "_followlast" /* %OwlVarStub */, 0,
  • zephyr.c

    rf25812b rc230bc1  
    12991299}
    13001300
    1301 #ifdef HAVE_LIBZEPHYR
    1302 void owl_zephyr_process_pseudologin(ZNotice_t *n)
    1303 {
    1304   owl_message *m;
    1305   owl_zbuddylist *zbl;
    1306   GList **zaldlist;
    1307   GList *zaldptr;
    1308   ZAsyncLocateData_t *zald = NULL;
    1309   ZLocations_t location;
    1310   int numlocs, ret, notify;
    1311 
    1312   /* Find a ZALD to match this notice. */
    1313   zaldlist = owl_global_get_zaldlist(&g);
    1314   zaldptr = g_list_first(*zaldlist);
    1315   while (zaldptr) {
    1316     if (ZCompareALDPred(n, zaldptr->data)) {
    1317       zald = zaldptr->data;
    1318       *zaldlist = g_list_remove(*zaldlist, zaldptr->data);
    1319       break;
    1320     }
    1321     zaldptr = g_list_next(zaldptr);
    1322   }
    1323   if (zald) {
    1324     /* Deal with notice. */
    1325     notify = owl_global_get_pseudologin_notify(&g);
    1326     zbl = owl_global_get_zephyr_buddylist(&g);
    1327     ret = ZParseLocations(n, zald, &numlocs, NULL);
    1328     if (ret == ZERR_NONE) {
    1329       if (numlocs > 0 && !owl_zbuddylist_contains_user(zbl, zald->user)) {
    1330         if (notify) {
    1331           numlocs = 1;
    1332           ret = ZGetLocations(&location, &numlocs);
    1333           if (ret == ZERR_NONE) {
    1334             /* Send a PSEUDO LOGIN! */
    1335             m = owl_malloc(sizeof(owl_message));
    1336             owl_message_create_pseudo_zlogin(m, 0, zald->user,
    1337                                              location.host,
    1338                                              location.time,
    1339                                              location.tty);
    1340             owl_global_messagequeue_addmsg(&g, m);
    1341           }
    1342           owl_zbuddylist_adduser(zbl, zald->user);
    1343           owl_function_debugmsg("owl_function_zephyr_buddy_check: login for %s ", zald->user);
    1344         }
    1345       } else if (numlocs == 0 && owl_zbuddylist_contains_user(zbl, zald->user)) {
    1346         /* Send a PSEUDO LOGOUT! */
    1347         if (notify) {
    1348           m = owl_malloc(sizeof(owl_message));
    1349           owl_message_create_pseudo_zlogin(m, 1, zald->user, "", "", "");
    1350           owl_global_messagequeue_addmsg(&g, m);
    1351         }
    1352         owl_zbuddylist_deluser(zbl, zald->user);
    1353         owl_function_debugmsg("owl_function_zephyr_buddy_check: logout for %s ", zald->user);
    1354       }
    1355     }
    1356     ZFreeALD(zald);
    1357     owl_free(zald);
    1358   }
    1359 }
    1360 #else
    1361 void owl_zephyr_process_pseudologin(void *n)
    1362 {
    1363 }
    1364 #endif
    1365 
    13661301/*
    13671302 * Process zephyrgrams from libzephyr's queue. To prevent starvation,
     
    13981333      }
    13991334
    1400       /* if it is a LOCATE message, it's for pseudologins. */
    1401       if (strcmp(notice.z_opcode, LOCATE_LOCATE) == 0) {
    1402         owl_zephyr_process_pseudologin(&notice);
    1403         ZFreeNotice(&notice);
    1404         continue;
    1405       }
    1406 
    14071335      /* create the new message */
    14081336      m=owl_malloc(sizeof(owl_message));
Note: See TracChangeset for help on using the changeset viewer.