amplitude-experiment 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/amplitude-experiment.gemspec +7 -6
  3. data/lib/amplitude-experiment.rb +16 -2
  4. data/lib/experiment/cohort/cohort.rb +25 -0
  5. data/lib/experiment/cohort/cohort_download_api.rb +90 -0
  6. data/lib/experiment/cohort/cohort_loader.rb +39 -0
  7. data/lib/experiment/cohort/cohort_storage.rb +91 -0
  8. data/lib/experiment/cohort/cohort_sync_config.rb +27 -0
  9. data/lib/experiment/deployment/deployment_runner.rb +135 -0
  10. data/lib/experiment/error.rb +23 -0
  11. data/lib/experiment/evaluation/evaluation.rb +311 -0
  12. data/lib/experiment/evaluation/flag.rb +123 -0
  13. data/lib/experiment/evaluation/murmur3.rb +104 -0
  14. data/lib/experiment/evaluation/select.rb +16 -0
  15. data/lib/experiment/evaluation/semantic_version.rb +52 -0
  16. data/lib/experiment/evaluation/topological_sort.rb +56 -0
  17. data/lib/experiment/{local/fetcher.rb → flag/flag_config_fetcher.rb} +7 -5
  18. data/lib/experiment/flag/flag_config_storage.rb +53 -0
  19. data/lib/experiment/local/client.rb +68 -29
  20. data/lib/experiment/local/config.rb +26 -2
  21. data/lib/experiment/persistent_http_client.rb +1 -1
  22. data/lib/experiment/remote/client.rb +8 -6
  23. data/lib/experiment/remote/config.rb +8 -1
  24. data/lib/experiment/user.rb +40 -20
  25. data/lib/experiment/util/flag_config.rb +60 -0
  26. data/lib/experiment/util/poller.rb +24 -0
  27. data/lib/experiment/util/user.rb +20 -12
  28. data/lib/experiment/version.rb +1 -1
  29. metadata +44 -25
  30. data/lib/experiment/local/evaluation/evaluation.rb +0 -76
  31. data/lib/experiment/local/evaluation/lib/linuxArm64/libevaluation_interop.so +0 -0
  32. data/lib/experiment/local/evaluation/lib/linuxArm64/libevaluation_interop_api.h +0 -110
  33. data/lib/experiment/local/evaluation/lib/linuxX64/libevaluation_interop.so +0 -0
  34. data/lib/experiment/local/evaluation/lib/linuxX64/libevaluation_interop_api.h +0 -110
  35. data/lib/experiment/local/evaluation/lib/macosArm64/libevaluation_interop.dylib +0 -0
  36. data/lib/experiment/local/evaluation/lib/macosArm64/libevaluation_interop_api.h +0 -110
  37. data/lib/experiment/local/evaluation/lib/macosX64/libevaluation_interop.dylib +0 -0
  38. data/lib/experiment/local/evaluation/lib/macosX64/libevaluation_interop_api.h +0 -110
  39. data/lib/experiment/util/topological_sort.rb +0 -39
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amplitude-experiment
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amplitude
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-29 00:00:00.000000000 Z
11
+ date: 2025-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -17,7 +17,7 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.2.2
20
- type: :development
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: '6.4'
61
+ version: '6.10'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: '6.4'
68
+ version: '6.10'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: '1.21'
89
+ version: 1.22.3
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: '1.21'
96
+ version: 1.22.3
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -137,19 +137,33 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0.9'
139
139
  - !ruby/object:Gem::Dependency
140
- name: ffi
140
+ name: dotenv
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '1.15'
146
- type: :runtime
145
+ version: 2.8.1
146
+ type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '1.15'
152
+ version: 2.8.1
153
+ - !ruby/object:Gem::Dependency
154
+ name: jar-dependencies
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '='
158
+ - !ruby/object:Gem::Version
159
+ version: 0.4.1
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - '='
165
+ - !ruby/object:Gem::Version
166
+ version: 0.4.1
153
167
  description: Amplitude Experiment Ruby Server SDK
154
168
  email:
155
169
  - sdk@amplitude.com
@@ -175,32 +189,37 @@ files:
175
189
  - lib/amplitude/timeline.rb
176
190
  - lib/amplitude/utils.rb
177
191
  - lib/amplitude/workers.rb
192
+ - lib/experiment/cohort/cohort.rb
193
+ - lib/experiment/cohort/cohort_download_api.rb
194
+ - lib/experiment/cohort/cohort_loader.rb
195
+ - lib/experiment/cohort/cohort_storage.rb
196
+ - lib/experiment/cohort/cohort_sync_config.rb
178
197
  - lib/experiment/cookie.rb
198
+ - lib/experiment/deployment/deployment_runner.rb
179
199
  - lib/experiment/error.rb
200
+ - lib/experiment/evaluation/evaluation.rb
201
+ - lib/experiment/evaluation/flag.rb
202
+ - lib/experiment/evaluation/murmur3.rb
203
+ - lib/experiment/evaluation/select.rb
204
+ - lib/experiment/evaluation/semantic_version.rb
205
+ - lib/experiment/evaluation/topological_sort.rb
180
206
  - lib/experiment/factory.rb
207
+ - lib/experiment/flag/flag_config_fetcher.rb
208
+ - lib/experiment/flag/flag_config_storage.rb
181
209
  - lib/experiment/local/assignment/assignment.rb
182
210
  - lib/experiment/local/assignment/assignment_config.rb
183
211
  - lib/experiment/local/assignment/assignment_filter.rb
184
212
  - lib/experiment/local/assignment/assignment_service.rb
185
213
  - lib/experiment/local/client.rb
186
214
  - lib/experiment/local/config.rb
187
- - lib/experiment/local/evaluation/evaluation.rb
188
- - lib/experiment/local/evaluation/lib/linuxArm64/libevaluation_interop.so
189
- - lib/experiment/local/evaluation/lib/linuxArm64/libevaluation_interop_api.h
190
- - lib/experiment/local/evaluation/lib/linuxX64/libevaluation_interop.so
191
- - lib/experiment/local/evaluation/lib/linuxX64/libevaluation_interop_api.h
192
- - lib/experiment/local/evaluation/lib/macosArm64/libevaluation_interop.dylib
193
- - lib/experiment/local/evaluation/lib/macosArm64/libevaluation_interop_api.h
194
- - lib/experiment/local/evaluation/lib/macosX64/libevaluation_interop.dylib
195
- - lib/experiment/local/evaluation/lib/macosX64/libevaluation_interop_api.h
196
- - lib/experiment/local/fetcher.rb
197
215
  - lib/experiment/persistent_http_client.rb
198
216
  - lib/experiment/remote/client.rb
199
217
  - lib/experiment/remote/config.rb
200
218
  - lib/experiment/user.rb
219
+ - lib/experiment/util/flag_config.rb
201
220
  - lib/experiment/util/hash.rb
202
221
  - lib/experiment/util/lru_cache.rb
203
- - lib/experiment/util/topological_sort.rb
222
+ - lib/experiment/util/poller.rb
204
223
  - lib/experiment/util/user.rb
205
224
  - lib/experiment/util/variant.rb
206
225
  - lib/experiment/variant.rb
@@ -210,7 +229,7 @@ licenses:
210
229
  - MIT
211
230
  metadata:
212
231
  rubygems_mfa_required: 'false'
213
- post_install_message:
232
+ post_install_message:
214
233
  rdoc_options: []
215
234
  require_paths:
216
235
  - lib
@@ -226,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
245
  version: '0'
227
246
  requirements: []
228
247
  rubygems_version: 3.1.6
229
- signing_key:
248
+ signing_key:
230
249
  specification_version: 4
231
250
  summary: Amplitude Experiment Ruby Server SDK
232
251
  test_files: []
@@ -1,76 +0,0 @@
1
- # rubocop:disable all
2
- require 'ffi'
3
- require 'json'
4
-
5
- # The evaluation wrapper
6
- module EvaluationInterop
7
- extend FFI::Library
8
- host_os = RbConfig::CONFIG['host_os']
9
- cpu = RbConfig::CONFIG['host_cpu']
10
- evaluation_dir = File.dirname(__FILE__)
11
- ffi_lib ["#{evaluation_dir}/lib/macosX64/libevaluation_interop.dylib"] if host_os =~ /darwin|mac os/ && cpu =~ /x86_64/
12
- ffi_lib ["#{evaluation_dir}/lib/macosArm64/libevaluation_interop.dylib"] if host_os =~ /darwin|mac os/ && cpu =~ /arm64/
13
- ffi_lib ["#{evaluation_dir}/lib/linuxX64/libevaluation_interop.so"] if host_os =~ /linux/ && cpu =~ /x86_64/
14
- ffi_lib ["#{evaluation_dir}/lib/linuxArm64/libevaluation_interop.so"] if host_os =~ /linux/ && cpu =~ /arm64|aarch64/
15
-
16
- class Root < FFI::Struct
17
- layout :evaluate, callback([:string, :string], :pointer)
18
- end
19
-
20
- class Kotlin < FFI::Struct
21
- layout :root, Root
22
- end
23
-
24
- class Libevaluation_interop_ExportedSymbols < FFI::Struct
25
- layout :DisposeStablePointer, callback([:pointer], :void),
26
- :DisposeString, callback([:pointer], :void),
27
- :IsInstance, callback([:pointer, :string], :pointer),
28
- :createNullableByte, callback([:string], :pointer),
29
- :getNonNullValueOfByte, callback([:pointer], :pointer),
30
- :createNullableShort, callback([:pointer], :pointer),
31
- :getNonNullValueOfShort, callback([:pointer], :pointer),
32
- :createNullableInt, callback([:pointer], :pointer),
33
- :getNonNullValueOfInt, callback([:pointer], :pointer),
34
- :createNullableLong, callback([:pointer], :pointer),
35
- :getNonNullValueOfLong, callback([:pointer], :pointer),
36
- :createNullableFloat, callback([:pointer], :pointer),
37
- :getNonNullValueOfFloat, callback([:pointer], :pointer),
38
- :createNullableDouble, callback([:pointer], :pointer),
39
- :getNonNullValueOfDouble, callback([:pointer], :pointer),
40
- :createNullableChar, callback([:pointer], :pointer),
41
- :getNonNullValueOfChar, callback([:pointer], :pointer),
42
- :createNullableBoolean, callback([:pointer], :pointer),
43
- :getNonNullValueOfBoolean, callback([:pointer], :pointer),
44
- :createNullableUnit, callback([], :pointer),
45
- :createNullableUByte, callback([:pointer], :pointer),
46
- :getNonNullValueOfUByte, callback([:pointer], :pointer),
47
- :createNullableUShort, callback([:pointer], :pointer),
48
- :getNonNullValueOfUShort, callback([:pointer], :pointer),
49
- :createNullableUInt, callback([:pointer], :pointer),
50
- :getNonNullValueOfUInt, callback([:pointer], :pointer),
51
- :createNullableULong, callback([:pointer], :pointer),
52
- :getNonNullValueOfULong, callback([:pointer], :pointer),
53
-
54
- :kotlin, Kotlin
55
- end
56
-
57
- attach_function :libevaluation_interop_symbols, [], Libevaluation_interop_ExportedSymbols.by_ref
58
- end
59
-
60
- def evaluation(rule_json, context_json)
61
- lib = EvaluationInterop.libevaluation_interop_symbols()
62
- evaluate = lib[:kotlin][:root][:evaluate]
63
- dispose = lib[:DisposeString]
64
- result_raw = evaluate.call(rule_json, context_json)
65
- result_json = result_raw.read_string
66
- result = JSON.parse(result_json)
67
- dispose.call(result_raw)
68
-
69
- if result["error"] != nil
70
- raise "#{result["error"]}"
71
- elsif result["result"] == nil
72
- raise "Evaluation result is nil."
73
- end
74
- result["result"]
75
- end
76
- # rubocop:disable all
@@ -1,110 +0,0 @@
1
- #ifndef KONAN_LIBEVALUATION_INTEROP_H
2
- #define KONAN_LIBEVALUATION_INTEROP_H
3
- #ifdef __cplusplus
4
- extern "C" {
5
- #endif
6
- #ifdef __cplusplus
7
- typedef bool libevaluation_interop_KBoolean;
8
- #else
9
- typedef _Bool libevaluation_interop_KBoolean;
10
- #endif
11
- typedef unsigned short libevaluation_interop_KChar;
12
- typedef signed char libevaluation_interop_KByte;
13
- typedef short libevaluation_interop_KShort;
14
- typedef int libevaluation_interop_KInt;
15
- typedef long long libevaluation_interop_KLong;
16
- typedef unsigned char libevaluation_interop_KUByte;
17
- typedef unsigned short libevaluation_interop_KUShort;
18
- typedef unsigned int libevaluation_interop_KUInt;
19
- typedef unsigned long long libevaluation_interop_KULong;
20
- typedef float libevaluation_interop_KFloat;
21
- typedef double libevaluation_interop_KDouble;
22
- typedef float __attribute__ ((__vector_size__ (16))) libevaluation_interop_KVector128;
23
- typedef void* libevaluation_interop_KNativePtr;
24
- struct libevaluation_interop_KType;
25
- typedef struct libevaluation_interop_KType libevaluation_interop_KType;
26
-
27
- typedef struct {
28
- libevaluation_interop_KNativePtr pinned;
29
- } libevaluation_interop_kref_kotlin_Byte;
30
- typedef struct {
31
- libevaluation_interop_KNativePtr pinned;
32
- } libevaluation_interop_kref_kotlin_Short;
33
- typedef struct {
34
- libevaluation_interop_KNativePtr pinned;
35
- } libevaluation_interop_kref_kotlin_Int;
36
- typedef struct {
37
- libevaluation_interop_KNativePtr pinned;
38
- } libevaluation_interop_kref_kotlin_Long;
39
- typedef struct {
40
- libevaluation_interop_KNativePtr pinned;
41
- } libevaluation_interop_kref_kotlin_Float;
42
- typedef struct {
43
- libevaluation_interop_KNativePtr pinned;
44
- } libevaluation_interop_kref_kotlin_Double;
45
- typedef struct {
46
- libevaluation_interop_KNativePtr pinned;
47
- } libevaluation_interop_kref_kotlin_Char;
48
- typedef struct {
49
- libevaluation_interop_KNativePtr pinned;
50
- } libevaluation_interop_kref_kotlin_Boolean;
51
- typedef struct {
52
- libevaluation_interop_KNativePtr pinned;
53
- } libevaluation_interop_kref_kotlin_Unit;
54
- typedef struct {
55
- libevaluation_interop_KNativePtr pinned;
56
- } libevaluation_interop_kref_kotlin_UByte;
57
- typedef struct {
58
- libevaluation_interop_KNativePtr pinned;
59
- } libevaluation_interop_kref_kotlin_UShort;
60
- typedef struct {
61
- libevaluation_interop_KNativePtr pinned;
62
- } libevaluation_interop_kref_kotlin_UInt;
63
- typedef struct {
64
- libevaluation_interop_KNativePtr pinned;
65
- } libevaluation_interop_kref_kotlin_ULong;
66
-
67
-
68
- typedef struct {
69
- /* Service functions. */
70
- void (*DisposeStablePointer)(libevaluation_interop_KNativePtr ptr);
71
- void (*DisposeString)(const char* string);
72
- libevaluation_interop_KBoolean (*IsInstance)(libevaluation_interop_KNativePtr ref, const libevaluation_interop_KType* type);
73
- libevaluation_interop_kref_kotlin_Byte (*createNullableByte)(libevaluation_interop_KByte);
74
- libevaluation_interop_KByte (*getNonNullValueOfByte)(libevaluation_interop_kref_kotlin_Byte);
75
- libevaluation_interop_kref_kotlin_Short (*createNullableShort)(libevaluation_interop_KShort);
76
- libevaluation_interop_KShort (*getNonNullValueOfShort)(libevaluation_interop_kref_kotlin_Short);
77
- libevaluation_interop_kref_kotlin_Int (*createNullableInt)(libevaluation_interop_KInt);
78
- libevaluation_interop_KInt (*getNonNullValueOfInt)(libevaluation_interop_kref_kotlin_Int);
79
- libevaluation_interop_kref_kotlin_Long (*createNullableLong)(libevaluation_interop_KLong);
80
- libevaluation_interop_KLong (*getNonNullValueOfLong)(libevaluation_interop_kref_kotlin_Long);
81
- libevaluation_interop_kref_kotlin_Float (*createNullableFloat)(libevaluation_interop_KFloat);
82
- libevaluation_interop_KFloat (*getNonNullValueOfFloat)(libevaluation_interop_kref_kotlin_Float);
83
- libevaluation_interop_kref_kotlin_Double (*createNullableDouble)(libevaluation_interop_KDouble);
84
- libevaluation_interop_KDouble (*getNonNullValueOfDouble)(libevaluation_interop_kref_kotlin_Double);
85
- libevaluation_interop_kref_kotlin_Char (*createNullableChar)(libevaluation_interop_KChar);
86
- libevaluation_interop_KChar (*getNonNullValueOfChar)(libevaluation_interop_kref_kotlin_Char);
87
- libevaluation_interop_kref_kotlin_Boolean (*createNullableBoolean)(libevaluation_interop_KBoolean);
88
- libevaluation_interop_KBoolean (*getNonNullValueOfBoolean)(libevaluation_interop_kref_kotlin_Boolean);
89
- libevaluation_interop_kref_kotlin_Unit (*createNullableUnit)(void);
90
- libevaluation_interop_kref_kotlin_UByte (*createNullableUByte)(libevaluation_interop_KUByte);
91
- libevaluation_interop_KUByte (*getNonNullValueOfUByte)(libevaluation_interop_kref_kotlin_UByte);
92
- libevaluation_interop_kref_kotlin_UShort (*createNullableUShort)(libevaluation_interop_KUShort);
93
- libevaluation_interop_KUShort (*getNonNullValueOfUShort)(libevaluation_interop_kref_kotlin_UShort);
94
- libevaluation_interop_kref_kotlin_UInt (*createNullableUInt)(libevaluation_interop_KUInt);
95
- libevaluation_interop_KUInt (*getNonNullValueOfUInt)(libevaluation_interop_kref_kotlin_UInt);
96
- libevaluation_interop_kref_kotlin_ULong (*createNullableULong)(libevaluation_interop_KULong);
97
- libevaluation_interop_KULong (*getNonNullValueOfULong)(libevaluation_interop_kref_kotlin_ULong);
98
-
99
- /* User functions. */
100
- struct {
101
- struct {
102
- const char* (*evaluate)(const char* flags, const char* context);
103
- } root;
104
- } kotlin;
105
- } libevaluation_interop_ExportedSymbols;
106
- extern libevaluation_interop_ExportedSymbols* libevaluation_interop_symbols(void);
107
- #ifdef __cplusplus
108
- } /* extern "C" */
109
- #endif
110
- #endif /* KONAN_LIBEVALUATION_INTEROP_H */
@@ -1,110 +0,0 @@
1
- #ifndef KONAN_LIBEVALUATION_INTEROP_H
2
- #define KONAN_LIBEVALUATION_INTEROP_H
3
- #ifdef __cplusplus
4
- extern "C" {
5
- #endif
6
- #ifdef __cplusplus
7
- typedef bool libevaluation_interop_KBoolean;
8
- #else
9
- typedef _Bool libevaluation_interop_KBoolean;
10
- #endif
11
- typedef unsigned short libevaluation_interop_KChar;
12
- typedef signed char libevaluation_interop_KByte;
13
- typedef short libevaluation_interop_KShort;
14
- typedef int libevaluation_interop_KInt;
15
- typedef long long libevaluation_interop_KLong;
16
- typedef unsigned char libevaluation_interop_KUByte;
17
- typedef unsigned short libevaluation_interop_KUShort;
18
- typedef unsigned int libevaluation_interop_KUInt;
19
- typedef unsigned long long libevaluation_interop_KULong;
20
- typedef float libevaluation_interop_KFloat;
21
- typedef double libevaluation_interop_KDouble;
22
- typedef float __attribute__ ((__vector_size__ (16))) libevaluation_interop_KVector128;
23
- typedef void* libevaluation_interop_KNativePtr;
24
- struct libevaluation_interop_KType;
25
- typedef struct libevaluation_interop_KType libevaluation_interop_KType;
26
-
27
- typedef struct {
28
- libevaluation_interop_KNativePtr pinned;
29
- } libevaluation_interop_kref_kotlin_Byte;
30
- typedef struct {
31
- libevaluation_interop_KNativePtr pinned;
32
- } libevaluation_interop_kref_kotlin_Short;
33
- typedef struct {
34
- libevaluation_interop_KNativePtr pinned;
35
- } libevaluation_interop_kref_kotlin_Int;
36
- typedef struct {
37
- libevaluation_interop_KNativePtr pinned;
38
- } libevaluation_interop_kref_kotlin_Long;
39
- typedef struct {
40
- libevaluation_interop_KNativePtr pinned;
41
- } libevaluation_interop_kref_kotlin_Float;
42
- typedef struct {
43
- libevaluation_interop_KNativePtr pinned;
44
- } libevaluation_interop_kref_kotlin_Double;
45
- typedef struct {
46
- libevaluation_interop_KNativePtr pinned;
47
- } libevaluation_interop_kref_kotlin_Char;
48
- typedef struct {
49
- libevaluation_interop_KNativePtr pinned;
50
- } libevaluation_interop_kref_kotlin_Boolean;
51
- typedef struct {
52
- libevaluation_interop_KNativePtr pinned;
53
- } libevaluation_interop_kref_kotlin_Unit;
54
- typedef struct {
55
- libevaluation_interop_KNativePtr pinned;
56
- } libevaluation_interop_kref_kotlin_UByte;
57
- typedef struct {
58
- libevaluation_interop_KNativePtr pinned;
59
- } libevaluation_interop_kref_kotlin_UShort;
60
- typedef struct {
61
- libevaluation_interop_KNativePtr pinned;
62
- } libevaluation_interop_kref_kotlin_UInt;
63
- typedef struct {
64
- libevaluation_interop_KNativePtr pinned;
65
- } libevaluation_interop_kref_kotlin_ULong;
66
-
67
-
68
- typedef struct {
69
- /* Service functions. */
70
- void (*DisposeStablePointer)(libevaluation_interop_KNativePtr ptr);
71
- void (*DisposeString)(const char* string);
72
- libevaluation_interop_KBoolean (*IsInstance)(libevaluation_interop_KNativePtr ref, const libevaluation_interop_KType* type);
73
- libevaluation_interop_kref_kotlin_Byte (*createNullableByte)(libevaluation_interop_KByte);
74
- libevaluation_interop_KByte (*getNonNullValueOfByte)(libevaluation_interop_kref_kotlin_Byte);
75
- libevaluation_interop_kref_kotlin_Short (*createNullableShort)(libevaluation_interop_KShort);
76
- libevaluation_interop_KShort (*getNonNullValueOfShort)(libevaluation_interop_kref_kotlin_Short);
77
- libevaluation_interop_kref_kotlin_Int (*createNullableInt)(libevaluation_interop_KInt);
78
- libevaluation_interop_KInt (*getNonNullValueOfInt)(libevaluation_interop_kref_kotlin_Int);
79
- libevaluation_interop_kref_kotlin_Long (*createNullableLong)(libevaluation_interop_KLong);
80
- libevaluation_interop_KLong (*getNonNullValueOfLong)(libevaluation_interop_kref_kotlin_Long);
81
- libevaluation_interop_kref_kotlin_Float (*createNullableFloat)(libevaluation_interop_KFloat);
82
- libevaluation_interop_KFloat (*getNonNullValueOfFloat)(libevaluation_interop_kref_kotlin_Float);
83
- libevaluation_interop_kref_kotlin_Double (*createNullableDouble)(libevaluation_interop_KDouble);
84
- libevaluation_interop_KDouble (*getNonNullValueOfDouble)(libevaluation_interop_kref_kotlin_Double);
85
- libevaluation_interop_kref_kotlin_Char (*createNullableChar)(libevaluation_interop_KChar);
86
- libevaluation_interop_KChar (*getNonNullValueOfChar)(libevaluation_interop_kref_kotlin_Char);
87
- libevaluation_interop_kref_kotlin_Boolean (*createNullableBoolean)(libevaluation_interop_KBoolean);
88
- libevaluation_interop_KBoolean (*getNonNullValueOfBoolean)(libevaluation_interop_kref_kotlin_Boolean);
89
- libevaluation_interop_kref_kotlin_Unit (*createNullableUnit)(void);
90
- libevaluation_interop_kref_kotlin_UByte (*createNullableUByte)(libevaluation_interop_KUByte);
91
- libevaluation_interop_KUByte (*getNonNullValueOfUByte)(libevaluation_interop_kref_kotlin_UByte);
92
- libevaluation_interop_kref_kotlin_UShort (*createNullableUShort)(libevaluation_interop_KUShort);
93
- libevaluation_interop_KUShort (*getNonNullValueOfUShort)(libevaluation_interop_kref_kotlin_UShort);
94
- libevaluation_interop_kref_kotlin_UInt (*createNullableUInt)(libevaluation_interop_KUInt);
95
- libevaluation_interop_KUInt (*getNonNullValueOfUInt)(libevaluation_interop_kref_kotlin_UInt);
96
- libevaluation_interop_kref_kotlin_ULong (*createNullableULong)(libevaluation_interop_KULong);
97
- libevaluation_interop_KULong (*getNonNullValueOfULong)(libevaluation_interop_kref_kotlin_ULong);
98
-
99
- /* User functions. */
100
- struct {
101
- struct {
102
- const char* (*evaluate)(const char* flags, const char* context);
103
- } root;
104
- } kotlin;
105
- } libevaluation_interop_ExportedSymbols;
106
- extern libevaluation_interop_ExportedSymbols* libevaluation_interop_symbols(void);
107
- #ifdef __cplusplus
108
- } /* extern "C" */
109
- #endif
110
- #endif /* KONAN_LIBEVALUATION_INTEROP_H */
@@ -1,110 +0,0 @@
1
- #ifndef KONAN_LIBEVALUATION_INTEROP_H
2
- #define KONAN_LIBEVALUATION_INTEROP_H
3
- #ifdef __cplusplus
4
- extern "C" {
5
- #endif
6
- #ifdef __cplusplus
7
- typedef bool libevaluation_interop_KBoolean;
8
- #else
9
- typedef _Bool libevaluation_interop_KBoolean;
10
- #endif
11
- typedef unsigned short libevaluation_interop_KChar;
12
- typedef signed char libevaluation_interop_KByte;
13
- typedef short libevaluation_interop_KShort;
14
- typedef int libevaluation_interop_KInt;
15
- typedef long long libevaluation_interop_KLong;
16
- typedef unsigned char libevaluation_interop_KUByte;
17
- typedef unsigned short libevaluation_interop_KUShort;
18
- typedef unsigned int libevaluation_interop_KUInt;
19
- typedef unsigned long long libevaluation_interop_KULong;
20
- typedef float libevaluation_interop_KFloat;
21
- typedef double libevaluation_interop_KDouble;
22
- typedef float __attribute__ ((__vector_size__ (16))) libevaluation_interop_KVector128;
23
- typedef void* libevaluation_interop_KNativePtr;
24
- struct libevaluation_interop_KType;
25
- typedef struct libevaluation_interop_KType libevaluation_interop_KType;
26
-
27
- typedef struct {
28
- libevaluation_interop_KNativePtr pinned;
29
- } libevaluation_interop_kref_kotlin_Byte;
30
- typedef struct {
31
- libevaluation_interop_KNativePtr pinned;
32
- } libevaluation_interop_kref_kotlin_Short;
33
- typedef struct {
34
- libevaluation_interop_KNativePtr pinned;
35
- } libevaluation_interop_kref_kotlin_Int;
36
- typedef struct {
37
- libevaluation_interop_KNativePtr pinned;
38
- } libevaluation_interop_kref_kotlin_Long;
39
- typedef struct {
40
- libevaluation_interop_KNativePtr pinned;
41
- } libevaluation_interop_kref_kotlin_Float;
42
- typedef struct {
43
- libevaluation_interop_KNativePtr pinned;
44
- } libevaluation_interop_kref_kotlin_Double;
45
- typedef struct {
46
- libevaluation_interop_KNativePtr pinned;
47
- } libevaluation_interop_kref_kotlin_Char;
48
- typedef struct {
49
- libevaluation_interop_KNativePtr pinned;
50
- } libevaluation_interop_kref_kotlin_Boolean;
51
- typedef struct {
52
- libevaluation_interop_KNativePtr pinned;
53
- } libevaluation_interop_kref_kotlin_Unit;
54
- typedef struct {
55
- libevaluation_interop_KNativePtr pinned;
56
- } libevaluation_interop_kref_kotlin_UByte;
57
- typedef struct {
58
- libevaluation_interop_KNativePtr pinned;
59
- } libevaluation_interop_kref_kotlin_UShort;
60
- typedef struct {
61
- libevaluation_interop_KNativePtr pinned;
62
- } libevaluation_interop_kref_kotlin_UInt;
63
- typedef struct {
64
- libevaluation_interop_KNativePtr pinned;
65
- } libevaluation_interop_kref_kotlin_ULong;
66
-
67
-
68
- typedef struct {
69
- /* Service functions. */
70
- void (*DisposeStablePointer)(libevaluation_interop_KNativePtr ptr);
71
- void (*DisposeString)(const char* string);
72
- libevaluation_interop_KBoolean (*IsInstance)(libevaluation_interop_KNativePtr ref, const libevaluation_interop_KType* type);
73
- libevaluation_interop_kref_kotlin_Byte (*createNullableByte)(libevaluation_interop_KByte);
74
- libevaluation_interop_KByte (*getNonNullValueOfByte)(libevaluation_interop_kref_kotlin_Byte);
75
- libevaluation_interop_kref_kotlin_Short (*createNullableShort)(libevaluation_interop_KShort);
76
- libevaluation_interop_KShort (*getNonNullValueOfShort)(libevaluation_interop_kref_kotlin_Short);
77
- libevaluation_interop_kref_kotlin_Int (*createNullableInt)(libevaluation_interop_KInt);
78
- libevaluation_interop_KInt (*getNonNullValueOfInt)(libevaluation_interop_kref_kotlin_Int);
79
- libevaluation_interop_kref_kotlin_Long (*createNullableLong)(libevaluation_interop_KLong);
80
- libevaluation_interop_KLong (*getNonNullValueOfLong)(libevaluation_interop_kref_kotlin_Long);
81
- libevaluation_interop_kref_kotlin_Float (*createNullableFloat)(libevaluation_interop_KFloat);
82
- libevaluation_interop_KFloat (*getNonNullValueOfFloat)(libevaluation_interop_kref_kotlin_Float);
83
- libevaluation_interop_kref_kotlin_Double (*createNullableDouble)(libevaluation_interop_KDouble);
84
- libevaluation_interop_KDouble (*getNonNullValueOfDouble)(libevaluation_interop_kref_kotlin_Double);
85
- libevaluation_interop_kref_kotlin_Char (*createNullableChar)(libevaluation_interop_KChar);
86
- libevaluation_interop_KChar (*getNonNullValueOfChar)(libevaluation_interop_kref_kotlin_Char);
87
- libevaluation_interop_kref_kotlin_Boolean (*createNullableBoolean)(libevaluation_interop_KBoolean);
88
- libevaluation_interop_KBoolean (*getNonNullValueOfBoolean)(libevaluation_interop_kref_kotlin_Boolean);
89
- libevaluation_interop_kref_kotlin_Unit (*createNullableUnit)(void);
90
- libevaluation_interop_kref_kotlin_UByte (*createNullableUByte)(libevaluation_interop_KUByte);
91
- libevaluation_interop_KUByte (*getNonNullValueOfUByte)(libevaluation_interop_kref_kotlin_UByte);
92
- libevaluation_interop_kref_kotlin_UShort (*createNullableUShort)(libevaluation_interop_KUShort);
93
- libevaluation_interop_KUShort (*getNonNullValueOfUShort)(libevaluation_interop_kref_kotlin_UShort);
94
- libevaluation_interop_kref_kotlin_UInt (*createNullableUInt)(libevaluation_interop_KUInt);
95
- libevaluation_interop_KUInt (*getNonNullValueOfUInt)(libevaluation_interop_kref_kotlin_UInt);
96
- libevaluation_interop_kref_kotlin_ULong (*createNullableULong)(libevaluation_interop_KULong);
97
- libevaluation_interop_KULong (*getNonNullValueOfULong)(libevaluation_interop_kref_kotlin_ULong);
98
-
99
- /* User functions. */
100
- struct {
101
- struct {
102
- const char* (*evaluate)(const char* flags, const char* context);
103
- } root;
104
- } kotlin;
105
- } libevaluation_interop_ExportedSymbols;
106
- extern libevaluation_interop_ExportedSymbols* libevaluation_interop_symbols(void);
107
- #ifdef __cplusplus
108
- } /* extern "C" */
109
- #endif
110
- #endif /* KONAN_LIBEVALUATION_INTEROP_H */