aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-05-12 12:34:30 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-05-12 12:36:50 -0400
commit9b7a784099f11fa20312a118c74d08a2c25572fc (patch)
tree18dfb8d7e14a5cf52f57e0242e0cbaa9a9b754a2 /src/lib
parentd89f776c1d55fa6ad41b5dcf870d03256a4f54a7 (diff)
downloadstasis-9b7a784099f11fa20312a118c74d08a2c25572fc.tar.gz
Replace void pointer with pointer to tplfunc_frame structure
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/core/include/template.h7
-rw-r--r--src/lib/core/include/template_func_proto.h10
-rw-r--r--src/lib/core/template.c2
-rw-r--r--src/lib/core/template_func_proto.c10
4 files changed, 16 insertions, 13 deletions
diff --git a/src/lib/core/include/template.h b/src/lib/core/include/template.h
index e3d83fb..436fcc6 100644
--- a/src/lib/core/include/template.h
+++ b/src/lib/core/include/template.h
@@ -40,7 +40,9 @@ char *tpl_render(char *str);
*/
int tpl_render_to_file(char *str, const char *filename);
-typedef int tplfunc(void *frame, void *data_out);
+struct tplfunc_frame;
+
+typedef int tplfunc(struct tplfunc_frame *frame, void *data_out);
struct tplfunc_frame {
char *key; ///< Name of the function
@@ -68,8 +70,9 @@ struct tplfunc_frame {
* @param key function name to expose to "func:" interface
* @param tplfunc_ptr pointer to function of type tplfunc
* @param argc number of function arguments to accept
+ * @param data_in pointer to function input data
*/
-void tpl_register_func(char *key, void *tplfunc_ptr, int argc, void *data_in);
+void tpl_register_func(char *key, tplfunc *tplfunc_ptr, int argc, void *data_in);
/**
* Get the function frame associated with a template function
diff --git a/src/lib/core/include/template_func_proto.h b/src/lib/core/include/template_func_proto.h
index 286ccfb..0f2ad80 100644
--- a/src/lib/core/include/template_func_proto.h
+++ b/src/lib/core/include/template_func_proto.h
@@ -4,10 +4,10 @@
#include "template.h"
-int get_github_release_notes_tplfunc_entrypoint(void *frame, void *data_out);
-int get_github_release_notes_auto_tplfunc_entrypoint(void *frame, void *data_out);
-int get_junitxml_file_entrypoint(void *frame, void *data_out);
-int get_basetemp_dir_entrypoint(void *frame, void *data_out);
-int tox_run_entrypoint(void *frame, void *data_out);
+int get_github_release_notes_tplfunc_entrypoint(struct tplfunc_frame *frame, void *data_out);
+int get_github_release_notes_auto_tplfunc_entrypoint(struct tplfunc_frame *frame, void *data_out);
+int get_junitxml_file_entrypoint(struct tplfunc_frame *frame, void *data_out);
+int get_basetemp_dir_entrypoint(struct tplfunc_frame *frame, void *data_out);
+int tox_run_entrypoint(struct tplfunc_frame *frame, void *data_out);
#endif //TEMPLATE_FUNC_PROTO_H \ No newline at end of file
diff --git a/src/lib/core/template.c b/src/lib/core/template.c
index 00e0058..8396b1e 100644
--- a/src/lib/core/template.c
+++ b/src/lib/core/template.c
@@ -26,7 +26,7 @@ extern void tpl_reset() {
tpl_pool_func_used = 0;
}
-void tpl_register_func(char *key, void *tplfunc_ptr, int argc, void *data_in) {
+void tpl_register_func(char *key, tplfunc *tplfunc_ptr, int argc, void *data_in) {
struct tplfunc_frame *frame = calloc(1, sizeof(*frame));
if (!frame) {
SYSERROR("unable to allocate memory for function frame");
diff --git a/src/lib/core/template_func_proto.c b/src/lib/core/template_func_proto.c
index f28a1eb..54a8860 100644
--- a/src/lib/core/template_func_proto.c
+++ b/src/lib/core/template_func_proto.c
@@ -2,7 +2,7 @@
#include "delivery.h"
#include "github.h"
-int get_github_release_notes_tplfunc_entrypoint(void *frame, void *data_out) {
+int get_github_release_notes_tplfunc_entrypoint(struct tplfunc_frame *frame, void *data_out) {
char **output = (char **) data_out;
struct tplfunc_frame *f = (struct tplfunc_frame *) frame;
char *api_token = getenv("STASIS_GH_TOKEN");
@@ -17,7 +17,7 @@ int get_github_release_notes_tplfunc_entrypoint(void *frame, void *data_out) {
return result;
}
-int get_github_release_notes_auto_tplfunc_entrypoint(void *frame, void *data_out) {
+int get_github_release_notes_auto_tplfunc_entrypoint(struct tplfunc_frame *frame, void *data_out) {
int result = 0;
char **output = (char **) data_out;
struct tplfunc_frame *f = (struct tplfunc_frame *) frame;
@@ -68,7 +68,7 @@ int get_github_release_notes_auto_tplfunc_entrypoint(void *frame, void *data_out
return result;
}
-int get_junitxml_file_entrypoint(void *frame, void *data_out) {
+int get_junitxml_file_entrypoint(struct tplfunc_frame *frame, void *data_out) {
int result = 0;
char **output = (char **) data_out;
struct tplfunc_frame *f = (struct tplfunc_frame *) frame;
@@ -95,7 +95,7 @@ int get_junitxml_file_entrypoint(void *frame, void *data_out) {
return result;
}
-int get_basetemp_dir_entrypoint(void *frame, void *data_out) {
+int get_basetemp_dir_entrypoint(struct tplfunc_frame *frame, void *data_out) {
int result = 0;
char **output = (char **) data_out;
struct tplfunc_frame *f = (struct tplfunc_frame *) frame;
@@ -121,7 +121,7 @@ int get_basetemp_dir_entrypoint(void *frame, void *data_out) {
return result;
}
-int tox_run_entrypoint(void *frame, void *data_out) {
+int tox_run_entrypoint(struct tplfunc_frame *frame, void *data_out) {
char **output = (char **) data_out;
struct tplfunc_frame *f = (struct tplfunc_frame *) frame;
const struct Delivery *ctx = (const struct Delivery *) f->data_in;