4.3BSD/usr/contrib/spms/src/lib/libslist/test/slappend.a

!<arch>
Islappend       418431492   968   27    100644  67        `
10th
1st
2nd
3rd
4th
5th
6th
7th
8th
9th


AAA
aaa
Aaa
BBB
bbb
Bbb

Oslappend       418431492   968   27    100644  78        `
10th
1st
2nd
3rd
4th
5th
6th
7th
8th
9th


AAA
aaa
Aaa
BBB
bbb
Bbb
maxkey = 4
Tslappend.c     418431492   968   27    100644  604       `
/*
 * slappend()
 */
#include <stdio.h>
#include "null.h"
#include "slist.h"

#define KEYSIZE 10

char *PGN = "Tslappend";

main()
{
	char key[KEYSIZE];		/* key to be added */
	char *gets();			/* get a line from stdin */
	char *slappend();		/* append key */
	SLBLK *curblk;			/* current list block */
	SLIST *slinit();		/* initialize list */
	SLIST *slist;			/* pointer to list head block */

	slist = slinit();
	while (gets(key) != NULL)
		slappend(key, slist);
	for (curblk = slist->head; curblk != NULL; curblk = curblk->next)
		puts(curblk->key);
	printf("maxkey = %d\n", slist->maxkey);
	exit(0);
}