Browse Source

Some bintree cleanup

Serj Kalichev 5 years ago
parent
commit
34b44a6cfc
8 changed files with 0 additions and 78 deletions
  1. 0 1
      clish/action.h
  2. 0 1
      clish/action/action.c
  3. 0 1
      clish/ptype.h
  4. 0 1
      clish/ptype/private.h
  5. 0 2
      konf/buf/private.h
  6. 0 33
      konf/tree/tree_dump.c
  7. 0 2
      lub/list.h
  8. 0 37
      lub/list/list.c

+ 0 - 1
clish/action.h

@@ -7,7 +7,6 @@
 
 typedef struct clish_action_s clish_action_t;
 
-#include "lub/bintree.h"
 #include "clish/macros.h"
 #include "clish/plugin.h"
 

+ 0 - 1
clish/action/action.c

@@ -10,7 +10,6 @@
 #include <assert.h>
 
 #include "private.h"
-#include "lub/bintree.h"
 #include "lub/string.h"
 
 /*--------------------------------------------------------- */

+ 0 - 1
clish/ptype.h

@@ -10,7 +10,6 @@ typedef struct clish_ptype_s clish_ptype_t;
 
 #include "lub/types.h"
 #include "clish/macros.h"
-#include "lub/bintree.h"
 #include "lub/argv.h"
 #include "clish/action.h"
 

+ 0 - 1
clish/ptype/private.h

@@ -2,7 +2,6 @@
  * ptype.h
  */
 #include "clish/pargv.h"
-#include "lub/bintree.h"
 #include "lub/argv.h"
 
 #include <sys/types.h>

+ 0 - 2
konf/buf/private.h

@@ -2,10 +2,8 @@
 #define _konf_buf_private_h
 
 #include "konf/buf.h"
-#include "lub/bintree.h"
 
 struct konf_buf_s {
-	lub_bintree_node_t bt_node;
 	int fd;
 	int size;
 	char *buf;

+ 0 - 33
konf/tree/tree_dump.c

@@ -1,41 +1,8 @@
 #ifdef DEBUG
-
 /*
  * conf_dump.c
  */
 #include "private.h"
 #include "lub/dump.h"
 
-/*--------------------------------------------------------- */
-/*void clish_conf_dump(clish_conf_t * this)
-{
-	clish_command_t *c;
-	lub_bintree_iterator_t iter;
-	unsigned i;
-
-	lub_dump_printf("view(%p)\n", this);
-	lub_dump_indent();
-
-	c = lub_bintree_findfirst(&this->tree);
-
-	lub_dump_printf("name  : %s\n", clish_view__get_name(this));
-	lub_dump_printf("depth : %u\n", clish_view__get_depth(this));
-*/
-	/* Get each namespace to dump their details */
-/*	for (i = 0; i < this->nspacec; i++) {
-		clish_nspace_dump(clish_view__get_nspace(this, i));
-	}
-*/
-	/* iterate the tree of commands */
-/*	for (lub_bintree_iterator_init(&iter, &this->tree, c);
-	     c; c = lub_bintree_iterator_next(&iter)) {
-		clish_command_dump(c);
-	}
-
-	lub_dump_undent();
-
-} */
-
-/*--------------------------------------------------------- */
-
 #endif /* DEBUG */

+ 0 - 2
lub/list.h

@@ -34,8 +34,6 @@ lub_list_node_t *lub_list_add(lub_list_t *list, void *data);
 lub_list_node_t *lub_list_add_uniq(lub_list_t *list, void *data);
 lub_list_node_t *lub_list_find_add(lub_list_t *list, void *data);
 void lub_list_del(lub_list_t *list, lub_list_node_t *node);
-lub_list_node_t *lub_list_search_node(lub_list_t *list, void *data);
-void *lub_list_search(lub_list_t *list, void *data);
 unsigned int lub_list_len(lub_list_t *list);
 lub_list_node_t *lub_list_match_node(lub_list_t *list,
 	lub_list_match_fn matchFn, const void *userkey,

+ 0 - 37
lub/list/list.c

@@ -281,45 +281,8 @@ void *lub_list_find(lub_list_t *this,
 	return lub_list_match(this, matchFn, userkey, NULL);
 }
 
-/*--------------------------------------------------------- */
-lub_list_node_t *lub_list_search_node(lub_list_t *this, void *data)
-{
-	lub_list_node_t *iter;
-	int res;
-
-	/* Empty list */
-	if (!this->head)
-		return NULL;
-	/* Not sorted list. Can't search. */
-	if (!this->compareFn)
-		return NULL;
-
-	/* Sorted list */
-	iter = this->head;
-	while (iter) {
-		res = this->compareFn(data, iter->data);
-		if (!res)
-			return iter;
-		if (res < 0)
-			break; // No chances to find it
-		iter = iter->next;
-	}
-
-	return NULL;
-}
-
-/*--------------------------------------------------------- */
-void *lub_list_search(lub_list_t *this, void *data)
-{
-	lub_list_node_t *iter = lub_list_search_node(this, data);
-
-	return iter->data;
-}
-
 /*--------------------------------------------------------- */
 inline unsigned int lub_list_len(lub_list_t *this)
 {
 	return this->len;
 }
-
-/*--------------------------------------------------------- */