wm: teppich

ref: 4d5b562d78b2ac82526f634ee4800d25d1775065
dir: /libc/lladd.c/

View raw version
#include <u.h>
#include <err.h>
#include <mem.h>

int
lladd(ll_t *last, void *data)
{
	ll_t *temp;

	if(last->next != nil)
		return LL_ERR;

	temp = malloc(sizeof(ll_t*));
	
	temp->val = data;
	temp->next = nil;
	
	last->next = temp;
	return OK;
}