From 19d701ddf07d855128ded0cf2b573ce468e3bdd6 Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Wed, 20 Jan 2016 01:10:01 +0000 Subject: Removing Suricata and Audit from source repo, and updated build.sh to avoid building suricata. Will re-address this in C release via tar balls. Change-Id: I3710076f8b7f3313cb3cb5260c4eb0a6834d4f6e Signed-off-by: Ashlee Young --- framework/src/audit/tools/auvirt/auvirt-list.c | 105 ------------------------- 1 file changed, 105 deletions(-) delete mode 100644 framework/src/audit/tools/auvirt/auvirt-list.c (limited to 'framework/src/audit/tools/auvirt/auvirt-list.c') diff --git a/framework/src/audit/tools/auvirt/auvirt-list.c b/framework/src/audit/tools/auvirt/auvirt-list.c deleted file mode 100644 index 75021889..00000000 --- a/framework/src/audit/tools/auvirt/auvirt-list.c +++ /dev/null @@ -1,105 +0,0 @@ -#include "auvirt-list.h" -#include - -list_t *list_init(list_t *list, list_free_data_fn *free_data_fn) -{ - if (list == NULL) - return NULL; - list->head = list->tail = NULL; - list->free_data_fn = free_data_fn; - return list; -} - -list_t *list_new(list_free_data_fn *free_data_fn) -{ - return list_init(malloc(sizeof(list_t)), free_data_fn); -} - -void list_free_node(list_node_t *node, list_free_data_fn *free_data_fn) -{ - if (node) { - if (free_data_fn) - free_data_fn(node->data); - free(node); - } -} - -void list_free_(list_t *list, list_free_data_fn *free_data_fn) -{ - if (list != NULL) { - list_node_t *it = list->head; - while (it && it->next) { - it = it->next; - list_free_node(it->prev, free_data_fn); - } - list_free_node(it, free_data_fn); - free(list); - } -} - -void list_free(list_t *list) -{ - if (list) - list_free_(list, list->free_data_fn); -} - -list_node_t *list_insert_after(list_t *list, list_node_t *it, - void *data) -{ - list_node_t *node = NULL; - if (list == NULL) - return NULL; - - /* allocate node */ - node = malloc(sizeof(list_node_t)); - if (node == NULL) - return NULL; - node->data = data; - - /* insert the new node after it */ - node->prev = it; - if (it) { - node->next = it->next; - it->next = node; - } - else - node->next = list->head; - if (node->next) - node->next->prev = node; - - /* update list's head and tail */ - if (it == list->tail) - list->tail = node; - if (it == NULL) - list->head = node; - - return node; -} - -list_node_t *list_append(list_t *list, void *data) -{ - return list_insert_after(list, list->tail, data); -} - -int list_remove_(list_t *list, list_node_t *it, - list_free_data_fn *free_data_fn) -{ - if (list == NULL || it == NULL) - return 1; - if (list->head == it) - list->head = it->next; - if (list->tail == it) - list->tail = it->prev; - if (it->next) - it->next->prev = it->prev; - if (it->prev) - it->prev->next = it->next; - list_free_node(it, free_data_fn); - return 0; -} - -int list_remove(list_t *list, list_node_t *it) -{ - return list_remove_(list, it, list->free_data_fn); -} - -- cgit 1.2.3-korg