Changeset 39301 for trunk/Ohana/src/libdvo
- Timestamp:
- Jan 4, 2016, 1:12:14 PM (11 years ago)
- Location:
- trunk/Ohana/src/libdvo
- Files:
-
- 2 edited
-
include/dvo.h (modified) (1 diff)
-
src/skyregion_ops.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/include/dvo.h
r39293 r39301 1071 1071 SkyTable *SkyTableLoadOptimal PROTO((char *catdir, char *SKYFILE, char *GSCFILE, int readwrite, int depth, int VERBOSE)); 1072 1072 int SkyTableSetDepth PROTO((SkyTable *sky, int depth)); 1073 SkyList *SkyListMatchList PROTO((SkyList *inlist, char **cptlist, int Ncptlist)); 1073 1074 SkyList *SkyRegionByIndex PROTO((SkyTable *table, int index)); 1074 1075 SkyList *SkyRegionByCPT PROTO((SkyTable *table, char *filename)); -
trunk/Ohana/src/libdvo/src/skyregion_ops.c
r38553 r39301 154 154 } 155 155 } 156 list[0].Nregions = N; 157 return (list); 158 } 159 160 /* find regions at all levels which match list of names */ 161 SkyList *SkyListMatchList (SkyList *inlist, char **cptlist, int Ncptlist) { 162 163 int i, j; 164 SkyList *list; 165 166 int N = 0; 167 int NREGIONS = 10; 168 ALLOCATE (list, SkyList, 1); 169 ALLOCATE (list[0].regions, SkyRegion *, NREGIONS); 170 ALLOCATE (list[0].filename, char *, NREGIONS); 171 list[0].Nregions = N; 172 list[0].ownElements = FALSE; // this list is only holding a view to the elements 173 strcpy (list[0].hosts, inlist[0].hosts); 174 175 SkyRegion **regions = inlist[0].regions; 176 177 for (i = 0; i < inlist[0].Nregions; i++) { 178 int found = FALSE; 179 for (j = 0; !found && (j < Ncptlist); j++) { 180 int Nchar = strlen (cptlist[j]); 181 if (strncasecmp (regions[i][0].name, cptlist[j], Nchar)) continue; 182 183 list[0].regions[N] = regions[i]; 184 list[0].filename[N] = inlist[0].filename[i]; 185 N++; 186 if (N >= NREGIONS) { 187 NREGIONS += 10; 188 REALLOCATE (list[0].regions, SkyRegion *, NREGIONS); 189 REALLOCATE (list[0].filename, char *, NREGIONS); 190 } 191 found = TRUE; 192 } 193 // we do not care if one of the regions does not match. do we care if any of the 194 // cptfile do not match? 195 } 196 SkyListFree (inlist); 197 156 198 list[0].Nregions = N; 157 199 return (list);
Note:
See TracChangeset
for help on using the changeset viewer.
