1987-03-09 19:15:41 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
1984-11-26 14:14:55 +00:00
|
|
|
/* I N L I N E S U B S T I T U T I O N
|
|
|
|
*
|
|
|
|
* I L 3 _ A U X . C
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "../share/types.h"
|
|
|
|
#include "il.h"
|
|
|
|
#include "../share/debug.h"
|
|
|
|
#include "../share/alloc.h"
|
|
|
|
#include "../share/global.h"
|
|
|
|
#include "il_aux.h"
|
|
|
|
#include "il3_aux.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
line_p last_line(lines)
|
|
|
|
line_p lines;
|
|
|
|
{
|
|
|
|
/* Determine the last line of a list */
|
|
|
|
|
|
|
|
register line_p l;
|
|
|
|
|
1985-01-23 16:12:21 +00:00
|
|
|
assert (lines != (line_p) 0);
|
1984-11-26 14:14:55 +00:00
|
|
|
for (l = lines; l->l_next != (line_p) 0; l = l->l_next);
|
|
|
|
return l;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app_list(list,l)
|
|
|
|
line_p list,l;
|
|
|
|
{
|
|
|
|
/* Append the list after line l */
|
|
|
|
|
|
|
|
line_p llast;
|
|
|
|
|
|
|
|
assert(l != (line_p) 0);
|
|
|
|
assert (list != (line_p) 0);
|
|
|
|
llast = last_line(list);
|
|
|
|
llast->l_next = l->l_next;
|
|
|
|
if (l->l_next != (line_p) 0) {
|
|
|
|
PREV(l->l_next) = llast;
|
|
|
|
}
|
|
|
|
l->l_next = list;
|
|
|
|
PREV(list) = l;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rem_line(l)
|
|
|
|
line_p l;
|
|
|
|
{
|
|
|
|
/* Remove a line from the list */
|
|
|
|
|
|
|
|
if (PREV(l) != (line_p) 0) {
|
|
|
|
PREV(l)->l_next = l->l_next;
|
|
|
|
}
|
|
|
|
if (l->l_next != (line_p) 0) {
|
|
|
|
PREV(l->l_next) = PREV(l);
|
|
|
|
}
|
|
|
|
oldline(l);
|
|
|
|
}
|