- Timestamp:
- May 18, 2007, 7:24:04 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/kapa-mods-2007-05/Ohana/src/opihi/cmd.data/section.c
r13404 r13432 1 1 # include "data.h" 2 2 3 enum {NONE, LIST, UP, DOWN, TOP, BOTTOM };3 enum {NONE, LIST, UP, DOWN, TOP, BOTTOM, TOOL}; 4 4 5 5 int section (int argc, char **argv) { 6 6 7 int N, action; 8 int kapa; 9 char *name; 7 int N, action, kapa; 8 char *name, *location; 10 9 Graphdata graphmode; 11 10 KapaSection section; … … 13 12 action = NONE; 14 13 if ((N = get_argument (argc, argv, "-list"))) { 14 action = LIST; 15 15 remove_argument (N, &argc, argv); 16 action = LIST;17 16 } 18 17 if ((N = get_argument (argc, argv, "-up"))) { 18 action = UP; 19 19 remove_argument (N, &argc, argv); 20 action = UP;21 20 } 22 21 if ((N = get_argument (argc, argv, "-down"))) { 22 action = DOWN; 23 23 remove_argument (N, &argc, argv); 24 action = DOWN;25 24 } 26 25 if ((N = get_argument (argc, argv, "-top"))) { 26 action = TOP; 27 27 remove_argument (N, &argc, argv); 28 action = TOP;29 28 } 30 29 if ((N = get_argument (argc, argv, "-bottom"))) { 30 action = BOTTOM; 31 31 remove_argument (N, &argc, argv); 32 action = BOTTOM; 32 } 33 if ((N = get_argument (argc, argv, "-imtool"))) { 34 action = TOOL; 35 remove_argument (N, &argc, argv); 36 location = argv[N]; 37 remove_argument (N, &argc, argv); 33 38 } 34 39 … … 43 48 44 49 /* list sections */ 45 if ( argc == 1) {50 if ((argc == 1) && (action == NONE)) { 46 51 KapaGetSection (kapa, "*"); 47 52 gprint (GP_ERR, "USAGE: section name [x y dx dy]\n"); … … 69 74 KapaMoveSection (kapa, argv[1], "bottom"); 70 75 break; 76 77 case TOOL: 78 if (!strcmp(location, "-x")) { 79 KapaSetToolbox (kapa, 1); 80 break; 81 } 82 if (!strcmp(location, "+x")) { 83 KapaSetToolbox (kapa, 3); 84 break; 85 } 86 if (!strcmp(location, "-y")) { 87 KapaSetToolbox (kapa, 2); 88 break; 89 } 90 if (!strcmp(location, "+y")) { 91 KapaSetToolbox (kapa, 4); 92 break; 93 } 94 if (!strcmp(location, "none")) { 95 KapaSetToolbox (kapa, 0); 96 break; 97 } 98 gprint (GP_ERR, "unknown toolbox location %s\n", location); 99 gprint (GP_ERR, "valid values: -x, +x, -y, +y, none\n"); 100 return (FALSE); 71 101 72 102 case LIST:
Note:
See TracChangeset
for help on using the changeset viewer.
