Changeset 93ee554 for owl.c


Ignore:
Timestamp:
Dec 23, 2007, 7:52:17 PM (16 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
5bc0f68
Parents:
34509d5 (diff), 78667f3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merged revisions 734-776 via svnmerge from 
file:///afs/sipb.mit.edu/project/barnowl/src/svn/trunk

........
  r738 | nelhage | 2007-07-07 17:42:45 -0400 (Sat, 07 Jul 2007) | 3 lines
  
  Make the built-in regression tests output TAP and add a perl wrapper
  to call it.
........
  r739 | nelhage | 2007-07-07 17:43:22 -0400 (Sat, 07 Jul 2007) | 2 lines
  
  Forgot these in the last commit; Make all the tests output TAP
........
  r740 | nelhage | 2007-07-07 19:46:16 -0400 (Sat, 07 Jul 2007) | 2 lines
  
  Clean up an unused var warning.
........
  r741 | nelhage | 2007-07-08 15:37:43 -0400 (Sun, 08 Jul 2007) | 2 lines
  
  Adding a -s switch to change the location of the config dir (~/.owl)
........
  r742 | nelhage | 2007-07-08 15:39:57 -0400 (Sun, 08 Jul 2007) | 2 lines
  
  I don't understand why this didn't commit last time. I blame psvn.
........
  r743 | nelhage | 2007-07-11 22:37:16 -0400 (Wed, 11 Jul 2007) | 3 lines
  
  Don't allow you to go off the end of an empty message list. [fixes:
  #9]
........
  r744 | nelhage | 2007-07-30 18:47:39 -0400 (Mon, 30 Jul 2007) | 2 lines
  
  Fix sending to -c message -i personal
........
  r745 | chmrr | 2007-07-30 20:21:18 -0400 (Mon, 30 Jul 2007) | 3 lines
  
   r20981@zoq-fot-pik:  chmrr | 2007-07-30 20:20:44 -0400
    * message length 0 means no fields
........
  r746 | nelhage | 2007-07-30 20:25:59 -0400 (Mon, 30 Jul 2007) | 4 lines
  
  * zero-len message means no fields
  * Actually use owl_zephyr_get_zsig to get the zsig, which handles 0-
    and 1- field zephyrs correctly.
........
  r747 | nelhage | 2007-07-30 20:29:36 -0400 (Mon, 30 Jul 2007) | 2 lines
  
  Making that last patch actually compile. Bad me.
........
  r748 | nelhage | 2007-08-01 01:42:53 -0400 (Wed, 01 Aug 2007) | 3 lines
  
  owl_message_get_text needs to make sure there's text to return before
  returning it. fixes: #15
........
  r749 | nelhage | 2007-08-01 01:52:08 -0400 (Wed, 01 Aug 2007) | 5 lines
  
  zephyr smartnarrow now uses the ``personal'' filter to decide whether
  to narrow to user or not, and the zephyr-user filter now checks for
  `filter personal' instead of <message,personal,*>.
  closes #2
........
  r750 | nelhage | 2007-08-01 02:27:30 -0400 (Wed, 01 Aug 2007) | 5 lines
  
  Changing the default personal filter to <message,personal,*> for
  zephyr.
  
  refs 2
........
  r751 | nelhage | 2007-08-01 22:58:31 -0400 (Wed, 01 Aug 2007) | 2 lines
  
  Display opcodes with the default style
........
  r752 | nelhage | 2007-08-08 18:01:51 -0400 (Wed, 08 Aug 2007) | 2 lines
  
  Applying ctl's variable shuffling patch for better ANSI C-ness. closes #18
........
  r753 | nelhage | 2007-08-11 01:04:07 -0400 (Sat, 11 Aug 2007) | 3 lines
  
  Implement :punt and :unpunt to punt arbitrary filters, rather than
  just z-triplets. closes #6
........
  r754 | nelhage | 2007-08-11 01:18:37 -0400 (Sat, 11 Aug 2007) | 2 lines
  
  Show non-personal pings like stock owl does. closes #12
........
  r756 | asedeno | 2007-08-17 12:48:37 -0400 (Fri, 17 Aug 2007) | 8 lines
  
  Apply patch from:
  http://rt.cpan.org/Public/Bug/Display.html?id=17484
  
  Fixing problems with jabber servers keeping the same stream id when negotiating TLS.
  
  Thanks to ghudson for tracking this down.
........
  r757 | nelhage | 2007-08-17 17:26:44 -0400 (Fri, 17 Aug 2007) | 4 lines
  
  When we're narrowing to an instance, properly include
  un-instances. This fixes narrowing to any instance that starts with
  ``un-''
........
  r758 | nelhage | 2007-08-27 19:17:20 -0400 (Mon, 27 Aug 2007) | 2 lines
  
  Don't read before the start of the string for an instance
........
  r759 | nelhage | 2007-09-07 00:13:45 -0400 (Fri, 07 Sep 2007) | 3 lines
  
  Adding an explicit -f - to the tar commands for FreeBSD compatibility
  (reported by ecprice)
........
  r760 | ecprice | 2007-09-08 17:33:34 -0400 (Sat, 08 Sep 2007) | 3 lines
  
  Fixes for FreeBSD.
........
  r761 | nelhage | 2007-09-10 20:00:45 -0400 (Mon, 10 Sep 2007) | 3 lines
  
  Use "" instead of `undef' as a default for messages with no reply
  command to hopefully squelch perl warnings.
........
  r762 | nelhage | 2007-09-12 21:37:41 -0400 (Wed, 12 Sep 2007) | 2 lines
  
  Do ~-expansion in :loadsubs. closes #26
........
  r763 | nelhage | 2007-09-12 21:54:51 -0400 (Wed, 12 Sep 2007) | 2 lines
  
  Validate JIDs passed to jmuc join. closes #25
........
  r764 | nelhage | 2007-09-12 22:46:17 -0400 (Wed, 12 Sep 2007) | 2 lines
  
  Show full JIDs for users in non-anonymous JIDs in :jmuc presence. closes #24
........
  r766 | nelhage | 2007-10-02 00:38:49 -0400 (Tue, 02 Oct 2007) | 3 lines
  
  Don't crash if we hit `i' on iso-8859-*. This is not the right
  solution, but at least it doesn't SEGV.
........
  r767 | asedeno | 2007-10-10 15:21:13 -0400 (Wed, 10 Oct 2007) | 1 line
  
  Fixing a typo pointed out by kchen.
........
  r768 | matt | 2007-10-14 17:16:35 -0400 (Sun, 14 Oct 2007) | 1 line
  
  added -m flag to aimwrite
........
  r769 | austein | 2007-10-14 18:16:44 -0400 (Sun, 14 Oct 2007) | 1 line
  
  aimwrite -m displays according to displayoutgoing
........
  r770 | asedeno | 2007-12-06 14:38:05 -0500 (Thu, 06 Dec 2007) | 3 lines
  
  Making usleep call more reasonable.
  Responsiveness seems okay on linerva, no-knife, and darkmatter, and reported good
  on zephyr.
........
  r771 | nelhage | 2007-12-10 21:34:46 -0500 (Mon, 10 Dec 2007) | 2 lines
  
  Add zip as build-depends
........
  r772 | nelhage | 2007-12-10 21:36:25 -0500 (Mon, 10 Dec 2007) | 2 lines
  
  We're not ktools
........
  r773 | nelhage | 2007-12-23 11:32:02 -0500 (Sun, 23 Dec 2007) | 2 lines
  
  bind END in popless windows. closes #41
........
  r774 | chmrr | 2007-12-23 15:16:26 -0500 (Sun, 23 Dec 2007) | 3 lines
  
   r1805@utwig:  chmrr | 2007-12-23 15:15:33 -0500
    * Allow C-r on outgoing messages (useful for CCs)
........
  r775 | chmrr | 2007-12-23 15:16:29 -0500 (Sun, 23 Dec 2007) | 3 lines
  
   r1806@utwig:  chmrr | 2007-12-23 15:15:50 -0500
    * Identify ourselves as barnowl in a couple more places
........
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    r34509d5 r93ee554  
    6565owl_global g;
    6666
     67char * owl_get_datadir() {
     68    char * datadir = getenv("BARNOWL_DATA_DIR");
     69    if(datadir != NULL)
     70        return strchr(datadir, '=') + 1;
     71    return DATADIR;
     72}
     73
    6774int main(int argc, char **argv, char **env)
    6875{
     
    7481  struct sigaction sigact;
    7582  char *configfile, *tty, *perlout, *perlerr, **argvsave, buff[LINE], startupmsg[LINE];
     83  char *confdir;
    7684  owl_filter *f;
    7785  owl_style *s;
     
    8896  argvsave=argv;
    8997  configfile=NULL;
     98  confdir = NULL;
    9099  tty=NULL;
    91100  debug=0;
     
    105114    } else if (!strcmp(argv[0], "-c")) {
    106115      if (argc<2) {
    107         fprintf(stderr, "Too few arguments to -c\n");
    108         usage();
    109         exit(1);
     116        fprintf(stderr, "Too few arguments to -c\n");
     117        usage();
     118        exit(1);
    110119      }
    111120      configfile=argv[1];
     
    114123    } else if (!strcmp(argv[0], "-t")) {
    115124      if (argc<2) {
    116         fprintf(stderr, "Too few arguments to -t\n");
    117         usage();
    118         exit(1);
     125        fprintf(stderr, "Too few arguments to -t\n");
     126        usage();
     127        exit(1);
    119128      }
    120129      tty=argv[1];
     130      argv+=2;
     131      argc-=2;
     132    } else if (!strcmp(argv[0], "-s")){
     133      if (argc<2) {
     134        fprintf(stderr, "Too few arguments to -s\n");
     135        usage();
     136        exit(1);
     137      }
     138      confdir = argv[1];
    121139      argv+=2;
    122140      argc-=2;
     
    131149      argc--;
    132150    } else if (!strcmp(argv[0], "-v")) {
    133       printf("This is owl version %s\n", OWL_VERSION_STRING);
     151      printf("This is barnowl version %s\n", OWL_VERSION_STRING);
    134152      exit(0);
    135153    } else {
     
    163181  /* screen init */
    164182  if (!getenv("TERMINFO")) {
    165     sprintf(buff, "TERMINFO=%s", TERMINFO);
    166     putenv(buff);
    167     owl_function_debugmsg("startup: setting TERMINFO to %s", TERMINFO);
     183    owl_function_debugmsg("startup: Not setting TERMINFO");
    168184  } else {
    169185    owl_function_debugmsg("startup: leaving TERMINFO as %s from envrionment", getenv("TERMINFO"));
     
    195211  /* owl global init */
    196212  owl_global_init(&g);
    197     if (debug) owl_global_set_debug_on(&g);
     213  if (debug) owl_global_set_debug_on(&g);
     214  if (confdir) owl_global_set_confdir(&g, confdir);
    198215  owl_function_debugmsg("startup: first available debugging message");
    199216  owl_global_set_startupargs(&g, argcsave, argvsave);
     
    217234  /* create the owl directory, in case it does not exist */
    218235  owl_function_debugmsg("startup: creating owl directory, if not present");
    219   dir=owl_sprintf("%s/%s", owl_global_get_homedir(&g), OWL_CONFIG_DIR);
     236  dir=owl_global_get_confdir(&g);
    220237  mkdir(dir, S_IRWXU);
    221   owl_free(dir);
    222238
    223239  /* set the tty, either from the command line, or by figuring it out */
     
    263279  owl_function_debugmsg("startup: creating default filters");
    264280  f=owl_malloc(sizeof(owl_filter));
    265   owl_filter_init_fromstring(f, "personal", "isprivate ^true$");
     281  owl_filter_init_fromstring(f, "personal", "isprivate ^true$ and ( not type ^zephyr$"
     282                             " or ( class ^message and"
     283                             " ( instance ^personal$ or instance ^urgent$ ) ) )");
    266284  owl_list_append_element(owl_global_get_filterlist(&g), f);
    267285
     
    533551    j=wgetch(typwin);
    534552    if (j==ERR) {
    535       usleep(10);
     553      usleep(10000);
    536554    } else {
    537555      owl_global_update_lastinputtime(&g);
     
    700718void usage()
    701719{
    702   fprintf(stderr, "Owl version %s\n", OWL_VERSION_STRING);
    703   fprintf(stderr, "Usage: owl [-n] [-d] [-D] [-v] [-h] [-c <configfile>] [-t <ttyname>]\n");
     720  fprintf(stderr, "Barnowl version %s\n", OWL_VERSION_STRING);
     721  fprintf(stderr, "Usage: barnowl [-n] [-d] [-D] [-v] [-h] [-c <configfile>] [-s <confdir>] [-t <ttyname>]\n");
    704722  fprintf(stderr, "  -n      don't load zephyr subscriptions\n");
    705723  fprintf(stderr, "  -d      enable debugging\n");
    706724  fprintf(stderr, "  -D      enable debugging and delete previous debug file\n");
    707   fprintf(stderr, "  -v      print the Owl version number and exit\n");
     725  fprintf(stderr, "  -v      print the Barnowl version number and exit\n");
    708726  fprintf(stderr, "  -h      print this help message\n");
    709727  fprintf(stderr, "  -c      specify an alternate config file\n");
     728  fprintf(stderr, "  -s      specify an alternate config dir (default ~/.owl)\n");
    710729  fprintf(stderr, "  -t      set the tty name\n");
    711730}
Note: See TracChangeset for help on using the changeset viewer.