Lines Matching refs:tos
53 stdout - put stdout marker on TOS
54 stderr - put stderr marker on TOS
55 print - print TOS-1 on TOS (eg: "hello\n" stdout print)
58 copy_past_newline - append input, up to and including newline into TOS
60 drop - discard TOS
62 remchar - delete last character from TOS
64 do_fancy_stuff - translate <<foo>> to @code{foo} in TOS
65 bulletize - if "o" lines found, prepend @itemize @bullet to TOS
133 string_type *tos;
309 if (tos < stack)
311 if (tos >= stack + STACK)
327 tos--;
329 delete_string (tos + 1);
361 if (tos->write_idx)
362 tos->write_idx--;
369 while (tos->write_idx > 0
370 && (isspace ((unsigned char) at (tos, tos->write_idx - 1))
371 || at (tos, tos->write_idx - 1) == '\n'))
372 tos->write_idx--;
397 tos++;
399 init_string (tos);
401 cattext (tos, pc->s);
465 (long) (tos - stack));
481 while (at (tos, idx))
483 if (at (tos, idx) == '{' && at (tos, idx + 1) == '*')
488 else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}')
495 catchar (&out, at (tos, idx));
500 overwrite_string (tos, &out);
505 /* Wrap tos-1 as a C comment, indenting by tos. */
513 catstr (&out, tos);
515 for (unsigned int idx = 0; at (tos - 1, idx); idx++)
517 catchar (&out, at (tos - 1, idx));
518 if (at (tos - 1, idx) == '\n' && at (tos - 1, idx + 1) != '\n')
520 catstr (&out, tos);
526 overwrite_string (tos - 1, &out);
530 /* Mod tos so that only lines with leading dots remain */
538 while (at (tos, idx))
541 if (at (tos, idx) == '.')
548 while ((c = at (tos, idx)) && c != '\n')
569 if (c == '{' && at (tos, idx + 1) == '*')
574 else if (c == '*' && at (tos, idx + 1) == '}')
591 idx = skip_past_newline_1 (tos, idx);
595 overwrite_string (tos, &out);
599 /* Find lines starting with . and | and put example around them on tos */
609 while (at (tos, idx))
611 if (at (tos, idx) == '\n'
612 && (at (tos, idx +1 ) == '.'
613 || at (tos, idx + 1) == '|'))
620 while (at (tos, idx) && at (tos, idx) != '\n')
626 if (at (tos, idx) == '{')
628 else if (at (tos, idx) == '}')
633 if (at (tos, idx) == '{')
635 else if (!islower ((unsigned char) at (tos, idx)))
638 else if (at (tos, idx) == '@'
639 && islower ((unsigned char) at (tos, idx + 1)))
643 else if (at (tos, idx) == '{' && at (tos, idx + 1) == '*')
649 else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}')
655 else if (at (tos, idx) == '{'
656 || at (tos, idx) == '}')
661 catchar (&out, at (tos, idx));
666 while (at (tos, idx) == '\n'
667 && ((at (tos, idx + 1) == '.')
668 || (at (tos, idx + 1) == '|')))
674 catchar (&out, at (tos, idx));
679 overwrite_string (tos, &out);
685 itemize, inplace at TOS*/
695 while (at (tos, idx))
697 if (at (tos, idx) == '@'
698 && at (tos, idx + 1) == '*')
703 else if (at (tos, idx) == '\n'
704 && at (tos, idx + 1) == 'o'
705 && isspace ((unsigned char) at (tos, idx + 2)))
718 catchar (&out, at (tos, idx));
719 if (on && at (tos, idx) == '\n'
720 && at (tos, idx + 1) == '\n'
721 && at (tos, idx + 2) != 'o')
735 delete_string (tos);
736 *tos = out;
740 /* Turn <<foo>> into @code{foo} in place at TOS*/
748 while (at (tos, idx))
750 if (at (tos, idx) == '<'
751 && at (tos, idx + 1) == '<'
752 && !isspace ((unsigned char) at (tos, idx + 2)))
757 while (at (tos, idx)
758 && at (tos, idx) != '>' )
760 catchar (&out, at (tos, idx));
769 catchar (&out, at (tos, idx));
773 delete_string (tos);
774 *tos = out;
837 tos++;
839 init_string (tos);
840 pos_idx = copy_past_newline (buf_ptr, pos_idx, tos);
856 while (at (tos
864 if (at (tos, idx) == '.')
868 while (at (tos, idx))
876 while (idx && isspace ((unsigned char) at (tos, idx)))
886 if (at (tos, c) == '\n'
887 && at (tos, c + 1) == '\n'
888 && at (tos, c + 2) == '.')
893 else if (at (tos, c) == '.' && sl)
898 else if (at (tos, c) == '\n'
899 && at (tos, c + 1) == '\n'
906 catchar (&out, at (tos, c));
907 if (at (tos, c) == '\n')
926 delete_string (tos);
927 *tos = out;
940 for (idx = 0; at (tos, idx) != 0; ++idx)
942 char c = at (tos, idx);
959 delete_string (tos);
960 *tos = out;
974 while (at (tos, idx))
976 switch (at (tos, idx))
981 if (tab && at (tos, idx))
1013 catchar (&out, at (tos, idx));
1021 delete_string (tos);
1022 *tos = out;
1029 tos++;
1031 init_string (tos);
1037 pos_idx = copy_past_newline (buf_ptr, pos_idx, tos);
1047 t = tos[0];
1048 tos[0] = tos[-1];
1049 tos[-1] = t;
1056 tos++;
1058 init_string (tos);
1059 catstr (tos, tos - 1);
1066 tos--;
1068 catstr (tos, tos + 1);
1069 delete_string (tos + 1);
1085 catstr (tos - 1, tos);
1087 delete_string (tos);
1088 tos--;
1100 catstr (tos - 1, tos);
1101 delete_string (tos);
1102 tos--;
1246 tos = stack;
1469 write_buffer (tos, stdout);
1471 write_buffer (tos, stderr);
1475 tos--;
1525 tos = stack + 1;
1610 if (tos != stack)
1613 (long) (tos - stack));