Changeset 61e79a9
- Timestamp:
- Sep 2, 2002, 12:10:37 PM (22 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:
- 5145235
- Parents:
- c01e477
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
rc01e477 r61e79a9 18 18 Moved zsig generation to the zwrite object 19 19 Print the zsig used for outgoing messages 20 Started changes to tty variables *** NOT DONE ***20 The tty variable now controls the zephyr location tty name 21 21 22 22 1.2.2 -
global.c
rc01e477 r61e79a9 63 63 strcpy(g->buffercommand, ""); 64 64 65 65 66 owl_global_set_config_format(g, 0); 66 67 owl_global_set_userclue(g, OWL_USERCLUE_NONE); … … 381 382 } 382 383 383 /* tty (not fully implemented yet) */384 385 void owl_global_set_tty_old(owl_global *g, char *tty) {386 if (tty) {387 strcpy(g->thistty, tty);388 } else if (getenv("DISPLAY")) {389 strcpy(g->thistty, getenv("DISPLAY"));390 } else if (ttyname(fileno(stdout))) {391 strcpy(g->thistty, ttyname(fileno(stdout)));392 if (!strncmp(g->thistty, "/dev/", 5)) {393 strcpy(g->thistty, g->thistty+5);394 }395 } else {396 strcpy(g->thistty, "unknown");397 }398 399 #ifdef HAVE_LIBZEPHYR_ZINITLOCATIONINFO400 ZInitLocationInfo(g->thishost, g->thistty);401 #endif402 }403 404 405 384 /* debug */ 406 385 … … 427 406 /* print something nicer later */ 428 407 sprintf(buff, "%i seconds", (int) diff); 408 } 409 410 char *owl_global_get_hostname(owl_global *g) { 411 return(g->thishost); 429 412 } 430 413 -
owl.c
r4b464a4 r61e79a9 132 132 if (debug) owl_global_set_debug_on(&g); 133 133 owl_global_set_startupargs(&g, argcsave, argvsave); 134 owl_global_set_tty(&g, tty);135 134 owl_context_set_readconfig(owl_global_get_context(&g)); 135 if (tty) { 136 owl_global_set_tty(&g, tty); 137 } else { 138 owl_global_set_tty(&g, owl_util_get_default_tty()); 139 } 136 140 137 141 /* setup the default filters */ -
owl.h
r56330ff r61e79a9 368 368 int typwinactive; 369 369 char thishost[LINE]; 370 char thistty[LINE];371 370 char homedir[LINE]; 372 371 int direction; -
util.c
r4b464a4 r61e79a9 494 494 } 495 495 496 char *owl_util_get_default_tty() { 497 /* call must free the return */ 498 char *out; 499 500 if (getenv("DISPLAY")) { 501 out=owl_strdup(getenv("DISPLAY")); 502 } else if (ttyname(fileno(stdout))) { 503 out=strdup(ttyname(fileno(stdout))); 504 if (!strncmp(out, "/dev/", 5)) { 505 owl_free(out); 506 out=strdup(ttyname(fileno(stdout)+5)); 507 } 508 } else { 509 out=strdup("unknown"); 510 } 511 return(out); 512 } 513 514 496 515 void owl_hack_animate() { 497 516 owl_messagelist *ml; -
variable.c
rc01e477 r61e79a9 311 311 312 312 int owl_variable_tty_set(owl_variable *v, void *newval) { 313 owl_function_makemsg("This is a test.");313 ZInitLocationInfo(owl_global_get_hostname(&g), newval); 314 314 return(owl_variable_string_set_default(v, newval)); 315 315 }
Note: See TracChangeset
for help on using the changeset viewer.