- Timestamp:
- Aug 15, 2009, 7:08:18 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 1077891a
- Parents:
- fa4562c
- git-author:
- Anders Kaseorg <andersk@mit.edu> (08/04/09 02:37:51)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (08/15/09 19:08:18)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cmd.c
rfa4562c re19eb97 38 38 } 39 39 40 owl_cmd *owl_cmddict_find(owl_cmddict *d, c har *name) {40 owl_cmd *owl_cmddict_find(owl_cmddict *d, const char *name) { 41 41 return owl_dict_find_element(d, name); 42 42 } … … 47 47 48 48 /* creates a new command alias */ 49 int owl_cmddict_add_alias(owl_cmddict *cd, c har *alias_from,char *alias_to) {49 int owl_cmddict_add_alias(owl_cmddict *cd, const char *alias_from, const char *alias_to) { 50 50 owl_cmd *cmd; 51 51 cmd = owl_malloc(sizeof(owl_cmd)); … … 65 65 } 66 66 67 char *_owl_cmddict_execute(owl_cmddict *cd, owl_context *ctx, c har **argv, int argc,char *buff) {67 char *_owl_cmddict_execute(owl_cmddict *cd, owl_context *ctx, const char *const *argv, int argc, const char *buff) { 68 68 char *retval = NULL; 69 69 owl_cmd *cmd; … … 78 78 } 79 79 80 char *owl_cmddict_execute(owl_cmddict *cd, owl_context *ctx, c har *cmdbuff) {80 char *owl_cmddict_execute(owl_cmddict *cd, owl_context *ctx, const char *cmdbuff) { 81 81 char **argv; 82 82 int argc; … … 103 103 } 104 104 105 char *owl_cmddict_execute_argv(owl_cmddict *cd, owl_context *ctx, c har **argv, int argc) {105 char *owl_cmddict_execute_argv(owl_cmddict *cd, owl_context *ctx, const char *const *argv, int argc) { 106 106 char *buff, *ptr; 107 107 int len = 0, i; … … 143 143 } 144 144 145 int owl_cmd_create_alias(owl_cmd *cmd, c har *name,char *aliased_to) {145 int owl_cmd_create_alias(owl_cmd *cmd, const char *name, const char *aliased_to) { 146 146 memset(cmd, 0, sizeof(owl_cmd)); 147 147 cmd->name = owl_strdup(name); … … 167 167 } 168 168 169 char *owl_cmd_execute(owl_cmd *cmd, owl_cmddict *cd, owl_context *ctx, int argc, c har **argv,char *cmdbuff) {169 char *owl_cmd_execute(owl_cmd *cmd, owl_cmddict *cd, owl_context *ctx, int argc, const char *const *argv, const char *cmdbuff) { 170 170 static int alias_recurse_depth = 0; 171 171 int ival=0; 172 c har *cmdbuffargs;172 const char *cmdbuffargs; 173 173 char *newcmd, *rv=NULL; 174 174 … … 206 206 207 207 if (cmd->cmd_i_fn || cmd->cmd_ctxi_fn) { 208 c har *ep = "x";208 const char *ep = "x"; 209 209 if (argc != 2) { 210 210 owl_function_makemsg("Wrong number of arguments for %s command.", argv[0]); … … 238 238 239 239 /* returns a reference */ 240 c har *owl_cmd_get_summary(owl_cmd *cmd) {240 const char *owl_cmd_get_summary(owl_cmd *cmd) { 241 241 return cmd->summary; 242 242 } … … 255 255 256 256 257 void owl_cmd_get_help(owl_cmddict *d, c har *name, owl_fmtext *fm) {258 c har *s;257 void owl_cmd_get_help(owl_cmddict *d, const char *name, owl_fmtext *fm) { 258 const char *s; 259 259 char *indent; 260 260 owl_cmd *cmd;
Note: See TracChangeset
for help on using the changeset viewer.