From a4fdf101703e3363c514c002240b5fa8dfb7850d Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 16 Mar 2016 18:10:40 +0000 Subject: [PATCH] ECC-241: Make the installation paths available through the API --- src/eccodes.c | 4 ++++ src/grib_api.h | 1 + src/grib_api_prototypes.h | 1 + src/grib_context.c | 5 +++++ 4 files changed, 11 insertions(+) diff --git a/src/eccodes.c b/src/eccodes.c index f2daa4327..f0195b6de 100644 --- a/src/eccodes.c +++ b/src/eccodes.c @@ -17,6 +17,10 @@ char* codes_samples_path(const grib_context *c) { return grib_samples_path(c); } +char* codes_definition_path(const grib_context *c) +{ + return grib_definition_path(c); +} long codes_get_api_version(void) { return grib_get_api_version(); diff --git a/src/grib_api.h b/src/grib_api.h index 999e846c5..8c058e7ff 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -1174,6 +1174,7 @@ void grib_multi_support_off(grib_context* c); void grib_multi_support_reset_file(grib_context* c, FILE* f); char* grib_samples_path(const grib_context *c); +char* grib_definition_path(const grib_context *c); /*! @} */ /** diff --git a/src/grib_api_prototypes.h b/src/grib_api_prototypes.h index fa7ff864a..5212c90e6 100644 --- a/src/grib_api_prototypes.h +++ b/src/grib_api_prototypes.h @@ -920,6 +920,7 @@ void grib_print_api_version(FILE *out); grib_context *grib_context_get_default(void); char *grib_context_full_defs_path(grib_context *c, const char *basename); char *grib_samples_path(const grib_context *c); +char *grib_definition_path(const grib_context *c); void grib_context_free(const grib_context *c, void *p); void grib_context_free_persistent(const grib_context *c, void *p); void grib_context_reset(grib_context *c); diff --git a/src/grib_context.c b/src/grib_context.c index bab3bdbeb..e94ace7b9 100644 --- a/src/grib_context.c +++ b/src/grib_context.c @@ -657,6 +657,11 @@ char* grib_samples_path(const grib_context *c) if (!c) c=grib_context_get_default(); return c->grib_samples_path; } +char* grib_definition_path(const grib_context *c) +{ + if (!c) c=grib_context_get_default(); + return c->grib_definition_files_path; +} void grib_context_free(const grib_context* c, void* p) {