]> git.ipfire.org Git - thirdparty/pciutils.git/blob - pciutils.h
maint/README: git push --tags is done by push-to-public
[thirdparty/pciutils.git] / pciutils.h
1 /*
2 * The PCI Utilities -- Declarations
3 *
4 * Copyright (c) 1997--2018 Martin Mares <mj@ucw.cz>
5 *
6 * Can be freely distributed and used under the terms of the GNU GPL.
7 */
8
9 #include "lib/pci.h"
10 #include "lib/sysdep.h"
11
12 #ifdef PCI_OS_WINDOWS
13 #include "compat/getopt.h"
14 #else
15 #include <unistd.h>
16 #endif
17
18 #define PCIUTILS_VERSION PCILIB_VERSION
19
20 extern const char program_name[];
21
22 void die(char *msg, ...) NONRET PCI_PRINTF(1,2);
23 void *xmalloc(size_t howmuch);
24 void *xrealloc(void *ptr, size_t howmuch);
25 char *xstrdup(const char *str);
26 int parse_generic_option(int i, struct pci_access *pacc, char *arg);
27
28 #ifdef PCI_HAVE_PM_INTEL_CONF
29 #define GENOPT_INTEL "H:"
30 #define GENHELP_INTEL "-H <mode>\tUse direct hardware access (<mode> = 1 or 2)\n"
31 #else
32 #define GENOPT_INTEL
33 #define GENHELP_INTEL
34 #endif
35 #if defined(PCI_HAVE_PM_DUMP) && !defined(PCIUTILS_SETPCI)
36 #define GENOPT_DUMP "F:"
37 #define GENHELP_DUMP "-F <file>\tRead PCI configuration dump from a given file\n"
38 #else
39 #define GENOPT_DUMP
40 #define GENHELP_DUMP
41 #endif
42
43 #define GENERIC_OPTIONS "A:GO:" GENOPT_INTEL GENOPT_DUMP
44 #define GENERIC_HELP \
45 "-A <method>\tUse the specified PCI access method (see `-A help' for a list)\n" \
46 "-O <par>=<val>\tSet PCI access parameter (see `-O help' for a list)\n" \
47 "-G\t\tEnable PCI access debugging\n" \
48 GENHELP_INTEL GENHELP_DUMP