/* 
 *  This library was designed to be used in the translation
 *  of Liss programs to C programs
 */

typedef int elem;

typedef struct node *link;

typedef struct node {
	elem value;
	link next;
		} listNode;

typedef struct ls {
	int size;
	link head;
	link last;
		} listst;

typedef listst * list;


// creates a new empty list
list newList();

// creates a new list with the values that are in array
list newInitList(elem array[], int dim);

// creates a new node with value=var and next=null and returns a pointer to the node
link newNodeList(elem val);

// adds a node, referenced by pointer lnode, in the last position of list l
void addNodeList(link lnode, list l);

// adds element val to the last position of list l
void addElemList(elem val, list l);

// returns the size of list l
int getSizeList(list l);

// returns the element of the node in the position pos
elem getElemList(int pos, list l);

// prints in stdout the list l
void printList(list l);

// returns the first element of list l
elem getHeadList(list l);

// returns a new list containing the tail (all elements except the first one) of list l
list getTailList(list l);

// creates a new list l_dest equal to list l_orig
void copyList(list l_orig, list l_dest);

// cleans the list from node nd till the end
void cleanList(link nd);

// checks if list l is empty
int isEmptyList(list l);

// checks if element val belongs to list l
int isMemberList(elem val, list l);

// removes the first node with element val in list l
void remElemList(elem val, list l);
