aboutsummaryrefslogtreecommitdiff
path: root/include/command.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/command.h')
-rw-r--r--include/command.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/command.h b/include/command.h
new file mode 100644
index 0000000..6e6490b
--- /dev/null
+++ b/include/command.h
@@ -0,0 +1,12 @@
+#ifndef TSL_COMMAND_H
+#define TSL_COMMAND_H
+
+#include "string_view.h"
+
+/* Return 1 if you want to continue reading. @data is null-terminated */
+typedef int (*ProgramOutputCallback)(char *data, int size, void *userdata);
+
+/* Returns the program exit code (a positive value), or a negative value on failure */
+int tsl_command_exec(char **args, ProgramOutputCallback output_callback, void *userdata);
+
+#endif /* TSL_COMMAND_H */