1995-12-28 04:05:14 +08:00
|
|
|
#ifndef _H_OLDRPMDB
|
|
|
|
#define _H_OLDRPMDB
|
1995-11-28 06:31:21 +08:00
|
|
|
|
2001-04-10 20:36:45 +08:00
|
|
|
/**
|
|
|
|
* \file lib/oldrpmdb.h
|
2000-08-28 03:27:03 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
1995-11-28 06:31:21 +08:00
|
|
|
#include <gdbm.h>
|
|
|
|
|
1999-07-14 05:37:57 +08:00
|
|
|
#include <oldheader.h>
|
1995-11-28 06:31:21 +08:00
|
|
|
|
1996-01-09 03:16:46 +08:00
|
|
|
typedef enum
|
|
|
|
{
|
1995-12-28 04:05:14 +08:00
|
|
|
RPMDB_NONE, RPMDB_GDBM_ERROR, RPMDB_NO_MEMORY
|
1996-01-09 03:16:46 +08:00
|
|
|
}
|
|
|
|
rpm_error;
|
1995-11-28 06:31:21 +08:00
|
|
|
|
1996-01-09 03:16:46 +08:00
|
|
|
struct oldrpmdb
|
|
|
|
{
|
1995-11-28 06:31:21 +08:00
|
|
|
GDBM_FILE packages;
|
|
|
|
GDBM_FILE nameIndex;
|
|
|
|
GDBM_FILE pathIndex;
|
|
|
|
GDBM_FILE groupIndex;
|
|
|
|
GDBM_FILE iconIndex;
|
|
|
|
GDBM_FILE postIndex;
|
|
|
|
rpm_error rpmdbError;
|
|
|
|
gdbm_error gdbmError;
|
1996-01-09 03:16:46 +08:00
|
|
|
};
|
1995-11-28 06:31:21 +08:00
|
|
|
|
1996-01-09 03:16:46 +08:00
|
|
|
enum oldrpmdbFreeType
|
|
|
|
{
|
1995-12-28 04:05:14 +08:00
|
|
|
RPMDB_NOFREE, RPMDB_FREENAME, RPMDB_FREEALL
|
1996-01-09 03:16:46 +08:00
|
|
|
};
|
1995-11-28 06:31:21 +08:00
|
|
|
|
1996-01-09 03:16:46 +08:00
|
|
|
struct oldrpmdbLabel
|
|
|
|
{
|
1995-12-28 04:05:14 +08:00
|
|
|
char *name, *version, *release;
|
|
|
|
enum oldrpmdbFreeType freeType;
|
|
|
|
struct oldrpmdbLabel *next;
|
|
|
|
int fileNumber; /* -1 means invalid */
|
1996-01-09 03:16:46 +08:00
|
|
|
};
|
1995-11-28 06:31:21 +08:00
|
|
|
|
1996-01-09 03:16:46 +08:00
|
|
|
struct oldrpmdbPackageInfo
|
|
|
|
{
|
1995-12-28 04:05:14 +08:00
|
|
|
char *name, *version, *release;
|
|
|
|
char *labelstr;
|
1995-11-28 06:31:21 +08:00
|
|
|
unsigned int installTime, buildTime;
|
|
|
|
unsigned int size;
|
1995-12-28 04:05:14 +08:00
|
|
|
char *description;
|
|
|
|
char *distribution;
|
|
|
|
char *vendor;
|
|
|
|
char *buildHost;
|
|
|
|
char *preamble;
|
|
|
|
char *copyright;
|
1995-11-28 06:31:21 +08:00
|
|
|
unsigned int fileCount;
|
1996-01-06 08:07:13 +08:00
|
|
|
struct oldrpmFileInfo *files;
|
1996-01-09 03:16:46 +08:00
|
|
|
};
|
1995-11-28 06:31:21 +08:00
|
|
|
|
|
|
|
#define RPMDB_READER 1
|
|
|
|
|
1999-07-14 05:37:57 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
1995-12-28 04:05:14 +08:00
|
|
|
int oldrpmdbOpen (struct oldrpmdb *oldrpmdb);
|
|
|
|
void oldrpmdbClose (struct oldrpmdb *oldrpmdb);
|
|
|
|
struct oldrpmdbLabel *oldrpmdbGetAllLabels (struct oldrpmdb *oldrpmdb);
|
|
|
|
struct oldrpmdbLabel *oldrpmdbFindPackagesByFile (struct oldrpmdb *oldrpmdb, char *path);
|
|
|
|
struct oldrpmdbLabel *oldrpmdbFindPackagesByLabel (struct oldrpmdb *oldrpmdb,
|
|
|
|
struct oldrpmdbLabel label);
|
1995-11-28 06:31:21 +08:00
|
|
|
|
1998-07-25 23:10:58 +08:00
|
|
|
char *oldrpmdbGetPackageGroup (struct oldrpmdb *oldrpmdb,
|
1996-01-09 03:16:46 +08:00
|
|
|
struct oldrpmdbLabel label);
|
1998-07-25 23:10:58 +08:00
|
|
|
char *oldrpmdbGetPackagePostun (struct oldrpmdb *oldrpmdb,
|
1996-01-09 03:16:46 +08:00
|
|
|
struct oldrpmdbLabel label);
|
1998-07-25 23:10:58 +08:00
|
|
|
char *oldrpmdbGetPackagePreun (struct oldrpmdb *oldrpmdb,
|
1996-01-09 03:16:46 +08:00
|
|
|
struct oldrpmdbLabel label);
|
1995-12-28 04:05:14 +08:00
|
|
|
char *oldrpmdbGetPackageGif (struct oldrpmdb *oldrpmdb, struct oldrpmdbLabel label,
|
|
|
|
int *size);
|
|
|
|
int oldrpmdbGetPackageInfo (struct oldrpmdb *oldrpmdb, struct oldrpmdbLabel label,
|
|
|
|
struct oldrpmdbPackageInfo *pinfo);
|
|
|
|
void oldrpmdbFreePackageInfo (struct oldrpmdbPackageInfo package);
|
1995-11-28 06:31:21 +08:00
|
|
|
|
1995-12-28 04:05:14 +08:00
|
|
|
struct oldrpmdbLabel oldrpmdbMakeLabel (char *name, char *version, char *release,
|
|
|
|
int fileNumber, enum oldrpmdbFreeType freeType);
|
|
|
|
void oldrpmdbFreeLabelList (struct oldrpmdbLabel *list);
|
|
|
|
void oldrpmdbFreeLabel (struct oldrpmdbLabel label);
|
|
|
|
int oldrpmdbWasError (struct oldrpmdb *oldrpmdb);
|
1995-11-28 06:31:21 +08:00
|
|
|
|
1995-12-28 04:05:14 +08:00
|
|
|
int oldrpmdbLabelstrToLabel (char *str, int length, struct oldrpmdbLabel *label);
|
|
|
|
char *oldrpmdbLabelToLabelstr (struct oldrpmdbLabel label, int withFileNum);
|
|
|
|
int oldrpmdbLabelCmp (struct oldrpmdbLabel *one, struct oldrpmdbLabel *two);
|
1995-11-28 06:31:21 +08:00
|
|
|
|
1995-12-28 04:05:14 +08:00
|
|
|
void oldrpmdbSetPrefix (char *new);
|
1995-11-28 06:31:21 +08:00
|
|
|
|
1999-07-14 05:37:57 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1998-07-25 23:10:58 +08:00
|
|
|
#endif /* _H_OLDRPMDB */
|