bescripts: Remove unused features and stale uses of gone features.
[libfirm] / ir / libcore / lc_opts_t.h
1 /*
2   libcore: library for basic data structures and algorithms.
3   Copyright (C) 2005  IPD Goos, Universit"at Karlsruhe, Germany
4
5   This library is free software; you can redistribute it and/or
6   modify it under the terms of the GNU Lesser General Public
7   License as published by the Free Software Foundation; either
8   version 2.1 of the License, or (at your option) any later version.
9
10   This library is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13   Lesser General Public License for more details.
14
15   You should have received a copy of the GNU Lesser General Public
16   License along with this library; if not, write to the Free Software
17   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 */
19
20
21
22 #ifndef _OPTS_T_H
23 #define _OPTS_T_H
24
25 #include <stdlib.h>
26
27 #include "lc_opts.h"
28 #include "list.h"
29
30 typedef struct {
31         struct list_head opts;
32         struct list_head grps;
33 } lc_grp_special_t;
34
35 typedef struct {
36         lc_opt_type_t type;
37         lc_opt_callback_t *cb;
38         lc_opt_dump_t *dump;
39         lc_opt_dump_vals_t *dump_vals;
40         void *value;
41         size_t length;
42         unsigned is_set : 1;
43 } lc_opt_special_t;
44
45 struct lc_opt_entry_t {
46         unsigned hash;
47         const char *name;
48         const char *desc;
49         struct lc_opt_entry_t *parent;
50
51         unsigned is_grp : 1;
52
53         struct list_head list;
54
55         union {
56                 lc_grp_special_t grp;
57                 lc_opt_special_t opt;
58         } v;
59 };
60
61 #define lc_get_opt_special(ent) (&(ent)->v.opt)
62 #define lc_get_grp_special(ent) (&(ent)->v.grp)
63
64 int lc_opt_raise_error(const lc_opt_err_info_t *err,
65                                            lc_opt_error_handler_t *handler,
66                                            const char *fmt, ...);
67
68 #endif