Skip to content

Commit

Permalink
Merge e06ea24 into c636e12
Browse files Browse the repository at this point in the history
  • Loading branch information
Ole Streicher committed Sep 20, 2018
2 parents c636e12 + e06ea24 commit 2d98242
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cpl/CPL_library.c
Expand Up @@ -109,6 +109,11 @@ cpl_library_t *create_library(const char *fname) {
cpl->pluginlist_new = dlsym(handle, "cpl_pluginlist_new");

cpl->dfs_update_product_header = dlsym(handle, "cpl_dfs_update_product_header");
if (cpl->version >= CPL_VERSION(6,5,0)) {
cpl->dfs_sign_products = dlsym(handle, "cpl_dfs_sign_products");
} else {
cpl->dfs_sign_products = NULL;
}

cpl->error_get_code = dlsym(handle, "cpl_error_get_code");
cpl->error_get_file = dlsym(handle, "cpl_error_get_file");
Expand Down
1 change: 1 addition & 0 deletions cpl/CPL_library.h
Expand Up @@ -54,6 +54,7 @@ typedef struct {
typeof(cpl_pluginlist_new) *pluginlist_new;

typeof(cpl_dfs_update_product_header) *dfs_update_product_header;
typeof(cpl_dfs_sign_products) *dfs_sign_products;

typeof(cpl_error_get_code) *error_get_code;
typeof(cpl_error_get_file) *error_get_file;
Expand Down
9 changes: 8 additions & 1 deletion cpl/CPL_recipe.c
Expand Up @@ -850,7 +850,14 @@ CPL_recipe_exec(CPL_recipe *self, PyObject *args) {
times(&clock_start);
setup_tracing(self, memory_trace);
retval = self->cpl->plugin_get_exec(self->plugin)(self->plugin);
int reto = self->cpl->dfs_update_product_header(recipe->frames);
int reto;
if (self->cpl->dfs_sign_products != NULL) {
reto = self->cpl->dfs_sign_products(recipe->frames,
CPL_DFS_SIGNATURE_DATAMD5 |
CPL_DFS_SIGNATURE_CHECKSUM);
} else {
reto = self->cpl->dfs_update_product_header(recipe->frames);
}
if (reto != CPL_ERROR_NONE) {
self->cpl->msg_error (__func__,
"could not update the product header."
Expand Down
3 changes: 3 additions & 0 deletions cpl/cpl_api.h
Expand Up @@ -95,6 +95,7 @@ cpl_plugin *cpl_pluginlist_get_first(cpl_pluginlist *);
cpl_plugin *cpl_pluginlist_get_next(cpl_pluginlist *);
cpl_pluginlist *cpl_pluginlist_new(void);
cpl_error_code cpl_dfs_update_product_header(cpl_frameset *);
cpl_error_code cpl_dfs_sign_products(const cpl_frameset *, unsigned int);

void cpl_msg_error(const char *, const char *, ...);
cpl_error_code cpl_error_get_code(void);
Expand Down Expand Up @@ -192,5 +193,7 @@ const char *cpl_version_get_version(void);
#define CPL_TYPE_DOUBLE (1 << 17)
#define CPL_TYPE_INT (1 << 10)
#define CPL_TYPE_STRING ((1 << 5)|(1 << 0))
#define CPL_DFS_SIGNATURE_DATAMD5 (1 << 0)
#define CPL_DFS_SIGNATURE_CHECKSUM (1 << 1)

#endif /* CPL_API_H */

0 comments on commit 2d98242

Please sign in to comment.