#endif /* lint || SABER */
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include "linked_list.h"
#ifndef NULL
#define FALSE 0
#endif
-char *calloc();
-
-#ifdef __STDC__
void ll_init(linked_list *list)
/*
* Requires:
* Initializes the list to be one with no elements. If list is
* NULL, prints an error message and causes the program to crash.
*/
-#else
-void ll_init(list)
- linked_list *list;
-#endif /* __STDC__ */
{
if (list == NULL) {
fprintf(stderr, "Error: calling ll_init with null pointer.\n");
#endif /* WINDOWS */
}
-#ifdef __STDC__
ll_node *ll_add_node(linked_list *list, ll_end which_end)
/*
* Modifies:
* list.h. If there is not enough memory to allocate a node,
* the program returns NULL.
*/
-#else
-ll_node *ll_add_node(list, which_end)
- linked_list *list;
- ll_end which_end;
-#endif /* __STDC__ */
{
ll_node *node = NULL;
}
-#ifdef __STDC__
int ll_delete_node(linked_list *list, ll_node *node)
/*
* Modifies:
* this routine frees node, after the routine is called, "node"
* won't point to valid data.
*/
-#else
-int ll_delete_node(list, node)
- linked_list *list;
- ll_node *node;
-#endif /* __STDC__ */
{
int status = LL_SUCCESS;
ll_node *cur_node = NULL;
/* ll_add_data is a macro defined in linked_list.h */
/* This routine maintains a list of strings preventing duplication. */
-#ifdef __STDC__
int ll_string(linked_list *list, ll_s_action action, char *string)
-#else
-int ll_string(list, action, string)
- linked_list *list;
- ll_s_action action;
- char *string;
-#endif /* __STDC__ */
{
int status = LL_SUCCESS;
ll_node *cur_node;