forked from dart-lang/native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathffigen.yaml
161 lines (154 loc) · 4.52 KB
/
ffigen.yaml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Run with `dart run ffigen --config ffigen.yaml`.
name: JniBindings
description: |
Bindings for libdartjni.so which is part of jni plugin.
It also transitively includes type definitions such as JNIEnv from third_party/jni.h;
However, functions prefixed JNI_ are not usable because they are in a different shared library.
Regenerate bindings with `flutter pub run ffigen.dart --config ffigen.yaml`.
output: 'lib/src/third_party/jni_bindings_generated.dart'
headers:
entry-points:
- 'src/dartjni.h' # Exports majority of JNI functions
- 'src/third_party/global_jni_env.h' # Exports GlobalJniEnv type
- 'src/jni_constants.h'
include-directives:
- 'src/dartjni.h'
- 'src/third_party/global_jni_env.h'
- 'third_party/jni.h' # jni.h from Android NDK
- 'src/jni_constants.h'
compiler-opts:
- '-Ithird_party/'
enums:
rename:
'JniType': 'JniCallType'
'jobjectRefType': 'JObjectRefType'
functions:
exclude:
# Exclude init functions supposed to be defined in loaded DLL, not JNI
- 'JNI_.*'
- 'GetJniContextPtr'
- 'setJniGetters'
- 'jni_log'
# Exclude functions with VarArgs, jnigen will generate them based on the
# exact arguments needed.
- 'globalEnv_NewObject'
- 'globalEnv_Call(Static|Nonvirtual|)[A-Z][a-z]+Method'
# Inline functions
# keep-sorted start
- 'acquire_lock'
- 'attach_thread'
- 'check_exception'
- 'destroy_cond'
- 'destroy_lock'
- 'init_cond'
- 'init_lock'
- 'load_class'
- 'load_class_global_ref'
- 'load_class_local_ref'
- 'load_class_platform'
- 'load_env'
- 'load_field'
- 'load_method'
- 'load_static_field'
- 'load_static_method'
- 'release_lock'
- 'signal_cond'
- 'thread_id'
- 'to_global_ref'
- 'to_global_ref_result'
- 'wait_for'
# keep-sorted end
structs:
exclude:
- 'JniContext'
- 'JniLocks'
- 'JNIEnv'
- '_JNIEnv'
- 'JNIInvokeInterface'
- '__va_list_tag'
- 'CallbackResult'
rename:
## opaque struct definitions, base types of jfieldID and jmethodID
'_jfieldID': 'jfieldID_'
'_jmethodID':
'jmethodID_'
#'JNI(.*)': 'Jni$1'
unions:
rename:
'jvalue': 'JValue'
globals:
exclude:
- 'jni'
- 'jniEnv'
- 'context_getter'
- 'env_getter'
typedefs:
exclude:
- 'va_list'
- '__builtin_va_list'
rename:
'JNI(.*)': 'Jni$1'
# Primitives
'jbyte': 'JByteMarker'
'jboolean': 'JBooleanMarker'
'jchar': 'JCharMarker'
'jshort': 'JShortMarker'
'jint': 'JIntMarker'
'jlong': 'JLongMarker'
'jfloat': 'JFloatMarker'
'jdouble': 'JDoubleMarker'
'jsize': 'JSizeMarker'
'jclass': 'JClassPtr'
'jobject': 'JObjectPtr'
'jmethodID': 'JMethodIDPtr'
'jfieldID': 'JFieldIDPtr'
'jthrowable': 'JThrowablePtr'
'jstring': 'JStringPtr'
'jarray': 'JArrayPtr'
'jobjectArray': 'JObjectArrayPtr'
'jbooleanArray': 'JBooleanArrayPtr'
'jbyteArray': 'JByteArrayPtr'
'jcharArray': 'JCharArrayPtr'
'jshortArray': 'JShortArrayPtr'
'jintArray': 'JIntArrayPtr'
'jlongArray': 'JLongArrayPtr'
'jfloatArray': 'JFloatArrayPtr'
'jdoubleArray': 'JDoubleArrayPtr'
'jweak': 'JWeakPtr'
'jvalue': 'JValue'
preamble: |
// Autogenerated file. Do not edit.
// Generated from an annotated version of jni.h provided in Android NDK.
// (NDK Version 23.1.7779620)
// The license for original file is provided below:
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* JNI specification, as defined by Sun:
* http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/jniTOC.html
*
* Everything here is expected to be VM-neutral.
*/
// ignore_for_file: always_specify_types
// ignore_for_file: camel_case_types
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: constant_identifier_names
// ignore_for_file: unused_field
// ignore_for_file: unused_element
// coverage:ignore-file
comments:
style: any
length: full