wm: teppich

ref: d88d5c75f64ca8eb1605cf9a8bbef65bc26aa902
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;

	temp->val = data;
	temp->next = nil;

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

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