IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 5, 2006, 3:52:41 AM (20 years ago)
Author:
eugene
Message:

changed queue key to allow multiple columns

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/queuepop.c

    r7917 r8190  
    33int queuepop (int argc, char **argv) {
    44 
    5   int N, Key;
     5  int N;
     6  char *Key;
    67  char *var;
    78  char *line;
     
    1617  }
    1718
    18   Key = -1;
     19  Key = NULL;
    1920  if ((N = get_argument (argc, argv, "-key"))) {
    2021    remove_argument (N, &argc, argv);
    21     Key = atoi (argv[N]);
     22    Key = strcreate (argv[N]);
    2223    remove_argument (N, &argc, argv);
    2324    Value = strcreate (argv[N]);
     
    3839  }
    3940
    40   if (Key == -1) {
    41       line = PopQueue (queue);
     41  if (Key == NULL) {
     42    line = PopQueue (queue);
    4243  } else {
    43       line = PopQueueMatch (queue, Key, Value);
     44    line = PopQueueMatch (queue, Key, Value);
    4445  }
    4546
    4647  if (var == NULL) {
    47       if (line == NULL) {
    48           gprint (GP_ERR, "queue %s is empty or match not found\n", argv[1]);
    49           return (FALSE);
    50       } else {
    51           gprint (GP_ERR, "%s\n", line);
    52           return (TRUE);
    53       }
     48    if (line == NULL) {
     49      gprint (GP_ERR, "queue %s is empty or match not found\n", argv[1]);
     50      return (FALSE);
     51    } else {
     52      gprint (GP_ERR, "%s\n", line);
     53      return (TRUE);
     54    }
    5455  }
    5556
     
    6162
    6263  free (line);
     64  if (Key != NULL) free (Key);
     65
    6366  return (TRUE);
    6467}
Note: See TracChangeset for help on using the changeset viewer.