ack/util/ego/il/il3_aux.c

68 lines
1.1 KiB
C
Raw Permalink Normal View History

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;
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;
}
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;
}
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);
}