summaryrefslogtreecommitdiffstats
path: root/Utilities/cmtar/libtar.h
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-30 19:22:46 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-30 19:22:46 (GMT)
commit6d0f0e0acb95c23a476510726bf7c5fe6fb840bf (patch)
tree0bf1ae222c7564868e7115f5fa5285dec947c908 /Utilities/cmtar/libtar.h
parent01ac4158ed47f82b0d7ee7015d1cc38943d86eee (diff)
downloadCMake-6d0f0e0acb95c23a476510726bf7c5fe6fb840bf.zip
CMake-6d0f0e0acb95c23a476510726bf7c5fe6fb840bf.tar.gz
CMake-6d0f0e0acb95c23a476510726bf7c5fe6fb840bf.tar.bz2
COMP: Fix support for gzip on non-32 bit platforms
Diffstat (limited to 'Utilities/cmtar/libtar.h')
-rw-r--r--Utilities/cmtar/libtar.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/Utilities/cmtar/libtar.h b/Utilities/cmtar/libtar.h
index ef822ea..9990a97 100644
--- a/Utilities/cmtar/libtar.h
+++ b/Utilities/cmtar/libtar.h
@@ -62,10 +62,10 @@ struct tar_header
/***** handle.c ************************************************************/
-typedef int (*openfunc_t)(const char *, int, ...);
-typedef int (*closefunc_t)(int);
-typedef ssize_t (*readfunc_t)(int, void *, size_t);
-typedef ssize_t (*writefunc_t)(int, const void *, size_t);
+typedef int (*openfunc_t)(void* call_data, const char *, int, mode_t);
+typedef int (*closefunc_t)(void* call_data, int);
+typedef ssize_t (*readfunc_t)(void* call_data, int, void *, size_t);
+typedef ssize_t (*writefunc_t)(void* call_data, int, const void *, size_t);
typedef struct
{
@@ -73,6 +73,7 @@ typedef struct
closefunc_t closefunc;
readfunc_t readfunc;
writefunc_t writefunc;
+ void* call_data;
}
tartype_t;
@@ -114,6 +115,12 @@ int tar_fdopen(TAR **t, int fd, char *pathname, tartype_t *type,
/* returns the descriptor associated with t */
int tar_fd(TAR *t);
+/* returns the descriptor associated with t */
+void* tar_call_data(TAR *t);
+
+/* returns the descriptor associated with t */
+void tar_set_call_data(TAR *t, void* cd);
+
/* close tarfile handle */
int tar_close(TAR *t);
@@ -145,9 +152,9 @@ int tar_append_regfile(TAR *t, char *realname);
/* macros for reading/writing tarchive blocks */
#define tar_block_read(t, buf) \
- (*((t)->type->readfunc))((t)->fd, (char *)(buf), T_BLOCKSIZE)
+ (*((t)->type->readfunc))((t)->type->call_data, (t)->fd, (char *)(buf), T_BLOCKSIZE)
#define tar_block_write(t, buf) \
- (*((t)->type->writefunc))((t)->fd, (char *)(buf), T_BLOCKSIZE)
+ (*((t)->type->writefunc))((t)->type->call_data, (t)->fd, (char *)(buf), T_BLOCKSIZE)
/* read/write a header block */
int th_read(TAR *t);