libropkg: implement tar file reader
This commit is contained in:
33
libropkg/include/ropkg/reader.h
Normal file
33
libropkg/include/ropkg/reader.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef ROPKG_READER_H_
|
||||
#define ROPKG_READER_H_
|
||||
|
||||
#include <ropkg/misc.h>
|
||||
#include <ropkg/status.h>
|
||||
|
||||
struct ropkg_reader;
|
||||
struct b_cstream;
|
||||
|
||||
struct ropkg_file_info {
|
||||
char f_filename[255];
|
||||
int f_mode;
|
||||
int f_uid, f_gid;
|
||||
unsigned long f_filesize;
|
||||
unsigned long f_mtime;
|
||||
int f_type;
|
||||
char f_linkname[100];
|
||||
};
|
||||
|
||||
ROPKG_API enum ropkg_status ropkg_reader_open(
|
||||
struct b_cstream *fp,
|
||||
struct ropkg_reader **out);
|
||||
ROPKG_API enum ropkg_status ropkg_reader_close(struct ropkg_reader *pkg);
|
||||
|
||||
ROPKG_API const struct ropkg_file_info *ropkg_reader_current_file(
|
||||
struct ropkg_reader *reader);
|
||||
ROPKG_API enum ropkg_status ropkg_reader_move_next(struct ropkg_reader *pkg);
|
||||
ROPKG_API enum ropkg_status ropkg_reader_move_to_file(
|
||||
struct ropkg_reader *pkg,
|
||||
const char *name);
|
||||
ROPKG_API bool ropkg_reader_eof(const struct ropkg_reader *pkg);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user