Upstream | cc2ee17 | 1970-01-12 13:46:40 +0000 | [diff] [blame] | 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 |
| 24 | extern "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 | */ |
| 34 | poptContext 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 */ |