2019-01-19 17:26:41 +01:00
|
|
|
#ifndef PACK_H
|
|
|
|
#define PACK_H
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include <getopt.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
|
|
|
#include "image_entry.h"
|
|
|
|
#include "compressor.h"
|
|
|
|
#include "pkgformat.h"
|
|
|
|
#include "pkgwriter.h"
|
|
|
|
#include "command.h"
|
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
FILE *f;
|
|
|
|
char *line;
|
|
|
|
const char *filename;
|
|
|
|
size_t linenum;
|
|
|
|
} input_file_t;
|
|
|
|
|
2019-01-28 20:01:36 +01:00
|
|
|
typedef struct dependency_t {
|
|
|
|
struct dependency_t *next;
|
|
|
|
int type;
|
|
|
|
char name[];
|
|
|
|
} dependency_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
dependency_t *deps;
|
2019-01-30 10:40:02 +01:00
|
|
|
char *name;
|
2019-01-28 20:01:36 +01:00
|
|
|
} pkg_desc_t;
|
|
|
|
|
2019-01-19 17:26:41 +01:00
|
|
|
image_entry_t *filelist_mkdir(input_file_t *f);
|
|
|
|
|
|
|
|
image_entry_t *filelist_mkslink(input_file_t *f);
|
|
|
|
|
|
|
|
image_entry_t *filelist_mkfile(input_file_t *f);
|
|
|
|
|
|
|
|
image_entry_t *filelist_read(const char *filename);
|
|
|
|
|
|
|
|
int write_toc(pkg_writer_t *wr, image_entry_t *list, compressor_t *cmp);
|
|
|
|
|
|
|
|
int write_files(pkg_writer_t *wr, image_entry_t *list, compressor_t *cmp);
|
|
|
|
|
2019-01-27 16:41:20 +01:00
|
|
|
int prefetch_line(input_file_t *f);
|
|
|
|
|
|
|
|
void cleanup_file(input_file_t *f);
|
|
|
|
|
|
|
|
int open_file(input_file_t *f, const char *filename);
|
|
|
|
|
2019-01-28 20:01:36 +01:00
|
|
|
int desc_read(const char *path, pkg_desc_t *desc);
|
|
|
|
|
|
|
|
void desc_free(pkg_desc_t *desc);
|
|
|
|
|
|
|
|
int write_header_data(pkg_writer_t *wr, pkg_desc_t *desc);
|
|
|
|
|
2019-01-19 17:26:41 +01:00
|
|
|
#endif /* PACK_H */
|