mirror of https://github.com/ecmwf/eccodes.git
Work on MEMFS
This commit is contained in:
parent
ac97b10ad5
commit
a6b8e3625e
1
memfs.py
1
memfs.py
|
@ -166,6 +166,7 @@ for n in NAMES:
|
|||
""" % (n,), file=g)
|
||||
|
||||
print("""
|
||||
/*printf("%s ===> %s\\n", path, start);*/
|
||||
if(start == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -641,6 +641,20 @@ char *grib_context_full_defs_path(grib_context* c,const char* basename)
|
|||
}
|
||||
dir=dir->next;
|
||||
}
|
||||
#ifdef HAVE_MEMFS
|
||||
sprintf(full,"/definitions/%s",basename);
|
||||
printf("=====> %s\n", full);
|
||||
if(codes_memfs_exists(full)) {
|
||||
fullpath=(grib_string_list*)grib_context_malloc_clear_persistent(c,sizeof(grib_string_list));
|
||||
Assert(fullpath);
|
||||
fullpath->value=grib_context_strdup(c,full);
|
||||
GRIB_MUTEX_LOCK(&mutex_c);
|
||||
grib_trie_insert(c->def_files,basename,fullpath);
|
||||
grib_context_log(c,GRIB_LOG_DEBUG,"Found def file %s in MEMFS",full);
|
||||
GRIB_MUTEX_UNLOCK(&mutex_c);
|
||||
return fullpath->value;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
GRIB_MUTEX_LOCK(&mutex_c);
|
||||
|
|
Loading…
Reference in New Issue