]> mj.ucw.cz Git - pciutils.git/blob - pciutils.h
6787ea800969791452f1dbdf23873abd2499d230
[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 #define PCIUTILS_VERSION PCILIB_VERSION
13
14 void die(char *msg, ...) NONRET;
15 void *xmalloc(unsigned int howmuch);
16 void *xrealloc(void *ptr, unsigned int howmuch);
17 int parse_generic_option(int i, struct pci_access *pacc, char *optarg);
18
19 #ifdef PCI_HAVE_PM_LINUX_PROC
20 #define GENOPT_PROC "P:"
21 #define GENHELP_PROC "-P <dir>\tUse specified directory instead of " PCI_PATH_PROC_BUS_PCI "\n"
22 #else
23 #define GENOPT_PROC
24 #define GENHELP_PROC
25 #endif
26 #ifdef PCI_HAVE_PM_INTEL_CONF
27 #define GENOPT_INTEL "H:"
28 #define GENHELP_INTEL "-H <mode>\tUse direct hardware access (<mode> = 1 or 2)\n"
29 #else
30 #define GENOPT_INTEL
31 #define GENHELP_INTEL
32 #endif
33 #ifdef PCI_HAVE_PM_DUMP
34 #define GENOPT_DUMP "F:"
35 #define GENHELP_DUMP "-F <file>\tRead configuration data from given file\n"
36 #else
37 #define GENOPT_DUMP
38 #define GENHELP_DUMP
39 #endif
40
41 #define GENERIC_OPTIONS "G" GENOPT_PROC GENOPT_INTEL GENOPT_DUMP
42 #define GENERIC_HELP GENHELP_PROC GENHELP_INTEL GENHELP_DUMP \
43         "-G\t\tEnable PCI access debugging\n"