| 1200 | ****************************************************************************/ |
| 1201 | |
| 1202 | static inline void process_help(FILE *stream, output_t outfunc) |
| 1203 | { |
| 1204 | char *ptr; |
| 1205 | int help_indent = 0; |
| 1206 | int indent; |
| 1207 | bool blank; |
| 1208 | bool done; |
| 1209 | bool newpara; |
| 1210 | bool preformatted; |
| 1211 | |
| 1212 | /* Read each comment line */ |
| 1213 | |
| 1214 | newpara = true; |
| 1215 | preformatted = false; |
| 1216 | |
| 1217 | for (; ; ) |
| 1218 | { |
| 1219 | /* Read the next line of comment text */ |
| 1220 | |
| 1221 | if (!read_line(stream)) |
| 1222 | { |
| 1223 | break; |
| 1224 | } |
| 1225 | |
| 1226 | /* What is the indentation level? The first help line sets the |
| 1227 | * indentation level. The first line encounter with lower |
| 1228 | * indentation terminates the help. |
| 1229 | */ |
| 1230 | |
| 1231 | ptr = g_line; |
| 1232 | indent = 0; |
| 1233 | blank = false; |
| 1234 | done = false; |
| 1235 | |
| 1236 | while (!done) |
| 1237 | { |
| 1238 | int ch = (int)*ptr; |
| 1239 | switch (ch) |
| 1240 | { |
| 1241 | case ' ': |
| 1242 | indent++; |
| 1243 | ptr++; |
| 1244 | break; |
| 1245 | |
| 1246 | case '\t': |
| 1247 | indent += TAB_SIZE; |
| 1248 | ptr++; |
| 1249 | break; |
| 1250 | |
| 1251 | case '#': |
| 1252 | #if 0 |
| 1253 | blank = true; |
| 1254 | #endif |
| 1255 | done = true; |
| 1256 | break; |
| 1257 | |
| 1258 | case '\n': |
| 1259 | case '\0': |
no test coverage detected