1
/* Editor Settings: expandtabs and use 4 spaces for indentation
2
* ex: set softtabstop=4 tabstop=8 expandtab shiftwidth=4: *
3
* -*- mode: c, c-basic-offset: 4 -*- */
6
* Copyright Likewise Software 2004-2008
9
* This library is free software; you can redistribute it and/or modify it
10
* under the terms of the GNU Lesser General Public License as published by
11
* the Free Software Foundation; either version 2.1 of the license, or (at
12
* your option) any later version.
14
* This library is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
17
* General Public License for more details. You should have received a copy
18
* of the GNU Lesser General Public License along with this program. If
19
* not, see <http://www.gnu.org/licenses/>.
21
* LIKEWISE SOFTWARE MAKES THIS SOFTWARE AVAILABLE UNDER OTHER LICENSING
22
* TERMS AS WELL. IF YOU HAVE ENTERED INTO A SEPARATE LICENSE AGREEMENT
23
* WITH LIKEWISE SOFTWARE, THEN YOU MAY ELECT TO USE THE SOFTWARE UNDER THE
24
* TERMS OF THAT SOFTWARE LICENSE AGREEMENT INSTEAD OF THE TERMS OF THE GNU
25
* LESSER GENERAL PUBLIC LICENSE, NOTWITHSTANDING THE ABOVE NOTICE. IF YOU
26
* HAVE QUESTIONS, OR WISH TO REQUEST A COPY OF THE ALTERNATE LICENSING
27
* TERMS OFFERED BY LIKEWISE SOFTWARE, PLEASE CONTACT LIKEWISE SOFTWARE AT
28
* license@likewisesoftware.com
54
perr_invalid_out_param = 2,
55
perr_unknown_type = 3,
56
perr_nullptr_passed = 4,
63
struct param_errstr_map {
69
struct param_errstr_map param_errstr_maps[] = {
70
{ perr_not_found, "parameter not found" },
71
{ perr_invalid_out_param, "invalid output parameter" },
72
{ perr_unknown_type, "unknown parameter type" },
73
{ perr_nullptr_passed, "null pointer passed" },
74
{ perr_success, "success" },
75
{ perr_unknown, "unknown error" }
78
const char *param_errstr(enum param_err perr);
81
#define perr_is_ok(perr_code) ((perr_code) == perr_success)
82
#define perr_fail(perr_code) { \
83
printf("Parameter error: %s\n", param_errstr(perr_code)); \
88
struct parameter* get_optional_params(char *opt, int *count);
89
const char* find_value(struct parameter *params, int count, const char *key);
90
enum param_err fetch_value(struct parameter *params, int count,
91
const char *key, enum param_type type, void *val,
94
void ParamInfo(const char* name, enum param_type type, void *value);
98
#endif /* _PARAMS_H_ */
105
indent-tabs-mode: nil