1994-06-24 11:31:16 +00:00
|
|
|
/* $Id$ */
|
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 "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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-31 22:05:22 +00:00
|
|
|
void app_list(list,l)
|
1984-11-26 14:14:55 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-31 22:05:22 +00:00
|
|
|
void rem_line(l)
|
1984-11-26 14:14:55 +00:00
|
|
|
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);
|
|
|
|
}
|