summaryrefslogtreecommitdiff
path: root/tbdiff/tbdiff-apply.c
diff options
context:
space:
mode:
authorBen Brewer <ben.brewer@codethink.co.uk>2014-05-29 17:36:26 +0100
committerBen Brewer <ben.brewer@codethink.co.uk>2014-06-02 11:03:00 +0100
commit1a8cdd49a574dc947bca54fc7ee734c5525475c0 (patch)
tree6d8f3892203d64fb89f8b56e5ca2f24bbfed8ed6 /tbdiff/tbdiff-apply.c
parentd806ee54230c46d1708a19598833ac47fbf341a9 (diff)
downloadtbdiff-1a8cdd49a574dc947bca54fc7ee734c5525475c0.tar.gz
style: Rename fread/fwrite in function names to read and write
The implementation currently uses fread and fwrite which are specific functions in stdlib, however this is an implementation detail and in the future these functions may not be used, so it doesn't make sense to name the higher level functions based on the function they use underneath.
Diffstat (limited to 'tbdiff/tbdiff-apply.c')
-rw-r--r--tbdiff/tbdiff-apply.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tbdiff/tbdiff-apply.c b/tbdiff/tbdiff-apply.c
index 754df5e..0a1fe7c 100644
--- a/tbdiff/tbdiff-apply.c
+++ b/tbdiff/tbdiff-apply.c
@@ -43,7 +43,7 @@
#include <tbdiff/tbdiff-xattrs.h>
char*
-tbd_apply_fread_string(FILE *stream)
+tbd_apply_read_string(FILE *stream)
{
uint16_t dlen;
if(tbd_read_uint16(&dlen, stream) != 1)
@@ -67,7 +67,7 @@ tbd_apply_fread_string(FILE *stream)
* - or your allocator does nothing when asked to free non-allocated memory
*/
int
-tbd_apply_fread_block(FILE *stream, void **data, size_t *size)
+tbd_apply_read_block(FILE *stream, void **data, size_t *size)
{
{
size_t _size;
@@ -542,7 +542,7 @@ tbd_apply_cmd_symlink_create(FILE *stream)
static int
tbd_apply_cmd_special_create(FILE *stream)
{
- char *name = tbd_apply_fread_string(stream);
+ char *name = tbd_apply_read_string(stream);
time_t mtime;
mode_t mode;
uid_t uid;
@@ -592,7 +592,7 @@ tbd_apply_cmd_dir_delta(FILE *stream)
tbd_read_uint32(&mode , stream) != 1)
return TBD_ERROR(TBD_ERROR_UNABLE_TO_READ_STREAM);
- char *dname = tbd_apply_fread_string(stream);
+ char *dname = tbd_apply_read_string(stream);
if(dname == NULL)
return TBD_ERROR(TBD_ERROR_UNABLE_TO_READ_STREAM);
@@ -627,7 +627,7 @@ tbd_apply_cmd_file_mdata_update(FILE *stream)
tbd_read_uint32(&mode , stream) != 1)
return TBD_ERROR(TBD_ERROR_UNABLE_TO_READ_STREAM);
- char *dname = tbd_apply_fread_string(stream);
+ char *dname = tbd_apply_read_string(stream);
if(dname == NULL)
return TBD_ERROR(TBD_ERROR_UNABLE_TO_READ_STREAM);
@@ -655,7 +655,7 @@ tbd_apply_cmd_xattrs_update(FILE *stream)
void *data = NULL;
size_t dsize = 0;
/* read the name of the file to operate on */
- if ((fname = tbd_apply_fread_string(stream)) == NULL) {
+ if ((fname = tbd_apply_read_string(stream)) == NULL) {
return TBD_ERROR(TBD_ERROR_UNABLE_TO_READ_STREAM);
}
@@ -672,14 +672,14 @@ tbd_apply_cmd_xattrs_update(FILE *stream)
/* operate on each attribute */
while (count > 0) {
- char *aname = tbd_apply_fread_string(stream);
+ char *aname = tbd_apply_read_string(stream);
if (aname == NULL) {
err=TBD_ERROR(TBD_ERROR_UNABLE_TO_READ_STREAM);
goto cleanup;
}
/* read a block of data, reallocating if needed */
- if ((err = tbd_apply_fread_block(stream, &data, &dsize))
+ if ((err = tbd_apply_read_block(stream, &data, &dsize))
!= TBD_ERROR_SUCCESS) {
free(aname);
goto cleanup;