diff options
author | Thomas White <taw@physics.org> | 2021-09-09 16:30:14 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2022-06-02 12:15:38 +0200 |
commit | 151924b7fccde4cb6bdb73128ba27c091037eb4b (patch) | |
tree | dfcaca887019e97be5272b02479ad3d9022aac97 /src/im-asapo.c | |
parent | 0c566e3bcc918f8f047fd3b2aad866f0e81e582f (diff) |
ASAP::O: Expose data source
Diffstat (limited to 'src/im-asapo.c')
-rw-r--r-- | src/im-asapo.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/im-asapo.c b/src/im-asapo.c index 876de222..9d8fb171 100644 --- a/src/im-asapo.c +++ b/src/im-asapo.c @@ -92,17 +92,27 @@ struct im_asapo *im_asapo_connect(const char *endpoint, const char *token, const char *beamtime, const char *path, - const char *group_id) + const char *group_id, + const char *data_source) { struct im_asapo *a; + int has_filesystem; AsapoSourceCredentialsHandle cred; AsapoErrorHandle err = asapo_new_handle(); a = malloc(sizeof(struct im_asapo)); if ( a == NULL ) return NULL; - cred = asapo_create_source_credentials(kProcessed, beamtime, "", "", token); - a->consumer = asapo_create_consumer(endpoint, path, 1, cred, &err); + cred = asapo_create_source_credentials(kProcessed, beamtime, "", + data_source, token); + if ( path == NULL ) { + path = ""; + has_filesystem = 0; + } else { + has_filesystem = 1; + } + a->consumer = asapo_create_consumer(endpoint, path, has_filesystem, + cred, &err); asapo_free_handle(&cred); if ( asapo_is_error(err) ) { show_asapo_error("Cannot create ASAP::O consumer", err); |