aboutsummaryrefslogtreecommitdiff
path: root/program.c
diff options
context:
space:
mode:
Diffstat (limited to 'program.c')
-rw-r--r--program.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/program.c b/program.c
index 8e980ab..c396695 100644
--- a/program.c
+++ b/program.c
@@ -1,4 +1,5 @@
#include "program.h"
+#include "buffer.h"
#include <unistd.h>
#include <sys/wait.h>
#include <sys/prctl.h>
@@ -11,6 +12,12 @@
#define READ_END 0
#define WRITE_END 1
+int program_buffer_write_callback(char *data, int size, void *userdata) {
+ Buffer *buffer = userdata;
+ buffer_append(buffer, data, size);
+ return 0;
+}
+
int program_exec(const char **args, ProgramOutputCallback output_callback, void *userdata) {
/* 1 arguments */
if(args[0] == NULL)