Browse Source

Normalize define names. clish_ to CLISH_

git-svn-id: https://klish.googlecode.com/svn/trunk@147 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 13 years ago
parent
commit
926cff3c17
4 changed files with 21 additions and 21 deletions
  1. 4 4
      clish/pargv.h
  2. 10 10
      clish/pargv/pargv.c
  3. 1 1
      clish/shell/shell_parse.c
  4. 6 6
      clish/shell/shell_tinyrl.c

+ 4 - 4
clish/pargv.h

@@ -14,10 +14,10 @@
 #define _clish_pargv_h
 
 typedef enum {
-	clish_LINE_OK,
-	clish_BAD_CMD,
-	clish_BAD_PARAM,
-	clish_BAD_HISTORY
+	CLISH_LINE_OK,
+	CLISH_BAD_CMD,
+	CLISH_BAD_PARAM,
+	CLISH_BAD_HISTORY
 } clish_pargv_status_t;
 
 typedef struct clish_pargv_s clish_pargv_t;

+ 10 - 10
clish/pargv/pargv.c

@@ -223,7 +223,7 @@ clish_pargv_parse(clish_pargv_t * this,
 				if (rec_paramc) {
 					retval = clish_pargv_parse(this, NULL, rec_paramv,
 						argv, idx, last, need_index);
-					if (clish_LINE_OK != retval)
+					if (CLISH_LINE_OK != retval)
 						return retval;
 				}
 
@@ -245,10 +245,10 @@ clish_pargv_parse(clish_pargv_t * this,
 					clish_param__get_optional(param))
 					index++;
 				else
-					return clish_BAD_PARAM;
+					return CLISH_BAD_PARAM;
 			}
 		} else {
-			return clish_BAD_PARAM;
+			return CLISH_BAD_PARAM;
 		}
 	}
 
@@ -259,7 +259,7 @@ clish_pargv_parse(clish_pargv_t * this,
 		while (j < paramc) {
 			param = clish_paramv__get_param(paramv, j++);
 			if (BOOL_TRUE != clish_param__get_optional(param))
-				return clish_BAD_PARAM;
+				return CLISH_BAD_PARAM;
 		}
 	}
 
@@ -284,7 +284,7 @@ clish_pargv_parse(clish_pargv_t * this,
 		char *args = NULL;
 
 		if (!param)
-			return clish_BAD_PARAM;
+			return CLISH_BAD_PARAM;
 
 		/*
 		 * put all the argument into a single string
@@ -311,7 +311,7 @@ clish_pargv_parse(clish_pargv_t * this,
 		lub_string_free(args);
 	}
 
-	return clish_LINE_OK;
+	return CLISH_LINE_OK;
 }
 
 /*--------------------------------------------------------- */
@@ -352,11 +352,11 @@ clish_pargv_t *clish_pargv_new(const clish_command_t * cmd,
 	if (NULL != this) {
 		*status = clish_pargv_init(this, cmd, argv);
 		switch (*status) {
-		case clish_LINE_OK:
+		case CLISH_LINE_OK:
 			break;
-		case clish_BAD_CMD:
-		case clish_BAD_PARAM:
-		case clish_BAD_HISTORY:
+		case CLISH_BAD_CMD:
+		case CLISH_BAD_PARAM:
+		case CLISH_BAD_HISTORY:
 			/* commit suicide */
 			clish_pargv_delete(this);
 			this = NULL;

+ 1 - 1
clish/shell/shell_parse.c

@@ -11,7 +11,7 @@ clish_shell_parse(const clish_shell_t * this,
 		  const char *line,
 		  const clish_command_t ** cmd, clish_pargv_t ** pargv)
 {
-	clish_pargv_status_t result = clish_BAD_CMD;
+	clish_pargv_status_t result = CLISH_BAD_CMD;
 	size_t offset;
 	char *prompt = clish_view__get_prompt(this->view, this->viewid);
 

+ 6 - 6
clish/shell/shell_tinyrl.c

@@ -69,7 +69,7 @@ static char *clish_shell_tinyrl_word_generator(tinyrl_t * this,
  */
 static clish_pargv_status_t clish_shell_tinyrl_expand(tinyrl_t * this)
 {
-	clish_pargv_status_t status = clish_LINE_OK;
+	clish_pargv_status_t status = CLISH_LINE_OK;
 	int rtn;
 	char *buffer;
 
@@ -80,7 +80,7 @@ static clish_pargv_status_t clish_shell_tinyrl_expand(tinyrl_t * this)
 	switch (rtn) {
 	case -1:
 		/* error in expansion */
-		status = clish_BAD_HISTORY;
+		status = CLISH_BAD_HISTORY;
 		break;
 	case 0:
 		/*no expansion */
@@ -253,13 +253,13 @@ static bool_t clish_shell_tinyrl_key_enter(tinyrl_t * this, int key)
 						       &context->command,
 						       &context->pargv);
 			switch (arg_status) {
-			case clish_LINE_OK:
+			case CLISH_LINE_OK:
 				tinyrl_done(this);
 				result = BOOL_TRUE;
 				break;
-			case clish_BAD_HISTORY:
-			case clish_BAD_CMD:
-			case clish_BAD_PARAM:
+			case CLISH_BAD_HISTORY:
+			case CLISH_BAD_CMD:
+			case CLISH_BAD_PARAM:
 				tinyrl_crlf(this);
 				fprintf(stderr, "Error. Illegal command line.\n");
 				tinyrl_crlf(this);