Subject: Re: as long as we're hitting FFS...
To: Bill Studenmund <wrstuden@nas.nasa.gov>
From: Ted Lemon <mellon@isc.org>
List: tech-kern
Date: 03/25/1999 21:00:29
> > No, because it would also have to compact space on closure, among other
> > things.
> Sorry, s/closure/deletion/.

int delete(tag, buf, buflen)
	u_int32_t tag;
{
	u_int32_t cur_tag;
	int cur_len;
	int endianness;
	int bufix;

	while (extract_cur_tag (&buf [bufix],
				&cur_len, &endianness, &cur_tag)) {
		if (cur_tag == tag) {
			int remainder = buflen - bufix - len - 4;
			if (remainder > 0)
				memcpy (&buf [bufix], 
					buf + len + 4, remainder);
			memset (&buf [bufix + remainder], 0, len + 4);
			return 0;
		}
		bufix += len + 4;
	}
}

I haven't tested this, or even really checked it very carefully, but
you get the idea.  Deletion/compaction is not difficult.

			       _MelloN_