IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 16, 2012, 2:14:22 PM (14 years ago)
Author:
eugene
Message:

rework dvo_client calls to pass the command via a file, not the cmd line (parens too complex)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/gcat.c

    r20535 r33563  
    33int gcat (int argc, char **argv) {
    44 
    5   int i;
     5  int i, N;
    66  struct stat filestat;
    77  double Ra, Dec, Radius;
     
    99  SkyList *skylist;
    1010  void *Signal;
     11
     12  int ShowHost = FALSE;
     13  if ((N = get_argument (argc, argv, "-host"))) {
     14    remove_argument (N, &argc, argv);
     15    ShowHost = TRUE;
     16  }
     17  int ShowBackup = FALSE;
     18  if ((N = get_argument (argc, argv, "-backup"))) {
     19    remove_argument (N, &argc, argv);
     20    ShowBackup = TRUE;
     21  }
     22  int ShowFlags = FALSE;
     23  if ((N = get_argument (argc, argv, "-flags"))) {
     24    remove_argument (N, &argc, argv);
     25    ShowFlags = TRUE;
     26  }
    1127
    1228  if ((argc != 3) && (argc != 4)) {
     
    3147
    3248  for (i = 0; (i < skylist[0].Nregions) && !interrupt; i++) {
     49    gprint (GP_ERR, "%3d %s", i, skylist[0].regions[i][0].name);
    3350    if (stat (skylist[0].filename[i], &filestat) != -1) {
    34       gprint (GP_ERR, "%3d %s *\n", i, skylist[0].regions[i][0].name);
     51      gprint (GP_ERR, " *");
    3552    } else {
    36       gprint (GP_ERR, "%3d %s\n", i, skylist[0].regions[i][0].name);
     53      gprint (GP_ERR, "  ");
    3754    }
     55    if (ShowHost) {
     56      gprint (GP_ERR, "  %3d", skylist[0].regions[i][0].hostID);
     57    } else {
     58      gprint (GP_ERR, "     ");
     59    }
     60    if (ShowBackup) {
     61      gprint (GP_ERR, "  %3d", skylist[0].regions[i][0].backupID);
     62    } else {
     63      gprint (GP_ERR, "     ");
     64    }
     65    if (ShowFlags) {
     66      gprint (GP_ERR, "  0x%04x", skylist[0].regions[i][0].hostFlags);
     67    } else {
     68      gprint (GP_ERR, "        ");
     69    }
     70    gprint (GP_ERR, "\n");
    3871    set_str_variable ("CATNAME", skylist[0].filename[i]);
    3972  }
Note: See TracChangeset for help on using the changeset viewer.