Changeset 40622 for trunk/Ohana/src/opihi/mana/deimos.c
- Timestamp:
- Feb 8, 2019, 8:20:03 PM (7 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/mana/deimos.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/mana/deimos.c
r40617 r40622 1 1 # include "data.h" 2 2 3 int deimos_list (int argc, char **argv); 3 int deimos_mkslit (int argc, char **argv); 4 int deimos_fitslit (int argc, char **argv); 5 int deimos_mkobj (int argc, char **argv); 4 6 5 static Command book_commands[] = { 6 {1, "list", book_list, "list books"}, 7 static Command deimos_commands[] = { 8 {1, "mkobj", deimos_mkobj, "make a full object image"}, 9 {1, "mkslit", deimos_mkslit, "make a slit image"}, 10 {1, "fitslit", deimos_fitslit, "fit slit image to observed slit flux"}, 7 11 }; 8 12 9 int book_command(int argc, char **argv) {13 int deimos (int argc, char **argv) { 10 14 11 15 int i, N, status; 12 16 13 17 if (argc < 2) { 14 gprint (GP_ERR, "USAGE: book(command)\n");15 gprint (GP_ERR, " book list : list books\n");18 gprint (GP_ERR, "USAGE: deimos (command)\n"); 19 gprint (GP_ERR, " deimos mkslit : make slit image\n"); 16 20 return (FALSE); 17 21 } 18 22 19 N = sizeof ( book_commands) / sizeof (Command);23 N = sizeof (deimos_commands) / sizeof (Command); 20 24 21 /* find the booksub-command which matches */25 /* find the deimos sub-command which matches */ 22 26 for (i = 0; i < N; i++) { 23 if (!strcmp ( book_commands[i].name, argv[1])) {24 status = (* book_commands[i].func) (argc - 1, argv + 1);27 if (!strcmp (deimos_commands[i].name, argv[1])) { 28 status = (*deimos_commands[i].func) (argc - 1, argv + 1); 25 29 return (status); 26 30 } 27 31 } 28 32 29 gprint (GP_ERR, "unknown bookcommand %s\n", argv[1]);33 gprint (GP_ERR, "unknown deimos command %s\n", argv[1]); 30 34 return (FALSE); 31 35 }
Note:
See TracChangeset
for help on using the changeset viewer.
