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 | |
30 | G_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 | |
37 | JSC_API gboolean |
38 | jsc_options_set_boolean (const char *option, |
39 | gboolean value); |
40 | JSC_API gboolean |
41 | jsc_options_get_boolean (const char *option, |
42 | gboolean *value); |
43 | |
44 | JSC_API gboolean |
45 | jsc_options_set_int (const char *option, |
46 | gint value); |
47 | JSC_API gboolean |
48 | jsc_options_get_int (const char *option, |
49 | gint *value); |
50 | |
51 | JSC_API gboolean |
52 | jsc_options_set_uint (const char *option, |
53 | guint value); |
54 | JSC_API gboolean |
55 | jsc_options_get_uint (const char *option, |
56 | guint *value); |
57 | |
58 | JSC_API gboolean |
59 | jsc_options_set_size (const char *option, |
60 | gsize value); |
61 | JSC_API gboolean |
62 | jsc_options_get_size (const char *option, |
63 | gsize *value); |
64 | |
65 | JSC_API gboolean |
66 | jsc_options_set_double (const char *option, |
67 | gdouble value); |
68 | JSC_API gboolean |
69 | jsc_options_get_double (const char *option, |
70 | gdouble *value); |
71 | |
72 | JSC_API gboolean |
73 | jsc_options_set_string (const char *option, |
74 | const char *value); |
75 | JSC_API gboolean |
76 | jsc_options_get_string (const char *option, |
77 | char **value); |
78 | |
79 | JSC_API gboolean |
80 | jsc_options_set_range_string (const char *option, |
81 | const char *value); |
82 | JSC_API gboolean |
83 | jsc_options_get_range_string (const char *option, |
84 | char **value); |
85 | |
86 | typedef 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 | |
96 | typedef gboolean (* JSCOptionsFunc) (const char *option, |
97 | JSCOptionType type, |
98 | const char *description, |
99 | gpointer user_data); |
100 | |
101 | JSC_API void |
102 | jsc_options_foreach (JSCOptionsFunc function, |
103 | gpointer user_data); |
104 | |
105 | JSC_API GOptionGroup * |
106 | jsc_options_get_option_group (void); |
107 | |
108 | G_END_DECLS |
109 | |
110 | #endif /* JSCOptions_h */ |
111 | |