]> git.ipfire.org Git - thirdparty/pciutils.git/blob - pciutils.h
Introduced NONRET macro
[thirdparty/pciutils.git] / pciutils.h
1 /*
2 * Linux PCI Utilities -- Declarations
3 *
4 * Copyright (c) 1997--2003 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
11 #define PCIUTILS_VERSION PCILIB_VERSION
12
13 #if !defined(__GNUC__)
14 #define NONRET
15 #define inline
16 #else
17 #define NONRET __attribute__((noreturn))
18 #endif
19
20 void die(char *msg, ...) NONRET;
21 void *xmalloc(unsigned int howmuch);
22 int parse_generic_option(int i, struct pci_access *pacc, char *optarg);
23
24 #ifdef HAVE_PM_LINUX_PROC
25 #define GENOPT_PROC "P:"
26 #define GENHELP_PROC "-P <dir>\tUse specified directory instead of " PATH_PROC_BUS_PCI "\n"
27 #else
28 #define GENOPT_PROC
29 #define GENHELP_PROC
30 #endif
31 #ifdef HAVE_PM_INTEL_CONF
32 #define GENOPT_INTEL "H:"
33 #define GENHELP_INTEL "-H <mode>\tUse direct hardware access (<mode> = 1 or 2)\n"
34 #else
35 #define GENOPT_INTEL
36 #define GENHELP_INTEL
37 #endif
38 #ifdef HAVE_PM_SYSCALLS
39 #define GENOPT_SYSCALLS "S"
40 #define GENHELP_SYSCALLS "-S\t\tUse direct hardware access via syscalls\n"
41 #else
42 #define GENOPT_SYSCALLS
43 #define GENHELP_SYSCALLS
44 #endif
45 #ifdef HAVE_PM_DUMP
46 #define GENOPT_DUMP "F:"
47 #define GENHELP_DUMP "-F <file>\tRead configuration data from given file\n"
48 #else
49 #define GENOPT_DUMP
50 #define GENHELP_DUMP
51 #endif
52
53 #define GENERIC_OPTIONS "G" GENOPT_PROC GENOPT_INTEL GENOPT_SYSCALLS GENOPT_DUMP
54 #define GENERIC_HELP GENHELP_PROC GENHELP_INTEL GENHELP_SYSCALLS GENHELP_DUMP \
55 "-G\t\tEnable PCI access debugging\n"