2019-03-08 18:18:31 +01:00
|
|
|
/* SPDX-License-Identifier: ISC */
|
2019-01-19 17:26:41 +01:00
|
|
|
#ifndef PACK_H
|
|
|
|
#define PACK_H
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
2019-02-04 17:43:24 +01:00
|
|
|
#include <sys/sysmacros.h>
|
2019-01-19 17:26:41 +01:00
|
|
|
#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>
|
|
|
|
|
2019-02-04 15:21:19 +01:00
|
|
|
#include "util/input_file.h"
|
|
|
|
#include "util/util.h"
|
|
|
|
|
2019-02-04 15:39:43 +01:00
|
|
|
#include "filelist/image_entry.h"
|
|
|
|
|
2019-04-05 12:13:12 +02:00
|
|
|
#include "comp/compressor.h"
|
2019-04-05 12:33:50 +02:00
|
|
|
#include "pkg/pkgformat.h"
|
|
|
|
#include "pkg/pkgwriter.h"
|
2019-01-19 17:26:41 +01:00
|
|
|
#include "command.h"
|
2019-04-28 16:36:10 +02:00
|
|
|
#include "config.h"
|
2019-01-19 17:26:41 +01:00
|
|
|
|
2019-01-28 20:01:36 +01:00
|
|
|
typedef struct dependency_t {
|
|
|
|
struct dependency_t *next;
|
|
|
|
int type;
|
|
|
|
char name[];
|
|
|
|
} dependency_t;
|
|
|
|
|
|
|
|
typedef struct {
|
2019-02-07 23:31:05 +01:00
|
|
|
compressor_t *datacmp;
|
|
|
|
compressor_t *toccmp;
|
2019-01-28 20:01:36 +01:00
|
|
|
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-03-08 17:10:47 +01:00
|
|
|
int filelist_mkdir(char *line, const char *filename,
|
|
|
|
size_t linenum, void *obj);
|
2019-01-19 17:26:41 +01:00
|
|
|
|
2019-03-08 17:10:47 +01:00
|
|
|
int filelist_mkslink(char *line, const char *filename,
|
|
|
|
size_t linenum, void *obj);
|
2019-01-19 17:26:41 +01:00
|
|
|
|
2019-03-08 17:10:47 +01:00
|
|
|
int filelist_mkfile(char *line, const char *filename,
|
|
|
|
size_t linenum, void *obj);
|
2019-01-19 17:26:41 +01:00
|
|
|
|
2019-02-07 23:14:45 +01:00
|
|
|
int filelist_read(const char *filename, image_entry_t **out);
|
2019-01-19 17:26:41 +01:00
|
|
|
|
|
|
|
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-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 */
|