]> mj.ucw.cz Git - pciutils.git/blob - pciutils.h
Introduced API for selection of access methods.
[pciutils.git] / pciutils.h
1 /*
2  *      The PCI Utilities -- Declarations
3  *
4  *      Copyright (c) 1997--2004 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 #endif
15
16 #define PCIUTILS_VERSION PCILIB_VERSION
17
18 extern const char program_name[];
19
20 void die(char *msg, ...) NONRET;
21 void *xmalloc(unsigned int howmuch);
22 void *xrealloc(void *ptr, unsigned int howmuch);
23 int parse_generic_option(int i, struct pci_access *pacc, char *optarg);
24
25 #ifdef PCI_HAVE_PM_LINUX_PROC
26 #define GENOPT_PROC "P:"
27 #define GENHELP_PROC "-P <dir>\tUse specified directory instead of " PCI_PATH_PROC_BUS_PCI "\n"
28 #else
29 #define GENOPT_PROC
30 #define GENHELP_PROC
31 #endif
32 #ifdef PCI_HAVE_PM_INTEL_CONF
33 #define GENOPT_INTEL "H:"
34 #define GENHELP_INTEL "-H <mode>\tUse direct hardware access (<mode> = 1 or 2)\n"
35 #else
36 #define GENOPT_INTEL
37 #define GENHELP_INTEL
38 #endif
39 #ifdef PCI_HAVE_PM_DUMP
40 #define GENOPT_DUMP "F:"
41 #define GENHELP_DUMP "-F <file>\tRead configuration data from given file\n"
42 #else
43 #define GENOPT_DUMP
44 #define GENHELP_DUMP
45 #endif
46
47 #define GENERIC_OPTIONS "GO:" GENOPT_PROC GENOPT_INTEL GENOPT_DUMP
48 #define GENERIC_HELP GENHELP_PROC GENHELP_INTEL GENHELP_DUMP \
49         "-G\t\tEnable PCI access debugging\n" \
50         "-O <par>=<val>\tSet PCI access parameter (see `-O help' for the list)\n"