- Timestamp:
- Nov 19, 2003, 11:19:03 PM (21 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- f1645da
- Parents:
- 52f3507
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
owl.c
r52f3507 ra0a5179 57 57 #endif 58 58 59 owl_function_debugmsg("startup: it's the very best place to start"); 60 61 owl_function_debugmsg("startup: processing command line arguments"); 59 62 argcsave=argc; 60 63 argvsave=argv; … … 106 109 #ifdef HAVE_LIBZEPHYR 107 110 /* zephyr init */ 111 owl_function_debugmsg("startup: initializing zephyr"); 108 112 ret=owl_zephyr_initialize(); 109 113 if (ret) { … … 113 117 114 118 /* signal handler */ 119 owl_function_debugmsg("startup: setting up signal handler"); 115 120 sigact.sa_handler=sig_handler; 116 121 sigemptyset(&sigact.sa_mask); … … 120 125 121 126 /* screen init */ 127 owl_function_debugmsg("startup: initializing screen"); 122 128 sprintf(buff, "TERMINFO=%s", TERMINFO); 123 129 putenv(buff); … … 143 149 144 150 /* owl global init */ 151 owl_function_debugmsg("startup: doing owl global initialization"); 145 152 owl_global_init(&g); 146 153 if (debug) owl_global_set_debug_on(&g); … … 152 159 153 160 #if OWL_STDERR_REDIR 154 /* Do this only after we've started curses up... */ 161 /* Do this only after we've started curses up... */ 162 owl_function_debugmsg("startup: doing stderr redirection"); 155 163 newstderr = stderr_replace(); 156 164 #endif 157 165 158 166 /* create the owl directory, in case it does not exist */ 167 owl_function_debugmsg("startup: creating owl directory, if not present"); 159 168 dir=owl_sprintf("%s/%s", owl_global_get_homedir(&g), OWL_CONFIG_DIR); 160 169 mkdir(dir, S_IRWXU); … … 162 171 163 172 /* set the tty, either from the command line, or by figuring it out */ 173 owl_function_debugmsg("startup: setting tty name"); 164 174 if (tty) { 165 175 owl_global_set_tty(&g, tty); … … 169 179 170 180 /* setup the built-in styles */ 181 owl_function_debugmsg("startup: creating built-in styles"); 171 182 s=owl_malloc(sizeof(owl_style)); 172 183 owl_style_create_internal(s, "default", &owl_stylefunc_default, … … 192 203 /* the personal filter will need to change again when AIM chat's are 193 204 * included. Also, there should be an %aimme% */ 205 owl_function_debugmsg("startup: creating default filters"); 194 206 f=owl_malloc(sizeof(owl_filter)); 195 207 owl_filter_init_fromstring(f, "personal", "( type ^zephyr$ " … … 240 252 241 253 /* set the current view */ 254 owl_function_debugmsg("startup: setting the current view"); 242 255 owl_view_create(owl_global_get_current_view(&g), "main", f, owl_global_get_style_by_name(&g, "default")); 243 256 244 257 /* AIM init */ 258 owl_function_debugmsg("startup: doing AIM initialization"); 245 259 owl_aim_init(); 246 260 247 261 /* process the startup file */ 262 owl_function_debugmsg("startup: processing startup file"); 248 263 owl_function_source(NULL); 249 264 250 265 /* read the config file */ 266 owl_function_debugmsg("startup: processing config file"); 251 267 owl_context_set_readconfig(owl_global_get_context(&g)); 252 268 perlerr=owl_perlconfig_readconfig(configfile); … … 269 285 270 286 /* execute the startup function in the configfile */ 287 owl_function_debugmsg("startup: executing perl startup, if applicable"); 271 288 perlout = owl_perlconfig_execute("owl::startup();"); 272 289 if (perlout) owl_free(perlout); 273 owl_function_debugmsg("-- Owl Startup --");274 290 275 291 /* hold on to the window names for convenience */ … … 281 297 282 298 /* welcome message */ 299 owl_function_debugmsg("startup: creating splash message"); 283 300 strcpy(startupmsg, "-----------------------------------------------------------------------\n"); 284 301 sprintf(buff, "Welcome to Owl version %s. Press 'h' for on-line help. \n", OWL_VERSION_STRING); … … 298 315 /* load zephyr subs */ 299 316 if (initialsubs) { 317 owl_function_debugmsg("startup: loading initial zephyr subs"); 300 318 /* load normal subscriptions */ 301 319 ret=owl_zephyr_loadsubs(NULL); … … 312 330 /* load login subscriptions */ 313 331 if (owl_global_is_loginsubs(&g)) { 332 owl_function_debugmsg("startup: loading login subs"); 314 333 owl_function_loadloginsubs(NULL); 315 334 } … … 318 337 /* set the startup and default style, based on userclue and presence of a 319 338 * formatting function */ 339 owl_function_debugmsg("startup: setting startup and default style"); 320 340 if (0 != strcmp(owl_global_get_default_style(&g), "__unspecified__")) { 321 341 /* the style was set by the user: leave it alone */ … … 330 350 /* zlog in if we need to */ 331 351 if (owl_global_is_startuplogin(&g)) { 352 owl_function_debugmsg("startup: doing zlog in"); 332 353 owl_zephyr_zlog_in(); 333 354 } 334 355 356 owl_function_debugmsg("startup: set style for the view"); 335 357 owl_view_set_style(owl_global_get_current_view(&g), 336 358 owl_global_get_style_by_name(&g, owl_global_get_default_style(&g))); 337 359 360 owl_function_debugmsg("startup: setting context interactive"); 338 361 owl_context_set_interactive(owl_global_get_context(&g)); 339 362 … … 341 364 nexttime=time(NULL); 342 365 366 owl_function_debugmsg("startup: entering main loop"); 343 367 /* main loop */ 344 368 while (1) {
Note: See TracChangeset
for help on using the changeset viewer.