diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-05-25 13:14:23 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-05-25 13:15:51 +0200 |
commit | 8c78c7950979ffae1bcdac75e11bd8f18cf320b6 (patch) | |
tree | c48302aa526f82625b0fce315d0e0db8b3e4c126 /src/libgamma-facade.h | |
parent | m + add test that lists adjustment methds (diff) | |
download | libgamma-8c78c7950979ffae1bcdac75e11bd8f18cf320b6.tar.gz libgamma-8c78c7950979ffae1bcdac75e11bd8f18cf320b6.tar.bz2 libgamma-8c78c7950979ffae1bcdac75e11bd8f18cf320b6.tar.xz |
add buf_size parameter tolibgamma_list_methods
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/libgamma-facade.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libgamma-facade.h b/src/libgamma-facade.h index ecc3b13..f3d6ef8 100644 --- a/src/libgamma-facade.h +++ b/src/libgamma-facade.h @@ -77,6 +77,9 @@ typedef double libgamma_gamma_rampsd_fun(double encoding); * List available adjustment methods by their order of preference based on the environment * * @param methods Output array of methods, should be able to hold `GAMMA_METHOD_COUNT` elements + * @þaram buf_size The number of elements that fits in `methods`, it should be `GAMMA_METHOD_COUNT`, + * This is used to avoid writing outside the output buffer if this library adds new + * adjustment methods without the users of the library recompiling * @param operation Allowed values: * 0: Methods that the environment suggests will work, excluding fake. * 1: Methods that the environment suggests will work, including fake. @@ -84,9 +87,10 @@ typedef double libgamma_gamma_rampsd_fun(double encoding); * 3: All real methods. * 4: All methods. * Other values invoke undefined behaviour. - * @return The number of element that have been stored in `methods` + * @return The number of element that have been stored in `methods`, or should + * have been stored if the buffer was large enought */ -size_t libgamma_list_methods(int* restrict methods, int operation); +size_t libgamma_list_methods(int* restrict methods, size_t buf_size, int operation); /** * Return the capabilities of an adjustment method |