00001
00002
00003
00004
00005
00006
00007
00008 #include <string.h>
00009 #include <nccf_errors.h>
00010 #include <nccf_utility_functions.h>
00011 #include <nccf_host.h>
00012
00013 int nccf_inq_host_statfilename(int hostid, int vfindx, int gfindx,
00014 char *fname) {
00015 int index;
00016 int dims[2];
00017 const int inx[] = {vfindx, gfindx};
00018 char *fn;
00019
00020 struct nccf_host_type *self;
00021 self = nccf_li_find(&CFLIST_HOST, hostid);
00022 dims[0] = self->nStatDataFiles;
00023 dims[1] = self->nGrids;
00024
00025
00026 index = nccf_get_flat_index(2, dims, inx);
00027 fn = nccf_li_find(&self->statDataFiles, index);
00028 if (fn) {
00029 strcpy(fname, fn);
00030 return NC_NOERR;
00031 }
00032 else {
00033 return NCCF_EINDEXOUTOFRANGE;
00034 }
00035 }