Passing compression options via void pointer is too error prone
If the user passes the wrong content, the library will likely segfault. An additional opt_len
parameter could at least double check that the correct size was passed by the user.
If the compressions options are restricted to an int array, n_opts
would be a better name for that parameter.
A safe alternative would be to always use JSON strings for the compression options.
Another alternative would be to create structs that contain the compression method together with its options (tagged union?).