diff --git a/src/net/collections/list.c b/src/net/collections/list.c index e8474f9..2e5eb61 100644 --- a/src/net/collections/list.c +++ b/src/net/collections/list.c @@ -4,7 +4,7 @@ #include "list.h" -list_node * insert_end(list_node* list, void* data) +list_node * insert_node(list_node* list, void* data) { list_node* node = (list_node*)malloc(sizeof(list_node)); if (node == NULL) @@ -60,4 +60,21 @@ void iterate_list(list_node* list, bool forward, int (*iterFunc)(const void*)) else current = current->previous; } +} + +list_node* find_node(list_node* list_start, bool forward, int (*findFunc)(const void*)) +{ + if (list_start == NULL || findFunc == NULL) + return NULL; + list_node* current = list_start; + while (current != NULL) + { + if (findFunc(current->data) == 1) + return current; + if (forward) + current = current->next; + else + current = current->previous; + } + return NULL; } \ No newline at end of file diff --git a/src/net/logging/log.c b/src/net/logging/log.c index 8631714..b8ce7cd 100755 --- a/src/net/logging/log.c +++ b/src/net/logging/log.c @@ -20,6 +20,7 @@ int shutdown_logger(const void* data) free(logger); return 0; } + void shutdown_log(app_logger_info* appLogger) { canLog = false;