refactored optionsfrom as in an object-oriented way using the options_t class. Elimin...
[strongswan.git] / src / libstrongswan / utils / optionsfrom.h
1 /**
2 * @file optionsfrom.h
3 *
4 * @brief Read command line options from a file
5 *
6 */
7
8 /*
9 * Copyright (C) 2007-2008 Andreas Steffen
10 *
11 * Hochschule fuer Technik Rapperswil
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
22 *
23 * RCSID $Id$
24 */
25
26 #ifndef OPTIONSFROM_H_
27 #define OPTIONSFROM_H_
28
29 typedef struct options_t options_t;
30
31 /**
32 * @brief options object.
33 *
34 * @b Constructors:
35 * - options_create()
36 *
37 * @ingroup utils
38 */
39 struct options_t {
40 /**
41 * @brief Check if the PKCS#7 contentType is data
42 *
43 * @param this calling object
44 * @param filename file containing the options
45 * @param argcp pointer to argc
46 * @param argvp pointer to argv[]
47 * @param optind current optind, number of next argument
48 * @return TRUE if optionsfrom parsing successful
49 */
50 bool (*from) (options_t * this, char *filename, int *argcp, char **argvp[], int optind);
51
52 /**
53 * @brief Destroys the options_t object.
54 *
55 * @param this options_t object to destroy
56 */
57 void (*destroy) (options_t *this);
58 };
59
60 /**
61 * @brief Create an options object.
62 *
63 * @return created options_t object
64 *
65 * @ingroup utils
66 */
67 options_t *options_create(void);
68
69 #endif /*OPTIONSFROM_H_*/