IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 2, 2005, 9:40:50 AM (21 years ago)
Author:
eugene
Message:

psched bugfixes, moved IOBuffers and queues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pantasks/task.c

    r4693 r4697  
    22# define prompt "> "
    33
    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 
    64int task (int argc, char **argv) {
    75
    8   int N;
     6  int N, hash;
    97  int ThisList, status;
    108  char *input, *outline;
     
    6664
    6765    stripwhite (input);
    68     switch (TaskHash (input)) {
     66    hash = TaskHash (input);
     67    switch (hash) {
    6968
    7069      case TASK_EMPTY:
     
    7877        free (input);
    7978        /* validate the new task: all mandatory elements defined? */
    80         if (!ValidateTask (task)) {
     79        if (!ValidateTask (task, FALSE)) {
    8180          DeleteNewTask ();
    8281          return (FALSE);
     
    107106  return (FALSE);
    108107}
    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.