
// APIs related to the DVO catalogs:

// XXX change name
// XXX add SORTED test to load
// XXX add Nsecfilt test? or add an API?
load_catalog (Catalog *catalog, int VERBOSE);
// returns
//   0: failure to lock catalog
//   1: success: file is locked and opened
//   2: success: file is locked but empty

dvo_catalog_lock (Catalog *catalog, int lockmode);
// lockmode: SOFT, XCLD, HARD

dvo_catalog_unlock (Catalog *catalog);

dvo_catalog_load (Catalog *catalog, int VERBOSE, int mode);
// format: INTERNAL, LONEOS, ELIXIR, PANSTARRS, PMTEST, etc.
// layout: RAW, MEF, SPLIT
// mode:   READ, WRITE

dvo_catalog_save (Catalog *catalog, int VERBOSE);
// format: INTERNAL, LONEOS, ELIXIR, PANSTARRS, PMTEST, etc.
// layout: RAW, MEF, SPLIT
// mode:   READ, WRITE

dvo_catalog_init (Catalog *catalog);

dvo_catalog_create (Catalog *catalog);

dvo_catalog_check (Catalog *catalog, int Nsecfilt, int extend);
// check an existing catalog against the identified Nsecfilt value
// if (Nsecfilt == catalog[0].Nsecfilt) OK
// if (Nsecfilt <  catalog[0].Nsecfilt) ERROR
// if (Nsecfilt >  catalog[0].Nsecfilt) && extend) extend
// if (Nsecfilt >  catalog[0].Nsecfilt) && !extend) ERROR


several possible cases:

- open and read an existing catalog / create if missing
- open and read an existing catalog / error if missing (can be ignored)


dvo_catalog_open (Catalog *catalog, int mode); 
