diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-07-13 21:27:34 +0200 |
---|---|---|
committer | Christian Ruppert <idl0r@gentoo.org> | 2011-07-13 21:31:20 +0200 |
commit | fdaf1c65cdcba2d9b83e02cc0d08fb6dbbd80a80 (patch) | |
tree | 6a106882bb41f58f7d6b06075569372d97c9774a /src/librc/rc.h.in | |
parent | ef22868f3668fe833cdf297e619afe5b721f7716 (diff) |
Add a new function, bool rc_getfile(const char *, char **, size_t *)
<snip>
Read the entire @file into the buffer and set @len to the
size of the buffer when finished. For C strings, this will
be strlen(buffer) + 1.
Don't forget to free the buffer afterwards!
</snip>
We also fix bug 374899 by adding this new function.
X-Gentoo-Bug: 374899
X-Gentoo-Bug-URL: http://bugs.gentoo.org/374899
Diffstat (limited to 'src/librc/rc.h.in')
-rw-r--r-- | src/librc/rc.h.in | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librc/rc.h.in b/src/librc/rc.h.in index 2a7c054a..350f518e 100644 --- a/src/librc/rc.h.in +++ b/src/librc/rc.h.in @@ -544,6 +544,9 @@ typedef LIST_HEAD(rc_pidlist, rc_pid) RC_PIDLIST; * @return NULL terminated list of pids */ RC_PIDLIST *rc_find_pids(const char *, const char *const *, uid_t, pid_t); +/* Basically the same as rc_getline() below, it just returns multiple lines */ +bool rc_getfile(const char *, char **, size_t *); + /* getline is a handy glibc function that not all libcs have, so * we have our own */ ssize_t rc_getline(char **, size_t *, FILE *); |