From 0a798f421863d7c74bf7e8e6f37d8021e9df52f2 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 22 Apr 2022 12:42:01 -0700 Subject: til: make til_module_randomize_setup() return -errno This makes the arg return optional by using a res_arg pointer, instead returning -ENOMEM when it would have returned NULL on allocation failures. This also makes it possible to detect when no setup was performed, by returning 0 in such a case. Now returns 1 when setup occurs and res pointers populated. --- src/til.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/til.h') diff --git a/src/til.h b/src/til.h index 836907c..572f408 100644 --- a/src/til.h +++ b/src/til.h @@ -33,6 +33,6 @@ void til_module_render(const til_module_t *module, void *context, unsigned ticks int til_module_create_context(const til_module_t *module, unsigned ticks, void *setup, void **res_context); void * til_module_destroy_context(const til_module_t *module, void *context); int til_module_setup(til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, void **res_setup); -char * til_module_randomize_setup(const til_module_t *module, void **res_setup); +int til_module_randomize_setup(const til_module_t *module, void **res_setup, char **res_arg); #endif -- cgit v1.2.1