Pristine Ack-5.5
[Ack-5.5.git] / util / ego / il / il3_aux.c
1 /* $Id: il3_aux.c,v 1.5 1994/06/24 10:25:48 ceriel Exp $ */
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
11
12 #include "../share/types.h"
13 #include "il.h"
14 #include "../share/debug.h"
15 #include "../share/alloc.h"
16 #include "../share/global.h"
17 #include "il_aux.h"
18 #include "il3_aux.h"
19
20
21
22 line_p last_line(lines)
23         line_p lines;
24 {
25         /* Determine the last line of a list */
26
27         register line_p l;
28
29         assert (lines != (line_p) 0);
30         for (l = lines; l->l_next != (line_p) 0; l = l->l_next);
31         return l;
32 }
33
34
35
36 app_list(list,l)
37         line_p list,l;
38 {
39         /* Append the list after line l */
40
41         line_p llast;
42
43         assert(l != (line_p) 0);
44         assert (list != (line_p) 0);
45         llast = last_line(list);
46         llast->l_next = l->l_next;
47         if (l->l_next != (line_p) 0) {
48                 PREV(l->l_next) = llast;
49         }
50         l->l_next = list;
51         PREV(list) = l;
52 }
53
54
55
56 rem_line(l)
57         line_p l;
58 {
59         /* Remove a line from the list */
60
61         if (PREV(l) != (line_p) 0) {
62                 PREV(l)->l_next = l->l_next;
63         }
64         if (l->l_next != (line_p) 0) {
65                 PREV(l->l_next) = PREV(l);
66         }
67         oldline(l);
68 }