#include <stdbool.h>
#include "schemeitem.h"

#ifndef __LINKED_LIST_H__
#define __LINKED_LIST_H__

// Create a new NULL_TYPE item node.
scheme_item_t *makeNull();

// Create a new CONS_TYPE item node.
scheme_item_t *cons(scheme_item_t *newCar, scheme_item_t *newCdr);

// Display the contents of the linked list to the screen in some kind of
// readable format.
void display(scheme_item_t *list);

// Return a new list that is the reverse of the one that is passed in.
// No stored data within the linked list should be duplicated; rather,
// a new linked list of CONS_TYPE nodes should be created, that point
// to items in the original list.
scheme_item_t *reverse(scheme_item_t *list);

// Utility to make it less typing to get car value.  Use assertions to make sure
// that this is a legitimate operation.
scheme_item_t *car(scheme_item_t *list);

// Utility to make it less typing to get cdr value.  Use assertions to make sure
// that this is a legitimate operation.
scheme_item_t *cdr(scheme_item_t *list);

// Utility to check if pointing to a NULL_TYPE value.  Use assertions to make sure
// that this is a legitimate operation.
bool isNull(scheme_item_t *item);

// Measure length of list.  Use assertions to make sure that this is a legitimate
// operation.
int length(scheme_item_t *item);

#endif // __LINKED_LIST_H__
