summaryrefslogtreecommitdiffstats
path: root/src/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/io.c b/src/io.c
index 81ed289..e0a9c9b 100644
--- a/src/io.c
+++ b/src/io.c
@@ -492,3 +492,13 @@ struct apk_ostream *apk_ostream_to_file(const char *file, mode_t mode)
return apk_ostream_to_fd(fd);
}
+size_t apk_ostream_write_string(struct apk_ostream *os, const char *string)
+{
+ size_t len;
+
+ len = strlen(string);
+ if (os->write(os, string, len) != len)
+ return -1;
+
+ return len;
+}