diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2024-05-22 11:37:50 +0200 |
|---|---|---|
| committer | Randy Palamar <randy@rnpnr.xyz> | 2024-09-13 06:03:59 -0600 |
| commit | c56b57fc58c73e96def91f4904d5b6e7c50e3de9 (patch) | |
| tree | b0918f3a6b234e4bd9ff5e5d86c2aa09ea622179 /text.h | |
| parent | d8276d916d875695a1000e14a6d1dfd03e689c81 (diff) | |
| download | vis-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.h')
| -rw-r--r-- | text.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -413,6 +413,12 @@ ssize_t text_write_range(const Text*, const Filerange*, int fd); * this text instance. */ bool text_mmaped(const Text*, const char *ptr); + +/** + * Write complete buffer to file descriptor. + * @return The number of bytes written or ``-1`` in case of an error. + */ +ssize_t write_all(int fd, const char *buf, size_t count); /** @} */ #endif |
