Lines Matching refs:line

110  * While the whatis line is being formed, it is stored in whatis_proto.
334 char line[LINE_ALLOC];
342 while (fgets(line, sizeof line, output) != NULL) {
343 line[strlen(line) - 1] = '\0';
344 sl_add(whatis_lines, strdup(line));
377 char *line = whatis_lines->sl_str[i];
378 if (i > 0 && strcmp(line, prev) == 0)
380 prev = line;
381 fputs(line, output);
467 only_digits(char *line)
469 if (!isdigit(*line++))
471 while (isdigit(*line))
472 line++;
473 return *line == '\0';
477 * Returns whether the line is of one of the forms:
484 name_section_line(char *line, const char *section_start)
489 if (strncmp(line, section_start, 3) != 0)
491 line = skip_spaces(line + 3);
492 rhs = trim_rhs(line);
493 if (*line == '"') {
494 line++;
499 if (strcmp(*title, line) == 0)
577 * Processes an old-style man(7) line. This ignores commands with only
581 process_man_line(char *line)
583 if (*line == '.') {
584 while (isalpha(*++line))
586 line = skip_spaces(line);
587 if (only_digits(line))
590 line = skip_spaces(line);
591 if (*line != '\0') {
592 add_nroff(line);
598 * Processes a new-style mdoc(7) line.
601 process_mdoc_line(char *line)
605 char *line_end = &line[strlen(line)];
609 if (*line == '\0')
611 if (line[0] != '.' || !isupper(line[1]) || !islower(line[2])) {
612 add_nroff(skip_spaces(line));
616 xref = strncmp(line, ".Xr", 3) == 0;
617 line += 3;
618 while ((line = skip_spaces(line)) < line_end) {
619 if (*line == '"') {
620 next = ++line;
632 next = strpbrk(line, " \t");
637 if (isupper(*line) && islower(line[1]) && line[2] == '\0') {
638 if (strcmp(line, "Ns") == 0) {
640 line = next;
643 if (strstr(mdoc_commands, line) != NULL) {
644 line = next;
648 if (arg > 0 && strchr(",.:;?!)]", *line) == 0) {
651 add_nroff(line);
654 line = blank;
658 add_nroff(line);
660 line = next;
690 * Processes a man page source into a single whatis line and adds it
698 char *line;
711 line = buffer;
712 if (strncmp(line, ".\\\"", 3) == 0) /* ignore comments */
719 if (name_section_line(line, ".SH"))
721 else if (name_section_line(line, ".Sh"))
728 if (strncmp(line, ".SH", 3) == 0)
730 if (strncmp(line, ".SS", 3) == 0)
732 trim_rhs(line);
733 if (strcmp(line, ".") == 0)
735 if (strncmp(line, ".IX", 3) == 0) {
736 line += 3;
737 line = skip_spaces(line);
739 process_man_line(line);
745 trim_rhs(line);
746 if (strncmp(line, ".Nm", 3) == 0) {
747 process_mdoc_line(line);
750 if (strcmp(line, ".") == 0)
760 if (strncmp(line, ".Sh", 3) == 0)
762 trim_rhs(line);
763 if (strcmp(line, ".") == 0)
765 process_mdoc_line(line);
772 line = sbuf_content(whatis_proto);
774 * line now contains the appropriate data, but without
777 descr = strstr(line, " - ");
779 descr = strchr(line, ' ');
782 fprintf(stderr, " ignoring junk description \"%s\"\n", line);
791 collect_names(names, line);