
#include <string.h>
#include <stdlib.h>

#include "llist.h"




elist *list_search(llist *L, const char *k)
{
    elist *x = L -> head;
    while ((x != (elist*) 0) && (strcmp(x -> key, k))) {
	x = x -> next;
    }
    return x;
}

elist *new_element(const char *s)
{
    elist *x;
    x = (elist *) malloc(sizeof(elist));
    x -> count = 1;
    x -> key = (char*) malloc((1 + strlen(s)) * sizeof(char));
    strcpy(x -> key, s);
    return x;
}


