release.h 2.49 KB
Newer Older
Bernhard Link's avatar
Bernhard Link committed
1 2
#ifndef REPREPRO_RELEASE_H
#define REPREPRO_RELEASE_H
Bernhard Link's avatar
Bernhard Link committed
3

Bernhard Link's avatar
Bernhard Link committed
4
#ifndef REPREPRO_ERROR_H
Bernhard Link's avatar
Bernhard Link committed
5
#include "error.h"
Bernhard Link's avatar
Bernhard Link committed
6
#warning "What's hapening here?"
Bernhard Link's avatar
Bernhard Link committed
7
#endif
Bernhard Link's avatar
Bernhard Link committed
8
#ifndef REPREPRO_STRLIST_H
9
#include "strlist.h"
10
#endif
11 12 13
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
14

15 16
struct release;

17
#define ic_first ic_uncompressed
18 19 20
enum indexcompression {ic_uncompressed=0, ic_gzip,
#ifdef HAVE_LIBBZ2
			ic_bzip2,
21 22 23
#endif
#ifdef HAVE_LIBLZMA
			ic_xz,
24 25 26
#endif
			ic_count /* fake item to get count */
};
27 28 29 30
typedef unsigned int compressionset; /* 1 << indexcompression */
#define IC_FLAG(a) (1<<(a))

/* Initialize Release generation */
31
retvalue release_init(struct release **, const char * /*codename*/, /*@null@*/const char * /*suite*/, /*@null@*/const char * /*fakeprefix*/);
Bernhard Link's avatar
Bernhard Link committed
32
/* same but for a snapshot */
33
retvalue release_initsnapshot(const char *codename, const char *name, struct release **);
Bernhard Link's avatar
Bernhard Link committed
34

35
retvalue release_mkdir(struct release *, const char * /*relativedirectory*/);
36

37
const char *release_dirofdist(struct release *);
38

39 40 41 42
retvalue release_addnew(struct release *, /*@only@*/char *, /*@only@*/char *);
retvalue release_addsilentnew(struct release *, /*@only@*/char *, /*@only@*/char *);
retvalue release_adddel(struct release *, /*@only@*/char *);
retvalue release_addold(struct release *, /*@only@*/char *);
43 44 45

struct filetorelease;

46
retvalue release_startfile(struct release *, const char * /*filename*/, compressionset, bool /*usecache*/, struct filetorelease **);
47
retvalue release_startlinkedfile(struct release *, const char * /*filename*/, const char * /*symlinkas*/, compressionset, bool /*usecache*/, struct filetorelease **);
48
void release_warnoldfileorlink(struct release *, const char *, compressionset);
49

50
/* return true if an old file is already there */
51
bool release_oldexists(struct filetorelease *);
52 53

/* errors will be cached for release_finishfile */
54 55
retvalue release_writedata(struct filetorelease *, const char *, size_t);
#define release_writestring(file, data) release_writedata(file, data, strlen(data))
56

57 58
void release_abortfile(/*@only@*/struct filetorelease *);
retvalue release_finishfile(struct release *, /*@only@*/struct filetorelease *);
59 60 61

struct distribution;
struct target;
62
retvalue release_directorydescription(struct release *, const struct distribution *, const struct target *, const char * /*filename*/, bool /*onlyifneeded*/);
Bernhard Link's avatar
Bernhard Link committed
63

64 65 66
void release_free(/*@only@*/struct release *);
retvalue release_prepare(struct release *, struct distribution *, bool /*onlyneeded*/);
retvalue release_finish(/*@only@*/struct release *, struct distribution *);
Bernhard Link's avatar
Bernhard Link committed
67

Bernhard Link's avatar
Bernhard Link committed
68
#endif