/*
 * request_list.h - definitions and declarations of the requests list 
 */

#ifndef _REQUEST_LIST_H_
#define _REQUEST_LIST_H_

#include <stdlib.h>
#include <stdio.h>
#include <config.h>


/* lst_iitem - each element of the list points to the next element */
typedef struct req_lst_iitem {
	char counter[MAX_COUNTER_ID_SIZE];
	char titles[MAX_TITLES_SIZE];
	struct req_lst_iitem *next;
} req_lst_iitem_t;

/* list_t */
typedef struct {
	req_lst_iitem_t *first;
	req_lst_iitem_t *last;
} req_list_t;



/* lst_new - allocates memory for list_t and initializes it */
req_list_t* req_lst_new();

/* lst_destroy - free memory of list_t and all its items */
void req_lst_destroy(req_list_t *);

void req_lst_insert(req_list_t *list, char* counter, char* title);

/* lst_pop - remove the first item from the list 'list' and returns it's value */
req_lst_iitem_t* req_lst_pop(req_list_t *list);

req_lst_iitem_t* req_lst_find(req_list_t *list, char* counter);

void req_lst_print(req_list_t *list);

#endif
