Browse Source

Rename client_hooks to hooks

Serj Kalichev 11 years ago
parent
commit
a347b77264

+ 1 - 1
clish/shell/private.h

@@ -44,7 +44,7 @@ struct clish_shell_s {
 	lub_bintree_t view_tree; /* Tree of views */
 	lub_bintree_t ptype_tree; /* Tree of ptypes */
 	lub_bintree_t var_tree; /* Tree of global variables */
-	const clish_shell_hooks_t *client_hooks; /* Client callback hooks */
+	const clish_shell_hooks_t *hooks; /* Client callback hooks */
 	void *client_cookie; /* Client callback cookie */
 	clish_view_t *global; /* Reference to the global view. */
 	clish_command_t *startup; /* This is the startup command */

+ 4 - 4
clish/shell/shell_execute.c

@@ -149,13 +149,13 @@ int clish_shell_execute(clish_context_t *context, char **out)
 	}
 
 	/* Call config callback */
-	if (!result && this->client_hooks->config_fn)
-		this->client_hooks->config_fn(context);
+	if (!result && this->hooks->config_fn)
+		this->hooks->config_fn(context);
 
 	/* Call logging callback */
-	if (clish_shell__get_log(this) && this->client_hooks->log_fn) {
+	if (clish_shell__get_log(this) && this->hooks->log_fn) {
 		char *full_line = clish_shell__get_full_line(context);
-		this->client_hooks->log_fn(context, full_line, result);
+		this->hooks->log_fn(context, full_line, result);
 		lub_string_free(full_line);
 	}
 

+ 3 - 3
clish/shell/shell_new.c

@@ -55,7 +55,7 @@ static void clish_shell_init(clish_shell_t * this,
 	assert(NULL != hooks);
 
 	/* set up defaults */
-	this->client_hooks = hooks;
+	this->hooks = hooks;
 	this->client_cookie = cookie;
 	this->global = NULL;
 	this->startup = NULL;
@@ -218,8 +218,8 @@ clish_shell_t *clish_shell_new(const clish_shell_hooks_t * hooks,
 void clish_shell_delete(clish_shell_t * this)
 {
 	/* now call the client finalisation */
-	if (this->client_hooks->fini_fn)
-		this->client_hooks->fini_fn(this);
+	if (this->hooks->fini_fn)
+		this->hooks->fini_fn(this);
 	clish_shell_fini(this);
 
 	free(this);

+ 2 - 2
clish/shell/shell_startup.c

@@ -25,8 +25,8 @@ int clish_shell_startup(clish_shell_t *this)
 	context.pargv = NULL;
 	
 	/* Call log initialize */
-	if (clish_shell__get_log(this) && this->client_hooks->log_fn)
-		this->client_hooks->log_fn(&context, NULL, 0);
+	if (clish_shell__get_log(this) && this->hooks->log_fn)
+		this->hooks->log_fn(&context, NULL, 0);
 	/* Call startup script */
 	res = clish_shell_execute(&context, NULL);
 

+ 2 - 2
clish/shell/shell_tinyrl.c

@@ -523,8 +523,8 @@ static int clish_shell_execline(clish_shell_t *this, const char *line, char **ou
 		tinyrl_history_add(history, str);
 	}
 	/* Let the client know the command line has been entered */
-	if (this->client_hooks->cmd_line_fn)
-		this->client_hooks->cmd_line_fn(&context, str);
+	if (this->hooks->cmd_line_fn)
+		this->hooks->cmd_line_fn(&context, str);
 	free(str);
 
 	/* Execute the provided command */

+ 6 - 6
clish/shell/shell_xml.c

@@ -282,8 +282,8 @@ static int process_view(clish_shell_t * shell, clish_xmlnode_t * element, void *
 	/* Check permissions */
 	if (access) {
 		allowed = 0;
-		if (shell->client_hooks->access_fn)
-			allowed = shell->client_hooks->access_fn(shell, access);
+		if (shell->hooks->access_fn)
+			allowed = shell->hooks->access_fn(shell, access);
 	}
 	if (!allowed)
 		goto process_view_end;
@@ -435,8 +435,8 @@ process_command(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
 	/* Check permissions */
 	if (access) {
 		allowed = 0;
-		if (shell->client_hooks->access_fn)
-			allowed = shell->client_hooks->access_fn(shell, access);
+		if (shell->hooks->access_fn)
+			allowed = shell->hooks->access_fn(shell, access);
 	}
 	if (!allowed)
 		goto process_command_end;
@@ -893,8 +893,8 @@ process_namespace(clish_shell_t * shell, clish_xmlnode_t * element, void *parent
 
 	if (access) {
 		allowed = 0;
-		if (shell->client_hooks->access_fn)
-			allowed = shell->client_hooks->access_fn(shell, access);
+		if (shell->hooks->access_fn)
+			allowed = shell->hooks->access_fn(shell, access);
 	}
 	if (!allowed)
 		goto process_namespace_end;