]> git.ipfire.org Git - thirdparty/pciutils.git/blame - pciutils.h
Released as 3.5.5
[thirdparty/pciutils.git] / pciutils.h
CommitLineData
98e39e09 1/*
4284af58 2 * The PCI Utilities -- Declarations
98e39e09 3 *
a0407443 4 * Copyright (c) 1997--2008 Martin Mares <mj@ucw.cz>
98e39e09
MM
5 *
6 * Can be freely distributed and used under the terms of the GNU GPL.
7 */
8
727ce158 9#include "lib/pci.h"
489233b4 10#include "lib/sysdep.h"
98e39e09 11
ee7d8384
MM
12#ifdef PCI_OS_WINDOWS
13#include "compat/getopt.h"
a30f0839
MM
14#else
15#include <unistd.h>
ee7d8384
MM
16#endif
17
727ce158 18#define PCIUTILS_VERSION PCILIB_VERSION
98e39e09 19
81afa98c
MM
20extern const char program_name[];
21
4f6b38ca 22void die(char *msg, ...) NONRET PCI_PRINTF(1,2);
727ce158 23void *xmalloc(unsigned int howmuch);
ec25b52d 24void *xrealloc(void *ptr, unsigned int howmuch);
d3f768e2 25char *xstrdup(char *str);
727ce158 26int parse_generic_option(int i, struct pci_access *pacc, char *optarg);
e4842ff3 27
489233b4 28#ifdef PCI_HAVE_PM_INTEL_CONF
727ce158
MM
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
1b99a704 35#if defined(PCI_HAVE_PM_DUMP) && !defined(PCIUTILS_SETPCI)
727ce158 36#define GENOPT_DUMP "F:"
1b99a704 37#define GENHELP_DUMP "-F <file>\tRead PCI configuration dump from a given file\n"
727ce158
MM
38#else
39#define GENOPT_DUMP
40#define GENHELP_DUMP
41#endif
e4842ff3 42
f2b31663 43#define GENERIC_OPTIONS "A:GO:" GENOPT_INTEL GENOPT_DUMP
1b99a704 44#define GENERIC_HELP \
a0407443 45 "-A <method>\tUse the specified PCI access method (see `-A help' for a list)\n" \
1b99a704 46 "-O <par>=<val>\tSet PCI access parameter (see `-O help' for a list)\n" \
553d12c8 47 "-G\t\tEnable PCI access debugging\n" \
1b99a704 48 GENHELP_INTEL GENHELP_DUMP