Changeset 4697 for trunk/Ohana/src/opihi/pantasks/task.c
- Timestamp:
- Aug 2, 2005, 9:40:50 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pantasks/task.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/task.c
r4693 r4697 2 2 # define prompt "> " 3 3 4 enum {TASK_NONE, TASK_EMPTY, TASK_COMMENT, TASK_NMAX, TASK_TRANGE, TASK_END, TASK_HOST, TASK_COMMAND, TASK_PERIODS, TASK_EXIT, TASK_EXEC};5 6 4 int task (int argc, char **argv) { 7 5 8 int N ;6 int N, hash; 9 7 int ThisList, status; 10 8 char *input, *outline; … … 66 64 67 65 stripwhite (input); 68 switch (TaskHash (input)) { 66 hash = TaskHash (input); 67 switch (hash) { 69 68 70 69 case TASK_EMPTY: … … 78 77 free (input); 79 78 /* validate the new task: all mandatory elements defined? */ 80 if (!ValidateTask (task )) {79 if (!ValidateTask (task, FALSE)) { 81 80 DeleteNewTask (); 82 81 return (FALSE); … … 107 106 return (FALSE); 108 107 } 109 110 int TaskHash (char *input) {111 112 int hash;113 char *command;114 115 hash = TASK_NONE;116 117 command = thisword (input);118 if (command == NULL) return (TASK_EMPTY);119 120 if (command[0] == '#') hash = TASK_COMMENT;121 if (!strcasecmp (command, "END")) hash = TASK_END;122 if (!strcasecmp (command, "HOST")) hash = TASK_HOST;123 if (!strcasecmp (command, "NMAX")) hash = TASK_NMAX;124 if (!strcasecmp (command, "TRANGE")) hash = TASK_TRANGE;125 if (!strcasecmp (command, "COMMAND")) hash = TASK_COMMAND;126 if (!strcasecmp (command, "PERIODS")) hash = TASK_PERIODS;127 if (!strcasecmp (command, "TASK.EXIT")) hash = TASK_EXIT;128 if (!strcasecmp (command, "TASK.EXEC")) hash = TASK_EXEC;129 130 free (command);131 return (hash);132 }
Note:
See TracChangeset
for help on using the changeset viewer.
