| 64 | **man-end****************************************************************/ |
| 65 | |
| 66 | int waddnstr(WINDOW *win, const char *str, int n) |
| 67 | { |
| 68 | int i = 0; |
| 69 | |
| 70 | PDC_LOG(("waddnstr() - called: string=\"%s\" n %d \n", str, n)); |
| 71 | |
| 72 | if (!win || !str) |
| 73 | return ERR; |
| 74 | |
| 75 | while (str[i] && (i < n || n < 0)) |
| 76 | { |
| 77 | #ifdef PDC_WIDE |
| 78 | wchar_t wch; |
| 79 | int retval = PDC_mbtowc(&wch, str + i, n >= 0 ? n - i : 6); |
| 80 | |
| 81 | if (retval <= 0) |
| 82 | return OK; |
| 83 | |
| 84 | i += retval; |
| 85 | #else |
| 86 | chtype wch = (unsigned char)(str[i++]); |
| 87 | #endif |
| 88 | if (waddch(win, wch) == ERR) |
| 89 | return ERR; |
| 90 | } |
| 91 | |
| 92 | return OK; |
| 93 | } |
| 94 | |
| 95 | int addstr(const char *str) |
| 96 | { |
no test coverage detected
searching dependent graphs…