Refactor list, add attaching functional

This commit is contained in:
2022-08-19 16:46:07 +03:00
parent 57a8a08234
commit 925a8855ed
13 changed files with 261 additions and 336 deletions
+3 -4
View File
@@ -3,8 +3,6 @@
#include "include.h"
/*#####################################################################################################################*/
static void init_first(list_t* x, vnode_t v, vtype t) {
lnode_t* node = malloc(sizeof(*node));
@@ -17,6 +15,7 @@ static void init_first(list_t* x, vnode_t v, vtype t) {
x->last = node;
}
static void push_next(list_t* x, vnode_t v, vtype t) {
lnode_t* node = malloc(sizeof(*node));
@@ -50,6 +49,7 @@ list_t list_copy(const list_t* s) {
return x;
}
list_t* list_duplicate(const list_t* s) {
list_t* x;
lnode_t* c;
@@ -69,6 +69,7 @@ list_t* list_duplicate(const list_t* s) {
return x;
}
void list_copy_init(list_t* x, const list_t* s) {
lnode_t* c;
@@ -85,7 +86,6 @@ void list_copy_init(list_t* x, const list_t* s) {
}
}
/*#####################################################################################################################*/
void list_extend(list_t* x, const list_t* s) {
lnode_t* c;
@@ -109,7 +109,6 @@ void list_extend(list_t* x, const list_t* s) {
}
size_t list_slice(list_t* x, list_t* s, ssize_t i, size_t n, _Bool cut) {
lnode_t* c;