package.h

Go to the documentation of this file.
00001 /*
00002  *  package.h
00003  *
00004  *  Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
00005  *  Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
00006  *  Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
00007  *  Copyright (c) 2005, 2006 by Christian Hamar <krics@linuxforum.hu>
00008  *  Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
00009  *
00010  *  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public License
00021  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00022  */
00023 #ifndef _ALPM_PACKAGE_H
00024 #define _ALPM_PACKAGE_H
00025 
00026 #include <time.h>
00027 
00028 #include "alpm.h"
00029 #include "db.h"
00030 
00031 typedef enum _pmpkgfrom_t {
00032     PKG_FROM_CACHE = 1,
00033     PKG_FROM_FILE
00034 } pmpkgfrom_t;
00035 
00036 struct __pmpkg_t {
00037     char *filename;
00038     char *name;
00039     char *version;
00040     char *desc;
00041     char *url;
00042     time_t builddate;
00043     time_t installdate;
00044     char *packager;
00045     char *md5sum;
00046     char *arch;
00047     unsigned long size;
00048     unsigned long isize;
00049     unsigned short scriptlet;
00050     unsigned short force;
00051     pmpkgreason_t reason;
00052     alpm_list_t *licenses;
00053     alpm_list_t *replaces;
00054     alpm_list_t *groups;
00055     alpm_list_t *files;
00056     alpm_list_t *backup;
00057     alpm_list_t *depends;
00058     alpm_list_t *optdepends;
00059     alpm_list_t *conflicts;
00060     alpm_list_t *provides;
00061     alpm_list_t *deltas;
00062     /* internal */
00063     pmpkgfrom_t origin;
00064     /* Replaced 'void *data' with this union as follows:
00065   origin == PKG_FROM_CACHE, use pkg->origin_data.db
00066   origin == PKG_FROM_FILE, use pkg->origin_data.file
00067     */
00068   union {
00069         pmdb_t *db;
00070         char *file;
00071     } origin_data;
00072     pmdbinfrq_t infolevel;
00073 };
00074 
00075 int _alpm_versioncmp(const char *a, const char *b);
00076 pmpkg_t* _alpm_pkg_new(const char *name, const char *version);
00077 pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg);
00078 void _alpm_pkg_free(pmpkg_t *pkg);
00079 int _alpm_pkg_cmp(const void *p1, const void *p2);
00080 int _alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg);
00081 pmpkg_t *_alpm_pkg_load(const char *pkgfile, unsigned short full);
00082 pmpkg_t *_alpm_pkg_find(const char *needle, alpm_list_t *haystack);
00083 int _alpm_pkg_should_ignore(pmpkg_t *pkg);
00084 
00085 #endif /* _ALPM_PACKAGE_H */
00086 
00087 /* vim: set ts=2 sw=2 noet: */

Generated on Mon Jan 14 23:53:40 2008 for libalpm by  doxygen 1.5.4