summaryrefslogtreecommitdiff
path: root/lib/oldheader.h
blob: 99614a04475b920b739c33d68650912ea1e05b9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef H_OLDHEADER
#define H_OLDHEADER

#include <stdio.h>

struct oldrpmFileInfo {
    char * path;
    int state;
    unsigned short mode;
    unsigned short uid;
    unsigned short gid;
    unsigned short rdev;
    unsigned long size;
    unsigned long mtime;
    char md5[32];
    char * linkto;
    int isconf;
    int isdoc;
} ;

struct oldrpmHeader {
    unsigned short type, cpu;
    unsigned int size;
    unsigned int os;
    unsigned int iconLength;

    char * name, * version, * release, * group;
    char * icon;

    unsigned int specLength;
    char * spec;
} ;

struct oldrpmHeaderSpec {
    char * description;
    char * vendor;
    char * distribution;
    char * buildHost;
    char * copyright;
    char * prein, * postin, * preun, * postun;

    int buildTime;

    int fileCount;
    struct oldrpmFileInfo * files;
} ;

#ifdef __cplusplus
extern "C" {
#endif

void oldrpmfileFromSpecLine(char * str, struct oldrpmFileInfo * fi);
void oldrpmfileFromInfoLine(char * path, char * state, char * str,
			struct oldrpmFileInfo * fi);
void oldrpmfileFree(struct oldrpmFileInfo * fi);
char * oldrpmfileToInfoStr(struct oldrpmFileInfo * fi);

/*@observer@*/ char * oldhdrReadFromStream(FD_t fd, /*@out@*/ struct oldrpmHeader * header);
/*@observer@*/ char * oldhdrReadFromFile(char * filename, /*@out@*/ struct oldrpmHeader * header);
/*@observer@*/ char * oldhdrParseSpec(struct oldrpmHeader * header, /*@out@*/struct oldrpmHeaderSpec * spec);
void   oldhdrFree( /*@only@*/ struct oldrpmHeader * header);
void   oldhdrSpecFree( /*@only@*/ struct oldrpmHeaderSpec * spec);

#ifdef __cplusplus
}
#endif

#endif	/* H_OLDHEADER */