summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/package.h
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-11-20 10:10:23 +0100
committerAaron Griffin <aaron@archlinux.org>2006-11-20 10:10:23 +0100
commitaa1c0ba9f8787fc3b1a1190103e394b0c1c95922 (patch)
treeed0c9675f7fc5da043a69b36e0b8c6c8e05cb583 /lib/libalpm/package.h
parentb8b9596b13de957566211b0e1db3e473ed66e147 (diff)
downloadpacman-aa1c0ba9f8787fc3b1a1190103e394b0c1c95922.tar.gz
pacman-aa1c0ba9f8787fc3b1a1190103e394b0c1c95922.tar.xz
* repo-add script - to add entries to a db file directly from package data (no PKGBUILD)
* libalpm api changes - move from a _getinfo(p, WHAT_WE_WANT) scheme to a typesafe _get_what_we_want(p) scheme [not 100% complete yet] * some const correctness changes * removal of PM_* types in alpm.h in favor of the pm*_t types used throughout libalpm
Diffstat (limited to 'lib/libalpm/package.h')
-rw-r--r--lib/libalpm/package.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h
index d96f8d41..1b834cb8 100644
--- a/lib/libalpm/package.h
+++ b/lib/libalpm/package.h
@@ -28,13 +28,15 @@
#if defined(__APPLE__) || defined(__sun__)
#include <time.h>
#endif
-#include "list.h"
+
+#include "alpm.h"
enum {
PKG_FROM_CACHE = 1,
PKG_FROM_FILE
};
+/* Packages */
#define PKG_NAME_LEN 256
#define PKG_VERSION_LEN 64
#define PKG_FULLNAME_LEN (PKG_NAME_LEN-1)+1+(PKG_VERSION_LEN-1)+1
@@ -47,7 +49,7 @@ enum {
#define PKG_SHA1SUM_LEN 41
#define PKG_ARCH_LEN 32
-typedef struct __pmpkg_t {
+struct __pmpkg_t {
char name[PKG_NAME_LEN];
char version[PKG_VERSION_LEN];
char desc[PKG_DESC_LEN];
@@ -80,16 +82,9 @@ typedef struct __pmpkg_t {
unsigned char origin;
void *data;
unsigned char infolevel;
-} pmpkg_t;
-
-#define FREEPKG(p) \
-do { \
- if(p) { \
- _alpm_pkg_free(p); \
- p = NULL; \
- } \
-} while(0)
+};
+#define FREEPKG(p) do { if(p){_alpm_pkg_free(p); p = NULL;}} while(0)
#define FREELISTPKGS(p) _FREELIST(p, _alpm_pkg_free)
pmpkg_t* _alpm_pkg_new(const char *name, const char *version);
@@ -101,6 +96,7 @@ pmpkg_t *_alpm_pkg_isin(char *needle, pmlist_t *haystack);
char *_alpm_pkg_makefilename(pmpkg_t *pkg);
int _alpm_pkg_splitname(char *target, char *name, char *version, int witharch);
+
#endif /* _ALPM_PACKAGE_H */
/* vim: set ts=2 sw=2 noet: */