aboutsummaryrefslogtreecommitdiff
path: root/program.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-07-12 21:32:44 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-12 21:32:44 +0200
commitdfad8a8016426d7fe198dc32973b01a1e075142e (patch)
tree1ba7312e0a3d5dbb1942088165e338ffd25af034 /program.h
parent4f9c16f821af54110889c01eed0cb6bbf9eb9ce2 (diff)
Starting on conversion to c. Program exec, buffers..
Diffstat (limited to 'program.h')
-rw-r--r--program.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/program.h b/program.h
new file mode 100644
index 0000000..4c93066
--- /dev/null
+++ b/program.h
@@ -0,0 +1,13 @@
+#ifndef PROGRAM_H
+#define PROGRAM_H
+
+/* Return 0 if you want to continue reading. @data is null-terminated */
+typedef int (*ProgramOutputCallback)(char *data, int size, void *userdata);
+
+/*
+ @args need to have at least 2 arguments. The first which is the program name
+ and the last which is NULL, which indicates end of args
+*/
+int program_exec(const char **args, ProgramOutputCallback output_callback, void *userdata);
+
+#endif