Annotation of rpm2html/rpmdata.h, revision 1.25
1.1 veillard 1: /*
2: * rpmdata.h : describes the data gathered for each RPM analyzed.
3: *
1.12 veillard 4: * Copyright (c) 1997 Daniel Veillard <veillard@apocalypse.org>
1.10 veillard 5: * See COPYING for the status of this software.
1.1 veillard 6: *
1.25 ! veillard 7: * $Id: rpmdata.h,v 1.24 1998/03/27 04:50:02 veillard Exp $
1.1 veillard 8: */
9:
10: #ifndef __RPMDATA_H__
11: #define __RPMDATA_H__
12:
13: #include <rpm/header.h>
14:
15: /*
1.6 veillard 16: * Structure associated to a local directory containing RPM files.
17: */
18:
1.20 veillard 19: #define MAX_URLS 256
1.16 veillard 20: #define MAX_ARCHS (sizeof(int) * 8)
1.6 veillard 21:
22: typedef struct rpm_dir {
23: struct rpm_dir *next; /* next in list */
1.14 veillard 24: char *color; /* The bgcolor for the pages :-) */
25: char *dir; /* where to store the HTML files */
1.21 veillard 26: char *subdir; /* subdirectory for multiple archive */
1.8 veillard 27: char *ftp; /* The host URL it's mirrored from */
28: char *ftpsrc; /* The host URL where src.rpm can be found */
1.14 veillard 29: char *host; /* Hostname for the server */
30: char *mail; /* mail contact for this directory */
31: char *maint; /* Maintainer name for this directory */
32: char *name; /* Name for this repository */
33: char *rpmdir; /* The local repository */
1.6 veillard 34: char *trust; /* Confidences in the files */
1.14 veillard 35: char *url; /* The output URL */
36: int files; /* number of files */
37: int installbase; /* Is this from an installed base */
38: int size; /* aggregated size of files */
39: int nb_mirrors; /* numbers of mirrors */
40: char *mirrors[MAX_URLS]; /* Urls for download */
1.23 veillard 41: int build_tree; /* Should we build the filesystem tree */
42: struct rpm_realdir *root; /* The corresponding filesystem tree */
1.6 veillard 43: } rpmDir, *rpmDirPtr;
44:
45: /*
1.22 veillard 46: * Structure associated to a local directory containing HTML files.
47: * We build a tree providing an actual map of the generated site.
48: */
49:
50: #define MAX_SUB_DIRECTORIES 50
51: typedef struct rpm_subdir {
52: struct rpm_subdir *parent; /* Parent directory ususally .. */
53: char *name; /* subdirectory name */
54: char *color; /* Color for the HTML output */
55: char *htmlpath; /* full path w.r.t. rpm2html_url */
56: char *rpmpath; /* full path w.r.t. rpm2html_dir */
57: int nb_subdirs; /* number of subdirectories */
58: /* list of the subdirectories */
59: struct rpm_subdir *subdirs[MAX_SUB_DIRECTORIES];
60: } rpmSubdir, *rpmSubdirPtr;
61:
62: /*
1.23 veillard 63: * Structure associated to a real directory containing files owned
64: * by RPM packages. It reflect the content of user's filesystem if
65: * it installed the packages.
66: */
67:
68: #define RPM_ELEM_DIRECTORY 0x1 /* File or directory ? */
69:
70: typedef struct rpm_realdir {
71: struct rpm_realdir *parent; /* Parent directory */
72: char *name; /* directory name */
73: int nb_elem; /* number of files (and subdirs) */
74: int max_elem; /* size of allocated arrays */
75: /* pointers to an array of either */
76: void **elems; /* filename or subdir rpm_realdir */
77: char **names; /* pointer to the array of names */
78: char *flags; /* pointer to array of flags */
79: } rpmRealDir, *rpmRealDirPtr;
80:
81: /*
1.13 veillard 82: * structure associated with an architecture.
83: */
84:
85: typedef struct rpm_arch {
86: struct rpm_arch *next; /* next in the list */
87: char *os; /* the Operating System name */
88: char *arch; /* the CPU architecture */
89: } rpmArch, *rpmArchPtr;
90:
91: /*
1.1 veillard 92: * structure associated with an rpm
93: */
94:
1.20 veillard 95: #define MAX_RES 64
96: #define MAX_REQU 64
1.1 veillard 97:
98: typedef struct rpm_data {
1.16 veillard 99: struct rpm_data *next; /* next in the full list of RPMs */
100: struct rpm_data *nextSoft; /* next software */
101: struct rpm_data *nextArch; /* RPM for same software on other archs */
102: struct rpm_data *nextHash; /* next in the hash list */
1.6 veillard 103: rpmDirPtr dir; /* directory infos */
1.18 veillard 104: char *subdir; /* subdirectory holding the rpm */
1.2 veillard 105: char *filename; /* name of the file */
1.1 veillard 106: char *name; /* name of the software */
107: char *version; /* version of the software */
108: char *release; /* software release */
1.8 veillard 109: char *url; /* URL for the software */
1.16 veillard 110: char *arch; /* the architecture system */
1.8 veillard 111: char *os; /* the target system */
1.1 veillard 112: char *distribution; /* general OS distribution */
113: char *vendor; /* general OS vendor */
1.8 veillard 114: char *packager; /* the packager */
1.1 veillard 115: char *group; /* type of software */
1.2 veillard 116: char *summary; /* 1 line summary */
117: char *description; /* short description */
1.8 veillard 118: char *copyright; /* software copyright */
1.20 veillard 119: char *changelog; /* changelog */
1.2 veillard 120: char *srcrpm; /* source RPM */
121: time_t date; /* date of packaging */
1.17 veillard 122: time_t stamp; /* modification file of the archive */
1.1 veillard 123: int_32 size; /* size of the software */
124: char *host; /* build host */
1.19 veillard 125: int nb_resources; /* #of resources provided */
126: struct rpm_resource *
127: resources[MAX_RES + 1];/* list of them */
128: int nb_requires; /* #of resources required */
129: struct rpm_resource *
1.4 veillard 130: requires[MAX_REQU]; /* list of them */
1.5 veillard 131: char *filelist; /* the filelist */
1.1 veillard 132: } rpmData, *rpmDataPtr;
133:
134: /*
135: * structure associated with a resource
136: */
137:
1.15 veillard 138: #define MAX_PROVIDE 75
1.1 veillard 139:
1.19 veillard 140: typedef struct rpm_resource {
141: struct rpm_resource *next; /* next in the list */
142: char *name; /* name of the resource */
143: int nb_provider; /* #of resources provided */
1.17 veillard 144: time_t stamp; /* max stamp of the provider */
1.1 veillard 145: struct rpm_data *
146: provider[MAX_PROVIDE];/* list of them */
147: } rpmRess, *rpmRessPtr;
148:
149:
1.16 veillard 150: extern const char *archNames[MAX_ARCHS];
151: extern int nbArchs;
152:
1.1 veillard 153: extern rpmDataPtr rpmList;
1.16 veillard 154: extern rpmDataPtr rpmSoftwareList; /* avoid different archs clash */
1.1 veillard 155: extern rpmRessPtr ressList;
1.13 veillard 156: extern rpmArchPtr archList;
1.12 veillard 157: extern rpmDataPtr rpmInstalledList;
158: extern rpmRessPtr ressInstalledList;
1.6 veillard 159: extern rpmDirPtr dirList;
1.22 veillard 160: extern rpmSubdirPtr dirTree;
1.23 veillard 161: extern rpmRealDirPtr treeRoot;
1.22 veillard 162:
163: extern rpmSubdirPtr rpmNewSubdir(rpmSubdirPtr dir, const char *name,
164: const char *htmlpath, const char *rpmpath, const char *color);
165: extern void rpmRemoveSubdir(rpmSubdirPtr tree);
166: extern void rpmFreeSubdir(rpmSubdirPtr tree);
1.1 veillard 167:
1.16 veillard 168: extern void rpmAddSoftware(rpmDataPtr rpm);
1.1 veillard 169: extern void rpmDataPrint(rpmDataPtr rpm);
1.8 veillard 170: /* extern void rpmDataPrintAll(void); */
1.12 veillard 171: extern rpmRessPtr rpmRessAdd(char *ress, rpmDataPtr rpm, int installed);
172: extern rpmRessPtr rpmRequAdd(char *requ, rpmDataPtr rpm, int installed);
1.13 veillard 173: extern rpmArchPtr rpmArchAdd(char *os, char *arch);
1.22 veillard 174: extern rpmDataPtr rpmOpen(char *nameRpm, rpmDirPtr dir, rpmSubdirPtr tree);
1.21 veillard 175: extern rpmDataPtr rpmDirScanAll(void);
1.8 veillard 176: extern char *extractEMail(char *string);
1.3 veillard 177:
1.21 veillard 178: extern rpmDataPtr rpmAddList(rpmDataPtr old, rpmDataPtr newlist);
179:
180: extern rpmDataPtr rpmGroupSort(rpmDataPtr list, int installed);
181: extern rpmDataPtr rpmDistribSort(rpmDataPtr list, int installed);
182: extern rpmDataPtr rpmVendorSort(rpmDataPtr list, int installed);
183: extern rpmDataPtr rpmDateSort(rpmDataPtr list, int installed);
184: extern rpmDataPtr rpmNameSort(rpmDataPtr list, int installed);
1.1 veillard 185:
1.24 veillard 186: extern rpmRealDirPtr rpmCreateRealRoot(void);
1.25 ! veillard 187: extern void rpmDestroyRealRoot(rpmRealDirPtr dir);
1.24 veillard 188: extern void rpmAddRealFile(rpmRealDirPtr root, const char *file,
189: rpmDataPtr rpm);
190: extern rpmRealDirPtr rpmMergeRealRoots(rpmRealDirPtr root1,
191: rpmRealDirPtr root2);
1.1 veillard 192: #endif /* __RPMDATA_H__ */
Webmaster