diff options
author | Lars Wirzenius <liw@liw.fi> | 2010-10-25 10:37:32 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2010-10-25 10:37:32 +0100 |
commit | ed77916173766327248d84453564f1ae05b05535 (patch) | |
tree | adb0e4c58330deae014897fca913fd51b869833b /dynstr.c | |
parent | 20da8374e9da7009da7fe7cfbf81387f6cc94dc6 (diff) | |
download | dynstr-ed77916173766327248d84453564f1ae05b05535.tar.gz |
Implement dynstr_write.
Changed the function signature since write(2) is so different from
fwrite(3), and there's no point in trying to shoehorn the two into
the same mold.
Diffstat (limited to 'dynstr.c')
-rw-r--r-- | dynstr.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -4,6 +4,7 @@ #include <stdbool.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> #include "dynstr.h" @@ -294,3 +295,9 @@ size_t dynstr_fwrite(FILE *file, Dynstr *dynstr) return fwrite(dynstr->mem, 1, dynstr->size, file); } + +ssize_t dynstr_write(int fd, Dynstr *dynstr) +{ + return write(fd, dynstr->mem, dynstr->size); +} + |