Browse Source

Remove legacy global cookie

Serj Kalichev 11 years ago
parent
commit
518613d8c6
5 changed files with 4 additions and 19 deletions
  1. 1 1
      bin/clish.c
  2. 1 4
      clish/shell.h
  3. 0 1
      clish/shell/private.h
  4. 0 6
      clish/shell/shell_execute.c
  5. 2 7
      clish/shell/shell_new.c

+ 1 - 1
bin/clish.c

@@ -219,7 +219,7 @@ int main(int argc, char **argv)
 	/* Create shell instance */
 	if (quiet)
 		outfd = fopen("/dev/null", "w");
-	shell = clish_shell_new(NULL, NULL, outfd, stop_on_error);
+	shell = clish_shell_new(NULL, outfd, stop_on_error);
 	if (!shell) {
 		fprintf(stderr, "Error: Can't run clish.\n");
 		goto end;

+ 1 - 4
clish/shell.h

@@ -66,7 +66,6 @@ _BEGIN_C_DECL
  *----------------- */
 
 clish_shell_t *clish_shell_new(
-	void *cookie,
 	FILE * istream,
 	FILE * ostream,
 	bool_t stop_on_error);
@@ -123,9 +122,7 @@ unsigned clish_shell__get_depth(const clish_shell_t * instance);
 const char *clish_shell__get_viewid(const clish_shell_t * instance);
 const char *clish_shell__get_overview(const clish_shell_t * instance);
 tinyrl_t *clish_shell__get_tinyrl(const clish_shell_t * instance);
-void *clish_shell__get_client_cookie(const clish_shell_t * instance);
-void
-clish_shell__set_pwd(clish_shell_t *instance, const char * line,
+void clish_shell__set_pwd(clish_shell_t *instance, const char * line,
 	clish_view_t * view, char * viewid, clish_context_t *context);
 char *clish_shell__get_pwd_line(const clish_shell_t * instance,
 	 unsigned int index);

+ 0 - 1
clish/shell/private.h

@@ -50,7 +50,6 @@ struct clish_shell_s {
 	clish_sym_t *hooks[CLISH_SYM_TYPE_MAX]; /* Callback hooks */
 	bool_t hooks_use[CLISH_SYM_TYPE_MAX]; /* Is hook defined */
 
-	void *client_cookie; /* Client callback cookie */
 	clish_view_t *global; /* Reference to the global view. */
 	clish_command_t *startup; /* This is the startup command */
 	unsigned int idle_timeout; /* This is the idle timeout */

+ 0 - 6
clish/shell/shell_execute.c

@@ -290,12 +290,6 @@ const char *clish_shell__get_fifo(clish_shell_t * this)
 	return this->fifo_name;
 }
 
-/*--------------------------------------------------------- */
-void *clish_shell__get_client_cookie(const clish_shell_t * this)
-{
-	return this->client_cookie;
-}
-
 /*-------------------------------------------------------- */
 void clish_shell__set_log(clish_shell_t *this, bool_t log)
 {

+ 2 - 7
clish/shell/shell_new.c

@@ -15,9 +15,7 @@
 
 /*-------------------------------------------------------- */
 static void clish_shell_init(clish_shell_t * this,
-	void *cookie, FILE * istream,
-	FILE * ostream,
-	bool_t stop_on_error)
+	FILE * istream, FILE * ostream, bool_t stop_on_error)
 {
 	clish_ptype_t *tmp_ptype = NULL;
 	int i;
@@ -54,7 +52,6 @@ static void clish_shell_init(clish_shell_t * this,
 	}
 
 	/* Set up defaults */
-	this->client_cookie = cookie;
 	this->global = NULL;
 	this->startup = NULL;
 	this->idle_timeout = 0; /* No idle timeout by default */
@@ -211,7 +208,6 @@ static void clish_shell_fini(clish_shell_t *this)
 
 /*-------------------------------------------------------- */
 clish_shell_t *clish_shell_new(
-	void *cookie,
 	FILE * istream,
 	FILE * ostream,
 	bool_t stop_on_error)
@@ -219,8 +215,7 @@ clish_shell_t *clish_shell_new(
 	clish_shell_t *this = malloc(sizeof(clish_shell_t));
 
 	if (this)
-		clish_shell_init(this, cookie,
-			istream, ostream, stop_on_error);
+		clish_shell_init(this, istream, ostream, stop_on_error);
 
 	return this;
 }