- Timestamp:
- Jul 6, 2003, 6:42:06 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:
- 5d9c664
- Parents:
- 675ce49
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
owl.c
ra352335c rf1e629d 33 33 int newmsgs, zpendcount, nexttimediff; 34 34 struct sigaction sigact; 35 char *configfile, *tty, *perlout, * *argvsave, buff[LINE], startupmsg[LINE];35 char *configfile, *tty, *perlout, *perlerr, **argvsave, buff[LINE], startupmsg[LINE]; 36 36 owl_filter *f; 37 37 owl_style *s; … … 152 152 /* setup the built-in styles */ 153 153 s=owl_malloc(sizeof(owl_style)); 154 owl_style_create_internal(s, "default", &owl_stylefunc_default); 154 owl_style_create_internal(s, "default", &owl_stylefunc_default, 155 "Default message formatting"); 155 156 owl_global_add_style(&g, s); 156 157 157 158 s=owl_malloc(sizeof(owl_style)); 158 owl_style_create_internal(s, "basic", &owl_stylefunc_basic); 159 owl_style_create_internal(s, "basic", &owl_stylefunc_basic, 160 "Basic message formatting."); 159 161 owl_global_add_style(&g, s); 160 162 161 163 s=owl_malloc(sizeof(owl_style)); 162 owl_style_create_internal(s, "oneline", &owl_stylefunc_oneline); 164 owl_style_create_internal(s, "oneline", &owl_stylefunc_oneline, 165 "Formats for one-line-per-message"); 163 166 owl_global_add_style(&g, s); 164 167 … … 224 227 /* read the config file */ 225 228 owl_context_set_readconfig(owl_global_get_context(&g)); 226 ret=owl_readconfig(configfile);227 if ( ret) {229 perlerr=owl_perlconfig_readconfig(configfile); 230 if (perlerr) { 228 231 endwin(); 229 printf("\nError parsing configfile\n");232 fprintf(stderr, "\nError parsing configfile: %s\n", perlerr); 230 233 exit(1); 231 234 } … … 235 238 owl_function_debugmsg("Found perl formatting"); 236 239 s=owl_malloc(sizeof(owl_style)); 237 owl_style_create_perl(s, "perl", "owl::format_msg"); 240 owl_style_create_perl(s, "perl", "owl::_format_msg_legacy_wrap", 241 "User-defined perl style that calls owl::format_msg" 242 "with legacy global variable support"); 238 243 owl_global_add_style(&g, s); 239 244 owl_global_set_default_style(&g, "perl"); 240 245 } 241 246 247 /* set the startup and default style, based on userclue and presence of a 248 * formatting function */ 249 if (owl_global_is_config_format(&g)) { 250 owl_global_set_default_style(&g, "perl"); 251 } else if (owl_global_is_userclue(&g, OWL_USERCLUE_CLASSES)) { 252 owl_global_set_default_style(&g, "default"); 253 } else { 254 owl_global_set_default_style(&g, "basic"); 255 } 256 242 257 /* execute the startup function in the configfile */ 243 perlout = owl_ config_execute("owl::startup();");258 perlout = owl_perlconfig_execute("owl::startup();"); 244 259 if (perlout) owl_free(perlout); 245 260 owl_function_debugmsg("-- Owl Startup --"); … … 273 288 } 274 289 275 /* set the startup and default style, based on userclue and presence of a 276 * formatting function */ 277 if (owl_global_is_config_format(&g)) { 278 owl_view_set_style(owl_global_get_current_view(&g), owl_global_get_style_by_name(&g, "perl")); 279 owl_global_set_default_style(&g, "perl"); 280 } else if (owl_global_is_userclue(&g, OWL_USERCLUE_CLASSES)) { 281 owl_view_set_style(owl_global_get_current_view(&g), owl_global_get_style_by_name(&g, "default")); 282 owl_global_set_default_style(&g, "default"); 283 } else { 284 owl_view_set_style(owl_global_get_current_view(&g), owl_global_get_style_by_name(&g, "basic")); 285 owl_global_set_default_style(&g, "basic"); 286 } 290 owl_view_set_style(owl_global_get_current_view(&g), 291 owl_global_get_style_by_name(&g, owl_global_get_default_style(&g))); 287 292 288 293 /* welcome message */ 289 294 strcpy(startupmsg, "-------------------------------------------------------------------------\n"); 290 sprintf(buff, "Welcome to Owl version %s. Press 'h' for on 295 sprintf(buff, "Welcome to Owl version %s. Press 'h' for on-line help. \n", OWL_VERSION_STRING); 291 296 strcat(startupmsg, buff); 292 297 strcat(startupmsg, " \n"); … … 395 400 396 401 /* let the config know the new message has been received */ 397 owl_ config_getmsg(m, "owl::receive_msg();");402 owl_perlconfig_getmsg(m, 0, NULL); 398 403 399 404 /* add it to any necessary views; right now there's only the current view */
Note: See TracChangeset
for help on using the changeset viewer.