Changeset View
Changeset View
Standalone View
Standalone View
stand/common/console.c
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | putchar(int c) | ||||
for (cons = 0; consoles[cons] != NULL; cons++) { | for (cons = 0; consoles[cons] != NULL; cons++) { | ||||
if ((consoles[cons]->c_flags & (C_PRESENTOUT | C_ACTIVEOUT)) == | if ((consoles[cons]->c_flags & (C_PRESENTOUT | C_ACTIVEOUT)) == | ||||
(C_PRESENTOUT | C_ACTIVEOUT)) | (C_PRESENTOUT | C_ACTIVEOUT)) | ||||
consoles[cons]->c_out(c); | consoles[cons]->c_out(c); | ||||
} | } | ||||
} | } | ||||
void | |||||
putchar_device(int c, void *name) | |||||
{ | |||||
int cons; | |||||
if (name == NULL) | |||||
return; | |||||
if (c == '\n') | |||||
putchar_device('\r', name); | |||||
cons = cons_find(name); | |||||
if (cons < 0) | |||||
return; | |||||
/* Expand newlines if not in raw mode */ | |||||
if ((consoles[cons]->c_flags & C_PRESENTOUT) == C_PRESENTOUT) { | |||||
consoles[cons]->c_out(c); | |||||
} | |||||
} | |||||
/* | /* | ||||
* Find the console with the specified name. | * Find the console with the specified name. | ||||
*/ | */ | ||||
static int | static int | ||||
cons_find(const char *name) | cons_find(const char *name) | ||||
{ | { | ||||
int cons; | int cons; | ||||
▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines |