#ifndef UNTAR_H #define UNTAR_H #include #define TAR_NAME_LEN 100 #define TAR_USER_LEN 32 #define TAR_GROUP_LEN 32 #define TAR_UINT_LEN 8 /* good for 24 bits */ #define TAR_ULONG_LEN 12 /* good for 32 bits */ #define TAR_MAGIC_LEN 8 struct tar_record { char name[TAR_NAME_LEN+1]; u_int mode; u_int uid; u_int gid; u_long size; u_long mtime; u_int chksum; char linkflag; char linkname[TAR_NAME_LEN+1]; char magic[TAR_MAGIC_LEN+1]; char uname[TAR_USER_LEN+1]; char gname[TAR_GROUP_LEN+1]; u_int devmajor; u_int devminor; }; struct untar_stream; struct untar_stream *untar_stream_create(const char *name); void untar_set_opaque(struct untar_stream *ts, void *opaque); void untar_set_file_data(struct untar_stream *ts, void (*file_data)(void *, struct untar_stream *, struct tar_record *, u_long off, size_t len, u_char *data)); void untar_set_new_file(struct untar_stream *ts, void (*new_file)(void *, struct untar_stream *, struct tar_record *)); void untar_stream_finished(struct untar_stream *ts); int untar_stream_push(struct untar_stream *ts, size_t len, void *data); int untar_finished(struct untar_stream *ts); #endif