1/*
2 * Copyright (C) 2019 Igalia S.L.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#if !defined(__JSC_H_INSIDE__) && !defined(JSC_COMPILATION) && !defined(WEBKIT2_COMPILATION)
21#error "Only <jsc/jsc.h> can be included directly."
22#endif
23
24#ifndef JSCOptions_h
25#define JSCOptions_h
26
27#include <glib-object.h>
28#include <jsc/JSCDefines.h>
29
30G_BEGIN_DECLS
31
32#define JSC_OPTIONS_USE_JIT "useJIT"
33#define JSC_OPTIONS_USE_DFG "useDFGJIT"
34#define JSC_OPTIONS_USE_FTL "useFTLJIT"
35#define JSC_OPTIONS_USE_LLINT "useLLInt"
36
37JSC_API gboolean
38jsc_options_set_boolean (const char *option,
39 gboolean value);
40JSC_API gboolean
41jsc_options_get_boolean (const char *option,
42 gboolean *value);
43
44JSC_API gboolean
45jsc_options_set_int (const char *option,
46 gint value);
47JSC_API gboolean
48jsc_options_get_int (const char *option,
49 gint *value);
50
51JSC_API gboolean
52jsc_options_set_uint (const char *option,
53 guint value);
54JSC_API gboolean
55jsc_options_get_uint (const char *option,
56 guint *value);
57
58JSC_API gboolean
59jsc_options_set_size (const char *option,
60 gsize value);
61JSC_API gboolean
62jsc_options_get_size (const char *option,
63 gsize *value);
64
65JSC_API gboolean
66jsc_options_set_double (const char *option,
67 gdouble value);
68JSC_API gboolean
69jsc_options_get_double (const char *option,
70 gdouble *value);
71
72JSC_API gboolean
73jsc_options_set_string (const char *option,
74 const char *value);
75JSC_API gboolean
76jsc_options_get_string (const char *option,
77 char **value);
78
79JSC_API gboolean
80jsc_options_set_range_string (const char *option,
81 const char *value);
82JSC_API gboolean
83jsc_options_get_range_string (const char *option,
84 char **value);
85
86typedef enum {
87 JSC_OPTION_BOOLEAN,
88 JSC_OPTION_INT,
89 JSC_OPTION_UINT,
90 JSC_OPTION_SIZE,
91 JSC_OPTION_DOUBLE,
92 JSC_OPTION_STRING,
93 JSC_OPTION_RANGE_STRING
94} JSCOptionType;
95
96typedef gboolean (* JSCOptionsFunc) (const char *option,
97 JSCOptionType type,
98 const char *description,
99 gpointer user_data);
100
101JSC_API void
102jsc_options_foreach (JSCOptionsFunc function,
103 gpointer user_data);
104
105JSC_API GOptionGroup *
106jsc_options_get_option_group (void);
107
108G_END_DECLS
109
110#endif /* JSCOptions_h */
111