| 1 |
/*
|
| 2 |
* Copyright 2005-2010 Gentoo Foundation
|
| 3 |
* Distributed under the terms of the GNU General Public License v2
|
| 4 |
* $Header: /var/cvsroot/gentoo-projects/portage-utils/applets.h,v 1.27 2011/02/21 01:33:47 vapier Exp $
|
| 5 |
*
|
| 6 |
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
|
| 7 |
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
|
| 8 |
*/
|
| 9 |
|
| 10 |
#ifndef _QAPPLETS_H_
|
| 11 |
#define _QAPPLETS_H_
|
| 12 |
|
| 13 |
/* applet prototypes */
|
| 14 |
typedef int (*APPLET)(int, char **);
|
| 15 |
|
| 16 |
#define DECLARE_APPLET(applet) \
|
| 17 |
extern int applet##_main(int, char **) __attribute__((weak));
|
| 18 |
DECLARE_APPLET(q)
|
| 19 |
DECLARE_APPLET(qcheck)
|
| 20 |
DECLARE_APPLET(qdepends)
|
| 21 |
DECLARE_APPLET(qfile)
|
| 22 |
DECLARE_APPLET(qlist)
|
| 23 |
DECLARE_APPLET(qlop)
|
| 24 |
DECLARE_APPLET(qsearch)
|
| 25 |
DECLARE_APPLET(qsize)
|
| 26 |
DECLARE_APPLET(qtbz2)
|
| 27 |
DECLARE_APPLET(quse)
|
| 28 |
DECLARE_APPLET(qxpak)
|
| 29 |
DECLARE_APPLET(qpkg)
|
| 30 |
DECLARE_APPLET(qgrep)
|
| 31 |
DECLARE_APPLET(qatom)
|
| 32 |
DECLARE_APPLET(qmerge)
|
| 33 |
DECLARE_APPLET(qcache)
|
| 34 |
DECLARE_APPLET(qglsa) /* disable */
|
| 35 |
#undef DECLARE_APPLET
|
| 36 |
|
| 37 |
#define DEFINE_APPLET_STUB(applet) \
|
| 38 |
int applet##_main(_q_unused_ int argc, _q_unused_ char **argv) { \
|
| 39 |
err("Sorry, this applet has been disabled"); \
|
| 40 |
}
|
| 41 |
|
| 42 |
static const struct applet_t {
|
| 43 |
const char *name;
|
| 44 |
APPLET func;
|
| 45 |
const char *opts;
|
| 46 |
const char *desc;
|
| 47 |
} applets[] = {
|
| 48 |
/* q must always be the first applet */
|
| 49 |
{"q", q_main, "<applet> <args>", "virtual applet"},
|
| 50 |
{"qatom", qatom_main, "<pkg>", "split atom strings"},
|
| 51 |
{"qcache", qcache_main, "<action> <args>", "search the metadata cache"},
|
| 52 |
{"qcheck", qcheck_main, "<pkgname>", "verify integrity of installed packages"},
|
| 53 |
{"qdepends", qdepends_main, "<pkgname>", "show dependency info"},
|
| 54 |
{"qfile", qfile_main, "<filename>", "list all pkgs owning files"},
|
| 55 |
{"qglsa", qglsa_main, "<action> <list>", "check GLSAs against system"},
|
| 56 |
{"qgrep", qgrep_main, "<misc args>", "grep in ebuilds"},
|
| 57 |
{"qlist", qlist_main, "<pkgname>", "list files owned by pkgname"},
|
| 58 |
{"qlop", qlop_main, "<pkgname>", "emerge log analyzer"},
|
| 59 |
{"qmerge", qmerge_main, "<pkgnames>", "fetch and merge binary package"},
|
| 60 |
{"qpkg", qpkg_main, "<misc args>", "manipulate Gentoo binpkgs"},
|
| 61 |
{"qsearch", qsearch_main, "<regex>", "search pkgname/desc"},
|
| 62 |
{"qsize", qsize_main, "<pkgname>", "calculate size usage"},
|
| 63 |
{"qtbz2", qtbz2_main, "<misc args>", "manipulate tbz2 packages"},
|
| 64 |
{"quse", quse_main, "<useflag>", "find pkgs using useflags"},
|
| 65 |
{"qxpak", qxpak_main, "<misc args>", "manipulate xpak archives"},
|
| 66 |
|
| 67 |
/* aliases for equery capatability */
|
| 68 |
{"belongs", qfile_main, NULL, NULL},
|
| 69 |
/*"changes"*/
|
| 70 |
{"check", qcheck_main, NULL, NULL},
|
| 71 |
{"depends", qdepends_main, NULL, NULL},
|
| 72 |
/*"depgraph"*/
|
| 73 |
{"files", qlist_main, NULL, NULL},
|
| 74 |
/*"glsa"*/
|
| 75 |
{"hasuse", quse_main, NULL, NULL},
|
| 76 |
/*"list"*/
|
| 77 |
{"size", qsize_main, NULL, NULL},
|
| 78 |
/*"stats"*/
|
| 79 |
/*"uses"*/
|
| 80 |
/*"which"*/
|
| 81 |
|
| 82 |
/* alias for quickpkg */
|
| 83 |
{"uickpkg", qpkg_main, NULL, NULL},
|
| 84 |
/* {"glsa", qglsa_main, NULL, NULL}, */
|
| 85 |
|
| 86 |
{NULL, NULL, NULL, NULL}
|
| 87 |
};
|
| 88 |
|
| 89 |
#endif
|