* prints the next boolean option, on the same line if possible, on a new * line if not. End with next_opt(""). */
| 9752 | * line if not. End with next_opt(""). |
| 9753 | */ |
| 9754 | void |
| 9755 | next_opt(winid datawin, const char *str) |
| 9756 | { |
| 9757 | static char *buf = 0; |
| 9758 | int i; |
| 9759 | char *s; |
| 9760 | |
| 9761 | if (!buf) |
| 9762 | *(buf = (char *) alloc(COLBUFSZ)) = '\0'; |
| 9763 | |
| 9764 | if (!*str) { |
| 9765 | s = eos(buf); |
| 9766 | if (s > &buf[1] && s[-2] == ',') |
| 9767 | s[-2] = '.', s[-1] = '\0'; /* replace ending ", " with "." */ |
| 9768 | i = COLNO; /* (greater than COLNO - 2) */ |
| 9769 | } else { |
| 9770 | i = Strlen(buf) + Strlen(str) + 2; |
| 9771 | } |
| 9772 | |
| 9773 | if (i > COLNO - 2) { /* rule of thumb */ |
| 9774 | putstr(datawin, 0, buf); |
| 9775 | buf[0] = 0; |
| 9776 | } |
| 9777 | if (*str) { |
| 9778 | Strcat(buf, str); |
| 9779 | Strcat(buf, ", "); |
| 9780 | } else { |
| 9781 | putstr(datawin, 0, str); |
| 9782 | free((genericptr_t) buf), buf = 0; |
| 9783 | } |
| 9784 | return; |
| 9785 | } |
| 9786 | |
| 9787 | static struct wc_Opt wc_options[] = { |
| 9788 | { "ascii_map", WC_ASCII_MAP }, |
no test coverage detected