Changes in / [89ab5c8:ecaec21]
- Files:
-
- 1 added
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.am
rc45e1eb rae333f0 1 1 ACLOCAL_AMFLAGS = -I m4 2 CFLAGS += $(EXTRA_CFLAGS)3 2 4 3 GIT_DESCRIPTION := $(if $(wildcard .git),$(shell git describe --match='barnowl-*' HEAD 2>/dev/null)) … … 49 48 keypress.c keymap.c keybinding.c cmd.c context.c \ 50 49 aim.c buddy.c buddylist.c style.c errqueue.c \ 51 zbuddylist.c popexec.c select.c wcwidth.c \50 zbuddylist.c popexec.c obarray.c select.c wcwidth.c \ 52 51 glib_compat.c filterproc.c 53 52 -
commands.c
rd544237 r14965e5 92 92 "Use 'show keymaps' to see the existing keymaps.\n" 93 93 "Key sequences may be things like M-C-t or NPAGE.\n\n" 94 "Ex.: bindkey recv C-b command zwrite -c barnowl\n" 95 "Ex.: bindkey recv m command start-command zwrite -c my-class -i \n\n" 96 "SEE ALSO: unbindkey, start-command"), 94 "Ex.: bindkey recv C-b command zwrite -c barnowl" 95 "SEE ALSO: bindkey"), 97 96 98 97 OWLCMD_ARGS("unbindkey", owl_command_unbindkey, OWL_CTX_ANY, … … 101 100 "Removes a binding of a key sequence within a keymap.\n" 102 101 "Use 'show keymaps' to see the existing keymaps.\n" 103 "Ex.: unbindkey recv H \n\n"102 "Ex.: unbindkey recv H" 104 103 "SEE ALSO: bindkey"), 105 104 106 105 OWLCMD_ARGS("zwrite", owl_command_zwrite, OWL_CTX_INTERACTIVE, 107 106 "send a zephyr", 108 "zwrite [-n] [-C] [-c class] [-i instance] [-r realm] [-O opc ode] [<user> ...] [-m <message...>]",107 "zwrite [-n] [-C] [-c class] [-i instance] [-r realm] [-O opcde] [<user> ...] [-m <message...>]", 109 108 "Zwrite send a zephyr to the one or more users specified.\n\n" 110 109 "The following options are available:\n\n" … … 138 137 OWLCMD_ARGS("zcrypt", owl_command_zcrypt, OWL_CTX_INTERACTIVE, 139 138 "send an encrypted zephyr", 140 "zcrypt [-n] [-C] [-c class] [-i instance] [-r realm] [-O opc ode] [-m <message...>]\n",139 "zcrypt [-n] [-C] [-c class] [-i instance] [-r realm] [-O opcde] [-m <message...>]\n", 141 140 "Behaves like zwrite but uses encryption. Not for use with\n" 142 141 "personal messages\n"), … … 148 147 "allow editing.\n\n" 149 148 "If 'sender' is specified, reply to the sender.\n\n" 150 "If 'all' or no args are specified, reply public ly to the\n"149 "If 'all' or no args are specified, reply publically to the\n" 151 150 "same class/instance for non-personal messages and to the\n" 152 151 "sender for personal messages.\n\n" … … 266 265 "zpunt <class> <instance> [recipient]\n" 267 266 "zpunt <instance>", 268 "The zpunt command will sup press messagesto the specified\n"267 "The zpunt command will supress message to the specified\n" 269 268 "zephyr triplet. In the second usage messages are suppressed\n" 270 269 "for class MESSAGE and the named instance.\n\n" … … 283 282 "punt <filter-text>", 284 283 "punt <filter-text (multiple words)>\n" 285 "The punt command will sup press messagesto the specified\n"284 "The punt command will supress message to the specified\n" 286 285 "filter\n\n" 287 286 "SEE ALSO: unpunt, zpunt, show zpunts\n"), … … 586 585 "name style after the -s argument.\n" 587 586 "\n" 588 "The other usages listed above are abbre viated forms that simply set\n"587 "The other usages listed above are abbreivated forms that simply set\n" 589 588 "the filter of the current view. The -d option allows you to write a\n" 590 589 "filter expression that will be dynamically created by owl and then\n" … … 594 593 OWLCMD_ARGS("smartnarrow", owl_command_smartnarrow, OWL_CTX_INTERACTIVE, 595 594 "view only messages similar to the current message", 596 "smartnarrow [-i | --instance] [-r | --relat ed]",595 "smartnarrow [-i | --instance] [-r | --relatde]", 597 596 "If the curmsg is a personal message narrow\n" 598 597 " to the conversation with that user.\n" … … 614 613 " message, the filter is to that instance.\n" 615 614 "If the curmsg is a class message, the filter is that class.\n" 616 "If the curmsg is a class message and '-i' is speci fied\n"615 "If the curmsg is a class message and '-i' is specied\n" 617 616 " the filter is to that class and instance.\n"), 618 617 … … 674 673 "for formatting messages.\n\n" 675 674 "Show variables will list the names of all variables.\n\n" 676 "Show errors will show a list of errors e ncountered by Owl.\n\n"675 "Show errors will show a list of errors ecountered by Owl.\n\n" 677 676 "SEE ALSO: filter, view, alias, bindkey, help\n"), 678 677 … … 743 742 "set the search highlight string without searching", 744 743 "setsearch <string>", 745 "The setsearch command highlights all occur rences of its\n"744 "The setsearch command highlights all occurences of its\n" 746 745 "argument and makes it the default argument for future\n" 747 746 "search commands, but does not move the cursor. With\n" … … 1295 1294 char opt; 1296 1295 int instance = 0, related = 0, i; 1297 c onst char **tmp_argv = owl_malloc(sizeof(char *) * argc);1296 char **tmp_argv = owl_malloc(sizeof(char *) * argc); 1298 1297 1299 1298 for (i = 0; i < argc; i++) 1300 tmp_argv[i] = argv[i];1301 1302 static conststruct option options[] = {1299 tmp_argv[i] = owl_strdup(argv[i]); 1300 1301 static struct option options[] = { 1303 1302 {"instance", 0, 0, 'i'}, 1304 1303 {"related", 0, 0, 'r'}, 1305 1304 {NULL, 0, 0, 0}}; 1306 1307 optind = 0; 1308 while ((opt = getopt_long(argc, (char **)tmp_argv, "ir", options, NULL)) != -1) { 1305 while ((opt = getopt_long(argc, tmp_argv, "ir", options, NULL)) != -1) { 1309 1306 switch (opt) { 1310 1307 case 'i': … … 1320 1317 } 1321 1318 1319 for (i = 0; i < argc; i++) 1320 owl_free(tmp_argv[i]); 1321 owl_free(tmp_argv); 1322 1322 1323 filtname = owl_function_smartfilter(instance, related); 1323 1324 … … 1328 1329 1329 1330 done: 1330 owl_free(tmp_argv); 1331 1331 optind = 0; /* reset getopt */ 1332 1332 return NULL; 1333 1333 } … … 1608 1608 char *owl_command_exec(int argc, const char *const *argv, const char *buff) 1609 1609 { 1610 return owl_function_exec(argc, argv, buff, OWL_OUTPUT_RETURN);1610 return owl_function_exec(argc, argv, buff, 0); 1611 1611 } 1612 1612 1613 1613 char *owl_command_pexec(int argc, const char *const *argv, const char *buff) 1614 1614 { 1615 return owl_function_exec(argc, argv, buff, OWL_OUTPUT_POPUP);1615 return owl_function_exec(argc, argv, buff, 1); 1616 1616 } 1617 1617 1618 1618 char *owl_command_aexec(int argc, const char *const *argv, const char *buff) 1619 1619 { 1620 return owl_function_exec(argc, argv, buff, OWL_OUTPUT_ADMINMSG);1620 return owl_function_exec(argc, argv, buff, 2); 1621 1621 } 1622 1622 1623 1623 char *owl_command_perl(int argc, const char *const *argv, const char *buff) 1624 1624 { 1625 return owl_function_perl(argc, argv, buff, OWL_OUTPUT_RETURN);1625 return owl_function_perl(argc, argv, buff, 0); 1626 1626 } 1627 1627 1628 1628 char *owl_command_pperl(int argc, const char *const *argv, const char *buff) 1629 1629 { 1630 return owl_function_perl(argc, argv, buff, OWL_OUTPUT_POPUP);1630 return owl_function_perl(argc, argv, buff, 1); 1631 1631 } 1632 1632 1633 1633 char *owl_command_aperl(int argc, const char *const *argv, const char *buff) 1634 1634 { 1635 return owl_function_perl(argc, argv, buff, OWL_OUTPUT_ADMINMSG);1635 return owl_function_perl(argc, argv, buff, 2); 1636 1636 } 1637 1637 -
doc/releasing-barnowl.txt
r5f08dbe r1ea0249 1 -*- mode: org *- 2 * DOING A BARNOWL RELEASE 3 - [ ] Send mail to barnowl-dev indicating that a release is 4 happening soon, and soliciting any improvements that 5 developers want included in the release. 6 - [ ] Wait a while (a week or so, or more if necessary) for any 7 pending patches to get in. 8 - [ ] Prepare the -rc commit 9 - [ ] Run ./scripts/add-changelog NEW-VERSION PREV-TAG..HEAD 10 - [ ] Edit ChangeLog to combine and filter entries 11 - [ ] Edit configure.ac to bump the version to 1.Nrc1 12 - [ ] Commit with message 'BarnOwl 1.Nrc1'; don't push until after 13 builds all succeed 14 - [ ] Run scripts/do-release with -f (so it won't complain about 15 missing changelog), makes a tarball 16 - [ ] Do a locker build (See DOING A LOCKER BUILD) 17 - [ ] Update configure.ac on master to bump the version to 1.(N+1)dev 18 - [ ] Push git git: 19 - [ ] The RC commit 20 - [ ] The configure.ac change on master 21 - [ ] A release-1.N branch pointing at the RC commit 22 - [ ] Copy tarball into /mit/barnowl/web_scripts/dist 23 - [ ] Send mail announcing the RC to barnowl-dev@mit.edu 24 - [ ] Wait 1-2 weeks, collect any bug reports 25 - [ ] Fix any reported bugs on master 26 - [ ] Cherry-pick/backport appropriate fixes from master onto 27 release-1.N 28 - [ ] If there have been many or large bugfixes, repeat the process 29 for barnowl 1.Nrc2 1 DOING A BARNOWL RELEASE 30 2 31 * DOING THE ACTUAL RELEASE 32 - [ ] Update the changelog and configure.ac for barnowl 1.N 33 - [ ] run ./scripts/do-release 34 - [ ] Do the locker build 35 - [ ] Push the release tag 36 - [ ] Write up release notes 37 (I usually use the previous release's email as a template) 38 - [ ] Update the website 39 - [ ] Add the line that `do-release` printed to the changelog on the home page 40 - [ ] Add your release notes as /release-notes/1.N 41 - [ ] Send the release notes to barnowl-users@mit.edu 3 [ ] Send mail to barnowl-dev indicating that a release is happening 4 soon, and soliciting any improvements that developers want 5 included in the release. 42 6 43 * DOING A LOCKER BUILD 44 - [ ] Copy the tarball to build@nelhage.com 45 - [ ] ssh to build@nelhage.com and kinit 46 - [ ] On build@nelhage.com, run barnowl-build-all TARBALL. 47 This script does builds for all Debathena platforms using chroots 48 on nelhage.com, and ssh's to Athena 9 machines to do the two 49 Athena 9 builds. 50 - [ ] Sanity-check the builds 51 - [ ] Do cursory testing on debathena platforms and both athena9s. 52 - [ ] chroots on nelhage.com also useful 53 - [ ] Update symlinks with locker-update script; 54 - locker-update [-b] [-n] VERSION 55 - e.g. locker-update -b -n barnowl-1.6rc1 56 - [ ] Use -b to update the barnowl-beta name 57 - [ ] Use -n first for dry-run 7 [ ] Wait a while (a week or so, or more if necessary) for any pending 8 patches to get in. 58 9 59 * LOCKER LAYOUT 60 - builds/barnowl-VERSION contains the arch-independent files by 61 version 62 - arch/SYSNAME/bin/barnowl-VERSION is the actual binary 63 - arch/SYSNAME/bin/barnowl is a symlink to ../../common/bin/barnowl 64 (wrapper script runs barnowl.real). .../barnowl.real is a symlink 65 to the latest version. 66 - zcrypt is also installed with a versioned name, but currently 67 barnowl-N will not run zcrypt-N, so we can't change that interface 68 at all. 10 [ ] Prepare the -rc commit 11 12 [ ] Run ./scripts/add-changelog NEW-VERSION PREV-TAG..HEAD 13 14 [ ] Edit ChangeLog to combine and filter entries 15 16 [ ] Edit configure.ac to bump the version to 1.Nrc1 17 18 [ ] Commit with message 'BarnOwl 1.Nrc1'; don't push until after 19 builds all succeed 20 21 [ ] Run scripts/do-release with -f (so it won't complain about missing 22 changelog), makes a tarball 23 24 [ ] Make all the builds 25 26 [ ] On build@nelhage.com, run barnowl-build-all TARBALL to build for 27 everything with chroots, doesn't do athena 9 builds. Builds into 28 locker parellel to all other versions. 29 30 [ ] Do two athena9 builds: solaris and linux, usually use multics (or 31 sun.dialup) for the solaris build, oliver for linux athena9 32 33 [ ] Remember to add gnu; add barnowl 34 35 [ ] eval `barnowl-perl-config` to include the perl modules in the 36 barnowl locker 37 38 [ ] Run scripts/locker-build TARBALL (barnowl-build-all loops over 39 all of them in schroots). It overrides existing one. 40 41 [ ] Sanity-check the builds 42 43 [ ] Do cursory testing on debathena platforms and both athena9s. 44 45 [ ] chroots on nelhage.com also useful 46 47 [ ] Update symlinks with locker-update script; 48 49 locker-update [-b] [-n] VERSION 50 51 e.g. locker-update -b -n barnowl-1.6rc1 52 53 [ ] -b for the beta 54 55 [ ] -n first for dry-run 56 57 [ ] Push the RC commit 58 59 [ ] Copy tarball into /mit/barnowl/web_scripts/dist 60 61 [ ] Send mail (rcs to barnowl-dev@, release to barnowl-users@) 62 63 [ ] Make an actual release about a week after the RC 64 65 66 LOCKER LAYOUT 67 68 * builds/barnowl-VERSION contains the arch-independent files by 69 version 70 71 * arch/SYSNAME/bin/barnowl-VERSION is the actual binary 72 73 * arch/SYSNAME/bin/barnowl is a symlink to ../../common/bin/barnowl 74 (wrapper script runs barnowl.real). .../barnowl.real is a symlink to 75 the latest version. 76 77 * zcrypt is also installed with a versioned name, but currently 78 barnowl-N will not run zcrypt-N, so we can't change that interface 79 at all. -
functions.c
r2cfc6d7 recaec21 1992 1992 newbuff = owl_sprintf("%s%s", buff, redirect); 1993 1993 1994 if (type == OWL_OUTPUT_POPUP) {1994 if (type == 1) { 1995 1995 owl_popexec_new(newbuff); 1996 1996 } else { … … 1999 1999 pclose(p); 2000 2000 2001 if (type == OWL_OUTPUT_RETURN) { 2001 if (type==1) { 2002 owl_function_popless_text(out); 2003 } else if (type==0) { 2002 2004 owl_free(newbuff); 2003 2005 return out; 2004 } else if (type == OWL_OUTPUT_ADMINMSG) {2006 } else if (type==2) { 2005 2007 owl_function_adminmsg(buff, out); 2008 } else { 2009 owl_function_popless_text(out); 2006 2010 } 2007 2011 owl_free(out); … … 2030 2034 perlout = owl_perlconfig_execute(buff); 2031 2035 if (perlout) { 2032 if (type == OWL_OUTPUT_POPUP) {2036 if (type==1) { 2033 2037 owl_function_popless_text(perlout); 2034 } else if (type == OWL_OUTPUT_ADMINMSG) {2038 } else if (type==2) { 2035 2039 owl_function_adminmsg(buff, perlout); 2036 } else if (type == OWL_OUTPUT_RETURN) {2040 } else if (type==0) { 2037 2041 return perlout; 2042 } else { 2043 owl_function_popless_text(perlout); 2038 2044 } 2039 2045 owl_free(perlout); … … 2325 2331 /* if it already exists then go with it. This lets users override */ 2326 2332 if (owl_global_get_filter(&g, filtname)) { 2327 goto done;2333 return(filtname); 2328 2334 } 2329 2335 … … 2355 2361 2356 2362 owl_free(argbuff); 2357 done:2358 2363 owl_free(class); 2359 2364 if (instance) { -
global.c
r20aced3 r719173c4 53 53 g->filterlist = NULL; 54 54 owl_list_create(&(g->puntlist)); 55 g->messagequeue = g_queue_new();55 owl_list_create(&(g->messagequeue)); 56 56 owl_dict_create(&(g->styledict)); 57 57 g->curmsg_vert_offset=0; … … 113 113 g->pseudologin_notify = 0; 114 114 115 owl_obarray_init(&(g->obarray)); 116 115 117 owl_message_init_fmtext_cache(); 116 118 owl_list_create(&(g->io_dispatch_list)); … … 118 120 g->timerlist = NULL; 119 121 g->interrupted = FALSE; 120 121 /* set up a pad for input */122 g->input_pad = newpad(1, 1);123 nodelay(g->input_pad, 1);124 keypad(g->input_pad, 1);125 meta(g->input_pad, 1);126 122 } 127 123 … … 183 179 idlok(owl_global_get_curs_msgwin(g), FALSE); 184 180 181 nodelay(owl_global_get_curs_typwin(g), 1); 182 keypad(owl_global_get_curs_typwin(g), TRUE); 185 183 wmove(owl_global_get_curs_typwin(g), 0, 0); 184 185 meta(owl_global_get_curs_typwin(g), TRUE); 186 186 } 187 187 … … 862 862 void owl_global_messagequeue_addmsg(owl_global *g, owl_message *m) 863 863 { 864 g_queue_push_tail(g->messagequeue, m);864 owl_list_append_element(&(g->messagequeue), m); 865 865 } 866 866 … … 873 873 owl_message *out; 874 874 875 if ( g_queue_is_empty(g->messagequeue))876 return NULL;877 o ut = g_queue_pop_head(g->messagequeue);878 return out;875 if (owl_list_get_size(&(g->messagequeue))==0) return(NULL); 876 out=owl_list_get_element(&(g->messagequeue), 0); 877 owl_list_remove_element(&(g->messagequeue), 0); 878 return(out); 879 879 } 880 880 881 881 int owl_global_messagequeue_pending(owl_global *g) 882 882 { 883 return !g_queue_is_empty(g->messagequeue); 883 if (owl_list_get_size(&(g->messagequeue))==0) return(0); 884 return(1); 884 885 } 885 886 … … 1009 1010 } 1010 1011 1012 const char * owl_global_intern(owl_global *g, const char * string) 1013 { 1014 return owl_obarray_insert(&(g->obarray), string); 1015 } 1016 1011 1017 owl_list *owl_global_get_io_dispatch_list(owl_global *g) 1012 1018 { -
message.c
rc314f39 r4727d31 61 61 owl_pair *p = NULL, *pair = NULL; 62 62 63 attrname = g_intern_string(attrname);64 65 63 /* look for an existing pair with this key, */ 66 64 j=owl_list_get_size(&(m->attributes)); 67 65 for (i=0; i<j; i++) { 68 66 p=owl_list_get_element(&(m->attributes), i); 69 if ( owl_pair_get_key(p) == attrname) {67 if (!strcmp(owl_pair_get_key(p), attrname)) { 70 68 owl_free(owl_pair_get_value(p)); 71 69 pair = p; … … 76 74 if(pair == NULL) { 77 75 pair = owl_malloc(sizeof(owl_pair)); 78 owl_pair_create(pair, attrname, NULL);76 owl_pair_create(pair, owl_global_intern(&g, attrname), NULL); 79 77 owl_list_append_element(&(m->attributes), pair); 80 78 } … … 89 87 int i, j; 90 88 owl_pair *p; 91 GQuark quark;92 93 quark = g_quark_try_string(attrname);94 if (quark == 0)95 /* don't bother inserting into string table */96 return NULL;97 attrname = g_quark_to_string(quark);98 89 99 90 j=owl_list_get_size(&(m->attributes)); 100 91 for (i=0; i<j; i++) { 101 92 p=owl_list_get_element(&(m->attributes), i); 102 if ( owl_pair_get_key(p) == attrname) {93 if (!strcmp(owl_pair_get_key(p), attrname)) { 103 94 return(owl_pair_get_value(p)); 104 95 } … … 505 496 void owl_message_set_hostname(owl_message *m, const char *hostname) 506 497 { 507 m->hostname = g_intern_string(hostname);498 m->hostname=owl_global_intern(&g, hostname); 508 499 } 509 500 -
owl.c
r3aa0522 rf7cf6c2 311 311 { 312 312 owl_input j; 313 WINDOW *typwin; 314 315 typwin = owl_global_get_curs_typwin(&g); 313 316 314 317 while (1) { 315 j.ch = wgetch( g.input_pad);318 j.ch = wgetch(typwin); 316 319 if (j.ch == ERR) return; 317 320 … … 336 339 337 340 for (i = 1; i < bytes; i++) { 338 int tmp = wgetch(g.input_pad);341 int tmp = wgetch(typwin); 339 342 /* If what we got was not a byte, or not a continuation byte */ 340 343 if (tmp > 0xff || !(tmp & 0x80 && ~tmp & 0x40)) { … … 455 458 #endif /* OWL_STDERR_REDIR */ 456 459 457 static int owl_refresh_pre_select_action(owl_ps_action *a, void *data) 458 { 459 /* if a resize has been scheduled, deal with it */ 460 owl_global_resize(&g, 0, 0); 461 /* also handle relayouts */ 462 owl_global_relayout(&g); 463 464 /* update the terminal if we need to */ 465 if (owl_global_is_needrefresh(&g)) { 466 /* these are here in case a relayout changes the windows */ 467 WINDOW *sepwin = owl_global_get_curs_sepwin(&g); 468 WINDOW *typwin = owl_global_get_curs_typwin(&g); 469 470 /* push all changed windows to screen */ 471 update_panels(); 472 /* leave the cursor in the appropriate window */ 473 if (!owl_popwin_is_active(owl_global_get_popwin(&g)) 474 && owl_global_get_typwin(&g)) { 475 owl_function_set_cursor(typwin); 476 } else { 477 owl_function_set_cursor(sepwin); 478 } 479 doupdate(); 480 owl_global_set_noneedrefresh(&g); 481 } 482 return 0; 460 void owl_zephyr_buddycheck_timer(owl_timer *t, void *data) 461 { 462 if (owl_global_is_pseudologins(&g)) { 463 owl_function_debugmsg("Doing zephyr buddy check"); 464 owl_function_zephyr_buddy_check(1); 465 } 483 466 } 484 467 … … 486 469 int main(int argc, char **argv, char **env) 487 470 { 471 WINDOW *sepwin, *typwin; 488 472 int argcsave; 489 473 const char *const *argvsave; … … 599 583 owl_function_source(NULL); 600 584 585 update_panels(); 586 601 587 /* Set the default style */ 602 588 owl_function_debugmsg("startup: setting startup and default style"); … … 619 605 owl_global_push_context(&g, OWL_CTX_READCONFIG|OWL_CTX_RECV, NULL, "recv"); 620 606 621 owl_select_add_pre_select_action(owl_refresh_pre_select_action, NULL, NULL); 607 owl_select_add_timer(180, 180, owl_zephyr_buddycheck_timer, NULL, NULL); 608 609 /* If we ever deprecate the mainloop hook, remove this. */ 610 owl_select_add_timer(0, 1, owl_perlconfig_mainloop, NULL, NULL); 611 622 612 owl_select_add_pre_select_action(owl_process_messages, NULL, NULL); 623 613 … … 625 615 /* main loop */ 626 616 while (1) { 617 618 /* if a resize has been scheduled, deal with it */ 619 owl_global_resize(&g, 0, 0); 620 /* also handle relayouts */ 621 owl_global_relayout(&g); 622 623 /* these are here in case a relayout changes the windows */ 624 sepwin=owl_global_get_curs_sepwin(&g); 625 typwin=owl_global_get_curs_typwin(&g); 626 627 /* update the terminal if we need to */ 628 if (owl_global_is_needrefresh(&g)) { 629 /* push all changed windows to screen */ 630 update_panels(); 631 /* leave the cursor in the appropriate window */ 632 if (!owl_popwin_is_active(owl_global_get_popwin(&g)) 633 && owl_global_get_typwin(&g)) { 634 owl_function_set_cursor(typwin); 635 } else { 636 owl_function_set_cursor(sepwin); 637 } 638 doupdate(); 639 owl_global_set_noneedrefresh(&g); 640 } 641 627 642 /* select on FDs we know about. */ 628 643 owl_select(); -
owl.h
r20aced3 rf7cf6c2 184 184 #define OWL_VARIABLE_BOOL 2 185 185 #define OWL_VARIABLE_STRING 3 186 187 #define OWL_OUTPUT_RETURN 0188 #define OWL_OUTPUT_POPUP 1189 #define OWL_OUTPUT_ADMINMSG 2190 186 191 187 #define OWL_FILTER_MAX_DEPTH 300 … … 522 518 } owl_colorpair_mgr; 523 519 520 typedef struct _owl_obarray { 521 owl_list strings; 522 } owl_obarray; 523 524 524 typedef struct _owl_io_dispatch { 525 525 int fd; /* FD to watch for dispatch. */ … … 565 565 owl_view current_view; 566 566 owl_messagelist msglist; 567 WINDOW *input_pad;568 567 PANEL *recpan, *seppan, *msgpan, *typpan; 569 568 int needrefresh; … … 606 605 char *aim_screenname_for_filters; /* currently logged in AIM screen name */ 607 606 owl_buddylist buddylist; /* list of logged in AIM buddies */ 608 GQueue *messagequeue;/* for queueing up aim and other messages */607 owl_list messagequeue; /* for queueing up aim and other messages */ 609 608 owl_dict styledict; /* global dictionary of available styles */ 610 609 char *response; /* response to the last question asked */ … … 619 618 int pseudologin_notify; 620 619 struct termios startup_tio; 620 owl_obarray obarray; 621 621 owl_list io_dispatch_list; 622 622 owl_list psa_list; -
perl/lib/BarnOwl/Hooks.pm
r3aa0522 rb30c256 79 79 our %EXPORT_TAGS = (all => [@EXPORT_OK]); 80 80 81 use BarnOwl::MainLoopCompatHook;82 83 81 our $startup = BarnOwl::Hook->new; 84 82 our $shutdown = BarnOwl::Hook->new; 85 83 our $receiveMessage = BarnOwl::Hook->new; 86 84 our $newMessage = BarnOwl::Hook->new; 87 our $mainLoop = BarnOwl:: MainLoopCompatHook->new;85 our $mainLoop = BarnOwl::Hook->new; 88 86 our $getBuddyList = BarnOwl::Hook->new; 89 87 our $getQuickstart = BarnOwl::Hook->new; … … 164 162 } 165 163 166 $mainLoop->check_owlconf();167 164 $startup->run(0); 168 165 BarnOwl::startup() if *BarnOwl::startup{CODE}; … … 189 186 190 187 BarnOwl::new_msg($m) if *BarnOwl::new_msg{CODE}; 188 } 189 190 sub _mainloop_hook { 191 $mainLoop->run; 192 BarnOwl::mainloop_hook() if *BarnOwl::mainloop_hook{CODE}; 191 193 } 192 194 -
perl/lib/BarnOwl/Timer.pm
r8d16e58 ree183be 21 21 } 22 22 23 sub stop {24 my $self = shift;25 if(defined($self->{timer})) {26 BarnOwl::Internal::remove_timer($self->{timer});27 undef $self->{timer};28 }29 }30 31 23 sub do_callback { 32 24 my $self = shift; … … 36 28 sub DESTROY { 37 29 my $self = shift; 38 $self->stop; 30 if(defined($self->{timer})) { 31 BarnOwl::Internal::remove_timer($self->{timer}); 32 } 39 33 } 40 34 -
perl/modules/Jabber/lib/BarnOwl/Message/Jabber.pm
r8278543 rc854e74 77 77 } elsif ($self->jtype eq 'groupchat') { 78 78 my $room = $self->room; 79 if ($inst) { 80 my $subject = $self->subject; 81 $filter = "jabber-room-$room-subject-$subject"; 82 BarnOwl::command(qw[filter], $filter, 83 qw[type ^jabber$ and room], "^\Q$room\E\$", 84 qw[and subject], "^\Q$subject\E\$"); 85 } else { 86 $filter = "jabber-room-$room"; 87 BarnOwl::command(qw[filter], $filter, 88 qw[type ^jabber$ and room], "^\Q$room\E\$"); 89 } 79 $filter = "jabber-room-$room"; 80 BarnOwl::command(qw[filter], $filter, 81 qw[type ^jabber$ and room], "^\Q$room\E\$"); 90 82 return $filter; 91 83 } elsif ($self->login ne 'none') { -
perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm
raa0a0b5 r8789410 285 285 { 286 286 summary => "Send a Jabber Message", 287 usage => "jwrite <jid> [-t <thread>] [-s <subject>] [-a <account>] [-m <message>]"287 usage => "jwrite <jid> [-t <thread>] [-s <subject>] [-a <account>]" 288 288 } 289 289 ); … … 308 308 description => "jmuc sends Jabber commands related to MUC.\n\n" 309 309 . "The following commands are available\n\n" 310 . "join <muc>[/<nick>]\n" 311 . " Join a MUC (with a given nickname, or otherwise your JID).\n\n" 310 . "join <muc> Join a MUC.\n\n" 312 311 . "part <muc> Part a MUC.\n" 313 312 . " The MUC is taken from the current message if not supplied.\n\n" … … 378 377 my $cjidStr = $conn->baseJIDExists($jidStr); 379 378 if ($cjidStr) { 380 die("Already logged in as $cjidStr.\n"); 379 BarnOwl::error("Already logged in as $cjidStr."); 380 return; 381 381 } 382 382 } … … 387 387 388 388 if ( !$uid || !$componentname ) { 389 die("usage: $cmd JID\n"); 389 BarnOwl::error("usage: $cmd JID"); 390 return; 390 391 } 391 392 392 393 if ( $conn->jidActive($jidStr) ) { 393 die("Already logged in as $jidStr.\n"); 394 BarnOwl::error("Already logged in as $jidStr."); 395 return; 394 396 } elsif ($conn->jidExists($jidStr)) { 395 397 return $conn->tryReconnect($jidStr, 1); … … 524 526 sub cmd_jlist { 525 527 if ( !( scalar $conn->getJIDs() ) ) { 526 die("You are not logged in to Jabber.\n"); 528 BarnOwl::error("You are not logged in to Jabber."); 529 return; 527 530 } 528 531 BarnOwl::popless_ztext( onGetBuddyList() ); … … 531 534 sub cmd_jwrite { 532 535 if ( !$conn->connected() ) { 533 die("You are not logged in to Jabber.\n"); 536 BarnOwl::error("You are not logged in to Jabber."); 537 return; 534 538 } 535 539 … … 539 543 my $jwrite_thread = ""; 540 544 my $jwrite_subject = ""; 541 my $jwrite_body;542 545 my ($to, $from); 543 546 my $jwrite_type = "chat"; … … 551 554 'subject=s' => \$jwrite_subject, 552 555 'account=s' => \$from, 553 'id=s' => \$jwrite_sid, 554 'message=s' => \$jwrite_body, 556 'id=s' => \$jwrite_sid, 555 557 ) or die("Usage: jwrite <jid> [-t <thread>] [-s <subject>] [-a <account>]\n"); 556 558 $jwrite_type = 'groupchat' if $gc; 557 559 558 560 if ( scalar @ARGV != 1 ) { 559 die("Usage: jwrite <jid> [-t <thread>] [-s <subject>] [-a <account>]\n"); 561 BarnOwl::error( 562 "Usage: jwrite <jid> [-t <thread>] [-s <subject>] [-a <account>]"); 563 return; 560 564 } 561 565 else { … … 566 570 567 571 unless(scalar @candidates) { 568 die("Unable to resolve JID $to \n");572 die("Unable to resolve JID $to"); 569 573 } 570 574 … … 573 577 unless(scalar @candidates) { 574 578 if(!$from) { 575 die("You must specify an account with -a \n");579 die("You must specify an account with -a"); 576 580 } else { 577 die("Unable to resolve account $from \n");581 die("Unable to resolve account $from"); 578 582 } 579 583 } … … 590 594 type => $jwrite_type 591 595 }; 592 593 if (defined($jwrite_body)) {594 process_owl_jwrite($jwrite_body);595 return;596 }597 596 598 597 if(scalar @candidates > 1) { … … 632 631 my $func = $jmuc_commands{$cmd}; 633 632 if ( !$func ) { 634 die("jmuc: Unknown command: $cmd\n"); 633 BarnOwl::error("jmuc: Unknown command: $cmd"); 634 return; 635 635 } 636 636 … … 654 654 } 655 655 else { 656 die("You must specify an account with -a <jid>\n");656 BarnOwl::error('You must specify an account with -a <jid>'); 657 657 } 658 658 return $func->( $jid, $muc, @ARGV ); … … 667 667 668 668 $muc = shift @ARGV 669 or die("Usage: jmuc join <muc> [-p <password>] [-a <account>] \n");669 or die("Usage: jmuc join <muc> [-p <password>] [-a <account>]"); 670 670 671 671 die("Error: Must specify a fully-qualified MUC name (e.g. barnowl\@conference.mit.edu)\n") … … 680 680 MaxChars => 0 681 681 }); 682 $completion_jids{$muc ->GetJID('base')} = 1;682 $completion_jids{$muc} = 1; 683 683 return; 684 684 } … … 688 688 689 689 $muc = shift @args if scalar @args; 690 die("Usage: jmuc part [<muc>] [-a <account>] \n") unless $muc;690 die("Usage: jmuc part [<muc>] [-a <account>]") unless $muc; 691 691 692 692 if($conn->getConnectionFromJID($jid)->MUCLeave(JID => $muc)) { 693 693 queue_admin_msg("$jid has left $muc."); 694 694 } else { 695 die("Error: Not joined to $muc \n");695 die("Error: Not joined to $muc"); 696 696 } 697 697 } … … 703 703 $muc = shift @args if scalar @args; 704 704 705 die( "Usage: jmuc invite <jid> [<muc>] [-a <account>]\n")705 die('Usage: jmuc invite <jid> [<muc>] [-a <account>]') 706 706 unless $muc && $invite_jid; 707 707 … … 718 718 my ( $jid, $muc, @args ) = @_; 719 719 $muc = shift @args if scalar @args; 720 die("Usage: jmuc configure [<muc>] \n") unless $muc;720 die("Usage: jmuc configure [<muc>]") unless $muc; 721 721 my $iq = Net::Jabber::IQ->new(); 722 722 $iq->SetTo($muc); … … 759 759 760 760 $muc = shift @args if scalar @args; 761 die("Usage: jmuc presence [<muc>] \n") unless $muc;761 die("Usage: jmuc presence [<muc>]") unless $muc; 762 762 763 763 if ($muc eq '-a') { … … 774 774 else { 775 775 my $m = $conn->getConnectionFromJID($jid)->FindMUC(jid => $muc); 776 die("No such muc: $muc \n") unless $m;776 die("No such muc: $muc") unless $m; 777 777 BarnOwl::popless_ztext(jmuc_presence_single($m)); 778 778 } … … 801 801 my $func = $jroster_commands{$cmd}; 802 802 if ( !$func ) { 803 die("jroster: Unknown command: $cmd\n"); 803 BarnOwl::error("jroster: Unknown command: $cmd"); 804 return; 804 805 } 805 806 … … 824 825 } 825 826 else { 826 die("You must specify an account with -a <jid>\n");827 BarnOwl::error('You must specify an account with -a <jid>'); 827 828 } 828 829 return $func->( $jid, $name, \@groups, $purgeGroups, @ARGV ); … … 848 849 } 849 850 else { 850 die("You must specify an account with -a <jid>\n");851 BarnOwl::error('You must specify an account with -a <jid>'); 851 852 } 852 853 … … 1233 1234 $completion_jids{$room} = 1; 1234 1235 1235 my $muc;1236 if ($dir eq 'in') {1237 my $connection = $conn->getConnectionFromSid($props{sid});1238 $muc = $connection->FindMUC(jid => $from);1239 } else {1240 my $connection = $conn->getConnectionFromJID($props{from});1241 $muc = $connection->FindMUC(jid => $to);1242 }1243 $props{from} = $muc->GetFullJID($from) || $nick || $room;1244 1236 $props{sender} = $nick || $room; 1245 1237 $props{recipient} = $room; … … 1339 1331 return $givenJIDStr if ($conn->jidExists($givenJIDStr) ); 1340 1332 return resolveConnectedJID($givenJID->GetJID('base')) if $loose; 1341 die("Invalid account: $givenJIDStr \n");1333 die("Invalid account: $givenJIDStr"); 1342 1334 } 1343 1335 … … 1392 1384 # Not one of ours. 1393 1385 else { 1394 die("Invalid account: $givenJIDStr \n");1386 die("Invalid account: $givenJIDStr"); 1395 1387 } 1396 1388 … … 1438 1430 if($from) { 1439 1431 $from_jid = resolveConnectedJID($from, 1); 1440 die("Unable to resolve account $from \n") unless $from_jid;1432 die("Unable to resolve account $from") unless $from_jid; 1441 1433 $to_jid = resolveDestJID($to, $from_jid); 1442 1434 push @matches, [$from_jid, $to_jid] if $to_jid; -
perlconfig.c
r3aa0522 r1b1cd2c 582 582 } 583 583 584 void owl_perlconfig_mainloop(owl_timer *t, void *data) 585 { 586 dSP; 587 if (!owl_perlconfig_is_function("BarnOwl::Hooks::_mainloop_hook")) 588 return; 589 PUSHMARK(SP) ; 590 call_pv("BarnOwl::Hooks::_mainloop_hook", G_DISCARD|G_EVAL); 591 if(SvTRUE(ERRSV)) { 592 owl_function_error("%s", SvPV_nolen(ERRSV)); 593 } 594 return; 595 } 596 584 597 void owl_perlconfig_io_dispatch(const owl_io_dispatch *d, void *data) 585 598 { -
popwin.c
r0881cdd r06cc8d9 28 28 popwin = newwin(pw->lines-2, pw->cols-2, startline+1, startcol+1); 29 29 pw->poppanel = new_panel(popwin); 30 31 meta(popwin,TRUE); 32 nodelay(popwin, 1); 33 keypad(popwin, TRUE); 30 34 31 35 werase(popwin); -
scripts/do-release
rc62c755 r51dbfb5 94 94 NOW=$(date +"%B %d, %Y") 95 95 cat <<EOF 96 * '''$NOW''': BarnOwl $VERS Released. [wiki:Download] it here. or see the [ wiki:release-notes/$VERS Release Notes] or [/browser/ChangeLog?rev=barnowl-$VERS ChangeLog].96 * '''$NOW''': BarnOwl $VERS Released. [wiki:Download] it here. or see the [/browser/ChangeLog?rev=$COMMIT ChangeLog] 97 97 EOF -
select.c
rc3031f3 r2a17b63 273 273 274 274 sigemptyset(&set); 275 sigaddset(&set, SIGWINCH);276 sigaddset(&set, SIGALRM);277 sigaddset(&set, SIGPIPE);278 sigaddset(&set, SIGTERM);279 sigaddset(&set, SIGHUP);280 275 sigaddset(&set, SIGINT); 281 276 sigprocmask(SIG_BLOCK, &set, oldmask); -
tester.c
r3f6555d r4123da1 16 16 int main(int argc, char **argv, char **env) 17 17 { 18 /* initialize a fake ncurses, detached from std{in,out} */ 19 FILE *rnull = fopen("/dev/null", "r"); 20 FILE *wnull = fopen("/dev/null", "w"); 21 newterm("xterm", wnull, rnull); 22 /* initialize global structures */ 23 owl_global_init(&g); 18 owl_errqueue_init(owl_global_get_errqueue(&g)); 19 owl_obarray_init(&(g.obarray)); 20 g.context_stack = NULL; 21 owl_global_push_context(&g, OWL_CTX_STARTUP, NULL, NULL); 24 22 25 23 numtests = 0; … … 33 31 numfailures += owl_variable_regtest(); 34 32 numfailures += owl_filter_regtest(); 33 numfailures += owl_obarray_regtest(); 35 34 numfailures += owl_editwin_regtest(); 36 35 if (numfailures) { … … 38 37 } 39 38 printf("1..%d\n", numtests); 40 41 /* probably not necessary, but tear down the screen */42 endwin();43 fclose(rnull);44 fclose(wnull);45 46 39 return(numfailures); 47 40 } … … 300 293 } 301 294 295 296 int owl_obarray_regtest(void) { 297 int numfailed = 0; 298 const char *p,*p2; 299 300 owl_obarray oa; 301 owl_obarray_init(&oa); 302 303 printf("# BEGIN testing owl_obarray\n"); 304 305 p = owl_obarray_insert(&oa, "test"); 306 FAIL_UNLESS("returned string is equal", p && !strcmp(p, "test")); 307 p2 = owl_obarray_insert(&oa, "test"); 308 FAIL_UNLESS("returned string is equal", p2 && !strcmp(p2, "test")); 309 FAIL_UNLESS("returned the same string", p2 && p == p2); 310 311 p = owl_obarray_insert(&oa, "test2"); 312 FAIL_UNLESS("returned string is equal", p && !strcmp(p, "test2")); 313 p2 = owl_obarray_find(&oa, "test2"); 314 FAIL_UNLESS("returned the same string", p2 && !strcmp(p2, "test2")); 315 316 p = owl_obarray_find(&oa, "nothere"); 317 FAIL_UNLESS("Didn't find a string that isn't there", p == NULL); 318 319 printf("# END testing owl_obarray (%d failures)\n", numfailed); 320 321 return numfailed; 322 } 323 302 324 int owl_editwin_regtest(void) { 303 325 int numfailed = 0; -
variable.c
rd544237 r4d9e4254 110 110 111 111 OWLVAR_ENUM( "loggingdirection" /* %OwlVarStub */, OWL_LOGGING_DIRECTION_BOTH, 112 "specifi es which kind of messages should be logged",112 "specifices which kind of messages should be logged", 113 113 "Can be one of 'both', 'in', or 'out'. If 'in' is\n" 114 114 "selected, only incoming messages are logged, if 'out'\n" … … 138 138 "location of users in your .anyone file. If a user is present\n" 139 139 "but sent no login message, or a user is not present that sent no\n" 140 "logout message, a pseudo login or logout message wil lbe created\n",140 "logout message, a pseudo login or logout message wil be created\n", 141 141 NULL, owl_variable_pseudologins_set, NULL), 142 142 … … 151 151 152 152 "If non empty, any messages matching the given filter will be logged.\n" 153 "This is a completely separate mechanis m from the other logging\n"153 "This is a completely separate mechanisim from the other logging\n" 154 154 "variables like logging, classlogging, loglogins, loggingdirection,\n" 155 155 "etc. If you want this variable to control all logging, make sure\n" … … 198 198 OWLVAR_PATH( "newmsgproc" /* %OwlVarStub:newmsgproc */, NULL, 199 199 "name of a program to run when new messages are present", 200 "The named program will be run when owl rece ives new\n"200 "The named program will be run when owl recevies new.\n" 201 201 "messages. It will not be run again until the first\n" 202 202 "instance exits"), … … 213 213 "Called every time you start a zephyrgram without an\n" 214 214 "explicit zsig. The default setting implements the policy\n" 215 "descri bed in the documentation for the 'zsig' variable.\n"),215 "descripted in the documentation for the 'zsig' variable.\n"), 216 216 217 217 OWLVAR_STRING( "zsig" /* %OwlVarStub */, "", … … 297 297 "number of seconds after AIM login to ignore login messages", 298 298 "This specifies the number of seconds to wait after an\n" 299 "AIM login before allowing the rec eipt of AIM login notifications.\n"299 "AIM login before allowing the recipt of AIM login notifications.\n" 300 300 "By default this is set to 15. If you would like to view login\n" 301 301 "notifications of buddies as soon as you login, set it to 0 instead."), … … 428 428 int owl_variable_pseudologins_set(owl_variable *v, const void *newval) 429 429 { 430 static owl_timer *timer = NULL;431 430 if (newval) { 432 431 if (*(const int*)newval == 1) { 433 432 owl_function_zephyr_buddy_check(0); 434 if (timer == NULL) {435 timer = owl_select_add_timer(180, 180, owl_zephyr_buddycheck_timer, NULL, NULL);436 }437 } else {438 if (timer != NULL) {439 owl_select_remove_timer(timer);440 timer = NULL;441 }442 433 } 443 434 } -
zephyr.c
r3687413 rf25812b 1364 1364 #endif 1365 1365 1366 void owl_zephyr_buddycheck_timer(owl_timer *t, void *data)1367 {1368 if (owl_global_is_pseudologins(&g)) {1369 owl_function_debugmsg("Doing zephyr buddy check");1370 owl_function_zephyr_buddy_check(1);1371 } else {1372 owl_function_debugmsg("Warning: owl_zephyr_buddycheck_timer call pointless; timer should have been disabled");1373 }1374 }1375 1376 1366 /* 1377 1367 * Process zephyrgrams from libzephyr's queue. To prevent starvation,
Note: See TracChangeset
for help on using the changeset viewer.