| plan 9 kernel history: overview | file list | diff list |
1991/0809/port/devcons.c (diff list | history)
| 1991/0808/sys/src/9/port/devcons.c:37,73 – 1991/0809/sys/src/9/port/devcons.c:37,84 (short | long | prev | next) | ||
| 1990/0227 | } /* | |
| 1991/0607 |
| |
| 1991/0809 | * Print a string on the console. Convert \n to \r\n for serial * line consoles. Locking of the queues is left up to the screen * or uart code. Multi-line messages to serial consoles may get * interspersed with other messages. | |
| 1990/0227 | */ void putstrn(char *str, int n) { | |
| 1991/0809 | char buf[PRINTSIZE+2]; int m; | |
| 1990/0227 | char *t; | |
| 1991/0808 |
| |
| 1990/0227 | ||
| 1991/0808 |
| |
| 1991/0809 | /* * if there's an attached bit mapped display, * put the message there. screenputs is defined * as a null macro for systems that have no such * display. */ screenputs(str, n); /* * if there's a serial line being used as a console, * put the message there. Tack a carriage return * before new lines. */ if(printq.puts == 0) return; | |
| 1990/0227 | while(n > 0){ | |
| 1991/0607 |
| |
| 1990/0227 |
| |
| 1991/0607 |
| |
| 1990/0227 |
| |
| 1991/0809 | t = memchr(str, '\n', n); if(t){ m = t - str; memmove(buf, str, m); buf[m] = '\r'; buf[m+1] = '\n'; (*printq.puts)(&printq, buf, m+2); str = t + 1; n -= m + 1; } else { (*printq.puts)(&printq, str, n); break; } | |
| 1990/0227 | } | |
| 1991/0808 |
| |
| 1990/0227 | } | |
| 1991/0607 | /* | |