aboutsummaryrefslogtreecommitdiff
path: root/text-io.c
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-05-22 11:37:50 +0200
committerRandy Palamar <randy@rnpnr.xyz>2024-09-13 06:03:59 -0600
commitc56b57fc58c73e96def91f4904d5b6e7c50e3de9 (patch)
treeb0918f3a6b234e4bd9ff5e5d86c2aa09ea622179 /text-io.c
parentd8276d916d875695a1000e14a6d1dfd03e689c81 (diff)
downloadvis-c56b57fc58c73e96def91f4904d5b6e7c50e3de9.tar.gz
vis-c56b57fc58c73e96def91f4904d5b6e7c50e3de9.tar.xz
support piping a buffer to an external process
Currently only Text objects can be piped to external commands. This is tedious if data not available in any file should be passed to an external process (e.g. building options and passing them to vis-menu). This adds the option to pass a buffer to _vis_pipe and provides wrapper functions for the original behavior and the new one.
Diffstat (limited to 'text-io.c')
-rw-r--r--text-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/text-io.c b/text-io.c
index 509df35..97fc138 100644
--- a/text-io.c
+++ b/text-io.c
@@ -182,7 +182,7 @@ Text *text_load_method(const char *filename, enum TextLoadMethod method) {
return text_loadat_method(AT_FDCWD, filename, method);
}
-static ssize_t write_all(int fd, const char *buf, size_t count) {
+ssize_t write_all(int fd, const char *buf, size_t count) {
size_t rem = count;
while (rem > 0) {
ssize_t written = write(fd, buf, rem > INT_MAX ? INT_MAX : rem);