#include #include "SDDAS_types.h" #include "libCfg.h" #include "libdb.h" int main (int argc, char *argv[]) { char p [MAX_IDFS_NAME], m [MAX_IDFS_NAME], e [MAX_IDFS_NAME], i [MAX_IDFS_NAME], v [MAX_IDFS_VIRT_NAME]; SDDAS_ULONG data_key = 10; char header [1024], data [1024]; int c; Time_t btime, etime; char **strhier; CfgInit (); dbInitialize (); data_key = dbGetDataKey ("UARS", "UARS-1", "PEM", "HEPS", "HPSB"); if (data_key != -1) { printf ("data key of HPSB = %ld\n", data_key); } else { printf ("%s\n", dbErrorMsg ()); } dbKeyToStrings_r (data_key, p, m, e, i, v); printf ("data_key = %ld, %s/%s/%s/%s/%s\n", data_key, p, m, e, i, v); btime.yr = 1993; btime.day = 303; btime.msec = 324230; etime.yr = 1993; etime.day = 304; etime.msec = 324230; if (dbGetFile (data_key, &btime, etime, _H_AND_D_, "", header, data) == ALL_OKAY) { printf ("First file needed for %ld, %d/%d/%ld - %d/%d/%ld are %s and %s.\n", data_key, btime.yr, btime.day, btime.msec, etime.yr, etime.day, etime.msec, header, data); } else { printf ("Error: %s\n", dbErrorMsg ()); } strhier = dbHierarchy (2, "UARS", "UARS-1"); c = 0; while (strhier [c] != NULL) { printf ("%s\n", strhier [c]); c++; } dbClose (); exit (0); }