Changeset 117c21c
- Timestamp:
- Jun 19, 2011, 1:49:34 AM (13 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 9e86f6f
- Parents:
- aad166a
- git-author:
- Anders Kaseorg <andersk@mit.edu> (06/18/11 20:41:46)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (06/19/11 01:49:34)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
raad166a r117c21c 8 8 /* fn is "char *foo(int argc, const char *const *argv, const char *buff)" */ 9 9 #define OWLCMD_ARGS(name, fn, ctx, summary, usage, description) \ 10 { name, summary, usage, description, ctx, \10 { g_strdup(name), g_strdup(summary), g_strdup(usage), g_strdup(description), ctx, \ 11 11 NULL, fn, NULL, NULL, NULL, NULL, NULL, NULL } 12 12 13 13 /* fn is "void foo(void)" */ 14 14 #define OWLCMD_VOID(name, fn, ctx, summary, usage, description) \ 15 { name, summary, usage, description, ctx, \15 { g_strdup(name), g_strdup(summary), g_strdup(usage), g_strdup(description), ctx, \ 16 16 NULL, NULL, fn, NULL, NULL, NULL, NULL, NULL } 17 17 18 18 /* fn is "void foo(int)" */ 19 19 #define OWLCMD_INT(name, fn, ctx, summary, usage, description) \ 20 { name, summary, usage, description, ctx, \20 { g_strdup(name), g_strdup(summary), g_strdup(usage), g_strdup(description), ctx, \ 21 21 NULL, NULL, NULL, fn, NULL, NULL, NULL, NULL } 22 22 23 23 #define OWLCMD_ALIAS(name, actualname) \ 24 { name, OWL_CMD_ALIAS_SUMMARY_PREFIX actualname, "", "", OWL_CTX_ANY, \25 actualname, NULL, NULL, NULL, NULL, NULL, NULL, NULL }24 { g_strdup(name), g_strdup(OWL_CMD_ALIAS_SUMMARY_PREFIX actualname), g_strdup(""), g_strdup(""), OWL_CTX_ANY, \ 25 g_strdup(actualname), NULL, NULL, NULL, NULL, NULL, NULL, NULL } 26 26 27 27 /* fn is "char *foo(void *ctx, int argc, const char *const *argv, const char *buff)" */ 28 28 #define OWLCMD_ARGS_CTX(name, fn, ctx, summary, usage, description) \ 29 { name, summary, usage, description, ctx, \29 { g_strdup(name), g_strdup(summary), g_strdup(usage), g_strdup(description), ctx, \ 30 30 NULL, NULL, NULL, NULL, ((char*(*)(void*,int,const char*const *,const char*))fn), NULL, NULL, NULL } 31 31 32 32 /* fn is "void foo(void)" */ 33 33 #define OWLCMD_VOID_CTX(name, fn, ctx, summary, usage, description) \ 34 { name, summary, usage, description, ctx, \34 { g_strdup(name), g_strdup(summary), g_strdup(usage), g_strdup(description), ctx, \ 35 35 NULL, NULL, NULL, NULL, NULL, ((void(*)(void*))(fn)), NULL, NULL } 36 36 37 37 /* fn is "void foo(int)" */ 38 38 #define OWLCMD_INT_CTX(name, fn, ctx, summary, usage, description) \ 39 { name, summary, usage, description, ctx, \39 { g_strdup(name), g_strdup(summary), g_strdup(usage), g_strdup(description), ctx, \ 40 40 NULL, NULL, NULL, NULL, NULL, NULL, ((void(*)(void*,int))fn), NULL } 41 41 … … 1041 1041 }; 1042 1042 1043 return owl_cmddict_add_from_list(cd, commands_to_init); 1043 int ret = owl_cmddict_add_from_list(cd, commands_to_init); 1044 owl_cmd *cmd; 1045 for (cmd = commands_to_init; cmd->name != NULL; cmd++) 1046 owl_cmd_cleanup(cmd); 1047 return ret; 1044 1048 } 1045 1049
Note: See TracChangeset
for help on using the changeset viewer.