4 * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
5 * Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
6 * Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
7 * Copyright (c) 2005, 2006 by Christian Hamar <krics@linuxforum.hu>
8 * Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
25 #ifndef _ALPM_PACKAGE_H
26 #define _ALPM_PACKAGE_H
28 #if defined(__APPLE__) || defined(__sun__)
35 typedef enum _pmpkgfrom_t
{
41 #define PKG_FILENAME_LEN 512
42 #define PKG_NAME_LEN 256
43 #define PKG_VERSION_LEN 64
44 #define PKG_FULLNAME_LEN (PKG_NAME_LEN + PKG_VERSION_LEN)
45 #define PKG_DESC_LEN 512
46 #define PKG_URL_LEN 256
47 #define PKG_DATE_LEN 32
48 #define PKG_TYPE_LEN 32
49 #define PKG_PACKAGER_LEN 64
50 #define PKG_MD5SUM_LEN 33
51 #define PKG_SHA1SUM_LEN 41
52 #define PKG_ARCH_LEN 32
55 char filename
[PKG_FILENAME_LEN
];
56 char name
[PKG_NAME_LEN
];
57 char version
[PKG_VERSION_LEN
];
58 char desc
[PKG_DESC_LEN
];
59 char url
[PKG_URL_LEN
];
60 char builddate
[PKG_DATE_LEN
];
61 char buildtype
[PKG_TYPE_LEN
];
62 char installdate
[PKG_DATE_LEN
];
63 char packager
[PKG_PACKAGER_LEN
];
64 char md5sum
[PKG_MD5SUM_LEN
];
65 char sha1sum
[PKG_SHA1SUM_LEN
];
66 char arch
[PKG_ARCH_LEN
];
69 unsigned short scriptlet
;
73 /* alpm_list_t *desc_localized;*/
74 alpm_list_t
*licenses
;
75 alpm_list_t
*replaces
;
81 alpm_list_t
*requiredby
;
82 alpm_list_t
*conflicts
;
83 alpm_list_t
*provides
;
87 /* TODO replace 'data' with this:
88 origin == PKG_FROM_CACHE, use pkg->origin_data.db
89 origin == PKG_FROM_FILE, use pkg->origin_data.fd
95 pmdbinfrq_t infolevel
;
98 #define FREEPKG(p) do { if(p){_alpm_pkg_free(p); p = NULL;}} while(0)
99 #define FREELISTPKGS(p) _FREELIST(p, _alpm_pkg_free)
101 pmpkg_t
* _alpm_pkg_new(const char *name
, const char *version
);
102 pmpkg_t
*_alpm_pkg_dup(pmpkg_t
*pkg
);
103 void _alpm_pkg_free(void *data
);
104 int _alpm_pkg_cmp(const void *p1
, const void *p2
);
105 int alpm_pkg_compare_versions(pmpkg_t
*local_pkg
, pmpkg_t
*pkg
);
106 pmpkg_t
*_alpm_pkg_load(const char *pkgfile
);
107 pmpkg_t
*_alpm_pkg_find(const char *needle
, alpm_list_t
*haystack
);
108 int _alpm_pkg_splitname(const char *target
, char *name
, char *version
, int witharch
);
109 int _alpm_pkg_istoonew(pmpkg_t
*pkg
);
110 void _alpm_pkg_update_requiredby(pmpkg_t
*pkg
);
112 #endif /* _ALPM_PACKAGE_H */
114 /* vim: set ts=2 sw=2 noet: */