- Timestamp:
- Dec 23, 2007, 7:52:17 PM (17 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
owl.c
r34509d5 r93ee554 65 65 owl_global g; 66 66 67 char * owl_get_datadir() { 68 char * datadir = getenv("BARNOWL_DATA_DIR"); 69 if(datadir != NULL) 70 return strchr(datadir, '=') + 1; 71 return DATADIR; 72 } 73 67 74 int main(int argc, char **argv, char **env) 68 75 { … … 74 81 struct sigaction sigact; 75 82 char *configfile, *tty, *perlout, *perlerr, **argvsave, buff[LINE], startupmsg[LINE]; 83 char *confdir; 76 84 owl_filter *f; 77 85 owl_style *s; … … 88 96 argvsave=argv; 89 97 configfile=NULL; 98 confdir = NULL; 90 99 tty=NULL; 91 100 debug=0; … … 105 114 } else if (!strcmp(argv[0], "-c")) { 106 115 if (argc<2) { 107 108 109 116 fprintf(stderr, "Too few arguments to -c\n"); 117 usage(); 118 exit(1); 110 119 } 111 120 configfile=argv[1]; … … 114 123 } else if (!strcmp(argv[0], "-t")) { 115 124 if (argc<2) { 116 117 118 125 fprintf(stderr, "Too few arguments to -t\n"); 126 usage(); 127 exit(1); 119 128 } 120 129 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]; 121 139 argv+=2; 122 140 argc-=2; … … 131 149 argc--; 132 150 } 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); 134 152 exit(0); 135 153 } else { … … 163 181 /* screen init */ 164 182 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"); 168 184 } else { 169 185 owl_function_debugmsg("startup: leaving TERMINFO as %s from envrionment", getenv("TERMINFO")); … … 195 211 /* owl global init */ 196 212 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); 198 215 owl_function_debugmsg("startup: first available debugging message"); 199 216 owl_global_set_startupargs(&g, argcsave, argvsave); … … 217 234 /* create the owl directory, in case it does not exist */ 218 235 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); 220 237 mkdir(dir, S_IRWXU); 221 owl_free(dir);222 238 223 239 /* set the tty, either from the command line, or by figuring it out */ … … 263 279 owl_function_debugmsg("startup: creating default filters"); 264 280 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$ ) ) )"); 266 284 owl_list_append_element(owl_global_get_filterlist(&g), f); 267 285 … … 533 551 j=wgetch(typwin); 534 552 if (j==ERR) { 535 usleep(10 );553 usleep(10000); 536 554 } else { 537 555 owl_global_update_lastinputtime(&g); … … 700 718 void usage() 701 719 { 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"); 704 722 fprintf(stderr, " -n don't load zephyr subscriptions\n"); 705 723 fprintf(stderr, " -d enable debugging\n"); 706 724 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"); 708 726 fprintf(stderr, " -h print this help message\n"); 709 727 fprintf(stderr, " -c specify an alternate config file\n"); 728 fprintf(stderr, " -s specify an alternate config dir (default ~/.owl)\n"); 710 729 fprintf(stderr, " -t set the tty name\n"); 711 730 }
Note: See TracChangeset
for help on using the changeset viewer.