il3_aux.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* $Id$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. */
  6. /* I N L I N E S U B S T I T U T I O N
  7. *
  8. * I L 3 _ A U X . C
  9. */
  10. #include "../share/types.h"
  11. #include "il.h"
  12. #include "../share/debug.h"
  13. #include "../share/alloc.h"
  14. #include "../share/global.h"
  15. #include "il_aux.h"
  16. #include "il3_aux.h"
  17. line_p last_line(lines)
  18. line_p lines;
  19. {
  20. /* Determine the last line of a list */
  21. register line_p l;
  22. assert (lines != (line_p) 0);
  23. for (l = lines; l->l_next != (line_p) 0; l = l->l_next);
  24. return l;
  25. }
  26. app_list(list,l)
  27. line_p list,l;
  28. {
  29. /* Append the list after line l */
  30. line_p llast;
  31. assert(l != (line_p) 0);
  32. assert (list != (line_p) 0);
  33. llast = last_line(list);
  34. llast->l_next = l->l_next;
  35. if (l->l_next != (line_p) 0) {
  36. PREV(l->l_next) = llast;
  37. }
  38. l->l_next = list;
  39. PREV(list) = l;
  40. }
  41. rem_line(l)
  42. line_p l;
  43. {
  44. /* Remove a line from the list */
  45. if (PREV(l) != (line_p) 0) {
  46. PREV(l)->l_next = l->l_next;
  47. }
  48. if (l->l_next != (line_p) 0) {
  49. PREV(l->l_next) = PREV(l);
  50. }
  51. oldline(l);
  52. }