Changeset 10996
- Timestamp:
- Jan 9, 2007, 9:57:59 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/cmd.basic/macro.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.basic/macro.c
r7917 r10996 1 1 # include "basic.h" 2 # include "macro.h" 2 3 static Command macro_command[] = { 4 {"create", macro_create, "create a macro *"}, 5 {"delete", macro_delete, "delete a macro *"}, 6 {"list", macro_list_f, "list a macro *"}, 7 {"edit", macro_edit, "edit a macro <not working yet!> *"}, 8 {"read", macro_read, "read a macro from a file <not working yet!> *"}, 9 {"write", macro_write, "write a macro to a file <not working yet!> *"} 10 }; 3 11 4 12 int macro (int argc, char **argv) { … … 19 27 } 20 28 21 N = sizeof ( in_macro) / sizeof (Command);29 N = sizeof (macro_command) / sizeof (Command); 22 30 23 31 /* find the macro sub-command which matches from the list. */ 24 32 /* if sub-command is not found, assume this is creating a new macro */ 25 33 for (i = 0; i < N; i++) { 26 if (!strcmp ( in_macro[i].name, argv[1])) {27 status = (* in_macro[i].func) (argc - 1, argv + 1);34 if (!strcmp (macro_command[i].name, argv[1])) { 35 status = (*macro_command[i].func) (argc - 1, argv + 1); 28 36 return (status); 29 37 }
Note:
See TracChangeset
for help on using the changeset viewer.
