summaryrefslogtreecommitdiffstats
path: root/nsxiv.h
diff options
context:
space:
mode:
authorN-R-K <79544946+N-R-K@users.noreply.github.com>2022-02-20 16:54:29 +0100
committerGitHub <noreply@github.com>2022-02-20 16:54:29 +0100
commitad95012be993664e062e7724155c54a482a51315 (patch)
tree519744b4b6ed6b99266505991a0e954d709e9d4d /nsxiv.h
parent3cf4fc5e816cdda1ae2108987b9558ea6968b9e9 (diff)
downloadnsxiv-ad95012be993664e062e7724155c54a482a51315.tar.zst
Add reuseable abstraction over fork/exec/dup2 (#211)
Diffstat (limited to 'nsxiv.h')
-rw-r--r--nsxiv.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/nsxiv.h b/nsxiv.h
index a9d4dad..b6b04fb 100644
--- a/nsxiv.h
+++ b/nsxiv.h
@@ -342,6 +342,17 @@ typedef struct {
int stlen;
} r_dir_t;
+typedef struct {
+ int readfd;
+ int writefd;
+ pid_t pid;
+} spawn_t;
+
+enum {
+ X_READ = (1 << 0),
+ X_WRITE = (1 << 1)
+};
+
extern const char *progname;
void* emalloc(size_t);
@@ -353,6 +364,8 @@ int r_opendir(r_dir_t*, const char*, bool);
int r_closedir(r_dir_t*);
char* r_readdir(r_dir_t*, bool);
int r_mkdir(char*);
+void construct_argv(char**, unsigned int, ...);
+spawn_t spawn(const char*, char *const [], unsigned int);
/* window.c */