Browse Source

Some bintree_t cleanup

Serj Kalichev 6 years ago
parent
commit
4cfa2c89fd
5 changed files with 1 additions and 39 deletions
  1. 0 1
      clish/command/command.c
  2. 0 1
      clish/shell/shell_plugin.c
  3. 0 4
      clish/var.h
  4. 1 6
      clish/var/private.h
  5. 0 27
      clish/var/var.c

+ 0 - 1
clish/command/command.c

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

+ 0 - 1
clish/shell/shell_plugin.c

@@ -8,7 +8,6 @@
 
 #include "lub/string.h"
 #include "lub/list.h"
-#include "lub/bintree.h"
 #include "clish/plugin.h"
 #include "clish/view.h"
 

+ 0 - 4
clish/var.h

@@ -2,14 +2,10 @@
 #define _clish_var_h
 
 #include "lub/types.h"
-#include "lub/bintree.h"
 #include "clish/action.h"
 
 typedef struct clish_var_s clish_var_t;
 
-int clish_var_bt_compare(const void *clientnode, const void *clientkey);
-void clish_var_bt_getkey(const void *clientnode, lub_bintree_key_t * key);
-size_t clish_var_bt_offset(void);
 clish_var_t *clish_var_new(const char *name);
 void clish_var_delete(void *instance);
 void clish_var_dump(const clish_var_t *instance);

+ 1 - 6
clish/var/private.h

@@ -3,15 +3,10 @@
  */
 #include "clish/var.h"
 
-/*---------------------------------------------------------
- * PRIVATE TYPES
- *--------------------------------------------------------- */
-
 struct clish_var_s {
-	lub_bintree_node_t bt_node;
 	char *name;
-	bool_t dynamic;
 	char *value;
 	char *saved; /* Saved value of static variable */
+	bool_t dynamic;
 	clish_action_t *action;
 };

+ 0 - 27
clish/var/var.c

@@ -19,9 +19,6 @@ static void clish_var_init(clish_var_t *this, const char *name)
 	this->value = NULL;
 	this->action = clish_action_new();
 	this->saved = NULL;
-
-	/* Be a good binary tree citizen */
-	lub_bintree_node_init(&this->bt_node);
 }
 
 /*--------------------------------------------------------- */
@@ -33,30 +30,6 @@ static void clish_var_fini(clish_var_t *this)
 	clish_action_delete(this->action);
 }
 
-/*--------------------------------------------------------- */
-int clish_var_bt_compare(const void *clientnode, const void *clientkey)
-{
-	const clish_var_t *this = clientnode;
-	const char *key = clientkey;
-
-	return strcmp(this->name, key);
-}
-
-/*-------------------------------------------------------- */
-void clish_var_bt_getkey(const void *clientnode, lub_bintree_key_t * key)
-{
-	const clish_var_t *this = clientnode;
-
-	/* fill out the opaque key */
-	strcpy((char *)key, this->name);
-}
-
-/*--------------------------------------------------------- */
-size_t clish_var_bt_offset(void)
-{
-	return offsetof(clish_var_t, bt_node);
-}
-
 /*--------------------------------------------------------- */
 clish_var_t *clish_var_new(const char *name)
 {