2019-03-08 18:18:31 +01:00
|
|
|
/* SPDX-License-Identifier: ISC */
|
2019-01-19 17:26:41 +01:00
|
|
|
#ifndef PKGREADER_H
|
|
|
|
#define PKGREADER_H
|
|
|
|
|
|
|
|
#include "pkgformat.h"
|
|
|
|
|
|
|
|
typedef struct pkg_reader_t pkg_reader_t;
|
|
|
|
|
|
|
|
pkg_reader_t *pkg_reader_open(const char *path);
|
|
|
|
|
2019-02-03 11:43:15 +01:00
|
|
|
pkg_reader_t *pkg_reader_open_repo(int dirfd, const char *name);
|
|
|
|
|
2019-01-19 17:26:41 +01:00
|
|
|
void pkg_reader_close(pkg_reader_t *reader);
|
|
|
|
|
|
|
|
int pkg_reader_get_next_record(pkg_reader_t *reader);
|
|
|
|
|
|
|
|
record_t *pkg_reader_current_record_header(pkg_reader_t *reader);
|
|
|
|
|
|
|
|
ssize_t pkg_reader_read_payload(pkg_reader_t *reader, void *buffer,
|
|
|
|
size_t size);
|
|
|
|
|
|
|
|
int pkg_reader_rewind(pkg_reader_t *reader);
|
|
|
|
|
|
|
|
const char *pkg_reader_get_filename(pkg_reader_t *reader);
|
|
|
|
|
|
|
|
#endif /* PKGREADER_H */
|