diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-09-07 18:28:45 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-09-07 18:29:31 (GMT) |
commit | 1c7c5a604b449465a76fbaa054c5b125ad75bb56 (patch) | |
tree | 85010169bed7c6d8f2d460b80ce18cdb27442b9b /tools/src/h5repack/h5repack_parse.c | |
parent | 56b48f6d2aee966bdd06e29c77f156c97cc05cdf (diff) | |
download | hdf5-1c7c5a604b449465a76fbaa054c5b125ad75bb56.zip hdf5-1c7c5a604b449465a76fbaa054c5b125ad75bb56.tar.gz hdf5-1c7c5a604b449465a76fbaa054c5b125ad75bb56.tar.bz2 |
HDFFV-10276 Add UD flag option to h5repack
Diffstat (limited to 'tools/src/h5repack/h5repack_parse.c')
-rw-r--r-- | tools/src/h5repack/h5repack_parse.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index a9a890d..4d62723 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -42,7 +42,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, size_t i, m, u; char c; size_t len = HDstrlen(str); - int k, l, p, q, end_obj = -1, no_param = 0; + int f, k, l, p, q, end_obj = -1, no_param = 0; unsigned j, n; char sobj[MAX_NC_NAME]; char scomp[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -209,13 +209,14 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, /*------------------------------------------------------------------------- * User Defined - * has the format UD=<filter_number,cd_value_count,value_1[,value_2,...,value_N]> + * has the format UD=<filter_number,filter_flag,cd_value_count,value_1[,value_2,...,value_N]> * BZIP2 example - * UD=307,1,9 + * UD=307,0,1,9 *------------------------------------------------------------------------- */ else if (HDstrcmp(scomp, "UD") == 0) { l = -1; /* filter number index check */ + f = -1; /* filter flag index check */ p = -1; /* CD_VAL count check */ for (m = 0, q = 0, u = i + 1; u < len; u++, m++, q++) { if (str[u] == ',') { @@ -224,6 +225,10 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, filt->filtn = HDatoi(stype); l = 0; } + else if (f == -1) { + filt->filt_flag = HDstrtoul(stype, NULL, 0); + f = 0; + } else if (p == -1) { filt->cd_nelmts = HDstrtoull(stype, NULL, 0); p = 0; @@ -240,6 +245,12 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, error_msg("filter number parameter is not a digit in <%s>\n", str); HDexit(EXIT_FAILURE); } + else if (!HDisdigit(c) && f == -1) { + if (obj_list) + HDfree(obj_list); + error_msg("filter flag parameter is not a digit in <%s>\n", str); + HDexit(EXIT_FAILURE); + } stype[q] = c; } /* for u */ stype[q] = '\0'; |