op_popt.h revision 10e23eebca4175a8dfe3a788b2bebacb1fcfce54
1/**
2 * @file op_popt.h
3 * Wrapper for libpopt - always use this rather
4 * than popt.h
5 *
6 * @remark Copyright 2002 OProfile authors
7 * @remark Read the file COPYING
8 *
9 * @author John Levon
10 * @author Philippe Elie
11 */
12
13#ifndef OP_POPT_H
14#define OP_POPT_H
15
16#include <popt.h>
17
18// not in some versions of popt.h
19#ifndef POPT_TABLEEND
20#define POPT_TABLEEND { NULL, '\0', 0, 0, 0, NULL, NULL }
21#endif
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/**
28 * op_poptGetContext - wrapper for popt
29 *
30 * Use this instead of poptGetContext to cope with
31 * different popt versions. This also handle unrecognized
32 * options. All error are fatal.
33 */
34poptContext op_poptGetContext(char const * name,
35                int argc, char const ** argv,
36                struct poptOption const * options, int flags);
37
38#ifdef __cplusplus
39}
40#endif
41
42#endif /* OP_POPT_H */
43