From ec0cfdc492065dcce687797d3a931af105a461c8 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Fri, 6 Jun 2025 13:42:25 -0500 Subject: Get rid of useless ll-internal files --- src/ll-internal.c | 17 ----------------- src/ll-internal.h | 28 ---------------------------- src/ll.c | 30 ++++++++++++++++++++++++++++-- src/main.c | 11 ----------- 4 files changed, 28 insertions(+), 58 deletions(-) delete mode 100644 src/ll-internal.c delete mode 100644 src/ll-internal.h diff --git a/src/ll-internal.c b/src/ll-internal.c deleted file mode 100644 index e56302e..0000000 --- a/src/ll-internal.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "ll-internal.h" -#include "shared.h" - -#include - -dllnode * dllnode_init(void *data, dll_freecb fcb) { - dllnode *n = VALLOC(1, sizeof(*n)); - if(!n) - return NULL; - - n->data = data; - n->freecb = fcb; - n->prev = NULL; - n->next = NULL; - - return n; -} \ No newline at end of file diff --git a/src/ll-internal.h b/src/ll-internal.h deleted file mode 100644 index e829669..0000000 --- a/src/ll-internal.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef __VXGG_REWRITE___LL_INTERNAL_H___21242172227746___ -#define __VXGG_REWRITE___LL_INTERNAL_H___21242172227746___ - -#define __VXGG_REWRITE___LL_INTERNAL___ 1 -#include "ll.h" -#undef __VXGG_REWRITE___LL_INTERNAL___ - -typedef struct dll { - void *data; - dll_freecb freecb; - - struct dll *next; - struct dll *prev; - -} dllnode; -typedef struct dlinked { - int size; - dllnode *start; - dllnode *end; - -} dlinkedlist; - -dllnode * dllnode_init(void *data, dll_freecb fcb); - -// Note: This file exists because I want to reuse dlinkedlist's definitions from threadpool to create a concurrent queue without -// sacrificing the opaqueness of the definition - -#endif \ No newline at end of file diff --git a/src/ll.c b/src/ll.c index 6cc2afe..b8d0d4c 100644 --- a/src/ll.c +++ b/src/ll.c @@ -1,12 +1,38 @@ #include "ll.h" -#include "ll-internal.h" #include "shared.h" -#include #include #include #include +typedef struct dln { + void *data; + dll_freecb freecb; + + struct dln *next; + struct dln *prev; + +} dllnode; +typedef struct dlinked { + int size; + dllnode *start; + dllnode *end; + +} dlinkedlist; + +dllnode * dllnode_init(void *data, dll_freecb fcb) { + dllnode *n = VALLOC(1, sizeof(*n)); + if(!n) + return NULL; + + n->data = data; + n->freecb = fcb; + n->prev = NULL; + n->next = NULL; + + return n; +} + dlinkedlist * dlinkedlist_init(void) { dlinkedlist *ll = VALLOC(1, sizeof(*ll)); if(!ll) diff --git a/src/main.c b/src/main.c index 1e4f960..b0727e2 100755 --- a/src/main.c +++ b/src/main.c @@ -7,17 +7,6 @@ #include #include -#include -#include - -int testcb(void *arg) { - if(!arg) - return -1; - - printf("%s\n", (char*)arg); - - return 0; -} int main() { error(-1, ENOTSUP, "lol"); -- cgit v1.2.3