Changeset 8342 for trunk/Ohana/src/libdvo/src/dvo_catalog_create.c
- Timestamp:
- Aug 14, 2006, 6:27:39 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libdvo/src/dvo_catalog_create.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/src/dvo_catalog_create.c
r8328 r8342 1 # include <ohana.h>2 1 # include <dvo.h> 3 2 # define DEBUG 1 4 3 5 4 // create a new dvo catalog file (if split, lock extra files as well?) 6 void dvo_catalog_create (SkyRegion *region, Catalog *catalog, int Nsecfilt, char *catformat, char *catmode) { 5 // catalog internals which must be set: 6 // catalog[0].filename 7 // catalog[0].catmode 8 // catalog[0].catformat (used by dvo_catalog_save) 9 // catalog[0].lockmode 10 void dvo_catalog_create (SkyRegion *region, Catalog *catalog, int Nsecfilt) { 7 11 8 int length , status;12 int length; 9 13 char *path, *root, *file, *line; 10 14 time_t now; … … 12 16 if (DEBUG) fprintf (stderr, "new catalog file: %s\n", catalog[0].filename); 13 17 14 dvo_catalog_init (catalog); 15 16 /* set the recommended CATFORMAT */ 17 catalog[0].catformat = DVO_FORMAT_UNDEF; 18 if (!strcasecmp (catformat, "INTERNAL")) catalog[0].catformat = DVO_FORMAT_INTERNAL; 19 if (!strcasecmp (catformat, "LONEOS")) catalog[0].catformat = DVO_FORMAT_LONEOS; 20 if (!strcasecmp (catformat, "ELIXIR")) catalog[0].catformat = DVO_FORMAT_ELIXIR; 21 if (!strcasecmp (catformat, "PANSTARRS")) catalog[0].catformat = DVO_FORMAT_PANSTARRS; 22 if (!strcasecmp (catformat, "PMTEST")) catalog[0].catformat = DVO_FORMAT_PMTEST; 23 if (catalog[0].catformat == DVO_FORMAT_UNDEF) { 24 fprintf (stderr, "invalid output catalog format\n"); 25 exit (1); 26 } 27 28 /* set the recommended CATMODE */ 29 catalog[0].catmode = DVO_MODE_UNDEF; 30 if (!strcasecmp (catmode, "RAW")) catalog[0].catmode = DVO_MODE_RAW; 31 if (!strcasecmp (catmode, "MEF")) catalog[0].catmode = DVO_MODE_MEF; 32 if (!strcasecmp (catmode, "SPLIT")) catalog[0].catmode = DVO_MODE_SPLIT; 33 if (catalog[0].catmode == DVO_MODE_UNDEF) { 34 fprintf (stderr, "invalid output catalog mode\n"); 35 exit (1); 36 } 18 // init the data values, not the internals listed above 19 dvo_catalog_init (catalog, FALSE); 37 20 38 21 /* for RAW mode, make header a fake image */ … … 52 35 /* define measure catalog file */ 53 36 ALLOCATE (catalog[0].measure_catalog, Catalog, 1); 54 dvo_catalog_init (catalog[0].measure_catalog );37 dvo_catalog_init (catalog[0].measure_catalog, TRUE); 55 38 56 39 /* create basic data for measure catalog file */ … … 64 47 /* define missing catalog file */ 65 48 ALLOCATE (catalog[0].missing_catalog, Catalog, 1); 66 dvo_catalog_init (catalog[0].missing_catalog );49 dvo_catalog_init (catalog[0].missing_catalog, TRUE); 67 50 68 51 /* create basic data for missing catalog file */ … … 76 59 /* define secfilt catalog file */ 77 60 ALLOCATE (catalog[0].secfilt_catalog, Catalog, 1); 78 dvo_catalog_init (catalog[0].secfilt_catalog );61 dvo_catalog_init (catalog[0].secfilt_catalog, TRUE); 79 62 80 63 /* create basic data for secfilt catalog file */ … … 90 73 // lock the additional split files 91 74 // XXX clear residual locks if we fail 92 if ( lock_catalog(catalog[0].measure_catalog, catalog[0].lockmode) != 2) {75 if (dvo_catalog_lock (catalog[0].measure_catalog, catalog[0].lockmode) != 2) { 93 76 fprintf (stderr, "error with file lock\n"); 94 77 exit (2); 95 78 } 96 if ( lock_catalog(catalog[0].missing_catalog, catalog[0].lockmode) != 2) {79 if (dvo_catalog_lock (catalog[0].missing_catalog, catalog[0].lockmode) != 2) { 97 80 fprintf (stderr, "error with file lock\n"); 98 81 exit (2); 99 82 } 100 if ( lock_catalog(catalog[0].secfilt_catalog, catalog[0].lockmode) != 2) {83 if (dvo_catalog_lock (catalog[0].secfilt_catalog, catalog[0].lockmode) != 2) { 101 84 fprintf (stderr, "error with file lock\n"); 102 85 exit (2);
Note:
See TracChangeset
for help on using the changeset viewer.
