t14.c 973 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #include "a.h"
  10. /*
  11. * 14. Three-part titles.
  12. */
  13. void
  14. r_lt(int argc, Rune **argv)
  15. {
  16. Rune *p;
  17. if(argc < 2)
  18. nr(L(".lt"), evalscale(L("6.5i"), 'm'));
  19. else{
  20. if(argc > 2)
  21. warn("too many arguments for .lt");
  22. p = argv[1];
  23. if(p[0] == '-')
  24. nr(L(".lt"), getnr(L(".lt"))-evalscale(p+1, 'm'));
  25. else if(p[0] == '+')
  26. nr(L(".lt"), getnr(L(".lt"))+evalscale(p+1, 'm'));
  27. else
  28. nr(L(".lt"), evalscale(p, 'm'));
  29. }
  30. }
  31. void
  32. t14init(void)
  33. {
  34. addreq(L("tl"), r_warn, -1);
  35. addreq(L("pc"), r_nop, -1); /* page number char */
  36. addreq(L("lt"), r_lt, -1);
  37. }