aboutsummaryrefslogtreecommitdiffstats
path: root/libgamma_value_of_subpixel_order.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgamma_value_of_subpixel_order.c')
-rw-r--r--libgamma_value_of_subpixel_order.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/libgamma_value_of_subpixel_order.c b/libgamma_value_of_subpixel_order.c
index 33c2a6f..ed81435 100644
--- a/libgamma_value_of_subpixel_order.c
+++ b/libgamma_value_of_subpixel_order.c
@@ -7,22 +7,27 @@
*
* @param order The name of the subpixel order, for example
* "Horizontal RGB" or "LIBGAMMA_SUBPIXEL_ORDER_HORIZONTAL_RGB"
- * @return The subpixel order; for example `LIBGAMMA_SUBPIXEL_ORDER_HORIZONTAL_RGB`
- * for "Horizontal RGB" and "LIBGAMMA_SUBPIXEL_ORDER_HORIZONTAL_RGB";
- * `LIBGAMMA_SUBPIXEL_ORDER_NOT_RECOGNISED` of not defined
+ * @param out Output parameter for the subpixel order, only set on success;
+ * for example `LIBGAMMA_SUBPIXEL_ORDER_HORIZONTAL_RGB` for
+ * "Horizontal RGB" and "LIBGAMMA_SUBPIXEL_ORDER_HORIZONTAL_RGB";
+ * @return Zero on success, `LIBGAMMA_SUBPIXEL_ORDER_NOT_RECOGNISED` of not defined
*/
int
-libgamma_value_of_subpixel_order(const char *order)
+libgamma_value_of_subpixel_order(const char *order, enum libgamma_subpixel_order *out)
{
#define X(CONST, NAME, ...)\
- if (!strcmp(order, NAME))\
- return CONST;
+ if (!strcmp(order, NAME)) {\
+ *out = CONST;\
+ return 0;\
+ }
LIST_SUBPIXEL_ORDERS(X)
#undef X
#define X(CONST, ...)\
- if (!strcmp(order, #CONST))\
- return CONST;
+ if (!strcmp(order, #CONST)) {\
+ *out = CONST;\
+ return 0;\
+ }
LIST_SUBPIXEL_ORDERS(X)
#undef X