summaryrefslogtreecommitdiffhomepage
path: root/ir/libcore/lc_opts_t.h
blob: 5733fc6da5b96f3ccc43b94decef7e529c9a6ddb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * This file is part of libFirm.
 * Copyright (C) 2012 IPD Goos, Universit"at Karlsruhe, Germany
 */



#ifndef _OPTS_T_H
#define _OPTS_T_H

#include <stdlib.h>

#include "lc_opts.h"
#include "list.h"

typedef struct {
	struct list_head opts;
	struct list_head grps;
} lc_grp_special_t;

typedef struct {
	lc_opt_type_t       type;
	lc_opt_callback_t  *cb;
	lc_opt_dump_t      *dump;
	lc_opt_dump_vals_t *dump_vals;
	void               *value;
	size_t              length;
	bool                is_set : 1;
} lc_opt_special_t;

struct lc_opt_entry_t {
	unsigned               hash;
	const char            *name;
	const char            *desc;
	struct lc_opt_entry_t *parent;
	bool                   is_grp : 1;
	struct list_head list;
	union {
		lc_grp_special_t grp;
		lc_opt_special_t opt;
	} v;
};

#define lc_get_opt_special(ent) (&(ent)->v.opt)
#define lc_get_grp_special(ent) (&(ent)->v.grp)

#endif