* Append a line of text to the message window. Split the line if the * rendering of the text is too long for the window. */
| 238 | * rendering of the text is too long for the window. |
| 239 | */ |
| 240 | void |
| 241 | append_message(struct xwindow *wp, const char *str) |
| 242 | { |
| 243 | char *mark, *remainder, buf[BUFSZ]; |
| 244 | |
| 245 | if (!str) |
| 246 | return; |
| 247 | |
| 248 | Strcpy(buf, str); /* we might mark it up */ |
| 249 | |
| 250 | remainder = buf; |
| 251 | do { |
| 252 | mark = remainder; |
| 253 | remainder = split(mark, wp->mesg_information->fs, wp->pixel_width); |
| 254 | add_line(wp->mesg_information, mark); |
| 255 | } while (remainder); |
| 256 | } |
| 257 | |
| 258 | /* private functions ======================================================= |
| 259 | */ |
no test coverage detected