Changeset 39294 for trunk/Ohana/src/opihi/dvo/gcat.c
- Timestamp:
- Dec 24, 2015, 6:01:22 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/gcat.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/gcat.c
r34088 r39294 9 9 SkyList *skylist; 10 10 11 int ShowFile = FALSE; 12 if ((N = get_argument (argc, argv, "-file"))) { 13 remove_argument (N, &argc, argv); 14 ShowFile = TRUE; 15 } 11 16 int ShowHost = FALSE; 12 17 if ((N = get_argument (argc, argv, "-host"))) { … … 41 46 skylist = SkyListByRadius (sky, -1, Ra, Dec, Radius); 42 47 48 HostTable *table = NULL; 49 char *CATDIR = GetCATDIR(); 50 if (HostTableExists (CATDIR, sky->hosts)) { 51 table = HostTableLoad (CATDIR, sky->hosts); 52 if (!table) { 53 gprint (GP_ERR, "ERROR: failure reading Host Table %s for parallel database %s\n", sky->hosts, CATDIR); 54 return FALSE; 55 } 56 } 57 43 58 // prepare to handle interrupt signals 44 59 signal (SIGINT, handle_interrupt); … … 46 61 47 62 for (i = 0; (i < skylist[0].Nregions) && !interrupt; i++) { 48 gprint (GP_ERR, "%3d %s", i, skylist[0].regions[i][0].name); 49 if (stat (skylist[0].filename[i], &filestat) != -1) { 63 SkyRegion *region = skylist[0].regions[i]; 64 65 char hostfile[1024]; 66 if (table) { 67 int hostID = (region->hostFlags & DATA_USE_BCK) ? region->backupID : region->hostID; 68 int index = table->index[hostID]; 69 snprintf (hostfile, 1024, "%s/%s.cpt", table->hosts[index].pathname, region->name); 70 } else { 71 strcpy (hostfile, skylist[0].filename[i]); 72 } 73 74 if (ShowFile) { 75 gprint (GP_ERR, "%3d %s", i, hostfile); 76 } else { 77 gprint (GP_ERR, "%3d %s", i, region->name); 78 } 79 80 if (stat (hostfile, &filestat) != -1) { 50 81 gprint (GP_ERR, " *"); 51 82 } else { … … 53 84 } 54 85 if (ShowHost) { 55 gprint (GP_ERR, " %3d", skylist[0].regions[i][0].hostID);86 gprint (GP_ERR, " %3d", region->hostID); 56 87 } else { 57 88 gprint (GP_ERR, " "); 58 89 } 59 90 if (ShowBackup) { 60 gprint (GP_ERR, " %3d", skylist[0].regions[i][0].backupID);91 gprint (GP_ERR, " %3d", region->backupID); 61 92 } else { 62 93 gprint (GP_ERR, " "); 63 94 } 64 95 if (ShowFlags) { 65 gprint (GP_ERR, " 0x%04x", skylist[0].regions[i][0].hostFlags);96 gprint (GP_ERR, " 0x%04x", region->hostFlags); 66 97 } else { 67 98 gprint (GP_ERR, " "); 68 99 } 69 100 gprint (GP_ERR, "\n"); 70 set_str_variable ("CATNAME", skylist[0].filename[i]);101 set_str_variable ("CATNAME", hostfile); 71 102 } 72 103
Note:
See TracChangeset
for help on using the changeset viewer.
