diff --git a/CHANGELOG.md b/CHANGELOG.md index be98e9ad..e8e031cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,39 @@ +# 4.0.0-dev.0 +- Added support for generating typedefs (_referred_ typedefs only). + + + + + + + + + +
Example C CodeGenerated Dart typedef
+ +```C++ +typedef struct A{ + ... +} TA, *PA; + +TA func(PA ptr); +``` + + +```dart +class A extends ffi.Struct {...} +typedef TA = A; +typedef PA = ffi.Pointer; +TA func(PA ptr){...} +``` +
+ +- All declarations that are excluded by the user are now only included if being +used somewhere. +- Improved struct/union include/exclude. These declarations can now be targetted +by their actual name, or if they are unnamed then by the name of the first +typedef that refers to them. + # 3.1.0-dev.1 - Users can now specify exact path to dynamic library in `llvm-path`. diff --git a/README.md b/README.md index 10911df5..25d0d8d8 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,9 @@ class NativeLibrary { return _sum(a, b); } - late final _sum_ptr = _lookup>('sum'); - late final _dart_sum _sum = _sum_ptr.asFunction<_dart_sum>(); + late final _sum_ptr = _lookup>('sum'); + late final _sum = _sum_ptr.asFunction(); } -typedef _c_sum = Int32 Function(Int32 a, Int32 b); -typedef _dart_sum = int Function(int a, int b); ``` ## Using this package - Add `ffigen` under `dev_dependencies` in your `pubspec.yaml`. @@ -233,6 +231,27 @@ globals: # Removes '_' from # beginning of a name. '_(.*)': '$1' +``` + + + + typedefs + Filters for referred typedefs.

+ Options -
+ - Include/Exclude (referred typedefs only).
+ - Rename typedefs.

+ Note: Typedefs that are not referred to anywhere will not be generated. + + + +```yaml +typedefs: + exclude: + # Typedefs starting with `p` are not generated. + - 'p.*' + rename: + # Removes '_' from beginning of a typedef. + '_(.*)': '$1' ``` @@ -511,3 +530,16 @@ functions: - 'myFunc' - '.*' # Do this to expose all pointers. ``` + +### How are Structs/Unions/Enums that are reffered to via typedefs handled? + +Named declarations use their own names even when inside another typedef. +However, unnamed declarations inside typedefs take the name of the _first_ typedef +that refers to them. + +### Why are some typedefs not generated? + +The following typedefs are not generated - +- They are not referred to anywhere in the included declarations. +- They refer to a struct/union having the same name as itself. +- They refer to a boolean, enum, inline array, Handle or any unsupported type. diff --git a/example/c_json/cjson_generated_bindings.dart b/example/c_json/cjson_generated_bindings.dart index 2b9d0a8a..d0fb894d 100644 --- a/example/c_json/cjson_generated_bindings.dart +++ b/example/c_json/cjson_generated_bindings.dart @@ -43,9 +43,10 @@ class CJson { } late final _cJSON_Version_ptr = - _lookup>('cJSON_Version'); - late final _dart_cJSON_Version _cJSON_Version = - _cJSON_Version_ptr.asFunction<_dart_cJSON_Version>(); + _lookup Function()>>( + 'cJSON_Version'); + late final _cJSON_Version = + _cJSON_Version_ptr.asFunction Function()>(); void cJSON_InitHooks( ffi.Pointer hooks, @@ -56,9 +57,10 @@ class CJson { } late final _cJSON_InitHooks_ptr = - _lookup>('cJSON_InitHooks'); - late final _dart_cJSON_InitHooks _cJSON_InitHooks = - _cJSON_InitHooks_ptr.asFunction<_dart_cJSON_InitHooks>(); + _lookup)>>( + 'cJSON_InitHooks'); + late final _cJSON_InitHooks = _cJSON_InitHooks_ptr + .asFunction)>(); ffi.Pointer cJSON_Parse( ffi.Pointer value, @@ -68,10 +70,11 @@ class CJson { ); } - late final _cJSON_Parse_ptr = - _lookup>('cJSON_Parse'); - late final _dart_cJSON_Parse _cJSON_Parse = - _cJSON_Parse_ptr.asFunction<_dart_cJSON_Parse>(); + late final _cJSON_Parse_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Parse'); + late final _cJSON_Parse = _cJSON_Parse_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_ParseWithOpts( ffi.Pointer value, @@ -85,11 +88,15 @@ class CJson { ); } - late final _cJSON_ParseWithOpts_ptr = - _lookup>( - 'cJSON_ParseWithOpts'); - late final _dart_cJSON_ParseWithOpts _cJSON_ParseWithOpts = - _cJSON_ParseWithOpts_ptr.asFunction<_dart_cJSON_ParseWithOpts>(); + late final _cJSON_ParseWithOpts_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer>, + cJSON_bool)>>('cJSON_ParseWithOpts'); + late final _cJSON_ParseWithOpts = _cJSON_ParseWithOpts_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer>, int)>(); ffi.Pointer cJSON_Print( ffi.Pointer item, @@ -99,10 +106,11 @@ class CJson { ); } - late final _cJSON_Print_ptr = - _lookup>('cJSON_Print'); - late final _dart_cJSON_Print _cJSON_Print = - _cJSON_Print_ptr.asFunction<_dart_cJSON_Print>(); + late final _cJSON_Print_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Print'); + late final _cJSON_Print = _cJSON_Print_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_PrintUnformatted( ffi.Pointer item, @@ -112,11 +120,12 @@ class CJson { ); } - late final _cJSON_PrintUnformatted_ptr = - _lookup>( - 'cJSON_PrintUnformatted'); - late final _dart_cJSON_PrintUnformatted _cJSON_PrintUnformatted = - _cJSON_PrintUnformatted_ptr.asFunction<_dart_cJSON_PrintUnformatted>(); + late final _cJSON_PrintUnformatted_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_PrintUnformatted'); + late final _cJSON_PrintUnformatted = _cJSON_PrintUnformatted_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_PrintBuffered( ffi.Pointer item, @@ -130,11 +139,12 @@ class CJson { ); } - late final _cJSON_PrintBuffered_ptr = - _lookup>( - 'cJSON_PrintBuffered'); - late final _dart_cJSON_PrintBuffered _cJSON_PrintBuffered = - _cJSON_PrintBuffered_ptr.asFunction<_dart_cJSON_PrintBuffered>(); + late final _cJSON_PrintBuffered_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Int32, + cJSON_bool)>>('cJSON_PrintBuffered'); + late final _cJSON_PrintBuffered = _cJSON_PrintBuffered_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int, int)>(); int cJSON_PrintPreallocated( ffi.Pointer item, @@ -150,11 +160,12 @@ class CJson { ); } - late final _cJSON_PrintPreallocated_ptr = - _lookup>( - 'cJSON_PrintPreallocated'); - late final _dart_cJSON_PrintPreallocated _cJSON_PrintPreallocated = - _cJSON_PrintPreallocated_ptr.asFunction<_dart_cJSON_PrintPreallocated>(); + late final _cJSON_PrintPreallocated_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, cJSON_bool)>>('cJSON_PrintPreallocated'); + late final _cJSON_PrintPreallocated = _cJSON_PrintPreallocated_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, int)>(); void cJSON_Delete( ffi.Pointer item, @@ -165,9 +176,10 @@ class CJson { } late final _cJSON_Delete_ptr = - _lookup>('cJSON_Delete'); - late final _dart_cJSON_Delete _cJSON_Delete = - _cJSON_Delete_ptr.asFunction<_dart_cJSON_Delete>(); + _lookup)>>( + 'cJSON_Delete'); + late final _cJSON_Delete = + _cJSON_Delete_ptr.asFunction)>(); int cJSON_GetArraySize( ffi.Pointer array, @@ -178,9 +190,10 @@ class CJson { } late final _cJSON_GetArraySize_ptr = - _lookup>('cJSON_GetArraySize'); - late final _dart_cJSON_GetArraySize _cJSON_GetArraySize = - _cJSON_GetArraySize_ptr.asFunction<_dart_cJSON_GetArraySize>(); + _lookup)>>( + 'cJSON_GetArraySize'); + late final _cJSON_GetArraySize = + _cJSON_GetArraySize_ptr.asFunction)>(); ffi.Pointer cJSON_GetArrayItem( ffi.Pointer array, @@ -192,10 +205,12 @@ class CJson { ); } - late final _cJSON_GetArrayItem_ptr = - _lookup>('cJSON_GetArrayItem'); - late final _dart_cJSON_GetArrayItem _cJSON_GetArrayItem = - _cJSON_GetArrayItem_ptr.asFunction<_dart_cJSON_GetArrayItem>(); + late final _cJSON_GetArrayItem_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_GetArrayItem'); + late final _cJSON_GetArrayItem = _cJSON_GetArrayItem_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_GetObjectItem( ffi.Pointer object, @@ -207,11 +222,12 @@ class CJson { ); } - late final _cJSON_GetObjectItem_ptr = - _lookup>( - 'cJSON_GetObjectItem'); - late final _dart_cJSON_GetObjectItem _cJSON_GetObjectItem = - _cJSON_GetObjectItem_ptr.asFunction<_dart_cJSON_GetObjectItem>(); + late final _cJSON_GetObjectItem_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_GetObjectItem'); + late final _cJSON_GetObjectItem = _cJSON_GetObjectItem_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_GetObjectItemCaseSensitive( ffi.Pointer object, @@ -223,12 +239,14 @@ class CJson { ); } - late final _cJSON_GetObjectItemCaseSensitive_ptr = - _lookup>( - 'cJSON_GetObjectItemCaseSensitive'); - late final _dart_cJSON_GetObjectItemCaseSensitive - _cJSON_GetObjectItemCaseSensitive = _cJSON_GetObjectItemCaseSensitive_ptr - .asFunction<_dart_cJSON_GetObjectItemCaseSensitive>(); + late final _cJSON_GetObjectItemCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_GetObjectItemCaseSensitive'); + late final _cJSON_GetObjectItemCaseSensitive = + _cJSON_GetObjectItemCaseSensitive_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); int cJSON_HasObjectItem( ffi.Pointer object, @@ -240,20 +258,22 @@ class CJson { ); } - late final _cJSON_HasObjectItem_ptr = - _lookup>( - 'cJSON_HasObjectItem'); - late final _dart_cJSON_HasObjectItem _cJSON_HasObjectItem = - _cJSON_HasObjectItem_ptr.asFunction<_dart_cJSON_HasObjectItem>(); + late final _cJSON_HasObjectItem_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_HasObjectItem'); + late final _cJSON_HasObjectItem = _cJSON_HasObjectItem_ptr + .asFunction, ffi.Pointer)>(); ffi.Pointer cJSON_GetErrorPtr() { return _cJSON_GetErrorPtr(); } late final _cJSON_GetErrorPtr_ptr = - _lookup>('cJSON_GetErrorPtr'); - late final _dart_cJSON_GetErrorPtr _cJSON_GetErrorPtr = - _cJSON_GetErrorPtr_ptr.asFunction<_dart_cJSON_GetErrorPtr>(); + _lookup Function()>>( + 'cJSON_GetErrorPtr'); + late final _cJSON_GetErrorPtr = + _cJSON_GetErrorPtr_ptr.asFunction Function()>(); ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, @@ -263,11 +283,12 @@ class CJson { ); } - late final _cJSON_GetStringValue_ptr = - _lookup>( - 'cJSON_GetStringValue'); - late final _dart_cJSON_GetStringValue _cJSON_GetStringValue = - _cJSON_GetStringValue_ptr.asFunction<_dart_cJSON_GetStringValue>(); + late final _cJSON_GetStringValue_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_GetStringValue'); + late final _cJSON_GetStringValue = _cJSON_GetStringValue_ptr + .asFunction Function(ffi.Pointer)>(); int cJSON_IsInvalid( ffi.Pointer item, @@ -278,9 +299,10 @@ class CJson { } late final _cJSON_IsInvalid_ptr = - _lookup>('cJSON_IsInvalid'); - late final _dart_cJSON_IsInvalid _cJSON_IsInvalid = - _cJSON_IsInvalid_ptr.asFunction<_dart_cJSON_IsInvalid>(); + _lookup)>>( + 'cJSON_IsInvalid'); + late final _cJSON_IsInvalid = + _cJSON_IsInvalid_ptr.asFunction)>(); int cJSON_IsFalse( ffi.Pointer item, @@ -291,9 +313,10 @@ class CJson { } late final _cJSON_IsFalse_ptr = - _lookup>('cJSON_IsFalse'); - late final _dart_cJSON_IsFalse _cJSON_IsFalse = - _cJSON_IsFalse_ptr.asFunction<_dart_cJSON_IsFalse>(); + _lookup)>>( + 'cJSON_IsFalse'); + late final _cJSON_IsFalse = + _cJSON_IsFalse_ptr.asFunction)>(); int cJSON_IsTrue( ffi.Pointer item, @@ -304,9 +327,10 @@ class CJson { } late final _cJSON_IsTrue_ptr = - _lookup>('cJSON_IsTrue'); - late final _dart_cJSON_IsTrue _cJSON_IsTrue = - _cJSON_IsTrue_ptr.asFunction<_dart_cJSON_IsTrue>(); + _lookup)>>( + 'cJSON_IsTrue'); + late final _cJSON_IsTrue = + _cJSON_IsTrue_ptr.asFunction)>(); int cJSON_IsBool( ffi.Pointer item, @@ -317,9 +341,10 @@ class CJson { } late final _cJSON_IsBool_ptr = - _lookup>('cJSON_IsBool'); - late final _dart_cJSON_IsBool _cJSON_IsBool = - _cJSON_IsBool_ptr.asFunction<_dart_cJSON_IsBool>(); + _lookup)>>( + 'cJSON_IsBool'); + late final _cJSON_IsBool = + _cJSON_IsBool_ptr.asFunction)>(); int cJSON_IsNull( ffi.Pointer item, @@ -330,9 +355,10 @@ class CJson { } late final _cJSON_IsNull_ptr = - _lookup>('cJSON_IsNull'); - late final _dart_cJSON_IsNull _cJSON_IsNull = - _cJSON_IsNull_ptr.asFunction<_dart_cJSON_IsNull>(); + _lookup)>>( + 'cJSON_IsNull'); + late final _cJSON_IsNull = + _cJSON_IsNull_ptr.asFunction)>(); int cJSON_IsNumber( ffi.Pointer item, @@ -343,9 +369,10 @@ class CJson { } late final _cJSON_IsNumber_ptr = - _lookup>('cJSON_IsNumber'); - late final _dart_cJSON_IsNumber _cJSON_IsNumber = - _cJSON_IsNumber_ptr.asFunction<_dart_cJSON_IsNumber>(); + _lookup)>>( + 'cJSON_IsNumber'); + late final _cJSON_IsNumber = + _cJSON_IsNumber_ptr.asFunction)>(); int cJSON_IsString( ffi.Pointer item, @@ -356,9 +383,10 @@ class CJson { } late final _cJSON_IsString_ptr = - _lookup>('cJSON_IsString'); - late final _dart_cJSON_IsString _cJSON_IsString = - _cJSON_IsString_ptr.asFunction<_dart_cJSON_IsString>(); + _lookup)>>( + 'cJSON_IsString'); + late final _cJSON_IsString = + _cJSON_IsString_ptr.asFunction)>(); int cJSON_IsArray( ffi.Pointer item, @@ -369,9 +397,10 @@ class CJson { } late final _cJSON_IsArray_ptr = - _lookup>('cJSON_IsArray'); - late final _dart_cJSON_IsArray _cJSON_IsArray = - _cJSON_IsArray_ptr.asFunction<_dart_cJSON_IsArray>(); + _lookup)>>( + 'cJSON_IsArray'); + late final _cJSON_IsArray = + _cJSON_IsArray_ptr.asFunction)>(); int cJSON_IsObject( ffi.Pointer item, @@ -382,9 +411,10 @@ class CJson { } late final _cJSON_IsObject_ptr = - _lookup>('cJSON_IsObject'); - late final _dart_cJSON_IsObject _cJSON_IsObject = - _cJSON_IsObject_ptr.asFunction<_dart_cJSON_IsObject>(); + _lookup)>>( + 'cJSON_IsObject'); + late final _cJSON_IsObject = + _cJSON_IsObject_ptr.asFunction)>(); int cJSON_IsRaw( ffi.Pointer item, @@ -395,36 +425,40 @@ class CJson { } late final _cJSON_IsRaw_ptr = - _lookup>('cJSON_IsRaw'); - late final _dart_cJSON_IsRaw _cJSON_IsRaw = - _cJSON_IsRaw_ptr.asFunction<_dart_cJSON_IsRaw>(); + _lookup)>>( + 'cJSON_IsRaw'); + late final _cJSON_IsRaw = + _cJSON_IsRaw_ptr.asFunction)>(); ffi.Pointer cJSON_CreateNull() { return _cJSON_CreateNull(); } late final _cJSON_CreateNull_ptr = - _lookup>('cJSON_CreateNull'); - late final _dart_cJSON_CreateNull _cJSON_CreateNull = - _cJSON_CreateNull_ptr.asFunction<_dart_cJSON_CreateNull>(); + _lookup Function()>>( + 'cJSON_CreateNull'); + late final _cJSON_CreateNull = + _cJSON_CreateNull_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateTrue() { return _cJSON_CreateTrue(); } late final _cJSON_CreateTrue_ptr = - _lookup>('cJSON_CreateTrue'); - late final _dart_cJSON_CreateTrue _cJSON_CreateTrue = - _cJSON_CreateTrue_ptr.asFunction<_dart_cJSON_CreateTrue>(); + _lookup Function()>>( + 'cJSON_CreateTrue'); + late final _cJSON_CreateTrue = + _cJSON_CreateTrue_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateFalse() { return _cJSON_CreateFalse(); } late final _cJSON_CreateFalse_ptr = - _lookup>('cJSON_CreateFalse'); - late final _dart_cJSON_CreateFalse _cJSON_CreateFalse = - _cJSON_CreateFalse_ptr.asFunction<_dart_cJSON_CreateFalse>(); + _lookup Function()>>( + 'cJSON_CreateFalse'); + late final _cJSON_CreateFalse = + _cJSON_CreateFalse_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateBool( int boolean, @@ -435,9 +469,10 @@ class CJson { } late final _cJSON_CreateBool_ptr = - _lookup>('cJSON_CreateBool'); - late final _dart_cJSON_CreateBool _cJSON_CreateBool = - _cJSON_CreateBool_ptr.asFunction<_dart_cJSON_CreateBool>(); + _lookup Function(cJSON_bool)>>( + 'cJSON_CreateBool'); + late final _cJSON_CreateBool = + _cJSON_CreateBool_ptr.asFunction Function(int)>(); ffi.Pointer cJSON_CreateNumber( double num, @@ -448,9 +483,10 @@ class CJson { } late final _cJSON_CreateNumber_ptr = - _lookup>('cJSON_CreateNumber'); - late final _dart_cJSON_CreateNumber _cJSON_CreateNumber = - _cJSON_CreateNumber_ptr.asFunction<_dart_cJSON_CreateNumber>(); + _lookup Function(ffi.Double)>>( + 'cJSON_CreateNumber'); + late final _cJSON_CreateNumber = + _cJSON_CreateNumber_ptr.asFunction Function(double)>(); ffi.Pointer cJSON_CreateString( ffi.Pointer string, @@ -460,10 +496,12 @@ class CJson { ); } - late final _cJSON_CreateString_ptr = - _lookup>('cJSON_CreateString'); - late final _dart_cJSON_CreateString _cJSON_CreateString = - _cJSON_CreateString_ptr.asFunction<_dart_cJSON_CreateString>(); + late final _cJSON_CreateString_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_CreateString'); + late final _cJSON_CreateString = _cJSON_CreateString_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateRaw( ffi.Pointer raw, @@ -473,28 +511,32 @@ class CJson { ); } - late final _cJSON_CreateRaw_ptr = - _lookup>('cJSON_CreateRaw'); - late final _dart_cJSON_CreateRaw _cJSON_CreateRaw = - _cJSON_CreateRaw_ptr.asFunction<_dart_cJSON_CreateRaw>(); + late final _cJSON_CreateRaw_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_CreateRaw'); + late final _cJSON_CreateRaw = _cJSON_CreateRaw_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArray() { return _cJSON_CreateArray(); } late final _cJSON_CreateArray_ptr = - _lookup>('cJSON_CreateArray'); - late final _dart_cJSON_CreateArray _cJSON_CreateArray = - _cJSON_CreateArray_ptr.asFunction<_dart_cJSON_CreateArray>(); + _lookup Function()>>( + 'cJSON_CreateArray'); + late final _cJSON_CreateArray = + _cJSON_CreateArray_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateObject() { return _cJSON_CreateObject(); } late final _cJSON_CreateObject_ptr = - _lookup>('cJSON_CreateObject'); - late final _dart_cJSON_CreateObject _cJSON_CreateObject = - _cJSON_CreateObject_ptr.asFunction<_dart_cJSON_CreateObject>(); + _lookup Function()>>( + 'cJSON_CreateObject'); + late final _cJSON_CreateObject = + _cJSON_CreateObject_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateStringReference( ffi.Pointer string, @@ -504,12 +546,12 @@ class CJson { ); } - late final _cJSON_CreateStringReference_ptr = - _lookup>( - 'cJSON_CreateStringReference'); - late final _dart_cJSON_CreateStringReference _cJSON_CreateStringReference = - _cJSON_CreateStringReference_ptr - .asFunction<_dart_cJSON_CreateStringReference>(); + late final _cJSON_CreateStringReference_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_CreateStringReference'); + late final _cJSON_CreateStringReference = _cJSON_CreateStringReference_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateObjectReference( ffi.Pointer child, @@ -519,12 +561,11 @@ class CJson { ); } - late final _cJSON_CreateObjectReference_ptr = - _lookup>( - 'cJSON_CreateObjectReference'); - late final _dart_cJSON_CreateObjectReference _cJSON_CreateObjectReference = - _cJSON_CreateObjectReference_ptr - .asFunction<_dart_cJSON_CreateObjectReference>(); + late final _cJSON_CreateObjectReference_ptr = _lookup< + ffi.NativeFunction Function(ffi.Pointer)>>( + 'cJSON_CreateObjectReference'); + late final _cJSON_CreateObjectReference = _cJSON_CreateObjectReference_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArrayReference( ffi.Pointer child, @@ -534,12 +575,11 @@ class CJson { ); } - late final _cJSON_CreateArrayReference_ptr = - _lookup>( - 'cJSON_CreateArrayReference'); - late final _dart_cJSON_CreateArrayReference _cJSON_CreateArrayReference = - _cJSON_CreateArrayReference_ptr - .asFunction<_dart_cJSON_CreateArrayReference>(); + late final _cJSON_CreateArrayReference_ptr = _lookup< + ffi.NativeFunction Function(ffi.Pointer)>>( + 'cJSON_CreateArrayReference'); + late final _cJSON_CreateArrayReference = _cJSON_CreateArrayReference_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateIntArray( ffi.Pointer numbers, @@ -551,11 +591,12 @@ class CJson { ); } - late final _cJSON_CreateIntArray_ptr = - _lookup>( - 'cJSON_CreateIntArray'); - late final _dart_cJSON_CreateIntArray _cJSON_CreateIntArray = - _cJSON_CreateIntArray_ptr.asFunction<_dart_cJSON_CreateIntArray>(); + late final _cJSON_CreateIntArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_CreateIntArray'); + late final _cJSON_CreateIntArray = _cJSON_CreateIntArray_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateFloatArray( ffi.Pointer numbers, @@ -567,11 +608,12 @@ class CJson { ); } - late final _cJSON_CreateFloatArray_ptr = - _lookup>( - 'cJSON_CreateFloatArray'); - late final _dart_cJSON_CreateFloatArray _cJSON_CreateFloatArray = - _cJSON_CreateFloatArray_ptr.asFunction<_dart_cJSON_CreateFloatArray>(); + late final _cJSON_CreateFloatArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_CreateFloatArray'); + late final _cJSON_CreateFloatArray = _cJSON_CreateFloatArray_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateDoubleArray( ffi.Pointer numbers, @@ -583,11 +625,12 @@ class CJson { ); } - late final _cJSON_CreateDoubleArray_ptr = - _lookup>( - 'cJSON_CreateDoubleArray'); - late final _dart_cJSON_CreateDoubleArray _cJSON_CreateDoubleArray = - _cJSON_CreateDoubleArray_ptr.asFunction<_dart_cJSON_CreateDoubleArray>(); + late final _cJSON_CreateDoubleArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_CreateDoubleArray'); + late final _cJSON_CreateDoubleArray = _cJSON_CreateDoubleArray_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateStringArray( ffi.Pointer> strings, @@ -599,11 +642,12 @@ class CJson { ); } - late final _cJSON_CreateStringArray_ptr = - _lookup>( - 'cJSON_CreateStringArray'); - late final _dart_cJSON_CreateStringArray _cJSON_CreateStringArray = - _cJSON_CreateStringArray_ptr.asFunction<_dart_cJSON_CreateStringArray>(); + late final _cJSON_CreateStringArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer>, + ffi.Int32)>>('cJSON_CreateStringArray'); + late final _cJSON_CreateStringArray = _cJSON_CreateStringArray_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer>, int)>(); void cJSON_AddItemToArray( ffi.Pointer array, @@ -615,11 +659,12 @@ class CJson { ); } - late final _cJSON_AddItemToArray_ptr = - _lookup>( - 'cJSON_AddItemToArray'); - late final _dart_cJSON_AddItemToArray _cJSON_AddItemToArray = - _cJSON_AddItemToArray_ptr.asFunction<_dart_cJSON_AddItemToArray>(); + late final _cJSON_AddItemToArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToArray'); + late final _cJSON_AddItemToArray = _cJSON_AddItemToArray_ptr + .asFunction, ffi.Pointer)>(); void cJSON_AddItemToObject( ffi.Pointer object, @@ -633,11 +678,13 @@ class CJson { ); } - late final _cJSON_AddItemToObject_ptr = - _lookup>( - 'cJSON_AddItemToObject'); - late final _dart_cJSON_AddItemToObject _cJSON_AddItemToObject = - _cJSON_AddItemToObject_ptr.asFunction<_dart_cJSON_AddItemToObject>(); + late final _cJSON_AddItemToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemToObject'); + late final _cJSON_AddItemToObject = _cJSON_AddItemToObject_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemToObjectCS( ffi.Pointer object, @@ -651,11 +698,13 @@ class CJson { ); } - late final _cJSON_AddItemToObjectCS_ptr = - _lookup>( - 'cJSON_AddItemToObjectCS'); - late final _dart_cJSON_AddItemToObjectCS _cJSON_AddItemToObjectCS = - _cJSON_AddItemToObjectCS_ptr.asFunction<_dart_cJSON_AddItemToObjectCS>(); + late final _cJSON_AddItemToObjectCS_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemToObjectCS'); + late final _cJSON_AddItemToObjectCS = _cJSON_AddItemToObjectCS_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemReferenceToArray( ffi.Pointer array, @@ -667,12 +716,12 @@ class CJson { ); } - late final _cJSON_AddItemReferenceToArray_ptr = - _lookup>( - 'cJSON_AddItemReferenceToArray'); - late final _dart_cJSON_AddItemReferenceToArray - _cJSON_AddItemReferenceToArray = _cJSON_AddItemReferenceToArray_ptr - .asFunction<_dart_cJSON_AddItemReferenceToArray>(); + late final _cJSON_AddItemReferenceToArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemReferenceToArray'); + late final _cJSON_AddItemReferenceToArray = _cJSON_AddItemReferenceToArray_ptr + .asFunction, ffi.Pointer)>(); void cJSON_AddItemReferenceToObject( ffi.Pointer object, @@ -686,12 +735,14 @@ class CJson { ); } - late final _cJSON_AddItemReferenceToObject_ptr = - _lookup>( - 'cJSON_AddItemReferenceToObject'); - late final _dart_cJSON_AddItemReferenceToObject - _cJSON_AddItemReferenceToObject = _cJSON_AddItemReferenceToObject_ptr - .asFunction<_dart_cJSON_AddItemReferenceToObject>(); + late final _cJSON_AddItemReferenceToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemReferenceToObject'); + late final _cJSON_AddItemReferenceToObject = + _cJSON_AddItemReferenceToObject_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemViaPointer( ffi.Pointer parent, @@ -703,12 +754,14 @@ class CJson { ); } - late final _cJSON_DetachItemViaPointer_ptr = - _lookup>( - 'cJSON_DetachItemViaPointer'); - late final _dart_cJSON_DetachItemViaPointer _cJSON_DetachItemViaPointer = - _cJSON_DetachItemViaPointer_ptr - .asFunction<_dart_cJSON_DetachItemViaPointer>(); + late final _cJSON_DetachItemViaPointer_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_DetachItemViaPointer'); + late final _cJSON_DetachItemViaPointer = + _cJSON_DetachItemViaPointer_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemFromArray( ffi.Pointer array, @@ -720,12 +773,12 @@ class CJson { ); } - late final _cJSON_DetachItemFromArray_ptr = - _lookup>( - 'cJSON_DetachItemFromArray'); - late final _dart_cJSON_DetachItemFromArray _cJSON_DetachItemFromArray = - _cJSON_DetachItemFromArray_ptr - .asFunction<_dart_cJSON_DetachItemFromArray>(); + late final _cJSON_DetachItemFromArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_DetachItemFromArray'); + late final _cJSON_DetachItemFromArray = _cJSON_DetachItemFromArray_ptr + .asFunction Function(ffi.Pointer, int)>(); void cJSON_DeleteItemFromArray( ffi.Pointer array, @@ -737,12 +790,11 @@ class CJson { ); } - late final _cJSON_DeleteItemFromArray_ptr = - _lookup>( - 'cJSON_DeleteItemFromArray'); - late final _dart_cJSON_DeleteItemFromArray _cJSON_DeleteItemFromArray = - _cJSON_DeleteItemFromArray_ptr - .asFunction<_dart_cJSON_DeleteItemFromArray>(); + late final _cJSON_DeleteItemFromArray_ptr = _lookup< + ffi.NativeFunction, ffi.Int32)>>( + 'cJSON_DeleteItemFromArray'); + late final _cJSON_DeleteItemFromArray = _cJSON_DeleteItemFromArray_ptr + .asFunction, int)>(); ffi.Pointer cJSON_DetachItemFromObject( ffi.Pointer object, @@ -754,12 +806,14 @@ class CJson { ); } - late final _cJSON_DetachItemFromObject_ptr = - _lookup>( - 'cJSON_DetachItemFromObject'); - late final _dart_cJSON_DetachItemFromObject _cJSON_DetachItemFromObject = - _cJSON_DetachItemFromObject_ptr - .asFunction<_dart_cJSON_DetachItemFromObject>(); + late final _cJSON_DetachItemFromObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_DetachItemFromObject'); + late final _cJSON_DetachItemFromObject = + _cJSON_DetachItemFromObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( ffi.Pointer object, @@ -771,13 +825,15 @@ class CJson { ); } - late final _cJSON_DetachItemFromObjectCaseSensitive_ptr = - _lookup>( - 'cJSON_DetachItemFromObjectCaseSensitive'); - late final _dart_cJSON_DetachItemFromObjectCaseSensitive - _cJSON_DetachItemFromObjectCaseSensitive = - _cJSON_DetachItemFromObjectCaseSensitive_ptr - .asFunction<_dart_cJSON_DetachItemFromObjectCaseSensitive>(); + late final _cJSON_DetachItemFromObjectCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>( + 'cJSON_DetachItemFromObjectCaseSensitive'); + late final _cJSON_DetachItemFromObjectCaseSensitive = + _cJSON_DetachItemFromObjectCaseSensitive_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); void cJSON_DeleteItemFromObject( ffi.Pointer object, @@ -789,12 +845,12 @@ class CJson { ); } - late final _cJSON_DeleteItemFromObject_ptr = - _lookup>( - 'cJSON_DeleteItemFromObject'); - late final _dart_cJSON_DeleteItemFromObject _cJSON_DeleteItemFromObject = - _cJSON_DeleteItemFromObject_ptr - .asFunction<_dart_cJSON_DeleteItemFromObject>(); + late final _cJSON_DeleteItemFromObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_DeleteItemFromObject'); + late final _cJSON_DeleteItemFromObject = _cJSON_DeleteItemFromObject_ptr + .asFunction, ffi.Pointer)>(); void cJSON_DeleteItemFromObjectCaseSensitive( ffi.Pointer object, @@ -806,13 +862,13 @@ class CJson { ); } - late final _cJSON_DeleteItemFromObjectCaseSensitive_ptr = - _lookup>( - 'cJSON_DeleteItemFromObjectCaseSensitive'); - late final _dart_cJSON_DeleteItemFromObjectCaseSensitive - _cJSON_DeleteItemFromObjectCaseSensitive = - _cJSON_DeleteItemFromObjectCaseSensitive_ptr - .asFunction<_dart_cJSON_DeleteItemFromObjectCaseSensitive>(); + late final _cJSON_DeleteItemFromObjectCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>( + 'cJSON_DeleteItemFromObjectCaseSensitive'); + late final _cJSON_DeleteItemFromObjectCaseSensitive = + _cJSON_DeleteItemFromObjectCaseSensitive_ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); void cJSON_InsertItemInArray( ffi.Pointer array, @@ -826,11 +882,12 @@ class CJson { ); } - late final _cJSON_InsertItemInArray_ptr = - _lookup>( - 'cJSON_InsertItemInArray'); - late final _dart_cJSON_InsertItemInArray _cJSON_InsertItemInArray = - _cJSON_InsertItemInArray_ptr.asFunction<_dart_cJSON_InsertItemInArray>(); + late final _cJSON_InsertItemInArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer)>>('cJSON_InsertItemInArray'); + late final _cJSON_InsertItemInArray = _cJSON_InsertItemInArray_ptr + .asFunction, int, ffi.Pointer)>(); int cJSON_ReplaceItemViaPointer( ffi.Pointer parent, @@ -844,12 +901,14 @@ class CJson { ); } - late final _cJSON_ReplaceItemViaPointer_ptr = - _lookup>( - 'cJSON_ReplaceItemViaPointer'); - late final _dart_cJSON_ReplaceItemViaPointer _cJSON_ReplaceItemViaPointer = - _cJSON_ReplaceItemViaPointer_ptr - .asFunction<_dart_cJSON_ReplaceItemViaPointer>(); + late final _cJSON_ReplaceItemViaPointer_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_ReplaceItemViaPointer'); + late final _cJSON_ReplaceItemViaPointer = + _cJSON_ReplaceItemViaPointer_ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_ReplaceItemInArray( ffi.Pointer array, @@ -863,12 +922,12 @@ class CJson { ); } - late final _cJSON_ReplaceItemInArray_ptr = - _lookup>( - 'cJSON_ReplaceItemInArray'); - late final _dart_cJSON_ReplaceItemInArray _cJSON_ReplaceItemInArray = - _cJSON_ReplaceItemInArray_ptr - .asFunction<_dart_cJSON_ReplaceItemInArray>(); + late final _cJSON_ReplaceItemInArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer)>>('cJSON_ReplaceItemInArray'); + late final _cJSON_ReplaceItemInArray = _cJSON_ReplaceItemInArray_ptr + .asFunction, int, ffi.Pointer)>(); void cJSON_ReplaceItemInObject( ffi.Pointer object, @@ -882,12 +941,14 @@ class CJson { ); } - late final _cJSON_ReplaceItemInObject_ptr = - _lookup>( - 'cJSON_ReplaceItemInObject'); - late final _dart_cJSON_ReplaceItemInObject _cJSON_ReplaceItemInObject = - _cJSON_ReplaceItemInObject_ptr - .asFunction<_dart_cJSON_ReplaceItemInObject>(); + late final _cJSON_ReplaceItemInObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_ReplaceItemInObject'); + late final _cJSON_ReplaceItemInObject = + _cJSON_ReplaceItemInObject_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_ReplaceItemInObjectCaseSensitive( ffi.Pointer object, @@ -901,13 +962,14 @@ class CJson { ); } - late final _cJSON_ReplaceItemInObjectCaseSensitive_ptr = - _lookup>( - 'cJSON_ReplaceItemInObjectCaseSensitive'); - late final _dart_cJSON_ReplaceItemInObjectCaseSensitive - _cJSON_ReplaceItemInObjectCaseSensitive = - _cJSON_ReplaceItemInObjectCaseSensitive_ptr - .asFunction<_dart_cJSON_ReplaceItemInObjectCaseSensitive>(); + late final _cJSON_ReplaceItemInObjectCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_ReplaceItemInObjectCaseSensitive'); + late final _cJSON_ReplaceItemInObjectCaseSensitive = + _cJSON_ReplaceItemInObjectCaseSensitive_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_Duplicate( ffi.Pointer item, @@ -919,10 +981,12 @@ class CJson { ); } - late final _cJSON_Duplicate_ptr = - _lookup>('cJSON_Duplicate'); - late final _dart_cJSON_Duplicate _cJSON_Duplicate = - _cJSON_Duplicate_ptr.asFunction<_dart_cJSON_Duplicate>(); + late final _cJSON_Duplicate_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, cJSON_bool)>>('cJSON_Duplicate'); + late final _cJSON_Duplicate = _cJSON_Duplicate_ptr + .asFunction Function(ffi.Pointer, int)>(); int cJSON_Compare( ffi.Pointer a, @@ -936,10 +1000,12 @@ class CJson { ); } - late final _cJSON_Compare_ptr = - _lookup>('cJSON_Compare'); - late final _dart_cJSON_Compare _cJSON_Compare = - _cJSON_Compare_ptr.asFunction<_dart_cJSON_Compare>(); + late final _cJSON_Compare_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + cJSON_bool)>>('cJSON_Compare'); + late final _cJSON_Compare = _cJSON_Compare_ptr + .asFunction, ffi.Pointer, int)>(); void cJSON_Minify( ffi.Pointer json, @@ -950,9 +1016,10 @@ class CJson { } late final _cJSON_Minify_ptr = - _lookup>('cJSON_Minify'); - late final _dart_cJSON_Minify _cJSON_Minify = - _cJSON_Minify_ptr.asFunction<_dart_cJSON_Minify>(); + _lookup)>>( + 'cJSON_Minify'); + late final _cJSON_Minify = + _cJSON_Minify_ptr.asFunction)>(); ffi.Pointer cJSON_AddNullToObject( ffi.Pointer object, @@ -964,11 +1031,12 @@ class CJson { ); } - late final _cJSON_AddNullToObject_ptr = - _lookup>( - 'cJSON_AddNullToObject'); - late final _dart_cJSON_AddNullToObject _cJSON_AddNullToObject = - _cJSON_AddNullToObject_ptr.asFunction<_dart_cJSON_AddNullToObject>(); + late final _cJSON_AddNullToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddNullToObject'); + late final _cJSON_AddNullToObject = _cJSON_AddNullToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddTrueToObject( ffi.Pointer object, @@ -980,11 +1048,12 @@ class CJson { ); } - late final _cJSON_AddTrueToObject_ptr = - _lookup>( - 'cJSON_AddTrueToObject'); - late final _dart_cJSON_AddTrueToObject _cJSON_AddTrueToObject = - _cJSON_AddTrueToObject_ptr.asFunction<_dart_cJSON_AddTrueToObject>(); + late final _cJSON_AddTrueToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddTrueToObject'); + late final _cJSON_AddTrueToObject = _cJSON_AddTrueToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddFalseToObject( ffi.Pointer object, @@ -996,11 +1065,12 @@ class CJson { ); } - late final _cJSON_AddFalseToObject_ptr = - _lookup>( - 'cJSON_AddFalseToObject'); - late final _dart_cJSON_AddFalseToObject _cJSON_AddFalseToObject = - _cJSON_AddFalseToObject_ptr.asFunction<_dart_cJSON_AddFalseToObject>(); + late final _cJSON_AddFalseToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddFalseToObject'); + late final _cJSON_AddFalseToObject = _cJSON_AddFalseToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddBoolToObject( ffi.Pointer object, @@ -1014,11 +1084,13 @@ class CJson { ); } - late final _cJSON_AddBoolToObject_ptr = - _lookup>( - 'cJSON_AddBoolToObject'); - late final _dart_cJSON_AddBoolToObject _cJSON_AddBoolToObject = - _cJSON_AddBoolToObject_ptr.asFunction<_dart_cJSON_AddBoolToObject>(); + late final _cJSON_AddBoolToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + cJSON_bool)>>('cJSON_AddBoolToObject'); + late final _cJSON_AddBoolToObject = _cJSON_AddBoolToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer cJSON_AddNumberToObject( ffi.Pointer object, @@ -1032,11 +1104,13 @@ class CJson { ); } - late final _cJSON_AddNumberToObject_ptr = - _lookup>( - 'cJSON_AddNumberToObject'); - late final _dart_cJSON_AddNumberToObject _cJSON_AddNumberToObject = - _cJSON_AddNumberToObject_ptr.asFunction<_dart_cJSON_AddNumberToObject>(); + late final _cJSON_AddNumberToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Double)>>('cJSON_AddNumberToObject'); + late final _cJSON_AddNumberToObject = _cJSON_AddNumberToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); ffi.Pointer cJSON_AddStringToObject( ffi.Pointer object, @@ -1050,11 +1124,13 @@ class CJson { ); } - late final _cJSON_AddStringToObject_ptr = - _lookup>( - 'cJSON_AddStringToObject'); - late final _dart_cJSON_AddStringToObject _cJSON_AddStringToObject = - _cJSON_AddStringToObject_ptr.asFunction<_dart_cJSON_AddStringToObject>(); + late final _cJSON_AddStringToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddStringToObject'); + late final _cJSON_AddStringToObject = _cJSON_AddStringToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddRawToObject( ffi.Pointer object, @@ -1068,11 +1144,13 @@ class CJson { ); } - late final _cJSON_AddRawToObject_ptr = - _lookup>( - 'cJSON_AddRawToObject'); - late final _dart_cJSON_AddRawToObject _cJSON_AddRawToObject = - _cJSON_AddRawToObject_ptr.asFunction<_dart_cJSON_AddRawToObject>(); + late final _cJSON_AddRawToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddRawToObject'); + late final _cJSON_AddRawToObject = _cJSON_AddRawToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddObjectToObject( ffi.Pointer object, @@ -1084,11 +1162,12 @@ class CJson { ); } - late final _cJSON_AddObjectToObject_ptr = - _lookup>( - 'cJSON_AddObjectToObject'); - late final _dart_cJSON_AddObjectToObject _cJSON_AddObjectToObject = - _cJSON_AddObjectToObject_ptr.asFunction<_dart_cJSON_AddObjectToObject>(); + late final _cJSON_AddObjectToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddObjectToObject'); + late final _cJSON_AddObjectToObject = _cJSON_AddObjectToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddArrayToObject( ffi.Pointer object, @@ -1100,11 +1179,12 @@ class CJson { ); } - late final _cJSON_AddArrayToObject_ptr = - _lookup>( - 'cJSON_AddArrayToObject'); - late final _dart_cJSON_AddArrayToObject _cJSON_AddArrayToObject = - _cJSON_AddArrayToObject_ptr.asFunction<_dart_cJSON_AddArrayToObject>(); + late final _cJSON_AddArrayToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddArrayToObject'); + late final _cJSON_AddArrayToObject = _cJSON_AddArrayToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); double cJSON_SetNumberHelper( ffi.Pointer object, @@ -1116,11 +1196,12 @@ class CJson { ); } - late final _cJSON_SetNumberHelper_ptr = - _lookup>( - 'cJSON_SetNumberHelper'); - late final _dart_cJSON_SetNumberHelper _cJSON_SetNumberHelper = - _cJSON_SetNumberHelper_ptr.asFunction<_dart_cJSON_SetNumberHelper>(); + late final _cJSON_SetNumberHelper_ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, ffi.Double)>>('cJSON_SetNumberHelper'); + late final _cJSON_SetNumberHelper = _cJSON_SetNumberHelper_ptr + .asFunction, double)>(); ffi.Pointer cJSON_malloc( int size, @@ -1131,9 +1212,10 @@ class CJson { } late final _cJSON_malloc_ptr = - _lookup>('cJSON_malloc'); - late final _dart_cJSON_malloc _cJSON_malloc = - _cJSON_malloc_ptr.asFunction<_dart_cJSON_malloc>(); + _lookup Function(ffi.IntPtr)>>( + 'cJSON_malloc'); + late final _cJSON_malloc = + _cJSON_malloc_ptr.asFunction Function(int)>(); void cJSON_free( ffi.Pointer object, @@ -1144,9 +1226,10 @@ class CJson { } late final _cJSON_free_ptr = - _lookup>('cJSON_free'); - late final _dart_cJSON_free _cJSON_free = - _cJSON_free_ptr.asFunction<_dart_cJSON_free>(); + _lookup)>>( + 'cJSON_free'); + late final _cJSON_free = + _cJSON_free_ptr.asFunction)>(); } class cJSON extends ffi.Struct { @@ -1171,11 +1254,16 @@ class cJSON extends ffi.Struct { } class cJSON_Hooks extends ffi.Struct { - external ffi.Pointer> malloc_fn; + external ffi.Pointer< + ffi.NativeFunction Function(ffi.IntPtr)>> malloc_fn; - external ffi.Pointer> free_fn; + external ffi + .Pointer)>> + free_fn; } +typedef cJSON_bool = ffi.Int32; + const int CJSON_VERSION_MAJOR = 1; const int CJSON_VERSION_MINOR = 7; @@ -1207,691 +1295,3 @@ const int cJSON_StringIsConst = 512; const int CJSON_NESTING_LIMIT = 1000; const double CJSON_DOUBLE_PRECISION = 1e-16; - -typedef _c_cJSON_Version = ffi.Pointer Function(); - -typedef _dart_cJSON_Version = ffi.Pointer Function(); - -typedef _c_cJSON_InitHooks = ffi.Void Function( - ffi.Pointer hooks, -); - -typedef _dart_cJSON_InitHooks = void Function( - ffi.Pointer hooks, -); - -typedef _c_cJSON_Parse = ffi.Pointer Function( - ffi.Pointer value, -); - -typedef _dart_cJSON_Parse = ffi.Pointer Function( - ffi.Pointer value, -); - -typedef _c_cJSON_ParseWithOpts = ffi.Pointer Function( - ffi.Pointer value, - ffi.Pointer> return_parse_end, - ffi.Int32 require_null_terminated, -); - -typedef _dart_cJSON_ParseWithOpts = ffi.Pointer Function( - ffi.Pointer value, - ffi.Pointer> return_parse_end, - int require_null_terminated, -); - -typedef _c_cJSON_Print = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_Print = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _c_cJSON_PrintUnformatted = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_PrintUnformatted = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _c_cJSON_PrintBuffered = ffi.Pointer Function( - ffi.Pointer item, - ffi.Int32 prebuffer, - ffi.Int32 fmt, -); - -typedef _dart_cJSON_PrintBuffered = ffi.Pointer Function( - ffi.Pointer item, - int prebuffer, - int fmt, -); - -typedef _c_cJSON_PrintPreallocated = ffi.Int32 Function( - ffi.Pointer item, - ffi.Pointer buffer, - ffi.Int32 length, - ffi.Int32 format, -); - -typedef _dart_cJSON_PrintPreallocated = int Function( - ffi.Pointer item, - ffi.Pointer buffer, - int length, - int format, -); - -typedef _c_cJSON_Delete = ffi.Void Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_Delete = void Function( - ffi.Pointer item, -); - -typedef _c_cJSON_GetArraySize = ffi.Int32 Function( - ffi.Pointer array, -); - -typedef _dart_cJSON_GetArraySize = int Function( - ffi.Pointer array, -); - -typedef _c_cJSON_GetArrayItem = ffi.Pointer Function( - ffi.Pointer array, - ffi.Int32 index, -); - -typedef _dart_cJSON_GetArrayItem = ffi.Pointer Function( - ffi.Pointer array, - int index, -); - -typedef _c_cJSON_GetObjectItem = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_GetObjectItem = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_GetObjectItemCaseSensitive = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_GetObjectItemCaseSensitive = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_HasObjectItem = ffi.Int32 Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_HasObjectItem = int Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_GetErrorPtr = ffi.Pointer Function(); - -typedef _dart_cJSON_GetErrorPtr = ffi.Pointer Function(); - -typedef _c_cJSON_GetStringValue = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_GetStringValue = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsInvalid = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsInvalid = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsFalse = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsFalse = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsTrue = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsTrue = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsBool = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsBool = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsNull = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsNull = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsNumber = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsNumber = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsString = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsString = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsArray = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsArray = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsObject = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsObject = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsRaw = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsRaw = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_CreateNull = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateNull = ffi.Pointer Function(); - -typedef _c_cJSON_CreateTrue = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateTrue = ffi.Pointer Function(); - -typedef _c_cJSON_CreateFalse = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateFalse = ffi.Pointer Function(); - -typedef _c_cJSON_CreateBool = ffi.Pointer Function( - ffi.Int32 boolean, -); - -typedef _dart_cJSON_CreateBool = ffi.Pointer Function( - int boolean, -); - -typedef _c_cJSON_CreateNumber = ffi.Pointer Function( - ffi.Double num, -); - -typedef _dart_cJSON_CreateNumber = ffi.Pointer Function( - double num, -); - -typedef _c_cJSON_CreateString = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _dart_cJSON_CreateString = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _c_cJSON_CreateRaw = ffi.Pointer Function( - ffi.Pointer raw, -); - -typedef _dart_cJSON_CreateRaw = ffi.Pointer Function( - ffi.Pointer raw, -); - -typedef _c_cJSON_CreateArray = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateArray = ffi.Pointer Function(); - -typedef _c_cJSON_CreateObject = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateObject = ffi.Pointer Function(); - -typedef _c_cJSON_CreateStringReference = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _dart_cJSON_CreateStringReference = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _c_cJSON_CreateObjectReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _dart_cJSON_CreateObjectReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _c_cJSON_CreateArrayReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _dart_cJSON_CreateArrayReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _c_cJSON_CreateIntArray = ffi.Pointer Function( - ffi.Pointer numbers, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateIntArray = ffi.Pointer Function( - ffi.Pointer numbers, - int count, -); - -typedef _c_cJSON_CreateFloatArray = ffi.Pointer Function( - ffi.Pointer numbers, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateFloatArray = ffi.Pointer Function( - ffi.Pointer numbers, - int count, -); - -typedef _c_cJSON_CreateDoubleArray = ffi.Pointer Function( - ffi.Pointer numbers, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateDoubleArray = ffi.Pointer Function( - ffi.Pointer numbers, - int count, -); - -typedef _c_cJSON_CreateStringArray = ffi.Pointer Function( - ffi.Pointer> strings, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateStringArray = ffi.Pointer Function( - ffi.Pointer> strings, - int count, -); - -typedef _c_cJSON_AddItemToArray = ffi.Void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemToArray = void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemToObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemToObject = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemToObjectCS = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemToObjectCS = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemReferenceToArray = ffi.Void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemReferenceToArray = void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemReferenceToObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemReferenceToObject = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _c_cJSON_DetachItemViaPointer = ffi.Pointer Function( - ffi.Pointer parent, - ffi.Pointer item, -); - -typedef _dart_cJSON_DetachItemViaPointer = ffi.Pointer Function( - ffi.Pointer parent, - ffi.Pointer item, -); - -typedef _c_cJSON_DetachItemFromArray = ffi.Pointer Function( - ffi.Pointer array, - ffi.Int32 which, -); - -typedef _dart_cJSON_DetachItemFromArray = ffi.Pointer Function( - ffi.Pointer array, - int which, -); - -typedef _c_cJSON_DeleteItemFromArray = ffi.Void Function( - ffi.Pointer array, - ffi.Int32 which, -); - -typedef _dart_cJSON_DeleteItemFromArray = void Function( - ffi.Pointer array, - int which, -); - -typedef _c_cJSON_DetachItemFromObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DetachItemFromObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_DetachItemFromObjectCaseSensitive = ffi.Pointer - Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DetachItemFromObjectCaseSensitive = ffi.Pointer - Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_DeleteItemFromObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DeleteItemFromObject = void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_DeleteItemFromObjectCaseSensitive = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DeleteItemFromObjectCaseSensitive = void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_InsertItemInArray = ffi.Void Function( - ffi.Pointer array, - ffi.Int32 which, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_InsertItemInArray = void Function( - ffi.Pointer array, - int which, - ffi.Pointer newitem, -); - -typedef _c_cJSON_ReplaceItemViaPointer = ffi.Int32 Function( - ffi.Pointer parent, - ffi.Pointer item, - ffi.Pointer replacement, -); - -typedef _dart_cJSON_ReplaceItemViaPointer = int Function( - ffi.Pointer parent, - ffi.Pointer item, - ffi.Pointer replacement, -); - -typedef _c_cJSON_ReplaceItemInArray = ffi.Void Function( - ffi.Pointer array, - ffi.Int32 which, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_ReplaceItemInArray = void Function( - ffi.Pointer array, - int which, - ffi.Pointer newitem, -); - -typedef _c_cJSON_ReplaceItemInObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_ReplaceItemInObject = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _c_cJSON_ReplaceItemInObjectCaseSensitive = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_ReplaceItemInObjectCaseSensitive = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _c_cJSON_Duplicate = ffi.Pointer Function( - ffi.Pointer item, - ffi.Int32 recurse, -); - -typedef _dart_cJSON_Duplicate = ffi.Pointer Function( - ffi.Pointer item, - int recurse, -); - -typedef _c_cJSON_Compare = ffi.Int32 Function( - ffi.Pointer a, - ffi.Pointer b, - ffi.Int32 case_sensitive, -); - -typedef _dart_cJSON_Compare = int Function( - ffi.Pointer a, - ffi.Pointer b, - int case_sensitive, -); - -typedef _c_cJSON_Minify = ffi.Void Function( - ffi.Pointer json, -); - -typedef _dart_cJSON_Minify = void Function( - ffi.Pointer json, -); - -typedef _c_cJSON_AddNullToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddNullToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddTrueToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddTrueToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddFalseToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddFalseToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddBoolToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Int32 boolean, -); - -typedef _dart_cJSON_AddBoolToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - int boolean, -); - -typedef _c_cJSON_AddNumberToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Double number, -); - -typedef _dart_cJSON_AddNumberToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - double number, -); - -typedef _c_cJSON_AddStringToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer string, -); - -typedef _dart_cJSON_AddStringToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer string, -); - -typedef _c_cJSON_AddRawToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer raw, -); - -typedef _dart_cJSON_AddRawToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer raw, -); - -typedef _c_cJSON_AddObjectToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddObjectToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddArrayToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddArrayToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_SetNumberHelper = ffi.Double Function( - ffi.Pointer object, - ffi.Double number, -); - -typedef _dart_cJSON_SetNumberHelper = double Function( - ffi.Pointer object, - double number, -); - -typedef _c_cJSON_malloc = ffi.Pointer Function( - ffi.Uint64 size, -); - -typedef _dart_cJSON_malloc = ffi.Pointer Function( - int size, -); - -typedef _c_cJSON_free = ffi.Void Function( - ffi.Pointer object, -); - -typedef _dart_cJSON_free = void Function( - ffi.Pointer object, -); - -typedef _typedefC_1 = ffi.Pointer Function( - ffi.Uint64, -); - -typedef _typedefC_2 = ffi.Void Function( - ffi.Pointer, -); diff --git a/example/c_json/main.dart b/example/c_json/main.dart index 2774c314..99042ebb 100644 --- a/example/c_json/main.dart +++ b/example/c_json/main.dart @@ -7,6 +7,7 @@ import 'dart:ffi'; import 'dart:io'; import 'package:ffi/ffi.dart'; +import 'package:path/path.dart' as p; import 'cjson_generated_bindings.dart' as cj; @@ -45,12 +46,14 @@ void main() { } String _getPath() { - var path = '../../third_party/cjson_library/libcjson.so'; + final cjsonExamplePath = Directory.current.absolute.path; + var path = p.join(cjsonExamplePath, '../../third_party/cjson_library/'); if (Platform.isMacOS) { - path = '../../third_party/cjson_library/libstructs.dylib'; - } - if (Platform.isWindows) { - path = r'..\..\third_party\cjson_library\Debug\structs.dll'; + path = p.join(path, 'libcjson.dylib'); + } else if (Platform.isWindows) { + path = p.join(path, 'Debug', 'cjson.dll'); + } else { + path = p.join(path, 'libcjson.so'); } return path; } diff --git a/example/c_json/pubspec.yaml b/example/c_json/pubspec.yaml index 5bce972a..03a913b3 100644 --- a/example/c_json/pubspec.yaml +++ b/example/c_json/pubspec.yaml @@ -5,10 +5,11 @@ name: c_json_example environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.13.0 <3.0.0' dependencies: ffi: ^1.0.0 + path: ^1.8.0 dev_dependencies: ffigen: @@ -24,6 +25,8 @@ ffigen: include-directives: - '**cJSON.h' comments: false + typedef-map: + 'size_t': 'IntPtr' preamble: | // Copyright (c) 2009-2017 Dave Gamble and cJSON contributors diff --git a/example/libclang-example/generated_bindings.dart b/example/libclang-example/generated_bindings.dart index 71fa196b..f8e77c4e 100644 --- a/example/libclang-example/generated_bindings.dart +++ b/example/libclang-example/generated_bindings.dart @@ -34,8 +34,8 @@ class LibClang { late final _clang_getCString_ptr = _lookup>('clang_getCString'); - late final _dart_clang_getCString _clang_getCString = - _clang_getCString_ptr.asFunction<_dart_clang_getCString>(); + late final _clang_getCString = _clang_getCString_ptr + .asFunction Function(CXString)>(); /// Free the given string. void clang_disposeString( @@ -49,8 +49,8 @@ class LibClang { late final _clang_disposeString_ptr = _lookup>( 'clang_disposeString'); - late final _dart_clang_disposeString _clang_disposeString = - _clang_disposeString_ptr.asFunction<_dart_clang_disposeString>(); + late final _clang_disposeString = + _clang_disposeString_ptr.asFunction(); /// Free the given string set. void clang_disposeStringSet( @@ -64,8 +64,8 @@ class LibClang { late final _clang_disposeStringSet_ptr = _lookup>( 'clang_disposeStringSet'); - late final _dart_clang_disposeStringSet _clang_disposeStringSet = - _clang_disposeStringSet_ptr.asFunction<_dart_clang_disposeStringSet>(); + late final _clang_disposeStringSet = _clang_disposeStringSet_ptr + .asFunction)>(); /// Provides a shared context for creating translation units. /// @@ -105,7 +105,7 @@ class LibClang { /// This process of creating the 'pch', loading it separately, and using it (via /// -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks /// (which gives the indexer the same performance benefit as the compiler). - ffi.Pointer clang_createIndex( + CXIndex clang_createIndex( int excludeDeclarationsFromPCH, int displayDiagnostics, ) { @@ -118,15 +118,15 @@ class LibClang { late final _clang_createIndex_ptr = _lookup>( 'clang_createIndex'); - late final _dart_clang_createIndex _clang_createIndex = - _clang_createIndex_ptr.asFunction<_dart_clang_createIndex>(); + late final _clang_createIndex = + _clang_createIndex_ptr.asFunction(); /// Destroy the given index. /// /// The index must not be destroyed until all of the translation units created /// within that index have been destroyed. void clang_disposeIndex( - ffi.Pointer index, + CXIndex index, ) { return _clang_disposeIndex( index, @@ -136,8 +136,8 @@ class LibClang { late final _clang_disposeIndex_ptr = _lookup>( 'clang_disposeIndex'); - late final _dart_clang_disposeIndex _clang_disposeIndex = - _clang_disposeIndex_ptr.asFunction<_dart_clang_disposeIndex>(); + late final _clang_disposeIndex = + _clang_disposeIndex_ptr.asFunction(); /// Sets general options associated with a CXIndex. /// @@ -151,7 +151,7 @@ class LibClang { /// /// \param options A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags. void clang_CXIndex_setGlobalOptions( - ffi.Pointer arg0, + CXIndex arg0, int options, ) { return _clang_CXIndex_setGlobalOptions( @@ -163,16 +163,16 @@ class LibClang { late final _clang_CXIndex_setGlobalOptions_ptr = _lookup>( 'clang_CXIndex_setGlobalOptions'); - late final _dart_clang_CXIndex_setGlobalOptions - _clang_CXIndex_setGlobalOptions = _clang_CXIndex_setGlobalOptions_ptr - .asFunction<_dart_clang_CXIndex_setGlobalOptions>(); + late final _clang_CXIndex_setGlobalOptions = + _clang_CXIndex_setGlobalOptions_ptr + .asFunction(); /// Gets the general options associated with a CXIndex. /// /// \returns A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags that /// are associated with the given CXIndex object. int clang_CXIndex_getGlobalOptions( - ffi.Pointer arg0, + CXIndex arg0, ) { return _clang_CXIndex_getGlobalOptions( arg0, @@ -182,9 +182,8 @@ class LibClang { late final _clang_CXIndex_getGlobalOptions_ptr = _lookup>( 'clang_CXIndex_getGlobalOptions'); - late final _dart_clang_CXIndex_getGlobalOptions - _clang_CXIndex_getGlobalOptions = _clang_CXIndex_getGlobalOptions_ptr - .asFunction<_dart_clang_CXIndex_getGlobalOptions>(); + late final _clang_CXIndex_getGlobalOptions = + _clang_CXIndex_getGlobalOptions_ptr.asFunction(); /// Sets the invocation emission path option in a CXIndex. /// @@ -192,7 +191,7 @@ class LibClang { /// files for certain libclang invocations. A null value (default) implies that /// libclang invocations are not logged.. void clang_CXIndex_setInvocationEmissionPathOption( - ffi.Pointer arg0, + CXIndex arg0, ffi.Pointer Path, ) { return _clang_CXIndex_setInvocationEmissionPathOption( @@ -205,14 +204,13 @@ class LibClang { ffi.NativeFunction< Native_clang_CXIndex_setInvocationEmissionPathOption>>( 'clang_CXIndex_setInvocationEmissionPathOption'); - late final _dart_clang_CXIndex_setInvocationEmissionPathOption - _clang_CXIndex_setInvocationEmissionPathOption = + late final _clang_CXIndex_setInvocationEmissionPathOption = _clang_CXIndex_setInvocationEmissionPathOption_ptr - .asFunction<_dart_clang_CXIndex_setInvocationEmissionPathOption>(); + .asFunction)>(); /// Retrieve the complete file and path name of the given file. CXString clang_getFileName( - ffi.Pointer SFile, + CXFile SFile, ) { return _clang_getFileName( SFile, @@ -222,12 +220,12 @@ class LibClang { late final _clang_getFileName_ptr = _lookup>( 'clang_getFileName'); - late final _dart_clang_getFileName _clang_getFileName = - _clang_getFileName_ptr.asFunction<_dart_clang_getFileName>(); + late final _clang_getFileName = + _clang_getFileName_ptr.asFunction(); /// Retrieve the last modification time of the given file. int clang_getFileTime( - ffi.Pointer SFile, + CXFile SFile, ) { return _clang_getFileTime( SFile, @@ -237,8 +235,8 @@ class LibClang { late final _clang_getFileTime_ptr = _lookup>( 'clang_getFileTime'); - late final _dart_clang_getFileTime _clang_getFileTime = - _clang_getFileTime_ptr.asFunction<_dart_clang_getFileTime>(); + late final _clang_getFileTime = + _clang_getFileTime_ptr.asFunction(); /// Retrieve the unique ID for the given \c file. /// @@ -247,7 +245,7 @@ class LibClang { /// \returns If there was a failure getting the unique ID, returns non-zero, /// otherwise returns 0. int clang_getFileUniqueID( - ffi.Pointer file, + CXFile file, ffi.Pointer outID, ) { return _clang_getFileUniqueID( @@ -259,15 +257,15 @@ class LibClang { late final _clang_getFileUniqueID_ptr = _lookup>( 'clang_getFileUniqueID'); - late final _dart_clang_getFileUniqueID _clang_getFileUniqueID = - _clang_getFileUniqueID_ptr.asFunction<_dart_clang_getFileUniqueID>(); + late final _clang_getFileUniqueID = _clang_getFileUniqueID_ptr + .asFunction)>(); /// Determine whether the given header is guarded against /// multiple inclusions, either with the conventional /// \#ifndef/\#define/\#endif macro guards or with \#pragma once. int clang_isFileMultipleIncludeGuarded( - ffi.Pointer tu, - ffi.Pointer file, + CXTranslationUnit tu, + CXFile file, ) { return _clang_isFileMultipleIncludeGuarded( tu, @@ -278,10 +276,9 @@ class LibClang { late final _clang_isFileMultipleIncludeGuarded_ptr = _lookup>( 'clang_isFileMultipleIncludeGuarded'); - late final _dart_clang_isFileMultipleIncludeGuarded - _clang_isFileMultipleIncludeGuarded = + late final _clang_isFileMultipleIncludeGuarded = _clang_isFileMultipleIncludeGuarded_ptr - .asFunction<_dart_clang_isFileMultipleIncludeGuarded>(); + .asFunction(); /// Retrieve a file handle within the given translation unit. /// @@ -291,8 +288,8 @@ class LibClang { /// /// \returns the file handle for the named file in the translation unit \p tu, /// or a NULL file handle if the file was not a part of this translation unit. - ffi.Pointer clang_getFile( - ffi.Pointer tu, + CXFile clang_getFile( + CXTranslationUnit tu, ffi.Pointer file_name, ) { return _clang_getFile( @@ -303,8 +300,8 @@ class LibClang { late final _clang_getFile_ptr = _lookup>('clang_getFile'); - late final _dart_clang_getFile _clang_getFile = - _clang_getFile_ptr.asFunction<_dart_clang_getFile>(); + late final _clang_getFile = _clang_getFile_ptr + .asFunction)>(); /// Retrieve the buffer associated with the given file. /// @@ -317,9 +314,9 @@ class LibClang { /// \returns a pointer to the buffer in memory that holds the contents of /// \p file, or a NULL pointer when the file is not loaded. ffi.Pointer clang_getFileContents( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, + CXTranslationUnit tu, + CXFile file, + ffi.Pointer size, ) { return _clang_getFileContents( tu, @@ -331,14 +328,15 @@ class LibClang { late final _clang_getFileContents_ptr = _lookup>( 'clang_getFileContents'); - late final _dart_clang_getFileContents _clang_getFileContents = - _clang_getFileContents_ptr.asFunction<_dart_clang_getFileContents>(); + late final _clang_getFileContents = _clang_getFileContents_ptr.asFunction< + ffi.Pointer Function( + CXTranslationUnit, CXFile, ffi.Pointer)>(); /// Returns non-zero if the \c file1 and \c file2 point to the same file, /// or they are both NULL. int clang_File_isEqual( - ffi.Pointer file1, - ffi.Pointer file2, + CXFile file1, + CXFile file2, ) { return _clang_File_isEqual( file1, @@ -349,14 +347,14 @@ class LibClang { late final _clang_File_isEqual_ptr = _lookup>( 'clang_File_isEqual'); - late final _dart_clang_File_isEqual _clang_File_isEqual = - _clang_File_isEqual_ptr.asFunction<_dart_clang_File_isEqual>(); + late final _clang_File_isEqual = + _clang_File_isEqual_ptr.asFunction(); /// Returns the real path name of \c file. /// /// An empty string may be returned. Use \c clang_getFileName() in that case. CXString clang_File_tryGetRealPathName( - ffi.Pointer file, + CXFile file, ) { return _clang_File_tryGetRealPathName( file, @@ -366,9 +364,8 @@ class LibClang { late final _clang_File_tryGetRealPathName_ptr = _lookup>( 'clang_File_tryGetRealPathName'); - late final _dart_clang_File_tryGetRealPathName - _clang_File_tryGetRealPathName = _clang_File_tryGetRealPathName_ptr - .asFunction<_dart_clang_File_tryGetRealPathName>(); + late final _clang_File_tryGetRealPathName = _clang_File_tryGetRealPathName_ptr + .asFunction(); /// Retrieve a NULL (invalid) source location. CXSourceLocation clang_getNullLocation() { @@ -378,8 +375,8 @@ class LibClang { late final _clang_getNullLocation_ptr = _lookup>( 'clang_getNullLocation'); - late final _dart_clang_getNullLocation _clang_getNullLocation = - _clang_getNullLocation_ptr.asFunction<_dart_clang_getNullLocation>(); + late final _clang_getNullLocation = + _clang_getNullLocation_ptr.asFunction(); /// Determine whether two source locations, which must refer into /// the same translation unit, refer to exactly the same point in the source @@ -400,14 +397,14 @@ class LibClang { late final _clang_equalLocations_ptr = _lookup>( 'clang_equalLocations'); - late final _dart_clang_equalLocations _clang_equalLocations = - _clang_equalLocations_ptr.asFunction<_dart_clang_equalLocations>(); + late final _clang_equalLocations = _clang_equalLocations_ptr + .asFunction(); /// Retrieves the source location associated with a given file/line/column /// in a particular translation unit. CXSourceLocation clang_getLocation( - ffi.Pointer tu, - ffi.Pointer file, + CXTranslationUnit tu, + CXFile file, int line, int column, ) { @@ -422,14 +419,14 @@ class LibClang { late final _clang_getLocation_ptr = _lookup>( 'clang_getLocation'); - late final _dart_clang_getLocation _clang_getLocation = - _clang_getLocation_ptr.asFunction<_dart_clang_getLocation>(); + late final _clang_getLocation = _clang_getLocation_ptr.asFunction< + CXSourceLocation Function(CXTranslationUnit, CXFile, int, int)>(); /// Retrieves the source location associated with a given character offset /// in a particular translation unit. CXSourceLocation clang_getLocationForOffset( - ffi.Pointer tu, - ffi.Pointer file, + CXTranslationUnit tu, + CXFile file, int offset, ) { return _clang_getLocationForOffset( @@ -442,9 +439,8 @@ class LibClang { late final _clang_getLocationForOffset_ptr = _lookup>( 'clang_getLocationForOffset'); - late final _dart_clang_getLocationForOffset _clang_getLocationForOffset = - _clang_getLocationForOffset_ptr - .asFunction<_dart_clang_getLocationForOffset>(); + late final _clang_getLocationForOffset = _clang_getLocationForOffset_ptr + .asFunction(); /// Returns non-zero if the given source location is in a system header. int clang_Location_isInSystemHeader( @@ -458,9 +454,9 @@ class LibClang { late final _clang_Location_isInSystemHeader_ptr = _lookup>( 'clang_Location_isInSystemHeader'); - late final _dart_clang_Location_isInSystemHeader - _clang_Location_isInSystemHeader = _clang_Location_isInSystemHeader_ptr - .asFunction<_dart_clang_Location_isInSystemHeader>(); + late final _clang_Location_isInSystemHeader = + _clang_Location_isInSystemHeader_ptr + .asFunction(); /// Returns non-zero if the given source location is in the main file of /// the corresponding translation unit. @@ -475,9 +471,8 @@ class LibClang { late final _clang_Location_isFromMainFile_ptr = _lookup>( 'clang_Location_isFromMainFile'); - late final _dart_clang_Location_isFromMainFile - _clang_Location_isFromMainFile = _clang_Location_isFromMainFile_ptr - .asFunction<_dart_clang_Location_isFromMainFile>(); + late final _clang_Location_isFromMainFile = _clang_Location_isFromMainFile_ptr + .asFunction(); /// Retrieve a NULL (invalid) source range. CXSourceRange clang_getNullRange() { @@ -487,8 +482,8 @@ class LibClang { late final _clang_getNullRange_ptr = _lookup>( 'clang_getNullRange'); - late final _dart_clang_getNullRange _clang_getNullRange = - _clang_getNullRange_ptr.asFunction<_dart_clang_getNullRange>(); + late final _clang_getNullRange = + _clang_getNullRange_ptr.asFunction(); /// Retrieve a source range given the beginning and ending source /// locations. @@ -504,8 +499,8 @@ class LibClang { late final _clang_getRange_ptr = _lookup>('clang_getRange'); - late final _dart_clang_getRange _clang_getRange = - _clang_getRange_ptr.asFunction<_dart_clang_getRange>(); + late final _clang_getRange = _clang_getRange_ptr + .asFunction(); /// Determine whether two ranges are equivalent. /// @@ -523,8 +518,8 @@ class LibClang { late final _clang_equalRanges_ptr = _lookup>( 'clang_equalRanges'); - late final _dart_clang_equalRanges _clang_equalRanges = - _clang_equalRanges_ptr.asFunction<_dart_clang_equalRanges>(); + late final _clang_equalRanges = _clang_equalRanges_ptr + .asFunction(); /// Returns non-zero if \p range is null. int clang_Range_isNull( @@ -538,8 +533,8 @@ class LibClang { late final _clang_Range_isNull_ptr = _lookup>( 'clang_Range_isNull'); - late final _dart_clang_Range_isNull _clang_Range_isNull = - _clang_Range_isNull_ptr.asFunction<_dart_clang_Range_isNull>(); + late final _clang_Range_isNull = + _clang_Range_isNull_ptr.asFunction(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -563,7 +558,7 @@ class LibClang { /// buffer to which the given source location points. void clang_getExpansionLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -580,9 +575,14 @@ class LibClang { late final _clang_getExpansionLocation_ptr = _lookup>( 'clang_getExpansionLocation'); - late final _dart_clang_getExpansionLocation _clang_getExpansionLocation = - _clang_getExpansionLocation_ptr - .asFunction<_dart_clang_getExpansionLocation>(); + late final _clang_getExpansionLocation = + _clang_getExpansionLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the file, line and column represented by the given source /// location, as specified in a # line directive. @@ -639,9 +639,10 @@ class LibClang { late final _clang_getPresumedLocation_ptr = _lookup>( 'clang_getPresumedLocation'); - late final _dart_clang_getPresumedLocation _clang_getPresumedLocation = - _clang_getPresumedLocation_ptr - .asFunction<_dart_clang_getPresumedLocation>(); + late final _clang_getPresumedLocation = + _clang_getPresumedLocation_ptr.asFunction< + void Function(CXSourceLocation, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Legacy API to retrieve the file, line, column, and offset represented /// by the given source location. @@ -651,7 +652,7 @@ class LibClang { /// details. void clang_getInstantiationLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -668,9 +669,14 @@ class LibClang { late final _clang_getInstantiationLocation_ptr = _lookup>( 'clang_getInstantiationLocation'); - late final _dart_clang_getInstantiationLocation - _clang_getInstantiationLocation = _clang_getInstantiationLocation_ptr - .asFunction<_dart_clang_getInstantiationLocation>(); + late final _clang_getInstantiationLocation = + _clang_getInstantiationLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -694,7 +700,7 @@ class LibClang { /// buffer to which the given source location points. void clang_getSpellingLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -711,9 +717,14 @@ class LibClang { late final _clang_getSpellingLocation_ptr = _lookup>( 'clang_getSpellingLocation'); - late final _dart_clang_getSpellingLocation _clang_getSpellingLocation = - _clang_getSpellingLocation_ptr - .asFunction<_dart_clang_getSpellingLocation>(); + late final _clang_getSpellingLocation = + _clang_getSpellingLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -738,7 +749,7 @@ class LibClang { /// buffer to which the given source location points. void clang_getFileLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -755,8 +766,13 @@ class LibClang { late final _clang_getFileLocation_ptr = _lookup>( 'clang_getFileLocation'); - late final _dart_clang_getFileLocation _clang_getFileLocation = - _clang_getFileLocation_ptr.asFunction<_dart_clang_getFileLocation>(); + late final _clang_getFileLocation = _clang_getFileLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve a source location representing the first character within a /// source range. @@ -771,8 +787,8 @@ class LibClang { late final _clang_getRangeStart_ptr = _lookup>( 'clang_getRangeStart'); - late final _dart_clang_getRangeStart _clang_getRangeStart = - _clang_getRangeStart_ptr.asFunction<_dart_clang_getRangeStart>(); + late final _clang_getRangeStart = _clang_getRangeStart_ptr + .asFunction(); /// Retrieve a source location representing the last character within a /// source range. @@ -787,16 +803,16 @@ class LibClang { late final _clang_getRangeEnd_ptr = _lookup>( 'clang_getRangeEnd'); - late final _dart_clang_getRangeEnd _clang_getRangeEnd = - _clang_getRangeEnd_ptr.asFunction<_dart_clang_getRangeEnd>(); + late final _clang_getRangeEnd = _clang_getRangeEnd_ptr + .asFunction(); /// Retrieve all ranges that were skipped by the preprocessor. /// /// The preprocessor will skip lines when they are surrounded by an /// if/ifdef/ifndef directive whose condition does not evaluate to true. ffi.Pointer clang_getSkippedRanges( - ffi.Pointer tu, - ffi.Pointer file, + CXTranslationUnit tu, + CXFile file, ) { return _clang_getSkippedRanges( tu, @@ -807,8 +823,8 @@ class LibClang { late final _clang_getSkippedRanges_ptr = _lookup>( 'clang_getSkippedRanges'); - late final _dart_clang_getSkippedRanges _clang_getSkippedRanges = - _clang_getSkippedRanges_ptr.asFunction<_dart_clang_getSkippedRanges>(); + late final _clang_getSkippedRanges = _clang_getSkippedRanges_ptr.asFunction< + ffi.Pointer Function(CXTranslationUnit, CXFile)>(); /// Retrieve all ranges from all files that were skipped by the /// preprocessor. @@ -816,7 +832,7 @@ class LibClang { /// The preprocessor will skip lines when they are surrounded by an /// if/ifdef/ifndef directive whose condition does not evaluate to true. ffi.Pointer clang_getAllSkippedRanges( - ffi.Pointer tu, + CXTranslationUnit tu, ) { return _clang_getAllSkippedRanges( tu, @@ -826,9 +842,8 @@ class LibClang { late final _clang_getAllSkippedRanges_ptr = _lookup>( 'clang_getAllSkippedRanges'); - late final _dart_clang_getAllSkippedRanges _clang_getAllSkippedRanges = - _clang_getAllSkippedRanges_ptr - .asFunction<_dart_clang_getAllSkippedRanges>(); + late final _clang_getAllSkippedRanges = _clang_getAllSkippedRanges_ptr + .asFunction Function(CXTranslationUnit)>(); /// Destroy the given \c CXSourceRangeList. void clang_disposeSourceRangeList( @@ -842,13 +857,12 @@ class LibClang { late final _clang_disposeSourceRangeList_ptr = _lookup>( 'clang_disposeSourceRangeList'); - late final _dart_clang_disposeSourceRangeList _clang_disposeSourceRangeList = - _clang_disposeSourceRangeList_ptr - .asFunction<_dart_clang_disposeSourceRangeList>(); + late final _clang_disposeSourceRangeList = _clang_disposeSourceRangeList_ptr + .asFunction)>(); /// Determine the number of diagnostics in a CXDiagnosticSet. int clang_getNumDiagnosticsInSet( - ffi.Pointer Diags, + CXDiagnosticSet Diags, ) { return _clang_getNumDiagnosticsInSet( Diags, @@ -858,9 +872,8 @@ class LibClang { late final _clang_getNumDiagnosticsInSet_ptr = _lookup>( 'clang_getNumDiagnosticsInSet'); - late final _dart_clang_getNumDiagnosticsInSet _clang_getNumDiagnosticsInSet = - _clang_getNumDiagnosticsInSet_ptr - .asFunction<_dart_clang_getNumDiagnosticsInSet>(); + late final _clang_getNumDiagnosticsInSet = _clang_getNumDiagnosticsInSet_ptr + .asFunction(); /// Retrieve a diagnostic associated with the given CXDiagnosticSet. /// @@ -869,8 +882,8 @@ class LibClang { /// /// \returns the requested diagnostic. This diagnostic must be freed /// via a call to \c clang_disposeDiagnostic(). - ffi.Pointer clang_getDiagnosticInSet( - ffi.Pointer Diags, + CXDiagnostic clang_getDiagnosticInSet( + CXDiagnosticSet Diags, int Index, ) { return _clang_getDiagnosticInSet( @@ -882,9 +895,8 @@ class LibClang { late final _clang_getDiagnosticInSet_ptr = _lookup>( 'clang_getDiagnosticInSet'); - late final _dart_clang_getDiagnosticInSet _clang_getDiagnosticInSet = - _clang_getDiagnosticInSet_ptr - .asFunction<_dart_clang_getDiagnosticInSet>(); + late final _clang_getDiagnosticInSet = _clang_getDiagnosticInSet_ptr + .asFunction(); /// Deserialize a set of diagnostics from a Clang diagnostics bitcode /// file. @@ -897,7 +909,7 @@ class LibClang { /// /// \returns A loaded CXDiagnosticSet if successful, and NULL otherwise. These /// diagnostics should be released using clang_disposeDiagnosticSet(). - ffi.Pointer clang_loadDiagnostics( + CXDiagnosticSet clang_loadDiagnostics( ffi.Pointer file, ffi.Pointer error, ffi.Pointer errorString, @@ -912,12 +924,13 @@ class LibClang { late final _clang_loadDiagnostics_ptr = _lookup>( 'clang_loadDiagnostics'); - late final _dart_clang_loadDiagnostics _clang_loadDiagnostics = - _clang_loadDiagnostics_ptr.asFunction<_dart_clang_loadDiagnostics>(); + late final _clang_loadDiagnostics = _clang_loadDiagnostics_ptr.asFunction< + CXDiagnosticSet Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Release a CXDiagnosticSet and all of its contained diagnostics. void clang_disposeDiagnosticSet( - ffi.Pointer Diags, + CXDiagnosticSet Diags, ) { return _clang_disposeDiagnosticSet( Diags, @@ -927,16 +940,15 @@ class LibClang { late final _clang_disposeDiagnosticSet_ptr = _lookup>( 'clang_disposeDiagnosticSet'); - late final _dart_clang_disposeDiagnosticSet _clang_disposeDiagnosticSet = - _clang_disposeDiagnosticSet_ptr - .asFunction<_dart_clang_disposeDiagnosticSet>(); + late final _clang_disposeDiagnosticSet = _clang_disposeDiagnosticSet_ptr + .asFunction(); /// Retrieve the child diagnostics of a CXDiagnostic. /// /// This CXDiagnosticSet does not need to be released by /// clang_disposeDiagnosticSet. - ffi.Pointer clang_getChildDiagnostics( - ffi.Pointer D, + CXDiagnosticSet clang_getChildDiagnostics( + CXDiagnostic D, ) { return _clang_getChildDiagnostics( D, @@ -946,14 +958,13 @@ class LibClang { late final _clang_getChildDiagnostics_ptr = _lookup>( 'clang_getChildDiagnostics'); - late final _dart_clang_getChildDiagnostics _clang_getChildDiagnostics = - _clang_getChildDiagnostics_ptr - .asFunction<_dart_clang_getChildDiagnostics>(); + late final _clang_getChildDiagnostics = _clang_getChildDiagnostics_ptr + .asFunction(); /// Determine the number of diagnostics produced for the given /// translation unit. int clang_getNumDiagnostics( - ffi.Pointer Unit, + CXTranslationUnit Unit, ) { return _clang_getNumDiagnostics( Unit, @@ -963,8 +974,8 @@ class LibClang { late final _clang_getNumDiagnostics_ptr = _lookup>( 'clang_getNumDiagnostics'); - late final _dart_clang_getNumDiagnostics _clang_getNumDiagnostics = - _clang_getNumDiagnostics_ptr.asFunction<_dart_clang_getNumDiagnostics>(); + late final _clang_getNumDiagnostics = _clang_getNumDiagnostics_ptr + .asFunction(); /// Retrieve a diagnostic associated with the given translation unit. /// @@ -973,8 +984,8 @@ class LibClang { /// /// \returns the requested diagnostic. This diagnostic must be freed /// via a call to \c clang_disposeDiagnostic(). - ffi.Pointer clang_getDiagnostic( - ffi.Pointer Unit, + CXDiagnostic clang_getDiagnostic( + CXTranslationUnit Unit, int Index, ) { return _clang_getDiagnostic( @@ -986,15 +997,15 @@ class LibClang { late final _clang_getDiagnostic_ptr = _lookup>( 'clang_getDiagnostic'); - late final _dart_clang_getDiagnostic _clang_getDiagnostic = - _clang_getDiagnostic_ptr.asFunction<_dart_clang_getDiagnostic>(); + late final _clang_getDiagnostic = _clang_getDiagnostic_ptr + .asFunction(); /// Retrieve the complete set of diagnostics associated with a /// translation unit. /// /// \param Unit the translation unit to query. - ffi.Pointer clang_getDiagnosticSetFromTU( - ffi.Pointer Unit, + CXDiagnosticSet clang_getDiagnosticSetFromTU( + CXTranslationUnit Unit, ) { return _clang_getDiagnosticSetFromTU( Unit, @@ -1004,13 +1015,12 @@ class LibClang { late final _clang_getDiagnosticSetFromTU_ptr = _lookup>( 'clang_getDiagnosticSetFromTU'); - late final _dart_clang_getDiagnosticSetFromTU _clang_getDiagnosticSetFromTU = - _clang_getDiagnosticSetFromTU_ptr - .asFunction<_dart_clang_getDiagnosticSetFromTU>(); + late final _clang_getDiagnosticSetFromTU = _clang_getDiagnosticSetFromTU_ptr + .asFunction(); /// Destroy a diagnostic. void clang_disposeDiagnostic( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, ) { return _clang_disposeDiagnostic( Diagnostic, @@ -1020,8 +1030,8 @@ class LibClang { late final _clang_disposeDiagnostic_ptr = _lookup>( 'clang_disposeDiagnostic'); - late final _dart_clang_disposeDiagnostic _clang_disposeDiagnostic = - _clang_disposeDiagnostic_ptr.asFunction<_dart_clang_disposeDiagnostic>(); + late final _clang_disposeDiagnostic = + _clang_disposeDiagnostic_ptr.asFunction(); /// Format the given diagnostic in a manner that is suitable for display. /// @@ -1037,7 +1047,7 @@ class LibClang { /// /// \returns A new string containing for formatted diagnostic. CXString clang_formatDiagnostic( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, int Options, ) { return _clang_formatDiagnostic( @@ -1049,8 +1059,8 @@ class LibClang { late final _clang_formatDiagnostic_ptr = _lookup>( 'clang_formatDiagnostic'); - late final _dart_clang_formatDiagnostic _clang_formatDiagnostic = - _clang_formatDiagnostic_ptr.asFunction<_dart_clang_formatDiagnostic>(); + late final _clang_formatDiagnostic = _clang_formatDiagnostic_ptr + .asFunction(); /// Retrieve the set of display options most similar to the /// default behavior of the clang compiler. @@ -1064,14 +1074,12 @@ class LibClang { late final _clang_defaultDiagnosticDisplayOptions_ptr = _lookup>( 'clang_defaultDiagnosticDisplayOptions'); - late final _dart_clang_defaultDiagnosticDisplayOptions - _clang_defaultDiagnosticDisplayOptions = - _clang_defaultDiagnosticDisplayOptions_ptr - .asFunction<_dart_clang_defaultDiagnosticDisplayOptions>(); + late final _clang_defaultDiagnosticDisplayOptions = + _clang_defaultDiagnosticDisplayOptions_ptr.asFunction(); /// Determine the severity of the given diagnostic. int clang_getDiagnosticSeverity( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticSeverity( arg0, @@ -1081,16 +1089,15 @@ class LibClang { late final _clang_getDiagnosticSeverity_ptr = _lookup>( 'clang_getDiagnosticSeverity'); - late final _dart_clang_getDiagnosticSeverity _clang_getDiagnosticSeverity = - _clang_getDiagnosticSeverity_ptr - .asFunction<_dart_clang_getDiagnosticSeverity>(); + late final _clang_getDiagnosticSeverity = + _clang_getDiagnosticSeverity_ptr.asFunction(); /// Retrieve the source location of the given diagnostic. /// /// This location is where Clang would print the caret ('^') when /// displaying the diagnostic on the command line. CXSourceLocation clang_getDiagnosticLocation( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticLocation( arg0, @@ -1100,13 +1107,12 @@ class LibClang { late final _clang_getDiagnosticLocation_ptr = _lookup>( 'clang_getDiagnosticLocation'); - late final _dart_clang_getDiagnosticLocation _clang_getDiagnosticLocation = - _clang_getDiagnosticLocation_ptr - .asFunction<_dart_clang_getDiagnosticLocation>(); + late final _clang_getDiagnosticLocation = _clang_getDiagnosticLocation_ptr + .asFunction(); /// Retrieve the text of the given diagnostic. CXString clang_getDiagnosticSpelling( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticSpelling( arg0, @@ -1116,9 +1122,8 @@ class LibClang { late final _clang_getDiagnosticSpelling_ptr = _lookup>( 'clang_getDiagnosticSpelling'); - late final _dart_clang_getDiagnosticSpelling _clang_getDiagnosticSpelling = - _clang_getDiagnosticSpelling_ptr - .asFunction<_dart_clang_getDiagnosticSpelling>(); + late final _clang_getDiagnosticSpelling = _clang_getDiagnosticSpelling_ptr + .asFunction(); /// Retrieve the name of the command-line option that enabled this /// diagnostic. @@ -1131,7 +1136,7 @@ class LibClang { /// \returns A string that contains the command-line option used to enable this /// warning, such as "-Wconversion" or "-pedantic". CXString clang_getDiagnosticOption( - ffi.Pointer Diag, + CXDiagnostic Diag, ffi.Pointer Disable, ) { return _clang_getDiagnosticOption( @@ -1143,9 +1148,8 @@ class LibClang { late final _clang_getDiagnosticOption_ptr = _lookup>( 'clang_getDiagnosticOption'); - late final _dart_clang_getDiagnosticOption _clang_getDiagnosticOption = - _clang_getDiagnosticOption_ptr - .asFunction<_dart_clang_getDiagnosticOption>(); + late final _clang_getDiagnosticOption = _clang_getDiagnosticOption_ptr + .asFunction)>(); /// Retrieve the category number for this diagnostic. /// @@ -1156,7 +1160,7 @@ class LibClang { /// \returns The number of the category that contains this diagnostic, or zero /// if this diagnostic is uncategorized. int clang_getDiagnosticCategory( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticCategory( arg0, @@ -1166,9 +1170,8 @@ class LibClang { late final _clang_getDiagnosticCategory_ptr = _lookup>( 'clang_getDiagnosticCategory'); - late final _dart_clang_getDiagnosticCategory _clang_getDiagnosticCategory = - _clang_getDiagnosticCategory_ptr - .asFunction<_dart_clang_getDiagnosticCategory>(); + late final _clang_getDiagnosticCategory = + _clang_getDiagnosticCategory_ptr.asFunction(); /// Retrieve the name of a particular diagnostic category. This /// is now deprecated. Use clang_getDiagnosticCategoryText() @@ -1189,15 +1192,14 @@ class LibClang { late final _clang_getDiagnosticCategoryName_ptr = _lookup>( 'clang_getDiagnosticCategoryName'); - late final _dart_clang_getDiagnosticCategoryName - _clang_getDiagnosticCategoryName = _clang_getDiagnosticCategoryName_ptr - .asFunction<_dart_clang_getDiagnosticCategoryName>(); + late final _clang_getDiagnosticCategoryName = + _clang_getDiagnosticCategoryName_ptr.asFunction(); /// Retrieve the diagnostic category text for a given diagnostic. /// /// \returns The text of the given diagnostic category. CXString clang_getDiagnosticCategoryText( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticCategoryText( arg0, @@ -1207,14 +1209,14 @@ class LibClang { late final _clang_getDiagnosticCategoryText_ptr = _lookup>( 'clang_getDiagnosticCategoryText'); - late final _dart_clang_getDiagnosticCategoryText - _clang_getDiagnosticCategoryText = _clang_getDiagnosticCategoryText_ptr - .asFunction<_dart_clang_getDiagnosticCategoryText>(); + late final _clang_getDiagnosticCategoryText = + _clang_getDiagnosticCategoryText_ptr + .asFunction(); /// Determine the number of source ranges associated with the given /// diagnostic. int clang_getDiagnosticNumRanges( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticNumRanges( arg0, @@ -1224,9 +1226,8 @@ class LibClang { late final _clang_getDiagnosticNumRanges_ptr = _lookup>( 'clang_getDiagnosticNumRanges'); - late final _dart_clang_getDiagnosticNumRanges _clang_getDiagnosticNumRanges = - _clang_getDiagnosticNumRanges_ptr - .asFunction<_dart_clang_getDiagnosticNumRanges>(); + late final _clang_getDiagnosticNumRanges = _clang_getDiagnosticNumRanges_ptr + .asFunction(); /// Retrieve a source range associated with the diagnostic. /// @@ -1240,7 +1241,7 @@ class LibClang { /// /// \returns the requested source range. CXSourceRange clang_getDiagnosticRange( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, int Range, ) { return _clang_getDiagnosticRange( @@ -1252,14 +1253,13 @@ class LibClang { late final _clang_getDiagnosticRange_ptr = _lookup>( 'clang_getDiagnosticRange'); - late final _dart_clang_getDiagnosticRange _clang_getDiagnosticRange = - _clang_getDiagnosticRange_ptr - .asFunction<_dart_clang_getDiagnosticRange>(); + late final _clang_getDiagnosticRange = _clang_getDiagnosticRange_ptr + .asFunction(); /// Determine the number of fix-it hints associated with the /// given diagnostic. int clang_getDiagnosticNumFixIts( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, ) { return _clang_getDiagnosticNumFixIts( Diagnostic, @@ -1269,9 +1269,8 @@ class LibClang { late final _clang_getDiagnosticNumFixIts_ptr = _lookup>( 'clang_getDiagnosticNumFixIts'); - late final _dart_clang_getDiagnosticNumFixIts _clang_getDiagnosticNumFixIts = - _clang_getDiagnosticNumFixIts_ptr - .asFunction<_dart_clang_getDiagnosticNumFixIts>(); + late final _clang_getDiagnosticNumFixIts = _clang_getDiagnosticNumFixIts_ptr + .asFunction(); /// Retrieve the replacement information for a given fix-it. /// @@ -1297,7 +1296,7 @@ class LibClang { /// \returns A string containing text that should be replace the source /// code indicated by the \c ReplacementRange. CXString clang_getDiagnosticFixIt( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, int FixIt, ffi.Pointer ReplacementRange, ) { @@ -1311,13 +1310,13 @@ class LibClang { late final _clang_getDiagnosticFixIt_ptr = _lookup>( 'clang_getDiagnosticFixIt'); - late final _dart_clang_getDiagnosticFixIt _clang_getDiagnosticFixIt = - _clang_getDiagnosticFixIt_ptr - .asFunction<_dart_clang_getDiagnosticFixIt>(); + late final _clang_getDiagnosticFixIt = + _clang_getDiagnosticFixIt_ptr.asFunction< + CXString Function(CXDiagnostic, int, ffi.Pointer)>(); /// Get the original translation unit source file name. CXString clang_getTranslationUnitSpelling( - ffi.Pointer CTUnit, + CXTranslationUnit CTUnit, ) { return _clang_getTranslationUnitSpelling( CTUnit, @@ -1327,9 +1326,9 @@ class LibClang { late final _clang_getTranslationUnitSpelling_ptr = _lookup>( 'clang_getTranslationUnitSpelling'); - late final _dart_clang_getTranslationUnitSpelling - _clang_getTranslationUnitSpelling = _clang_getTranslationUnitSpelling_ptr - .asFunction<_dart_clang_getTranslationUnitSpelling>(); + late final _clang_getTranslationUnitSpelling = + _clang_getTranslationUnitSpelling_ptr + .asFunction(); /// Return the CXTranslationUnit for a given source file and the provided /// command line arguments one would pass to the compiler. @@ -1369,8 +1368,8 @@ class LibClang { /// those files. The contents and name of these files (as specified by /// CXUnsavedFile) are copied when necessary, so the client only needs to /// guarantee their validity until the call to this function returns. - ffi.Pointer clang_createTranslationUnitFromSourceFile( - ffi.Pointer CIdx, + CXTranslationUnit clang_createTranslationUnitFromSourceFile( + CXIndex CIdx, ffi.Pointer source_filename, int num_clang_command_line_args, ffi.Pointer> clang_command_line_args, @@ -1390,17 +1389,22 @@ class LibClang { late final _clang_createTranslationUnitFromSourceFile_ptr = _lookup< ffi.NativeFunction>( 'clang_createTranslationUnitFromSourceFile'); - late final _dart_clang_createTranslationUnitFromSourceFile - _clang_createTranslationUnitFromSourceFile = - _clang_createTranslationUnitFromSourceFile_ptr - .asFunction<_dart_clang_createTranslationUnitFromSourceFile>(); + late final _clang_createTranslationUnitFromSourceFile = + _clang_createTranslationUnitFromSourceFile_ptr.asFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + int, + ffi.Pointer>, + int, + ffi.Pointer)>(); /// Same as \c clang_createTranslationUnit2, but returns /// the \c CXTranslationUnit instead of an error code. In case of an error this /// routine returns a \c NULL \c CXTranslationUnit, without further detailed /// error codes. - ffi.Pointer clang_createTranslationUnit( - ffi.Pointer CIdx, + CXTranslationUnit clang_createTranslationUnit( + CXIndex CIdx, ffi.Pointer ast_filename, ) { return _clang_createTranslationUnit( @@ -1412,9 +1416,8 @@ class LibClang { late final _clang_createTranslationUnit_ptr = _lookup>( 'clang_createTranslationUnit'); - late final _dart_clang_createTranslationUnit _clang_createTranslationUnit = - _clang_createTranslationUnit_ptr - .asFunction<_dart_clang_createTranslationUnit>(); + late final _clang_createTranslationUnit = _clang_createTranslationUnit_ptr + .asFunction)>(); /// Create a translation unit from an AST file (\c -emit-ast). /// @@ -1423,9 +1426,9 @@ class LibClang { /// /// \returns Zero on success, otherwise returns an error code. int clang_createTranslationUnit2( - ffi.Pointer CIdx, + CXIndex CIdx, ffi.Pointer ast_filename, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, ) { return _clang_createTranslationUnit2( CIdx, @@ -1437,9 +1440,10 @@ class LibClang { late final _clang_createTranslationUnit2_ptr = _lookup>( 'clang_createTranslationUnit2'); - late final _dart_clang_createTranslationUnit2 _clang_createTranslationUnit2 = - _clang_createTranslationUnit2_ptr - .asFunction<_dart_clang_createTranslationUnit2>(); + late final _clang_createTranslationUnit2 = + _clang_createTranslationUnit2_ptr.asFunction< + int Function(CXIndex, ffi.Pointer, + ffi.Pointer)>(); /// Returns the set of flags that is suitable for parsing a translation /// unit that is being edited. @@ -1459,17 +1463,16 @@ class LibClang { ffi.NativeFunction< Native_clang_defaultEditingTranslationUnitOptions>>( 'clang_defaultEditingTranslationUnitOptions'); - late final _dart_clang_defaultEditingTranslationUnitOptions - _clang_defaultEditingTranslationUnitOptions = + late final _clang_defaultEditingTranslationUnitOptions = _clang_defaultEditingTranslationUnitOptions_ptr - .asFunction<_dart_clang_defaultEditingTranslationUnitOptions>(); + .asFunction(); /// Same as \c clang_parseTranslationUnit2, but returns /// the \c CXTranslationUnit instead of an error code. In case of an error this /// routine returns a \c NULL \c CXTranslationUnit, without further detailed /// error codes. - ffi.Pointer clang_parseTranslationUnit( - ffi.Pointer CIdx, + CXTranslationUnit clang_parseTranslationUnit( + CXIndex CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, int num_command_line_args, @@ -1491,9 +1494,16 @@ class LibClang { late final _clang_parseTranslationUnit_ptr = _lookup>( 'clang_parseTranslationUnit'); - late final _dart_clang_parseTranslationUnit _clang_parseTranslationUnit = - _clang_parseTranslationUnit_ptr - .asFunction<_dart_clang_parseTranslationUnit>(); + late final _clang_parseTranslationUnit = + _clang_parseTranslationUnit_ptr.asFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + int)>(); /// Parse the given source file and the translation unit corresponding /// to that file. @@ -1538,14 +1548,14 @@ class LibClang { /// /// \returns Zero on success, otherwise returns an error code. int clang_parseTranslationUnit2( - ffi.Pointer CIdx, + CXIndex CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, int options, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, ) { return _clang_parseTranslationUnit2( CIdx, @@ -1562,22 +1572,30 @@ class LibClang { late final _clang_parseTranslationUnit2_ptr = _lookup>( 'clang_parseTranslationUnit2'); - late final _dart_clang_parseTranslationUnit2 _clang_parseTranslationUnit2 = - _clang_parseTranslationUnit2_ptr - .asFunction<_dart_clang_parseTranslationUnit2>(); + late final _clang_parseTranslationUnit2 = + _clang_parseTranslationUnit2_ptr.asFunction< + int Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + int, + ffi.Pointer)>(); /// Same as clang_parseTranslationUnit2 but requires a full command line /// for \c command_line_args including argv[0]. This is useful if the standard /// library paths are relative to the binary. int clang_parseTranslationUnit2FullArgv( - ffi.Pointer CIdx, + CXIndex CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, int options, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, ) { return _clang_parseTranslationUnit2FullArgv( CIdx, @@ -1594,10 +1612,17 @@ class LibClang { late final _clang_parseTranslationUnit2FullArgv_ptr = _lookup>( 'clang_parseTranslationUnit2FullArgv'); - late final _dart_clang_parseTranslationUnit2FullArgv - _clang_parseTranslationUnit2FullArgv = - _clang_parseTranslationUnit2FullArgv_ptr - .asFunction<_dart_clang_parseTranslationUnit2FullArgv>(); + late final _clang_parseTranslationUnit2FullArgv = + _clang_parseTranslationUnit2FullArgv_ptr.asFunction< + int Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + int, + ffi.Pointer)>(); /// Returns the set of flags that is suitable for saving a translation /// unit. @@ -1607,7 +1632,7 @@ class LibClang { /// set contains an unspecified set of options that save translation units with /// the most commonly-requested data. int clang_defaultSaveOptions( - ffi.Pointer TU, + CXTranslationUnit TU, ) { return _clang_defaultSaveOptions( TU, @@ -1617,9 +1642,8 @@ class LibClang { late final _clang_defaultSaveOptions_ptr = _lookup>( 'clang_defaultSaveOptions'); - late final _dart_clang_defaultSaveOptions _clang_defaultSaveOptions = - _clang_defaultSaveOptions_ptr - .asFunction<_dart_clang_defaultSaveOptions>(); + late final _clang_defaultSaveOptions = _clang_defaultSaveOptions_ptr + .asFunction(); /// Saves a translation unit into a serialized representation of /// that translation unit on disk. @@ -1643,7 +1667,7 @@ class LibClang { /// enumeration. Zero (CXSaveError_None) indicates that the translation unit was /// saved successfully, while a non-zero value indicates that a problem occurred. int clang_saveTranslationUnit( - ffi.Pointer TU, + CXTranslationUnit TU, ffi.Pointer FileName, int options, ) { @@ -1657,9 +1681,9 @@ class LibClang { late final _clang_saveTranslationUnit_ptr = _lookup>( 'clang_saveTranslationUnit'); - late final _dart_clang_saveTranslationUnit _clang_saveTranslationUnit = - _clang_saveTranslationUnit_ptr - .asFunction<_dart_clang_saveTranslationUnit>(); + late final _clang_saveTranslationUnit = + _clang_saveTranslationUnit_ptr.asFunction< + int Function(CXTranslationUnit, ffi.Pointer, int)>(); /// Suspend a translation unit in order to free memory associated with it. /// @@ -1667,7 +1691,7 @@ class LibClang { /// side does not support any other calls than \c clang_reparseTranslationUnit /// to resume it or \c clang_disposeTranslationUnit to dispose it completely. int clang_suspendTranslationUnit( - ffi.Pointer arg0, + CXTranslationUnit arg0, ) { return _clang_suspendTranslationUnit( arg0, @@ -1677,13 +1701,12 @@ class LibClang { late final _clang_suspendTranslationUnit_ptr = _lookup>( 'clang_suspendTranslationUnit'); - late final _dart_clang_suspendTranslationUnit _clang_suspendTranslationUnit = - _clang_suspendTranslationUnit_ptr - .asFunction<_dart_clang_suspendTranslationUnit>(); + late final _clang_suspendTranslationUnit = _clang_suspendTranslationUnit_ptr + .asFunction(); /// Destroy the specified CXTranslationUnit object. void clang_disposeTranslationUnit( - ffi.Pointer arg0, + CXTranslationUnit arg0, ) { return _clang_disposeTranslationUnit( arg0, @@ -1693,9 +1716,8 @@ class LibClang { late final _clang_disposeTranslationUnit_ptr = _lookup>( 'clang_disposeTranslationUnit'); - late final _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit = - _clang_disposeTranslationUnit_ptr - .asFunction<_dart_clang_disposeTranslationUnit>(); + late final _clang_disposeTranslationUnit = _clang_disposeTranslationUnit_ptr + .asFunction(); /// Returns the set of flags that is suitable for reparsing a translation /// unit. @@ -1706,7 +1728,7 @@ class LibClang { /// of reparsing. The set of optimizations enabled may change from one version /// to the next. int clang_defaultReparseOptions( - ffi.Pointer TU, + CXTranslationUnit TU, ) { return _clang_defaultReparseOptions( TU, @@ -1716,9 +1738,8 @@ class LibClang { late final _clang_defaultReparseOptions_ptr = _lookup>( 'clang_defaultReparseOptions'); - late final _dart_clang_defaultReparseOptions _clang_defaultReparseOptions = - _clang_defaultReparseOptions_ptr - .asFunction<_dart_clang_defaultReparseOptions>(); + late final _clang_defaultReparseOptions = _clang_defaultReparseOptions_ptr + .asFunction(); /// Reparse the source files that produced this translation unit. /// @@ -1758,7 +1779,7 @@ class LibClang { /// \c clang_disposeTranslationUnit(TU). The error codes returned by this /// routine are described by the \c CXErrorCode enum. int clang_reparseTranslationUnit( - ffi.Pointer TU, + CXTranslationUnit TU, int num_unsaved_files, ffi.Pointer unsaved_files, int options, @@ -1774,9 +1795,10 @@ class LibClang { late final _clang_reparseTranslationUnit_ptr = _lookup>( 'clang_reparseTranslationUnit'); - late final _dart_clang_reparseTranslationUnit _clang_reparseTranslationUnit = - _clang_reparseTranslationUnit_ptr - .asFunction<_dart_clang_reparseTranslationUnit>(); + late final _clang_reparseTranslationUnit = + _clang_reparseTranslationUnit_ptr.asFunction< + int Function( + CXTranslationUnit, int, ffi.Pointer, int)>(); /// Returns the human-readable null-terminated C string that represents /// the name of the memory category. This string should never be freed. @@ -1791,14 +1813,13 @@ class LibClang { late final _clang_getTUResourceUsageName_ptr = _lookup>( 'clang_getTUResourceUsageName'); - late final _dart_clang_getTUResourceUsageName _clang_getTUResourceUsageName = - _clang_getTUResourceUsageName_ptr - .asFunction<_dart_clang_getTUResourceUsageName>(); + late final _clang_getTUResourceUsageName = _clang_getTUResourceUsageName_ptr + .asFunction Function(int)>(); /// Return the memory usage of a translation unit. This object /// should be released with clang_disposeCXTUResourceUsage(). CXTUResourceUsage clang_getCXTUResourceUsage( - ffi.Pointer TU, + CXTranslationUnit TU, ) { return _clang_getCXTUResourceUsage( TU, @@ -1808,9 +1829,8 @@ class LibClang { late final _clang_getCXTUResourceUsage_ptr = _lookup>( 'clang_getCXTUResourceUsage'); - late final _dart_clang_getCXTUResourceUsage _clang_getCXTUResourceUsage = - _clang_getCXTUResourceUsage_ptr - .asFunction<_dart_clang_getCXTUResourceUsage>(); + late final _clang_getCXTUResourceUsage = _clang_getCXTUResourceUsage_ptr + .asFunction(); void clang_disposeCXTUResourceUsage( CXTUResourceUsage usage, @@ -1823,15 +1843,15 @@ class LibClang { late final _clang_disposeCXTUResourceUsage_ptr = _lookup>( 'clang_disposeCXTUResourceUsage'); - late final _dart_clang_disposeCXTUResourceUsage - _clang_disposeCXTUResourceUsage = _clang_disposeCXTUResourceUsage_ptr - .asFunction<_dart_clang_disposeCXTUResourceUsage>(); + late final _clang_disposeCXTUResourceUsage = + _clang_disposeCXTUResourceUsage_ptr + .asFunction(); /// Get target information for this translation unit. /// /// The CXTargetInfo object cannot outlive the CXTranslationUnit object. - ffi.Pointer clang_getTranslationUnitTargetInfo( - ffi.Pointer CTUnit, + CXTargetInfo clang_getTranslationUnitTargetInfo( + CXTranslationUnit CTUnit, ) { return _clang_getTranslationUnitTargetInfo( CTUnit, @@ -1841,14 +1861,13 @@ class LibClang { late final _clang_getTranslationUnitTargetInfo_ptr = _lookup>( 'clang_getTranslationUnitTargetInfo'); - late final _dart_clang_getTranslationUnitTargetInfo - _clang_getTranslationUnitTargetInfo = + late final _clang_getTranslationUnitTargetInfo = _clang_getTranslationUnitTargetInfo_ptr - .asFunction<_dart_clang_getTranslationUnitTargetInfo>(); + .asFunction(); /// Destroy the CXTargetInfo object. void clang_TargetInfo_dispose( - ffi.Pointer Info, + CXTargetInfo Info, ) { return _clang_TargetInfo_dispose( Info, @@ -1858,15 +1877,14 @@ class LibClang { late final _clang_TargetInfo_dispose_ptr = _lookup>( 'clang_TargetInfo_dispose'); - late final _dart_clang_TargetInfo_dispose _clang_TargetInfo_dispose = - _clang_TargetInfo_dispose_ptr - .asFunction<_dart_clang_TargetInfo_dispose>(); + late final _clang_TargetInfo_dispose = + _clang_TargetInfo_dispose_ptr.asFunction(); /// Get the normalized target triple as a string. /// /// Returns the empty string in case of any error. CXString clang_TargetInfo_getTriple( - ffi.Pointer Info, + CXTargetInfo Info, ) { return _clang_TargetInfo_getTriple( Info, @@ -1876,15 +1894,14 @@ class LibClang { late final _clang_TargetInfo_getTriple_ptr = _lookup>( 'clang_TargetInfo_getTriple'); - late final _dart_clang_TargetInfo_getTriple _clang_TargetInfo_getTriple = - _clang_TargetInfo_getTriple_ptr - .asFunction<_dart_clang_TargetInfo_getTriple>(); + late final _clang_TargetInfo_getTriple = _clang_TargetInfo_getTriple_ptr + .asFunction(); /// Get the pointer width of the target in bits. /// /// Returns -1 in case of error. int clang_TargetInfo_getPointerWidth( - ffi.Pointer Info, + CXTargetInfo Info, ) { return _clang_TargetInfo_getPointerWidth( Info, @@ -1894,9 +1911,9 @@ class LibClang { late final _clang_TargetInfo_getPointerWidth_ptr = _lookup>( 'clang_TargetInfo_getPointerWidth'); - late final _dart_clang_TargetInfo_getPointerWidth - _clang_TargetInfo_getPointerWidth = _clang_TargetInfo_getPointerWidth_ptr - .asFunction<_dart_clang_TargetInfo_getPointerWidth>(); + late final _clang_TargetInfo_getPointerWidth = + _clang_TargetInfo_getPointerWidth_ptr + .asFunction(); /// Retrieve the NULL cursor, which represents no entity. CXCursor clang_getNullCursor() { @@ -1906,15 +1923,15 @@ class LibClang { late final _clang_getNullCursor_ptr = _lookup>( 'clang_getNullCursor'); - late final _dart_clang_getNullCursor _clang_getNullCursor = - _clang_getNullCursor_ptr.asFunction<_dart_clang_getNullCursor>(); + late final _clang_getNullCursor = + _clang_getNullCursor_ptr.asFunction(); /// Retrieve the cursor that represents the given translation unit. /// /// The translation unit cursor can be used to start traversing the /// various declarations within the given translation unit. CXCursor clang_getTranslationUnitCursor( - ffi.Pointer arg0, + CXTranslationUnit arg0, ) { return _clang_getTranslationUnitCursor( arg0, @@ -1924,9 +1941,9 @@ class LibClang { late final _clang_getTranslationUnitCursor_ptr = _lookup>( 'clang_getTranslationUnitCursor'); - late final _dart_clang_getTranslationUnitCursor - _clang_getTranslationUnitCursor = _clang_getTranslationUnitCursor_ptr - .asFunction<_dart_clang_getTranslationUnitCursor>(); + late final _clang_getTranslationUnitCursor = + _clang_getTranslationUnitCursor_ptr + .asFunction(); /// Determine whether two cursors are equivalent. int clang_equalCursors( @@ -1942,8 +1959,8 @@ class LibClang { late final _clang_equalCursors_ptr = _lookup>( 'clang_equalCursors'); - late final _dart_clang_equalCursors _clang_equalCursors = - _clang_equalCursors_ptr.asFunction<_dart_clang_equalCursors>(); + late final _clang_equalCursors = + _clang_equalCursors_ptr.asFunction(); /// Returns non-zero if \p cursor is null. int clang_Cursor_isNull( @@ -1957,8 +1974,8 @@ class LibClang { late final _clang_Cursor_isNull_ptr = _lookup>( 'clang_Cursor_isNull'); - late final _dart_clang_Cursor_isNull _clang_Cursor_isNull = - _clang_Cursor_isNull_ptr.asFunction<_dart_clang_Cursor_isNull>(); + late final _clang_Cursor_isNull = + _clang_Cursor_isNull_ptr.asFunction(); /// Compute a hash value for the given cursor. int clang_hashCursor( @@ -1971,8 +1988,8 @@ class LibClang { late final _clang_hashCursor_ptr = _lookup>('clang_hashCursor'); - late final _dart_clang_hashCursor _clang_hashCursor = - _clang_hashCursor_ptr.asFunction<_dart_clang_hashCursor>(); + late final _clang_hashCursor = + _clang_hashCursor_ptr.asFunction(); /// Retrieve the kind of the given cursor. int clang_getCursorKind( @@ -1986,8 +2003,8 @@ class LibClang { late final _clang_getCursorKind_ptr = _lookup>( 'clang_getCursorKind'); - late final _dart_clang_getCursorKind _clang_getCursorKind = - _clang_getCursorKind_ptr.asFunction<_dart_clang_getCursorKind>(); + late final _clang_getCursorKind = + _clang_getCursorKind_ptr.asFunction(); /// Determine whether the given cursor kind represents a declaration. int clang_isDeclaration( @@ -2001,8 +2018,8 @@ class LibClang { late final _clang_isDeclaration_ptr = _lookup>( 'clang_isDeclaration'); - late final _dart_clang_isDeclaration _clang_isDeclaration = - _clang_isDeclaration_ptr.asFunction<_dart_clang_isDeclaration>(); + late final _clang_isDeclaration = + _clang_isDeclaration_ptr.asFunction(); /// Determine whether the given declaration is invalid. /// @@ -2021,9 +2038,8 @@ class LibClang { late final _clang_isInvalidDeclaration_ptr = _lookup>( 'clang_isInvalidDeclaration'); - late final _dart_clang_isInvalidDeclaration _clang_isInvalidDeclaration = - _clang_isInvalidDeclaration_ptr - .asFunction<_dart_clang_isInvalidDeclaration>(); + late final _clang_isInvalidDeclaration = + _clang_isInvalidDeclaration_ptr.asFunction(); /// Determine whether the given cursor kind represents a simple /// reference. @@ -2042,8 +2058,8 @@ class LibClang { late final _clang_isReference_ptr = _lookup>( 'clang_isReference'); - late final _dart_clang_isReference _clang_isReference = - _clang_isReference_ptr.asFunction<_dart_clang_isReference>(); + late final _clang_isReference = + _clang_isReference_ptr.asFunction(); /// Determine whether the given cursor kind represents an expression. int clang_isExpression( @@ -2057,8 +2073,8 @@ class LibClang { late final _clang_isExpression_ptr = _lookup>( 'clang_isExpression'); - late final _dart_clang_isExpression _clang_isExpression = - _clang_isExpression_ptr.asFunction<_dart_clang_isExpression>(); + late final _clang_isExpression = + _clang_isExpression_ptr.asFunction(); /// Determine whether the given cursor kind represents a statement. int clang_isStatement( @@ -2072,8 +2088,8 @@ class LibClang { late final _clang_isStatement_ptr = _lookup>( 'clang_isStatement'); - late final _dart_clang_isStatement _clang_isStatement = - _clang_isStatement_ptr.asFunction<_dart_clang_isStatement>(); + late final _clang_isStatement = + _clang_isStatement_ptr.asFunction(); /// Determine whether the given cursor kind represents an attribute. int clang_isAttribute( @@ -2087,8 +2103,8 @@ class LibClang { late final _clang_isAttribute_ptr = _lookup>( 'clang_isAttribute'); - late final _dart_clang_isAttribute _clang_isAttribute = - _clang_isAttribute_ptr.asFunction<_dart_clang_isAttribute>(); + late final _clang_isAttribute = + _clang_isAttribute_ptr.asFunction(); /// Determine whether the given cursor has any attributes. int clang_Cursor_hasAttrs( @@ -2102,8 +2118,8 @@ class LibClang { late final _clang_Cursor_hasAttrs_ptr = _lookup>( 'clang_Cursor_hasAttrs'); - late final _dart_clang_Cursor_hasAttrs _clang_Cursor_hasAttrs = - _clang_Cursor_hasAttrs_ptr.asFunction<_dart_clang_Cursor_hasAttrs>(); + late final _clang_Cursor_hasAttrs = + _clang_Cursor_hasAttrs_ptr.asFunction(); /// Determine whether the given cursor kind represents an invalid /// cursor. @@ -2117,8 +2133,8 @@ class LibClang { late final _clang_isInvalid_ptr = _lookup>('clang_isInvalid'); - late final _dart_clang_isInvalid _clang_isInvalid = - _clang_isInvalid_ptr.asFunction<_dart_clang_isInvalid>(); + late final _clang_isInvalid = + _clang_isInvalid_ptr.asFunction(); /// Determine whether the given cursor kind represents a translation /// unit. @@ -2133,8 +2149,8 @@ class LibClang { late final _clang_isTranslationUnit_ptr = _lookup>( 'clang_isTranslationUnit'); - late final _dart_clang_isTranslationUnit _clang_isTranslationUnit = - _clang_isTranslationUnit_ptr.asFunction<_dart_clang_isTranslationUnit>(); + late final _clang_isTranslationUnit = + _clang_isTranslationUnit_ptr.asFunction(); /// Determine whether the given cursor represents a preprocessing /// element, such as a preprocessor directive or macro instantiation. @@ -2149,8 +2165,8 @@ class LibClang { late final _clang_isPreprocessing_ptr = _lookup>( 'clang_isPreprocessing'); - late final _dart_clang_isPreprocessing _clang_isPreprocessing = - _clang_isPreprocessing_ptr.asFunction<_dart_clang_isPreprocessing>(); + late final _clang_isPreprocessing = + _clang_isPreprocessing_ptr.asFunction(); /// Determine whether the given cursor represents a currently /// unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). @@ -2165,8 +2181,8 @@ class LibClang { late final _clang_isUnexposed_ptr = _lookup>( 'clang_isUnexposed'); - late final _dart_clang_isUnexposed _clang_isUnexposed = - _clang_isUnexposed_ptr.asFunction<_dart_clang_isUnexposed>(); + late final _clang_isUnexposed = + _clang_isUnexposed_ptr.asFunction(); /// Determine the linkage of the entity referred to by a given cursor. int clang_getCursorLinkage( @@ -2180,8 +2196,8 @@ class LibClang { late final _clang_getCursorLinkage_ptr = _lookup>( 'clang_getCursorLinkage'); - late final _dart_clang_getCursorLinkage _clang_getCursorLinkage = - _clang_getCursorLinkage_ptr.asFunction<_dart_clang_getCursorLinkage>(); + late final _clang_getCursorLinkage = + _clang_getCursorLinkage_ptr.asFunction(); /// Describe the visibility of the entity referred to by a cursor. /// @@ -2203,9 +2219,8 @@ class LibClang { late final _clang_getCursorVisibility_ptr = _lookup>( 'clang_getCursorVisibility'); - late final _dart_clang_getCursorVisibility _clang_getCursorVisibility = - _clang_getCursorVisibility_ptr - .asFunction<_dart_clang_getCursorVisibility>(); + late final _clang_getCursorVisibility = + _clang_getCursorVisibility_ptr.asFunction(); /// Determine the availability of the entity that this cursor refers to, /// taking the current target platform into account. @@ -2224,9 +2239,8 @@ class LibClang { late final _clang_getCursorAvailability_ptr = _lookup>( 'clang_getCursorAvailability'); - late final _dart_clang_getCursorAvailability _clang_getCursorAvailability = - _clang_getCursorAvailability_ptr - .asFunction<_dart_clang_getCursorAvailability>(); + late final _clang_getCursorAvailability = + _clang_getCursorAvailability_ptr.asFunction(); /// Determine the availability of the entity that this cursor refers to /// on any platforms for which availability information is known. @@ -2285,10 +2299,16 @@ class LibClang { late final _clang_getCursorPlatformAvailability_ptr = _lookup>( 'clang_getCursorPlatformAvailability'); - late final _dart_clang_getCursorPlatformAvailability - _clang_getCursorPlatformAvailability = - _clang_getCursorPlatformAvailability_ptr - .asFunction<_dart_clang_getCursorPlatformAvailability>(); + late final _clang_getCursorPlatformAvailability = + _clang_getCursorPlatformAvailability_ptr.asFunction< + int Function( + CXCursor, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); /// Free the memory associated with a \c CXPlatformAvailability structure. void clang_disposeCXPlatformAvailability( @@ -2302,10 +2322,9 @@ class LibClang { late final _clang_disposeCXPlatformAvailability_ptr = _lookup>( 'clang_disposeCXPlatformAvailability'); - late final _dart_clang_disposeCXPlatformAvailability - _clang_disposeCXPlatformAvailability = + late final _clang_disposeCXPlatformAvailability = _clang_disposeCXPlatformAvailability_ptr - .asFunction<_dart_clang_disposeCXPlatformAvailability>(); + .asFunction)>(); /// Determine the "language" of the entity referred to by a given cursor. int clang_getCursorLanguage( @@ -2319,8 +2338,8 @@ class LibClang { late final _clang_getCursorLanguage_ptr = _lookup>( 'clang_getCursorLanguage'); - late final _dart_clang_getCursorLanguage _clang_getCursorLanguage = - _clang_getCursorLanguage_ptr.asFunction<_dart_clang_getCursorLanguage>(); + late final _clang_getCursorLanguage = + _clang_getCursorLanguage_ptr.asFunction(); /// Determine the "thread-local storage (TLS) kind" of the declaration /// referred to by a cursor. @@ -2335,11 +2354,11 @@ class LibClang { late final _clang_getCursorTLSKind_ptr = _lookup>( 'clang_getCursorTLSKind'); - late final _dart_clang_getCursorTLSKind _clang_getCursorTLSKind = - _clang_getCursorTLSKind_ptr.asFunction<_dart_clang_getCursorTLSKind>(); + late final _clang_getCursorTLSKind = + _clang_getCursorTLSKind_ptr.asFunction(); /// Returns the translation unit that a cursor originated from. - ffi.Pointer clang_Cursor_getTranslationUnit( + CXTranslationUnit clang_Cursor_getTranslationUnit( CXCursor arg0, ) { return _clang_Cursor_getTranslationUnit( @@ -2350,24 +2369,24 @@ class LibClang { late final _clang_Cursor_getTranslationUnit_ptr = _lookup>( 'clang_Cursor_getTranslationUnit'); - late final _dart_clang_Cursor_getTranslationUnit - _clang_Cursor_getTranslationUnit = _clang_Cursor_getTranslationUnit_ptr - .asFunction<_dart_clang_Cursor_getTranslationUnit>(); + late final _clang_Cursor_getTranslationUnit = + _clang_Cursor_getTranslationUnit_ptr + .asFunction(); /// Creates an empty CXCursorSet. - ffi.Pointer clang_createCXCursorSet() { + CXCursorSet clang_createCXCursorSet() { return _clang_createCXCursorSet(); } late final _clang_createCXCursorSet_ptr = _lookup>( 'clang_createCXCursorSet'); - late final _dart_clang_createCXCursorSet _clang_createCXCursorSet = - _clang_createCXCursorSet_ptr.asFunction<_dart_clang_createCXCursorSet>(); + late final _clang_createCXCursorSet = + _clang_createCXCursorSet_ptr.asFunction(); /// Disposes a CXCursorSet and releases its associated memory. void clang_disposeCXCursorSet( - ffi.Pointer cset, + CXCursorSet cset, ) { return _clang_disposeCXCursorSet( cset, @@ -2377,15 +2396,14 @@ class LibClang { late final _clang_disposeCXCursorSet_ptr = _lookup>( 'clang_disposeCXCursorSet'); - late final _dart_clang_disposeCXCursorSet _clang_disposeCXCursorSet = - _clang_disposeCXCursorSet_ptr - .asFunction<_dart_clang_disposeCXCursorSet>(); + late final _clang_disposeCXCursorSet = + _clang_disposeCXCursorSet_ptr.asFunction(); /// Queries a CXCursorSet to see if it contains a specific CXCursor. /// /// \returns non-zero if the set contains the specified cursor. int clang_CXCursorSet_contains( - ffi.Pointer cset, + CXCursorSet cset, CXCursor cursor, ) { return _clang_CXCursorSet_contains( @@ -2397,15 +2415,14 @@ class LibClang { late final _clang_CXCursorSet_contains_ptr = _lookup>( 'clang_CXCursorSet_contains'); - late final _dart_clang_CXCursorSet_contains _clang_CXCursorSet_contains = - _clang_CXCursorSet_contains_ptr - .asFunction<_dart_clang_CXCursorSet_contains>(); + late final _clang_CXCursorSet_contains = _clang_CXCursorSet_contains_ptr + .asFunction(); /// Inserts a CXCursor into a CXCursorSet. /// /// \returns zero if the CXCursor was already in the set, and non-zero otherwise. int clang_CXCursorSet_insert( - ffi.Pointer cset, + CXCursorSet cset, CXCursor cursor, ) { return _clang_CXCursorSet_insert( @@ -2417,9 +2434,8 @@ class LibClang { late final _clang_CXCursorSet_insert_ptr = _lookup>( 'clang_CXCursorSet_insert'); - late final _dart_clang_CXCursorSet_insert _clang_CXCursorSet_insert = - _clang_CXCursorSet_insert_ptr - .asFunction<_dart_clang_CXCursorSet_insert>(); + late final _clang_CXCursorSet_insert = _clang_CXCursorSet_insert_ptr + .asFunction(); /// Determine the semantic parent of the given cursor. /// @@ -2463,9 +2479,8 @@ class LibClang { late final _clang_getCursorSemanticParent_ptr = _lookup>( 'clang_getCursorSemanticParent'); - late final _dart_clang_getCursorSemanticParent - _clang_getCursorSemanticParent = _clang_getCursorSemanticParent_ptr - .asFunction<_dart_clang_getCursorSemanticParent>(); + late final _clang_getCursorSemanticParent = _clang_getCursorSemanticParent_ptr + .asFunction(); /// Determine the lexical parent of the given cursor. /// @@ -2510,9 +2525,8 @@ class LibClang { late final _clang_getCursorLexicalParent_ptr = _lookup>( 'clang_getCursorLexicalParent'); - late final _dart_clang_getCursorLexicalParent _clang_getCursorLexicalParent = - _clang_getCursorLexicalParent_ptr - .asFunction<_dart_clang_getCursorLexicalParent>(); + late final _clang_getCursorLexicalParent = _clang_getCursorLexicalParent_ptr + .asFunction(); /// Determine the set of methods that are overridden by the given /// method. @@ -2570,9 +2584,10 @@ class LibClang { late final _clang_getOverriddenCursors_ptr = _lookup>( 'clang_getOverriddenCursors'); - late final _dart_clang_getOverriddenCursors _clang_getOverriddenCursors = - _clang_getOverriddenCursors_ptr - .asFunction<_dart_clang_getOverriddenCursors>(); + late final _clang_getOverriddenCursors = + _clang_getOverriddenCursors_ptr.asFunction< + void Function(CXCursor, ffi.Pointer>, + ffi.Pointer)>(); /// Free the set of overridden cursors returned by \c /// clang_getOverriddenCursors(). @@ -2587,13 +2602,13 @@ class LibClang { late final _clang_disposeOverriddenCursors_ptr = _lookup>( 'clang_disposeOverriddenCursors'); - late final _dart_clang_disposeOverriddenCursors - _clang_disposeOverriddenCursors = _clang_disposeOverriddenCursors_ptr - .asFunction<_dart_clang_disposeOverriddenCursors>(); + late final _clang_disposeOverriddenCursors = + _clang_disposeOverriddenCursors_ptr + .asFunction)>(); /// Retrieve the file that is included by the given inclusion directive /// cursor. - ffi.Pointer clang_getIncludedFile( + CXFile clang_getIncludedFile( CXCursor cursor, ) { return _clang_getIncludedFile( @@ -2604,8 +2619,8 @@ class LibClang { late final _clang_getIncludedFile_ptr = _lookup>( 'clang_getIncludedFile'); - late final _dart_clang_getIncludedFile _clang_getIncludedFile = - _clang_getIncludedFile_ptr.asFunction<_dart_clang_getIncludedFile>(); + late final _clang_getIncludedFile = + _clang_getIncludedFile_ptr.asFunction(); /// Map a source location to the cursor that describes the entity at that /// location in the source code. @@ -2621,7 +2636,7 @@ class LibClang { /// \returns a cursor representing the entity at the given source location, or /// a NULL cursor if no such entity can be found. CXCursor clang_getCursor( - ffi.Pointer arg0, + CXTranslationUnit arg0, CXSourceLocation arg1, ) { return _clang_getCursor( @@ -2632,8 +2647,8 @@ class LibClang { late final _clang_getCursor_ptr = _lookup>('clang_getCursor'); - late final _dart_clang_getCursor _clang_getCursor = - _clang_getCursor_ptr.asFunction<_dart_clang_getCursor>(); + late final _clang_getCursor = _clang_getCursor_ptr + .asFunction(); /// Retrieve the physical location of the source constructor referenced /// by the given cursor. @@ -2654,8 +2669,8 @@ class LibClang { late final _clang_getCursorLocation_ptr = _lookup>( 'clang_getCursorLocation'); - late final _dart_clang_getCursorLocation _clang_getCursorLocation = - _clang_getCursorLocation_ptr.asFunction<_dart_clang_getCursorLocation>(); + late final _clang_getCursorLocation = _clang_getCursorLocation_ptr + .asFunction(); /// Retrieve the physical extent of the source construct referenced by /// the given cursor. @@ -2677,8 +2692,8 @@ class LibClang { late final _clang_getCursorExtent_ptr = _lookup>( 'clang_getCursorExtent'); - late final _dart_clang_getCursorExtent _clang_getCursorExtent = - _clang_getCursorExtent_ptr.asFunction<_dart_clang_getCursorExtent>(); + late final _clang_getCursorExtent = + _clang_getCursorExtent_ptr.asFunction(); /// Retrieve the type of a CXCursor (if any). CXType clang_getCursorType( @@ -2692,8 +2707,8 @@ class LibClang { late final _clang_getCursorType_ptr = _lookup>( 'clang_getCursorType'); - late final _dart_clang_getCursorType _clang_getCursorType = - _clang_getCursorType_ptr.asFunction<_dart_clang_getCursorType>(); + late final _clang_getCursorType = + _clang_getCursorType_ptr.asFunction(); /// Pretty-print the underlying type using the rules of the /// language of the translation unit from which it came. @@ -2710,8 +2725,8 @@ class LibClang { late final _clang_getTypeSpelling_ptr = _lookup>( 'clang_getTypeSpelling'); - late final _dart_clang_getTypeSpelling _clang_getTypeSpelling = - _clang_getTypeSpelling_ptr.asFunction<_dart_clang_getTypeSpelling>(); + late final _clang_getTypeSpelling = + _clang_getTypeSpelling_ptr.asFunction(); /// Retrieve the underlying type of a typedef declaration. /// @@ -2728,10 +2743,9 @@ class LibClang { late final _clang_getTypedefDeclUnderlyingType_ptr = _lookup>( 'clang_getTypedefDeclUnderlyingType'); - late final _dart_clang_getTypedefDeclUnderlyingType - _clang_getTypedefDeclUnderlyingType = + late final _clang_getTypedefDeclUnderlyingType = _clang_getTypedefDeclUnderlyingType_ptr - .asFunction<_dart_clang_getTypedefDeclUnderlyingType>(); + .asFunction(); /// Retrieve the integer type of an enum declaration. /// @@ -2748,9 +2762,8 @@ class LibClang { late final _clang_getEnumDeclIntegerType_ptr = _lookup>( 'clang_getEnumDeclIntegerType'); - late final _dart_clang_getEnumDeclIntegerType _clang_getEnumDeclIntegerType = - _clang_getEnumDeclIntegerType_ptr - .asFunction<_dart_clang_getEnumDeclIntegerType>(); + late final _clang_getEnumDeclIntegerType = + _clang_getEnumDeclIntegerType_ptr.asFunction(); /// Retrieve the integer value of an enum constant declaration as a signed /// long long. @@ -2769,9 +2782,8 @@ class LibClang { late final _clang_getEnumConstantDeclValue_ptr = _lookup>( 'clang_getEnumConstantDeclValue'); - late final _dart_clang_getEnumConstantDeclValue - _clang_getEnumConstantDeclValue = _clang_getEnumConstantDeclValue_ptr - .asFunction<_dart_clang_getEnumConstantDeclValue>(); + late final _clang_getEnumConstantDeclValue = + _clang_getEnumConstantDeclValue_ptr.asFunction(); /// Retrieve the integer value of an enum constant declaration as an unsigned /// long long. @@ -2790,10 +2802,9 @@ class LibClang { late final _clang_getEnumConstantDeclUnsignedValue_ptr = _lookup< ffi.NativeFunction>( 'clang_getEnumConstantDeclUnsignedValue'); - late final _dart_clang_getEnumConstantDeclUnsignedValue - _clang_getEnumConstantDeclUnsignedValue = + late final _clang_getEnumConstantDeclUnsignedValue = _clang_getEnumConstantDeclUnsignedValue_ptr - .asFunction<_dart_clang_getEnumConstantDeclUnsignedValue>(); + .asFunction(); /// Retrieve the bit width of a bit field declaration as an integer. /// @@ -2809,9 +2820,8 @@ class LibClang { late final _clang_getFieldDeclBitWidth_ptr = _lookup>( 'clang_getFieldDeclBitWidth'); - late final _dart_clang_getFieldDeclBitWidth _clang_getFieldDeclBitWidth = - _clang_getFieldDeclBitWidth_ptr - .asFunction<_dart_clang_getFieldDeclBitWidth>(); + late final _clang_getFieldDeclBitWidth = + _clang_getFieldDeclBitWidth_ptr.asFunction(); /// Retrieve the number of non-variadic arguments associated with a given /// cursor. @@ -2829,9 +2839,8 @@ class LibClang { late final _clang_Cursor_getNumArguments_ptr = _lookup>( 'clang_Cursor_getNumArguments'); - late final _dart_clang_Cursor_getNumArguments _clang_Cursor_getNumArguments = - _clang_Cursor_getNumArguments_ptr - .asFunction<_dart_clang_Cursor_getNumArguments>(); + late final _clang_Cursor_getNumArguments = + _clang_Cursor_getNumArguments_ptr.asFunction(); /// Retrieve the argument cursor of a function or method. /// @@ -2851,9 +2860,8 @@ class LibClang { late final _clang_Cursor_getArgument_ptr = _lookup>( 'clang_Cursor_getArgument'); - late final _dart_clang_Cursor_getArgument _clang_Cursor_getArgument = - _clang_Cursor_getArgument_ptr - .asFunction<_dart_clang_Cursor_getArgument>(); + late final _clang_Cursor_getArgument = _clang_Cursor_getArgument_ptr + .asFunction(); /// Returns the number of template args of a function decl representing a /// template specialization. @@ -2880,10 +2888,9 @@ class LibClang { late final _clang_Cursor_getNumTemplateArguments_ptr = _lookup>( 'clang_Cursor_getNumTemplateArguments'); - late final _dart_clang_Cursor_getNumTemplateArguments - _clang_Cursor_getNumTemplateArguments = + late final _clang_Cursor_getNumTemplateArguments = _clang_Cursor_getNumTemplateArguments_ptr - .asFunction<_dart_clang_Cursor_getNumTemplateArguments>(); + .asFunction(); /// Retrieve the kind of the I'th template argument of the CXCursor C. /// @@ -2912,10 +2919,9 @@ class LibClang { late final _clang_Cursor_getTemplateArgumentKind_ptr = _lookup>( 'clang_Cursor_getTemplateArgumentKind'); - late final _dart_clang_Cursor_getTemplateArgumentKind - _clang_Cursor_getTemplateArgumentKind = + late final _clang_Cursor_getTemplateArgumentKind = _clang_Cursor_getTemplateArgumentKind_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentKind>(); + .asFunction(); /// Retrieve a CXType representing the type of a TemplateArgument of a /// function decl representing a template specialization. @@ -2946,10 +2952,9 @@ class LibClang { late final _clang_Cursor_getTemplateArgumentType_ptr = _lookup>( 'clang_Cursor_getTemplateArgumentType'); - late final _dart_clang_Cursor_getTemplateArgumentType - _clang_Cursor_getTemplateArgumentType = + late final _clang_Cursor_getTemplateArgumentType = _clang_Cursor_getTemplateArgumentType_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentType>(); + .asFunction(); /// Retrieve the value of an Integral TemplateArgument (of a function /// decl representing a template specialization) as a signed long long. @@ -2979,10 +2984,9 @@ class LibClang { late final _clang_Cursor_getTemplateArgumentValue_ptr = _lookup>( 'clang_Cursor_getTemplateArgumentValue'); - late final _dart_clang_Cursor_getTemplateArgumentValue - _clang_Cursor_getTemplateArgumentValue = + late final _clang_Cursor_getTemplateArgumentValue = _clang_Cursor_getTemplateArgumentValue_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentValue>(); + .asFunction(); /// Retrieve the value of an Integral TemplateArgument (of a function /// decl representing a template specialization) as an unsigned long long. @@ -3013,10 +3017,9 @@ class LibClang { ffi.NativeFunction< Native_clang_Cursor_getTemplateArgumentUnsignedValue>>( 'clang_Cursor_getTemplateArgumentUnsignedValue'); - late final _dart_clang_Cursor_getTemplateArgumentUnsignedValue - _clang_Cursor_getTemplateArgumentUnsignedValue = + late final _clang_Cursor_getTemplateArgumentUnsignedValue = _clang_Cursor_getTemplateArgumentUnsignedValue_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentUnsignedValue>(); + .asFunction(); /// Determine whether two CXTypes represent the same type. /// @@ -3034,8 +3037,8 @@ class LibClang { late final _clang_equalTypes_ptr = _lookup>('clang_equalTypes'); - late final _dart_clang_equalTypes _clang_equalTypes = - _clang_equalTypes_ptr.asFunction<_dart_clang_equalTypes>(); + late final _clang_equalTypes = + _clang_equalTypes_ptr.asFunction(); /// Return the canonical type for a CXType. /// @@ -3054,8 +3057,8 @@ class LibClang { late final _clang_getCanonicalType_ptr = _lookup>( 'clang_getCanonicalType'); - late final _dart_clang_getCanonicalType _clang_getCanonicalType = - _clang_getCanonicalType_ptr.asFunction<_dart_clang_getCanonicalType>(); + late final _clang_getCanonicalType = + _clang_getCanonicalType_ptr.asFunction(); /// Determine whether a CXType has the "const" qualifier set, /// without looking through typedefs that may have added "const" at a @@ -3071,9 +3074,8 @@ class LibClang { late final _clang_isConstQualifiedType_ptr = _lookup>( 'clang_isConstQualifiedType'); - late final _dart_clang_isConstQualifiedType _clang_isConstQualifiedType = - _clang_isConstQualifiedType_ptr - .asFunction<_dart_clang_isConstQualifiedType>(); + late final _clang_isConstQualifiedType = + _clang_isConstQualifiedType_ptr.asFunction(); /// Determine whether a CXCursor that is a macro, is /// function like. @@ -3088,9 +3090,9 @@ class LibClang { late final _clang_Cursor_isMacroFunctionLike_ptr = _lookup>( 'clang_Cursor_isMacroFunctionLike'); - late final _dart_clang_Cursor_isMacroFunctionLike - _clang_Cursor_isMacroFunctionLike = _clang_Cursor_isMacroFunctionLike_ptr - .asFunction<_dart_clang_Cursor_isMacroFunctionLike>(); + late final _clang_Cursor_isMacroFunctionLike = + _clang_Cursor_isMacroFunctionLike_ptr + .asFunction(); /// Determine whether a CXCursor that is a macro, is a /// builtin one. @@ -3105,9 +3107,8 @@ class LibClang { late final _clang_Cursor_isMacroBuiltin_ptr = _lookup>( 'clang_Cursor_isMacroBuiltin'); - late final _dart_clang_Cursor_isMacroBuiltin _clang_Cursor_isMacroBuiltin = - _clang_Cursor_isMacroBuiltin_ptr - .asFunction<_dart_clang_Cursor_isMacroBuiltin>(); + late final _clang_Cursor_isMacroBuiltin = + _clang_Cursor_isMacroBuiltin_ptr.asFunction(); /// Determine whether a CXCursor that is a function declaration, is an /// inline declaration. @@ -3122,9 +3123,8 @@ class LibClang { late final _clang_Cursor_isFunctionInlined_ptr = _lookup>( 'clang_Cursor_isFunctionInlined'); - late final _dart_clang_Cursor_isFunctionInlined - _clang_Cursor_isFunctionInlined = _clang_Cursor_isFunctionInlined_ptr - .asFunction<_dart_clang_Cursor_isFunctionInlined>(); + late final _clang_Cursor_isFunctionInlined = + _clang_Cursor_isFunctionInlined_ptr.asFunction(); /// Determine whether a CXType has the "volatile" qualifier set, /// without looking through typedefs that may have added "volatile" at @@ -3140,9 +3140,8 @@ class LibClang { late final _clang_isVolatileQualifiedType_ptr = _lookup>( 'clang_isVolatileQualifiedType'); - late final _dart_clang_isVolatileQualifiedType - _clang_isVolatileQualifiedType = _clang_isVolatileQualifiedType_ptr - .asFunction<_dart_clang_isVolatileQualifiedType>(); + late final _clang_isVolatileQualifiedType = + _clang_isVolatileQualifiedType_ptr.asFunction(); /// Determine whether a CXType has the "restrict" qualifier set, /// without looking through typedefs that may have added "restrict" at a @@ -3158,9 +3157,8 @@ class LibClang { late final _clang_isRestrictQualifiedType_ptr = _lookup>( 'clang_isRestrictQualifiedType'); - late final _dart_clang_isRestrictQualifiedType - _clang_isRestrictQualifiedType = _clang_isRestrictQualifiedType_ptr - .asFunction<_dart_clang_isRestrictQualifiedType>(); + late final _clang_isRestrictQualifiedType = + _clang_isRestrictQualifiedType_ptr.asFunction(); /// Returns the address space of the given type. int clang_getAddressSpace( @@ -3174,8 +3172,8 @@ class LibClang { late final _clang_getAddressSpace_ptr = _lookup>( 'clang_getAddressSpace'); - late final _dart_clang_getAddressSpace _clang_getAddressSpace = - _clang_getAddressSpace_ptr.asFunction<_dart_clang_getAddressSpace>(); + late final _clang_getAddressSpace = + _clang_getAddressSpace_ptr.asFunction(); /// Returns the typedef name of the given type. CXString clang_getTypedefName( @@ -3189,8 +3187,8 @@ class LibClang { late final _clang_getTypedefName_ptr = _lookup>( 'clang_getTypedefName'); - late final _dart_clang_getTypedefName _clang_getTypedefName = - _clang_getTypedefName_ptr.asFunction<_dart_clang_getTypedefName>(); + late final _clang_getTypedefName = + _clang_getTypedefName_ptr.asFunction(); /// For pointer types, returns the type of the pointee. CXType clang_getPointeeType( @@ -3204,8 +3202,8 @@ class LibClang { late final _clang_getPointeeType_ptr = _lookup>( 'clang_getPointeeType'); - late final _dart_clang_getPointeeType _clang_getPointeeType = - _clang_getPointeeType_ptr.asFunction<_dart_clang_getPointeeType>(); + late final _clang_getPointeeType = + _clang_getPointeeType_ptr.asFunction(); /// Return the cursor for the declaration of the given type. CXCursor clang_getTypeDeclaration( @@ -3219,9 +3217,8 @@ class LibClang { late final _clang_getTypeDeclaration_ptr = _lookup>( 'clang_getTypeDeclaration'); - late final _dart_clang_getTypeDeclaration _clang_getTypeDeclaration = - _clang_getTypeDeclaration_ptr - .asFunction<_dart_clang_getTypeDeclaration>(); + late final _clang_getTypeDeclaration = + _clang_getTypeDeclaration_ptr.asFunction(); /// Returns the Objective-C type encoding for the specified declaration. CXString clang_getDeclObjCTypeEncoding( @@ -3235,9 +3232,8 @@ class LibClang { late final _clang_getDeclObjCTypeEncoding_ptr = _lookup>( 'clang_getDeclObjCTypeEncoding'); - late final _dart_clang_getDeclObjCTypeEncoding - _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncoding_ptr - .asFunction<_dart_clang_getDeclObjCTypeEncoding>(); + late final _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncoding_ptr + .asFunction(); /// Returns the Objective-C type encoding for the specified CXType. CXString clang_Type_getObjCEncoding( @@ -3251,9 +3247,8 @@ class LibClang { late final _clang_Type_getObjCEncoding_ptr = _lookup>( 'clang_Type_getObjCEncoding'); - late final _dart_clang_Type_getObjCEncoding _clang_Type_getObjCEncoding = - _clang_Type_getObjCEncoding_ptr - .asFunction<_dart_clang_Type_getObjCEncoding>(); + late final _clang_Type_getObjCEncoding = + _clang_Type_getObjCEncoding_ptr.asFunction(); /// Retrieve the spelling of a given CXTypeKind. CXString clang_getTypeKindSpelling( @@ -3267,9 +3262,8 @@ class LibClang { late final _clang_getTypeKindSpelling_ptr = _lookup>( 'clang_getTypeKindSpelling'); - late final _dart_clang_getTypeKindSpelling _clang_getTypeKindSpelling = - _clang_getTypeKindSpelling_ptr - .asFunction<_dart_clang_getTypeKindSpelling>(); + late final _clang_getTypeKindSpelling = + _clang_getTypeKindSpelling_ptr.asFunction(); /// Retrieve the calling convention associated with a function type. /// @@ -3285,9 +3279,8 @@ class LibClang { late final _clang_getFunctionTypeCallingConv_ptr = _lookup>( 'clang_getFunctionTypeCallingConv'); - late final _dart_clang_getFunctionTypeCallingConv - _clang_getFunctionTypeCallingConv = _clang_getFunctionTypeCallingConv_ptr - .asFunction<_dart_clang_getFunctionTypeCallingConv>(); + late final _clang_getFunctionTypeCallingConv = + _clang_getFunctionTypeCallingConv_ptr.asFunction(); /// Retrieve the return type associated with a function type. /// @@ -3303,8 +3296,8 @@ class LibClang { late final _clang_getResultType_ptr = _lookup>( 'clang_getResultType'); - late final _dart_clang_getResultType _clang_getResultType = - _clang_getResultType_ptr.asFunction<_dart_clang_getResultType>(); + late final _clang_getResultType = + _clang_getResultType_ptr.asFunction(); /// Retrieve the exception specification type associated with a function type. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -3321,10 +3314,9 @@ class LibClang { late final _clang_getExceptionSpecificationType_ptr = _lookup>( 'clang_getExceptionSpecificationType'); - late final _dart_clang_getExceptionSpecificationType - _clang_getExceptionSpecificationType = + late final _clang_getExceptionSpecificationType = _clang_getExceptionSpecificationType_ptr - .asFunction<_dart_clang_getExceptionSpecificationType>(); + .asFunction(); /// Retrieve the number of non-variadic parameters associated with a /// function type. @@ -3341,8 +3333,8 @@ class LibClang { late final _clang_getNumArgTypes_ptr = _lookup>( 'clang_getNumArgTypes'); - late final _dart_clang_getNumArgTypes _clang_getNumArgTypes = - _clang_getNumArgTypes_ptr.asFunction<_dart_clang_getNumArgTypes>(); + late final _clang_getNumArgTypes = + _clang_getNumArgTypes_ptr.asFunction(); /// Retrieve the type of a parameter of a function type. /// @@ -3360,8 +3352,8 @@ class LibClang { late final _clang_getArgType_ptr = _lookup>('clang_getArgType'); - late final _dart_clang_getArgType _clang_getArgType = - _clang_getArgType_ptr.asFunction<_dart_clang_getArgType>(); + late final _clang_getArgType = + _clang_getArgType_ptr.asFunction(); /// Retrieves the base type of the ObjCObjectType. /// @@ -3377,9 +3369,9 @@ class LibClang { late final _clang_Type_getObjCObjectBaseType_ptr = _lookup>( 'clang_Type_getObjCObjectBaseType'); - late final _dart_clang_Type_getObjCObjectBaseType - _clang_Type_getObjCObjectBaseType = _clang_Type_getObjCObjectBaseType_ptr - .asFunction<_dart_clang_Type_getObjCObjectBaseType>(); + late final _clang_Type_getObjCObjectBaseType = + _clang_Type_getObjCObjectBaseType_ptr + .asFunction(); /// Retrieve the number of protocol references associated with an ObjC object/id. /// @@ -3395,10 +3387,8 @@ class LibClang { late final _clang_Type_getNumObjCProtocolRefs_ptr = _lookup>( 'clang_Type_getNumObjCProtocolRefs'); - late final _dart_clang_Type_getNumObjCProtocolRefs - _clang_Type_getNumObjCProtocolRefs = - _clang_Type_getNumObjCProtocolRefs_ptr - .asFunction<_dart_clang_Type_getNumObjCProtocolRefs>(); + late final _clang_Type_getNumObjCProtocolRefs = + _clang_Type_getNumObjCProtocolRefs_ptr.asFunction(); /// Retrieve the decl for a protocol reference for an ObjC object/id. /// @@ -3417,9 +3407,9 @@ class LibClang { late final _clang_Type_getObjCProtocolDecl_ptr = _lookup>( 'clang_Type_getObjCProtocolDecl'); - late final _dart_clang_Type_getObjCProtocolDecl - _clang_Type_getObjCProtocolDecl = _clang_Type_getObjCProtocolDecl_ptr - .asFunction<_dart_clang_Type_getObjCProtocolDecl>(); + late final _clang_Type_getObjCProtocolDecl = + _clang_Type_getObjCProtocolDecl_ptr + .asFunction(); /// Retreive the number of type arguments associated with an ObjC object. /// @@ -3435,9 +3425,8 @@ class LibClang { late final _clang_Type_getNumObjCTypeArgs_ptr = _lookup>( 'clang_Type_getNumObjCTypeArgs'); - late final _dart_clang_Type_getNumObjCTypeArgs - _clang_Type_getNumObjCTypeArgs = _clang_Type_getNumObjCTypeArgs_ptr - .asFunction<_dart_clang_Type_getNumObjCTypeArgs>(); + late final _clang_Type_getNumObjCTypeArgs = + _clang_Type_getNumObjCTypeArgs_ptr.asFunction(); /// Retrieve a type argument associated with an ObjC object. /// @@ -3456,9 +3445,8 @@ class LibClang { late final _clang_Type_getObjCTypeArg_ptr = _lookup>( 'clang_Type_getObjCTypeArg'); - late final _dart_clang_Type_getObjCTypeArg _clang_Type_getObjCTypeArg = - _clang_Type_getObjCTypeArg_ptr - .asFunction<_dart_clang_Type_getObjCTypeArg>(); + late final _clang_Type_getObjCTypeArg = + _clang_Type_getObjCTypeArg_ptr.asFunction(); /// Return 1 if the CXType is a variadic function type, and 0 otherwise. int clang_isFunctionTypeVariadic( @@ -3472,9 +3460,8 @@ class LibClang { late final _clang_isFunctionTypeVariadic_ptr = _lookup>( 'clang_isFunctionTypeVariadic'); - late final _dart_clang_isFunctionTypeVariadic _clang_isFunctionTypeVariadic = - _clang_isFunctionTypeVariadic_ptr - .asFunction<_dart_clang_isFunctionTypeVariadic>(); + late final _clang_isFunctionTypeVariadic = + _clang_isFunctionTypeVariadic_ptr.asFunction(); /// Retrieve the return type associated with a given cursor. /// @@ -3490,9 +3477,8 @@ class LibClang { late final _clang_getCursorResultType_ptr = _lookup>( 'clang_getCursorResultType'); - late final _dart_clang_getCursorResultType _clang_getCursorResultType = - _clang_getCursorResultType_ptr - .asFunction<_dart_clang_getCursorResultType>(); + late final _clang_getCursorResultType = + _clang_getCursorResultType_ptr.asFunction(); /// Retrieve the exception specification type associated with a given cursor. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -3509,10 +3495,9 @@ class LibClang { late final _clang_getCursorExceptionSpecificationType_ptr = _lookup< ffi.NativeFunction>( 'clang_getCursorExceptionSpecificationType'); - late final _dart_clang_getCursorExceptionSpecificationType - _clang_getCursorExceptionSpecificationType = + late final _clang_getCursorExceptionSpecificationType = _clang_getCursorExceptionSpecificationType_ptr - .asFunction<_dart_clang_getCursorExceptionSpecificationType>(); + .asFunction(); /// Return 1 if the CXType is a POD (plain old data) type, and 0 /// otherwise. @@ -3526,8 +3511,8 @@ class LibClang { late final _clang_isPODType_ptr = _lookup>('clang_isPODType'); - late final _dart_clang_isPODType _clang_isPODType = - _clang_isPODType_ptr.asFunction<_dart_clang_isPODType>(); + late final _clang_isPODType = + _clang_isPODType_ptr.asFunction(); /// Return the element type of an array, complex, or vector type. /// @@ -3544,8 +3529,8 @@ class LibClang { late final _clang_getElementType_ptr = _lookup>( 'clang_getElementType'); - late final _dart_clang_getElementType _clang_getElementType = - _clang_getElementType_ptr.asFunction<_dart_clang_getElementType>(); + late final _clang_getElementType = + _clang_getElementType_ptr.asFunction(); /// Return the number of elements of an array or vector type. /// @@ -3562,8 +3547,8 @@ class LibClang { late final _clang_getNumElements_ptr = _lookup>( 'clang_getNumElements'); - late final _dart_clang_getNumElements _clang_getNumElements = - _clang_getNumElements_ptr.asFunction<_dart_clang_getNumElements>(); + late final _clang_getNumElements = + _clang_getNumElements_ptr.asFunction(); /// Return the element type of an array type. /// @@ -3579,9 +3564,8 @@ class LibClang { late final _clang_getArrayElementType_ptr = _lookup>( 'clang_getArrayElementType'); - late final _dart_clang_getArrayElementType _clang_getArrayElementType = - _clang_getArrayElementType_ptr - .asFunction<_dart_clang_getArrayElementType>(); + late final _clang_getArrayElementType = + _clang_getArrayElementType_ptr.asFunction(); /// Return the array size of a constant array. /// @@ -3597,8 +3581,8 @@ class LibClang { late final _clang_getArraySize_ptr = _lookup>( 'clang_getArraySize'); - late final _dart_clang_getArraySize _clang_getArraySize = - _clang_getArraySize_ptr.asFunction<_dart_clang_getArraySize>(); + late final _clang_getArraySize = + _clang_getArraySize_ptr.asFunction(); /// Retrieve the type named by the qualified-id. /// @@ -3614,8 +3598,8 @@ class LibClang { late final _clang_Type_getNamedType_ptr = _lookup>( 'clang_Type_getNamedType'); - late final _dart_clang_Type_getNamedType _clang_Type_getNamedType = - _clang_Type_getNamedType_ptr.asFunction<_dart_clang_Type_getNamedType>(); + late final _clang_Type_getNamedType = + _clang_Type_getNamedType_ptr.asFunction(); /// Determine if a typedef is 'transparent' tag. /// @@ -3634,10 +3618,9 @@ class LibClang { late final _clang_Type_isTransparentTagTypedef_ptr = _lookup>( 'clang_Type_isTransparentTagTypedef'); - late final _dart_clang_Type_isTransparentTagTypedef - _clang_Type_isTransparentTagTypedef = + late final _clang_Type_isTransparentTagTypedef = _clang_Type_isTransparentTagTypedef_ptr - .asFunction<_dart_clang_Type_isTransparentTagTypedef>(); + .asFunction(); /// Retrieve the nullability kind of a pointer type. int clang_Type_getNullability( @@ -3651,9 +3634,8 @@ class LibClang { late final _clang_Type_getNullability_ptr = _lookup>( 'clang_Type_getNullability'); - late final _dart_clang_Type_getNullability _clang_Type_getNullability = - _clang_Type_getNullability_ptr - .asFunction<_dart_clang_Type_getNullability>(); + late final _clang_Type_getNullability = + _clang_Type_getNullability_ptr.asFunction(); /// Return the alignment of a type in bytes as per C++[expr.alignof] /// standard. @@ -3676,8 +3658,8 @@ class LibClang { late final _clang_Type_getAlignOf_ptr = _lookup>( 'clang_Type_getAlignOf'); - late final _dart_clang_Type_getAlignOf _clang_Type_getAlignOf = - _clang_Type_getAlignOf_ptr.asFunction<_dart_clang_Type_getAlignOf>(); + late final _clang_Type_getAlignOf = + _clang_Type_getAlignOf_ptr.asFunction(); /// Return the class type of an member pointer type. /// @@ -3693,8 +3675,8 @@ class LibClang { late final _clang_Type_getClassType_ptr = _lookup>( 'clang_Type_getClassType'); - late final _dart_clang_Type_getClassType _clang_Type_getClassType = - _clang_Type_getClassType_ptr.asFunction<_dart_clang_Type_getClassType>(); + late final _clang_Type_getClassType = + _clang_Type_getClassType_ptr.asFunction(); /// Return the size of a type in bytes as per C++[expr.sizeof] standard. /// @@ -3714,8 +3696,8 @@ class LibClang { late final _clang_Type_getSizeOf_ptr = _lookup>( 'clang_Type_getSizeOf'); - late final _dart_clang_Type_getSizeOf _clang_Type_getSizeOf = - _clang_Type_getSizeOf_ptr.asFunction<_dart_clang_Type_getSizeOf>(); + late final _clang_Type_getSizeOf = + _clang_Type_getSizeOf_ptr.asFunction(); /// Return the offset of a field named S in a record of type T in bits /// as it would be returned by __offsetof__ as per C++11[18.2p4] @@ -3741,8 +3723,8 @@ class LibClang { late final _clang_Type_getOffsetOf_ptr = _lookup>( 'clang_Type_getOffsetOf'); - late final _dart_clang_Type_getOffsetOf _clang_Type_getOffsetOf = - _clang_Type_getOffsetOf_ptr.asFunction<_dart_clang_Type_getOffsetOf>(); + late final _clang_Type_getOffsetOf = _clang_Type_getOffsetOf_ptr + .asFunction)>(); /// Return the type that was modified by this attributed type. /// @@ -3758,9 +3740,8 @@ class LibClang { late final _clang_Type_getModifiedType_ptr = _lookup>( 'clang_Type_getModifiedType'); - late final _dart_clang_Type_getModifiedType _clang_Type_getModifiedType = - _clang_Type_getModifiedType_ptr - .asFunction<_dart_clang_Type_getModifiedType>(); + late final _clang_Type_getModifiedType = + _clang_Type_getModifiedType_ptr.asFunction(); /// Return the offset of the field represented by the Cursor. /// @@ -3784,9 +3765,8 @@ class LibClang { late final _clang_Cursor_getOffsetOfField_ptr = _lookup>( 'clang_Cursor_getOffsetOfField'); - late final _dart_clang_Cursor_getOffsetOfField - _clang_Cursor_getOffsetOfField = _clang_Cursor_getOffsetOfField_ptr - .asFunction<_dart_clang_Cursor_getOffsetOfField>(); + late final _clang_Cursor_getOffsetOfField = + _clang_Cursor_getOffsetOfField_ptr.asFunction(); /// Determine whether the given cursor represents an anonymous /// tag or namespace @@ -3801,9 +3781,8 @@ class LibClang { late final _clang_Cursor_isAnonymous_ptr = _lookup>( 'clang_Cursor_isAnonymous'); - late final _dart_clang_Cursor_isAnonymous _clang_Cursor_isAnonymous = - _clang_Cursor_isAnonymous_ptr - .asFunction<_dart_clang_Cursor_isAnonymous>(); + late final _clang_Cursor_isAnonymous = + _clang_Cursor_isAnonymous_ptr.asFunction(); /// Determine whether the given cursor represents an anonymous record /// declaration. @@ -3818,10 +3797,9 @@ class LibClang { late final _clang_Cursor_isAnonymousRecordDecl_ptr = _lookup>( 'clang_Cursor_isAnonymousRecordDecl'); - late final _dart_clang_Cursor_isAnonymousRecordDecl - _clang_Cursor_isAnonymousRecordDecl = + late final _clang_Cursor_isAnonymousRecordDecl = _clang_Cursor_isAnonymousRecordDecl_ptr - .asFunction<_dart_clang_Cursor_isAnonymousRecordDecl>(); + .asFunction(); /// Determine whether the given cursor represents an inline namespace /// declaration. @@ -3836,9 +3814,8 @@ class LibClang { late final _clang_Cursor_isInlineNamespace_ptr = _lookup>( 'clang_Cursor_isInlineNamespace'); - late final _dart_clang_Cursor_isInlineNamespace - _clang_Cursor_isInlineNamespace = _clang_Cursor_isInlineNamespace_ptr - .asFunction<_dart_clang_Cursor_isInlineNamespace>(); + late final _clang_Cursor_isInlineNamespace = + _clang_Cursor_isInlineNamespace_ptr.asFunction(); /// Returns the number of template arguments for given template /// specialization, or -1 if type \c T is not a template specialization. @@ -3853,10 +3830,9 @@ class LibClang { late final _clang_Type_getNumTemplateArguments_ptr = _lookup>( 'clang_Type_getNumTemplateArguments'); - late final _dart_clang_Type_getNumTemplateArguments - _clang_Type_getNumTemplateArguments = + late final _clang_Type_getNumTemplateArguments = _clang_Type_getNumTemplateArguments_ptr - .asFunction<_dart_clang_Type_getNumTemplateArguments>(); + .asFunction(); /// Returns the type template argument of a template class specialization /// at given index. @@ -3876,10 +3852,9 @@ class LibClang { late final _clang_Type_getTemplateArgumentAsType_ptr = _lookup>( 'clang_Type_getTemplateArgumentAsType'); - late final _dart_clang_Type_getTemplateArgumentAsType - _clang_Type_getTemplateArgumentAsType = + late final _clang_Type_getTemplateArgumentAsType = _clang_Type_getTemplateArgumentAsType_ptr - .asFunction<_dart_clang_Type_getTemplateArgumentAsType>(); + .asFunction(); /// Retrieve the ref-qualifier kind of a function or method. /// @@ -3896,9 +3871,8 @@ class LibClang { late final _clang_Type_getCXXRefQualifier_ptr = _lookup>( 'clang_Type_getCXXRefQualifier'); - late final _dart_clang_Type_getCXXRefQualifier - _clang_Type_getCXXRefQualifier = _clang_Type_getCXXRefQualifier_ptr - .asFunction<_dart_clang_Type_getCXXRefQualifier>(); + late final _clang_Type_getCXXRefQualifier = + _clang_Type_getCXXRefQualifier_ptr.asFunction(); /// Returns non-zero if the cursor specifies a Record member that is a /// bitfield. @@ -3913,8 +3887,8 @@ class LibClang { late final _clang_Cursor_isBitField_ptr = _lookup>( 'clang_Cursor_isBitField'); - late final _dart_clang_Cursor_isBitField _clang_Cursor_isBitField = - _clang_Cursor_isBitField_ptr.asFunction<_dart_clang_Cursor_isBitField>(); + late final _clang_Cursor_isBitField = + _clang_Cursor_isBitField_ptr.asFunction(); /// Returns 1 if the base class specified by the cursor with kind /// CX_CXXBaseSpecifier is virtual. @@ -3929,8 +3903,8 @@ class LibClang { late final _clang_isVirtualBase_ptr = _lookup>( 'clang_isVirtualBase'); - late final _dart_clang_isVirtualBase _clang_isVirtualBase = - _clang_isVirtualBase_ptr.asFunction<_dart_clang_isVirtualBase>(); + late final _clang_isVirtualBase = + _clang_isVirtualBase_ptr.asFunction(); /// Returns the access control level for the referenced object. /// @@ -3948,9 +3922,8 @@ class LibClang { late final _clang_getCXXAccessSpecifier_ptr = _lookup>( 'clang_getCXXAccessSpecifier'); - late final _dart_clang_getCXXAccessSpecifier _clang_getCXXAccessSpecifier = - _clang_getCXXAccessSpecifier_ptr - .asFunction<_dart_clang_getCXXAccessSpecifier>(); + late final _clang_getCXXAccessSpecifier = + _clang_getCXXAccessSpecifier_ptr.asFunction(); /// Returns the storage class for a function or variable declaration. /// @@ -3967,9 +3940,8 @@ class LibClang { late final _clang_Cursor_getStorageClass_ptr = _lookup>( 'clang_Cursor_getStorageClass'); - late final _dart_clang_Cursor_getStorageClass _clang_Cursor_getStorageClass = - _clang_Cursor_getStorageClass_ptr - .asFunction<_dart_clang_Cursor_getStorageClass>(); + late final _clang_Cursor_getStorageClass = + _clang_Cursor_getStorageClass_ptr.asFunction(); /// Determine the number of overloaded declarations referenced by a /// \c CXCursor_OverloadedDeclRef cursor. @@ -3989,9 +3961,8 @@ class LibClang { late final _clang_getNumOverloadedDecls_ptr = _lookup>( 'clang_getNumOverloadedDecls'); - late final _dart_clang_getNumOverloadedDecls _clang_getNumOverloadedDecls = - _clang_getNumOverloadedDecls_ptr - .asFunction<_dart_clang_getNumOverloadedDecls>(); + late final _clang_getNumOverloadedDecls = + _clang_getNumOverloadedDecls_ptr.asFunction(); /// Retrieve a cursor for one of the overloaded declarations referenced /// by a \c CXCursor_OverloadedDeclRef cursor. @@ -4018,8 +3989,8 @@ class LibClang { late final _clang_getOverloadedDecl_ptr = _lookup>( 'clang_getOverloadedDecl'); - late final _dart_clang_getOverloadedDecl _clang_getOverloadedDecl = - _clang_getOverloadedDecl_ptr.asFunction<_dart_clang_getOverloadedDecl>(); + late final _clang_getOverloadedDecl = _clang_getOverloadedDecl_ptr + .asFunction(); /// For cursors representing an iboutletcollection attribute, /// this function returns the collection element type. @@ -4034,9 +4005,9 @@ class LibClang { late final _clang_getIBOutletCollectionType_ptr = _lookup>( 'clang_getIBOutletCollectionType'); - late final _dart_clang_getIBOutletCollectionType - _clang_getIBOutletCollectionType = _clang_getIBOutletCollectionType_ptr - .asFunction<_dart_clang_getIBOutletCollectionType>(); + late final _clang_getIBOutletCollectionType = + _clang_getIBOutletCollectionType_ptr + .asFunction(); /// Visit the children of a particular cursor. /// @@ -4060,8 +4031,8 @@ class LibClang { /// prematurely by the visitor returning \c CXChildVisit_Break. int clang_visitChildren( CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, + CXCursorVisitor visitor, + CXClientData client_data, ) { return _clang_visitChildren( parent, @@ -4073,8 +4044,8 @@ class LibClang { late final _clang_visitChildren_ptr = _lookup>( 'clang_visitChildren'); - late final _dart_clang_visitChildren _clang_visitChildren = - _clang_visitChildren_ptr.asFunction<_dart_clang_visitChildren>(); + late final _clang_visitChildren = _clang_visitChildren_ptr + .asFunction(); /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced /// by the given cursor. @@ -4094,8 +4065,8 @@ class LibClang { late final _clang_getCursorUSR_ptr = _lookup>( 'clang_getCursorUSR'); - late final _dart_clang_getCursorUSR _clang_getCursorUSR = - _clang_getCursorUSR_ptr.asFunction<_dart_clang_getCursorUSR>(); + late final _clang_getCursorUSR = + _clang_getCursorUSR_ptr.asFunction(); /// Construct a USR for a specified Objective-C class. CXString clang_constructUSR_ObjCClass( @@ -4109,9 +4080,8 @@ class LibClang { late final _clang_constructUSR_ObjCClass_ptr = _lookup>( 'clang_constructUSR_ObjCClass'); - late final _dart_clang_constructUSR_ObjCClass _clang_constructUSR_ObjCClass = - _clang_constructUSR_ObjCClass_ptr - .asFunction<_dart_clang_constructUSR_ObjCClass>(); + late final _clang_constructUSR_ObjCClass = _clang_constructUSR_ObjCClass_ptr + .asFunction)>(); /// Construct a USR for a specified Objective-C category. CXString clang_constructUSR_ObjCCategory( @@ -4127,9 +4097,9 @@ class LibClang { late final _clang_constructUSR_ObjCCategory_ptr = _lookup>( 'clang_constructUSR_ObjCCategory'); - late final _dart_clang_constructUSR_ObjCCategory - _clang_constructUSR_ObjCCategory = _clang_constructUSR_ObjCCategory_ptr - .asFunction<_dart_clang_constructUSR_ObjCCategory>(); + late final _clang_constructUSR_ObjCCategory = + _clang_constructUSR_ObjCCategory_ptr.asFunction< + CXString Function(ffi.Pointer, ffi.Pointer)>(); /// Construct a USR for a specified Objective-C protocol. CXString clang_constructUSR_ObjCProtocol( @@ -4143,9 +4113,9 @@ class LibClang { late final _clang_constructUSR_ObjCProtocol_ptr = _lookup>( 'clang_constructUSR_ObjCProtocol'); - late final _dart_clang_constructUSR_ObjCProtocol - _clang_constructUSR_ObjCProtocol = _clang_constructUSR_ObjCProtocol_ptr - .asFunction<_dart_clang_constructUSR_ObjCProtocol>(); + late final _clang_constructUSR_ObjCProtocol = + _clang_constructUSR_ObjCProtocol_ptr + .asFunction)>(); /// Construct a USR for a specified Objective-C instance variable and /// the USR for its containing class. @@ -4162,9 +4132,8 @@ class LibClang { late final _clang_constructUSR_ObjCIvar_ptr = _lookup>( 'clang_constructUSR_ObjCIvar'); - late final _dart_clang_constructUSR_ObjCIvar _clang_constructUSR_ObjCIvar = - _clang_constructUSR_ObjCIvar_ptr - .asFunction<_dart_clang_constructUSR_ObjCIvar>(); + late final _clang_constructUSR_ObjCIvar = _clang_constructUSR_ObjCIvar_ptr + .asFunction, CXString)>(); /// Construct a USR for a specified Objective-C method and /// the USR for its containing class. @@ -4183,9 +4152,8 @@ class LibClang { late final _clang_constructUSR_ObjCMethod_ptr = _lookup>( 'clang_constructUSR_ObjCMethod'); - late final _dart_clang_constructUSR_ObjCMethod - _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethod_ptr - .asFunction<_dart_clang_constructUSR_ObjCMethod>(); + late final _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethod_ptr + .asFunction, int, CXString)>(); /// Construct a USR for a specified Objective-C property and the USR /// for its containing class. @@ -4202,9 +4170,9 @@ class LibClang { late final _clang_constructUSR_ObjCProperty_ptr = _lookup>( 'clang_constructUSR_ObjCProperty'); - late final _dart_clang_constructUSR_ObjCProperty - _clang_constructUSR_ObjCProperty = _clang_constructUSR_ObjCProperty_ptr - .asFunction<_dart_clang_constructUSR_ObjCProperty>(); + late final _clang_constructUSR_ObjCProperty = + _clang_constructUSR_ObjCProperty_ptr + .asFunction, CXString)>(); /// Retrieve a name for the entity referenced by this cursor. CXString clang_getCursorSpelling( @@ -4218,8 +4186,8 @@ class LibClang { late final _clang_getCursorSpelling_ptr = _lookup>( 'clang_getCursorSpelling'); - late final _dart_clang_getCursorSpelling _clang_getCursorSpelling = - _clang_getCursorSpelling_ptr.asFunction<_dart_clang_getCursorSpelling>(); + late final _clang_getCursorSpelling = + _clang_getCursorSpelling_ptr.asFunction(); /// Retrieve a range for a piece that forms the cursors spelling name. /// Most of the times there is only one range for the complete spelling but for @@ -4245,14 +4213,13 @@ class LibClang { late final _clang_Cursor_getSpellingNameRange_ptr = _lookup>( 'clang_Cursor_getSpellingNameRange'); - late final _dart_clang_Cursor_getSpellingNameRange - _clang_Cursor_getSpellingNameRange = + late final _clang_Cursor_getSpellingNameRange = _clang_Cursor_getSpellingNameRange_ptr - .asFunction<_dart_clang_Cursor_getSpellingNameRange>(); + .asFunction(); /// Get a property value for the given printing policy. int clang_PrintingPolicy_getProperty( - ffi.Pointer Policy, + CXPrintingPolicy Policy, int Property, ) { return _clang_PrintingPolicy_getProperty( @@ -4264,13 +4231,13 @@ class LibClang { late final _clang_PrintingPolicy_getProperty_ptr = _lookup>( 'clang_PrintingPolicy_getProperty'); - late final _dart_clang_PrintingPolicy_getProperty - _clang_PrintingPolicy_getProperty = _clang_PrintingPolicy_getProperty_ptr - .asFunction<_dart_clang_PrintingPolicy_getProperty>(); + late final _clang_PrintingPolicy_getProperty = + _clang_PrintingPolicy_getProperty_ptr + .asFunction(); /// Set a property value for the given printing policy. void clang_PrintingPolicy_setProperty( - ffi.Pointer Policy, + CXPrintingPolicy Policy, int Property, int Value, ) { @@ -4284,15 +4251,15 @@ class LibClang { late final _clang_PrintingPolicy_setProperty_ptr = _lookup>( 'clang_PrintingPolicy_setProperty'); - late final _dart_clang_PrintingPolicy_setProperty - _clang_PrintingPolicy_setProperty = _clang_PrintingPolicy_setProperty_ptr - .asFunction<_dart_clang_PrintingPolicy_setProperty>(); + late final _clang_PrintingPolicy_setProperty = + _clang_PrintingPolicy_setProperty_ptr + .asFunction(); /// Retrieve the default policy for the cursor. /// /// The policy should be released after use with \c /// clang_PrintingPolicy_dispose. - ffi.Pointer clang_getCursorPrintingPolicy( + CXPrintingPolicy clang_getCursorPrintingPolicy( CXCursor arg0, ) { return _clang_getCursorPrintingPolicy( @@ -4303,13 +4270,12 @@ class LibClang { late final _clang_getCursorPrintingPolicy_ptr = _lookup>( 'clang_getCursorPrintingPolicy'); - late final _dart_clang_getCursorPrintingPolicy - _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicy_ptr - .asFunction<_dart_clang_getCursorPrintingPolicy>(); + late final _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicy_ptr + .asFunction(); /// Release a printing policy. void clang_PrintingPolicy_dispose( - ffi.Pointer Policy, + CXPrintingPolicy Policy, ) { return _clang_PrintingPolicy_dispose( Policy, @@ -4319,9 +4285,8 @@ class LibClang { late final _clang_PrintingPolicy_dispose_ptr = _lookup>( 'clang_PrintingPolicy_dispose'); - late final _dart_clang_PrintingPolicy_dispose _clang_PrintingPolicy_dispose = - _clang_PrintingPolicy_dispose_ptr - .asFunction<_dart_clang_PrintingPolicy_dispose>(); + late final _clang_PrintingPolicy_dispose = _clang_PrintingPolicy_dispose_ptr + .asFunction(); /// Pretty print declarations. /// @@ -4334,7 +4299,7 @@ class LibClang { /// other cursors. CXString clang_getCursorPrettyPrinted( CXCursor Cursor, - ffi.Pointer Policy, + CXPrintingPolicy Policy, ) { return _clang_getCursorPrettyPrinted( Cursor, @@ -4345,9 +4310,8 @@ class LibClang { late final _clang_getCursorPrettyPrinted_ptr = _lookup>( 'clang_getCursorPrettyPrinted'); - late final _dart_clang_getCursorPrettyPrinted _clang_getCursorPrettyPrinted = - _clang_getCursorPrettyPrinted_ptr - .asFunction<_dart_clang_getCursorPrettyPrinted>(); + late final _clang_getCursorPrettyPrinted = _clang_getCursorPrettyPrinted_ptr + .asFunction(); /// Retrieve the display name for the entity referenced by this cursor. /// @@ -4365,9 +4329,8 @@ class LibClang { late final _clang_getCursorDisplayName_ptr = _lookup>( 'clang_getCursorDisplayName'); - late final _dart_clang_getCursorDisplayName _clang_getCursorDisplayName = - _clang_getCursorDisplayName_ptr - .asFunction<_dart_clang_getCursorDisplayName>(); + late final _clang_getCursorDisplayName = + _clang_getCursorDisplayName_ptr.asFunction(); /// For a cursor that is a reference, retrieve a cursor representing the /// entity that it references. @@ -4389,9 +4352,8 @@ class LibClang { late final _clang_getCursorReferenced_ptr = _lookup>( 'clang_getCursorReferenced'); - late final _dart_clang_getCursorReferenced _clang_getCursorReferenced = - _clang_getCursorReferenced_ptr - .asFunction<_dart_clang_getCursorReferenced>(); + late final _clang_getCursorReferenced = + _clang_getCursorReferenced_ptr.asFunction(); /// For a cursor that is either a reference to or a declaration /// of some entity, retrieve a cursor that describes the definition of @@ -4430,9 +4392,8 @@ class LibClang { late final _clang_getCursorDefinition_ptr = _lookup>( 'clang_getCursorDefinition'); - late final _dart_clang_getCursorDefinition _clang_getCursorDefinition = - _clang_getCursorDefinition_ptr - .asFunction<_dart_clang_getCursorDefinition>(); + late final _clang_getCursorDefinition = + _clang_getCursorDefinition_ptr.asFunction(); /// Determine whether the declaration pointed to by this cursor /// is also a definition of that entity. @@ -4447,9 +4408,8 @@ class LibClang { late final _clang_isCursorDefinition_ptr = _lookup>( 'clang_isCursorDefinition'); - late final _dart_clang_isCursorDefinition _clang_isCursorDefinition = - _clang_isCursorDefinition_ptr - .asFunction<_dart_clang_isCursorDefinition>(); + late final _clang_isCursorDefinition = + _clang_isCursorDefinition_ptr.asFunction(); /// Retrieve the canonical cursor corresponding to the given cursor. /// @@ -4484,9 +4444,8 @@ class LibClang { late final _clang_getCanonicalCursor_ptr = _lookup>( 'clang_getCanonicalCursor'); - late final _dart_clang_getCanonicalCursor _clang_getCanonicalCursor = - _clang_getCanonicalCursor_ptr - .asFunction<_dart_clang_getCanonicalCursor>(); + late final _clang_getCanonicalCursor = + _clang_getCanonicalCursor_ptr.asFunction(); /// If the cursor points to a selector identifier in an Objective-C /// method or message expression, this returns the selector index. @@ -4508,10 +4467,9 @@ class LibClang { late final _clang_Cursor_getObjCSelectorIndex_ptr = _lookup>( 'clang_Cursor_getObjCSelectorIndex'); - late final _dart_clang_Cursor_getObjCSelectorIndex - _clang_Cursor_getObjCSelectorIndex = + late final _clang_Cursor_getObjCSelectorIndex = _clang_Cursor_getObjCSelectorIndex_ptr - .asFunction<_dart_clang_Cursor_getObjCSelectorIndex>(); + .asFunction(); /// Given a cursor pointing to a C++ method call or an Objective-C /// message, returns non-zero if the method/message is "dynamic", meaning: @@ -4533,9 +4491,8 @@ class LibClang { late final _clang_Cursor_isDynamicCall_ptr = _lookup>( 'clang_Cursor_isDynamicCall'); - late final _dart_clang_Cursor_isDynamicCall _clang_Cursor_isDynamicCall = - _clang_Cursor_isDynamicCall_ptr - .asFunction<_dart_clang_Cursor_isDynamicCall>(); + late final _clang_Cursor_isDynamicCall = + _clang_Cursor_isDynamicCall_ptr.asFunction(); /// Given a cursor pointing to an Objective-C message or property /// reference, or C++ method call, returns the CXType of the receiver. @@ -4550,9 +4507,8 @@ class LibClang { late final _clang_Cursor_getReceiverType_ptr = _lookup>( 'clang_Cursor_getReceiverType'); - late final _dart_clang_Cursor_getReceiverType _clang_Cursor_getReceiverType = - _clang_Cursor_getReceiverType_ptr - .asFunction<_dart_clang_Cursor_getReceiverType>(); + late final _clang_Cursor_getReceiverType = + _clang_Cursor_getReceiverType_ptr.asFunction(); /// Given a cursor that represents a property declaration, return the /// associated property attributes. The bits are formed from @@ -4572,10 +4528,9 @@ class LibClang { late final _clang_Cursor_getObjCPropertyAttributes_ptr = _lookup< ffi.NativeFunction>( 'clang_Cursor_getObjCPropertyAttributes'); - late final _dart_clang_Cursor_getObjCPropertyAttributes - _clang_Cursor_getObjCPropertyAttributes = + late final _clang_Cursor_getObjCPropertyAttributes = _clang_Cursor_getObjCPropertyAttributes_ptr - .asFunction<_dart_clang_Cursor_getObjCPropertyAttributes>(); + .asFunction(); /// Given a cursor that represents a property declaration, return the /// name of the method that implements the getter. @@ -4590,10 +4545,9 @@ class LibClang { late final _clang_Cursor_getObjCPropertyGetterName_ptr = _lookup< ffi.NativeFunction>( 'clang_Cursor_getObjCPropertyGetterName'); - late final _dart_clang_Cursor_getObjCPropertyGetterName - _clang_Cursor_getObjCPropertyGetterName = + late final _clang_Cursor_getObjCPropertyGetterName = _clang_Cursor_getObjCPropertyGetterName_ptr - .asFunction<_dart_clang_Cursor_getObjCPropertyGetterName>(); + .asFunction(); /// Given a cursor that represents a property declaration, return the /// name of the method that implements the setter, if any. @@ -4608,10 +4562,9 @@ class LibClang { late final _clang_Cursor_getObjCPropertySetterName_ptr = _lookup< ffi.NativeFunction>( 'clang_Cursor_getObjCPropertySetterName'); - late final _dart_clang_Cursor_getObjCPropertySetterName - _clang_Cursor_getObjCPropertySetterName = + late final _clang_Cursor_getObjCPropertySetterName = _clang_Cursor_getObjCPropertySetterName_ptr - .asFunction<_dart_clang_Cursor_getObjCPropertySetterName>(); + .asFunction(); /// Given a cursor that represents an Objective-C method or parameter /// declaration, return the associated Objective-C qualifiers for the return @@ -4628,10 +4581,9 @@ class LibClang { late final _clang_Cursor_getObjCDeclQualifiers_ptr = _lookup>( 'clang_Cursor_getObjCDeclQualifiers'); - late final _dart_clang_Cursor_getObjCDeclQualifiers - _clang_Cursor_getObjCDeclQualifiers = + late final _clang_Cursor_getObjCDeclQualifiers = _clang_Cursor_getObjCDeclQualifiers_ptr - .asFunction<_dart_clang_Cursor_getObjCDeclQualifiers>(); + .asFunction(); /// Given a cursor that represents an Objective-C method or property /// declaration, return non-zero if the declaration was affected by "\@optional". @@ -4647,9 +4599,8 @@ class LibClang { late final _clang_Cursor_isObjCOptional_ptr = _lookup>( 'clang_Cursor_isObjCOptional'); - late final _dart_clang_Cursor_isObjCOptional _clang_Cursor_isObjCOptional = - _clang_Cursor_isObjCOptional_ptr - .asFunction<_dart_clang_Cursor_isObjCOptional>(); + late final _clang_Cursor_isObjCOptional = + _clang_Cursor_isObjCOptional_ptr.asFunction(); /// Returns non-zero if the given cursor is a variadic function or method. int clang_Cursor_isVariadic( @@ -4663,8 +4614,8 @@ class LibClang { late final _clang_Cursor_isVariadic_ptr = _lookup>( 'clang_Cursor_isVariadic'); - late final _dart_clang_Cursor_isVariadic _clang_Cursor_isVariadic = - _clang_Cursor_isVariadic_ptr.asFunction<_dart_clang_Cursor_isVariadic>(); + late final _clang_Cursor_isVariadic = + _clang_Cursor_isVariadic_ptr.asFunction(); /// Returns non-zero if the given cursor points to a symbol marked with /// external_source_symbol attribute. @@ -4694,9 +4645,10 @@ class LibClang { late final _clang_Cursor_isExternalSymbol_ptr = _lookup>( 'clang_Cursor_isExternalSymbol'); - late final _dart_clang_Cursor_isExternalSymbol - _clang_Cursor_isExternalSymbol = _clang_Cursor_isExternalSymbol_ptr - .asFunction<_dart_clang_Cursor_isExternalSymbol>(); + late final _clang_Cursor_isExternalSymbol = + _clang_Cursor_isExternalSymbol_ptr.asFunction< + int Function(CXCursor, ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Given a cursor that represents a declaration, return the associated /// comment's source range. The range may include multiple consecutive comments @@ -4712,9 +4664,8 @@ class LibClang { late final _clang_Cursor_getCommentRange_ptr = _lookup>( 'clang_Cursor_getCommentRange'); - late final _dart_clang_Cursor_getCommentRange _clang_Cursor_getCommentRange = - _clang_Cursor_getCommentRange_ptr - .asFunction<_dart_clang_Cursor_getCommentRange>(); + late final _clang_Cursor_getCommentRange = _clang_Cursor_getCommentRange_ptr + .asFunction(); /// Given a cursor that represents a declaration, return the associated /// comment text, including comment markers. @@ -4729,9 +4680,9 @@ class LibClang { late final _clang_Cursor_getRawCommentText_ptr = _lookup>( 'clang_Cursor_getRawCommentText'); - late final _dart_clang_Cursor_getRawCommentText - _clang_Cursor_getRawCommentText = _clang_Cursor_getRawCommentText_ptr - .asFunction<_dart_clang_Cursor_getRawCommentText>(); + late final _clang_Cursor_getRawCommentText = + _clang_Cursor_getRawCommentText_ptr + .asFunction(); /// Given a cursor that represents a documentable entity (e.g., /// declaration), return the associated \paragraph; otherwise return the @@ -4747,9 +4698,9 @@ class LibClang { late final _clang_Cursor_getBriefCommentText_ptr = _lookup>( 'clang_Cursor_getBriefCommentText'); - late final _dart_clang_Cursor_getBriefCommentText - _clang_Cursor_getBriefCommentText = _clang_Cursor_getBriefCommentText_ptr - .asFunction<_dart_clang_Cursor_getBriefCommentText>(); + late final _clang_Cursor_getBriefCommentText = + _clang_Cursor_getBriefCommentText_ptr + .asFunction(); /// Retrieve the CXString representing the mangled name of the cursor. CXString clang_Cursor_getMangling( @@ -4763,9 +4714,8 @@ class LibClang { late final _clang_Cursor_getMangling_ptr = _lookup>( 'clang_Cursor_getMangling'); - late final _dart_clang_Cursor_getMangling _clang_Cursor_getMangling = - _clang_Cursor_getMangling_ptr - .asFunction<_dart_clang_Cursor_getMangling>(); + late final _clang_Cursor_getMangling = + _clang_Cursor_getMangling_ptr.asFunction(); /// Retrieve the CXStrings representing the mangled symbols of the C++ /// constructor or destructor at the cursor. @@ -4780,9 +4730,8 @@ class LibClang { late final _clang_Cursor_getCXXManglings_ptr = _lookup>( 'clang_Cursor_getCXXManglings'); - late final _dart_clang_Cursor_getCXXManglings _clang_Cursor_getCXXManglings = - _clang_Cursor_getCXXManglings_ptr - .asFunction<_dart_clang_Cursor_getCXXManglings>(); + late final _clang_Cursor_getCXXManglings = _clang_Cursor_getCXXManglings_ptr + .asFunction Function(CXCursor)>(); /// Retrieve the CXStrings representing the mangled symbols of the ObjC /// class interface or implementation at the cursor. @@ -4797,12 +4746,11 @@ class LibClang { late final _clang_Cursor_getObjCManglings_ptr = _lookup>( 'clang_Cursor_getObjCManglings'); - late final _dart_clang_Cursor_getObjCManglings - _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglings_ptr - .asFunction<_dart_clang_Cursor_getObjCManglings>(); + late final _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglings_ptr + .asFunction Function(CXCursor)>(); /// Given a CXCursor_ModuleImportDecl cursor, return the associated module. - ffi.Pointer clang_Cursor_getModule( + CXModule clang_Cursor_getModule( CXCursor C, ) { return _clang_Cursor_getModule( @@ -4813,14 +4761,14 @@ class LibClang { late final _clang_Cursor_getModule_ptr = _lookup>( 'clang_Cursor_getModule'); - late final _dart_clang_Cursor_getModule _clang_Cursor_getModule = - _clang_Cursor_getModule_ptr.asFunction<_dart_clang_Cursor_getModule>(); + late final _clang_Cursor_getModule = + _clang_Cursor_getModule_ptr.asFunction(); /// Given a CXFile header file, return the module that contains it, if one /// exists. - ffi.Pointer clang_getModuleForFile( - ffi.Pointer arg0, - ffi.Pointer arg1, + CXModule clang_getModuleForFile( + CXTranslationUnit arg0, + CXFile arg1, ) { return _clang_getModuleForFile( arg0, @@ -4831,14 +4779,14 @@ class LibClang { late final _clang_getModuleForFile_ptr = _lookup>( 'clang_getModuleForFile'); - late final _dart_clang_getModuleForFile _clang_getModuleForFile = - _clang_getModuleForFile_ptr.asFunction<_dart_clang_getModuleForFile>(); + late final _clang_getModuleForFile = _clang_getModuleForFile_ptr + .asFunction(); /// \param Module a module object. /// /// \returns the module file where the provided module object came from. - ffi.Pointer clang_Module_getASTFile( - ffi.Pointer Module, + CXFile clang_Module_getASTFile( + CXModule Module, ) { return _clang_Module_getASTFile( Module, @@ -4848,15 +4796,15 @@ class LibClang { late final _clang_Module_getASTFile_ptr = _lookup>( 'clang_Module_getASTFile'); - late final _dart_clang_Module_getASTFile _clang_Module_getASTFile = - _clang_Module_getASTFile_ptr.asFunction<_dart_clang_Module_getASTFile>(); + late final _clang_Module_getASTFile = + _clang_Module_getASTFile_ptr.asFunction(); /// \param Module a module object. /// /// \returns the parent of a sub-module or NULL if the given module is top-level, /// e.g. for 'std.vector' it will return the 'std' module. - ffi.Pointer clang_Module_getParent( - ffi.Pointer Module, + CXModule clang_Module_getParent( + CXModule Module, ) { return _clang_Module_getParent( Module, @@ -4866,15 +4814,15 @@ class LibClang { late final _clang_Module_getParent_ptr = _lookup>( 'clang_Module_getParent'); - late final _dart_clang_Module_getParent _clang_Module_getParent = - _clang_Module_getParent_ptr.asFunction<_dart_clang_Module_getParent>(); + late final _clang_Module_getParent = + _clang_Module_getParent_ptr.asFunction(); /// \param Module a module object. /// /// \returns the name of the module, e.g. for the 'std.vector' sub-module it /// will return "vector". CXString clang_Module_getName( - ffi.Pointer Module, + CXModule Module, ) { return _clang_Module_getName( Module, @@ -4884,14 +4832,14 @@ class LibClang { late final _clang_Module_getName_ptr = _lookup>( 'clang_Module_getName'); - late final _dart_clang_Module_getName _clang_Module_getName = - _clang_Module_getName_ptr.asFunction<_dart_clang_Module_getName>(); + late final _clang_Module_getName = + _clang_Module_getName_ptr.asFunction(); /// \param Module a module object. /// /// \returns the full name of the module, e.g. "std.vector". CXString clang_Module_getFullName( - ffi.Pointer Module, + CXModule Module, ) { return _clang_Module_getFullName( Module, @@ -4901,15 +4849,14 @@ class LibClang { late final _clang_Module_getFullName_ptr = _lookup>( 'clang_Module_getFullName'); - late final _dart_clang_Module_getFullName _clang_Module_getFullName = - _clang_Module_getFullName_ptr - .asFunction<_dart_clang_Module_getFullName>(); + late final _clang_Module_getFullName = + _clang_Module_getFullName_ptr.asFunction(); /// \param Module a module object. /// /// \returns non-zero if the module is a system one. int clang_Module_isSystem( - ffi.Pointer Module, + CXModule Module, ) { return _clang_Module_isSystem( Module, @@ -4919,15 +4866,15 @@ class LibClang { late final _clang_Module_isSystem_ptr = _lookup>( 'clang_Module_isSystem'); - late final _dart_clang_Module_isSystem _clang_Module_isSystem = - _clang_Module_isSystem_ptr.asFunction<_dart_clang_Module_isSystem>(); + late final _clang_Module_isSystem = + _clang_Module_isSystem_ptr.asFunction(); /// \param Module a module object. /// /// \returns the number of top level headers associated with this module. int clang_Module_getNumTopLevelHeaders( - ffi.Pointer arg0, - ffi.Pointer Module, + CXTranslationUnit arg0, + CXModule Module, ) { return _clang_Module_getNumTopLevelHeaders( arg0, @@ -4938,19 +4885,18 @@ class LibClang { late final _clang_Module_getNumTopLevelHeaders_ptr = _lookup>( 'clang_Module_getNumTopLevelHeaders'); - late final _dart_clang_Module_getNumTopLevelHeaders - _clang_Module_getNumTopLevelHeaders = + late final _clang_Module_getNumTopLevelHeaders = _clang_Module_getNumTopLevelHeaders_ptr - .asFunction<_dart_clang_Module_getNumTopLevelHeaders>(); + .asFunction(); /// \param Module a module object. /// /// \param Index top level header index (zero-based). /// /// \returns the specified top level header associated with the module. - ffi.Pointer clang_Module_getTopLevelHeader( - ffi.Pointer arg0, - ffi.Pointer Module, + CXFile clang_Module_getTopLevelHeader( + CXTranslationUnit arg0, + CXModule Module, int Index, ) { return _clang_Module_getTopLevelHeader( @@ -4963,9 +4909,9 @@ class LibClang { late final _clang_Module_getTopLevelHeader_ptr = _lookup>( 'clang_Module_getTopLevelHeader'); - late final _dart_clang_Module_getTopLevelHeader - _clang_Module_getTopLevelHeader = _clang_Module_getTopLevelHeader_ptr - .asFunction<_dart_clang_Module_getTopLevelHeader>(); + late final _clang_Module_getTopLevelHeader = + _clang_Module_getTopLevelHeader_ptr + .asFunction(); /// Determine if a C++ constructor is a converting constructor. int clang_CXXConstructor_isConvertingConstructor( @@ -4980,10 +4926,9 @@ class LibClang { ffi.NativeFunction< Native_clang_CXXConstructor_isConvertingConstructor>>( 'clang_CXXConstructor_isConvertingConstructor'); - late final _dart_clang_CXXConstructor_isConvertingConstructor - _clang_CXXConstructor_isConvertingConstructor = + late final _clang_CXXConstructor_isConvertingConstructor = _clang_CXXConstructor_isConvertingConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isConvertingConstructor>(); + .asFunction(); /// Determine if a C++ constructor is a copy constructor. int clang_CXXConstructor_isCopyConstructor( @@ -4997,10 +4942,9 @@ class LibClang { late final _clang_CXXConstructor_isCopyConstructor_ptr = _lookup< ffi.NativeFunction>( 'clang_CXXConstructor_isCopyConstructor'); - late final _dart_clang_CXXConstructor_isCopyConstructor - _clang_CXXConstructor_isCopyConstructor = + late final _clang_CXXConstructor_isCopyConstructor = _clang_CXXConstructor_isCopyConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isCopyConstructor>(); + .asFunction(); /// Determine if a C++ constructor is the default constructor. int clang_CXXConstructor_isDefaultConstructor( @@ -5014,10 +4958,9 @@ class LibClang { late final _clang_CXXConstructor_isDefaultConstructor_ptr = _lookup< ffi.NativeFunction>( 'clang_CXXConstructor_isDefaultConstructor'); - late final _dart_clang_CXXConstructor_isDefaultConstructor - _clang_CXXConstructor_isDefaultConstructor = + late final _clang_CXXConstructor_isDefaultConstructor = _clang_CXXConstructor_isDefaultConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isDefaultConstructor>(); + .asFunction(); /// Determine if a C++ constructor is a move constructor. int clang_CXXConstructor_isMoveConstructor( @@ -5031,10 +4974,9 @@ class LibClang { late final _clang_CXXConstructor_isMoveConstructor_ptr = _lookup< ffi.NativeFunction>( 'clang_CXXConstructor_isMoveConstructor'); - late final _dart_clang_CXXConstructor_isMoveConstructor - _clang_CXXConstructor_isMoveConstructor = + late final _clang_CXXConstructor_isMoveConstructor = _clang_CXXConstructor_isMoveConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isMoveConstructor>(); + .asFunction(); /// Determine if a C++ field is declared 'mutable'. int clang_CXXField_isMutable( @@ -5048,9 +4990,8 @@ class LibClang { late final _clang_CXXField_isMutable_ptr = _lookup>( 'clang_CXXField_isMutable'); - late final _dart_clang_CXXField_isMutable _clang_CXXField_isMutable = - _clang_CXXField_isMutable_ptr - .asFunction<_dart_clang_CXXField_isMutable>(); + late final _clang_CXXField_isMutable = + _clang_CXXField_isMutable_ptr.asFunction(); /// Determine if a C++ method is declared '= default'. int clang_CXXMethod_isDefaulted( @@ -5064,9 +5005,8 @@ class LibClang { late final _clang_CXXMethod_isDefaulted_ptr = _lookup>( 'clang_CXXMethod_isDefaulted'); - late final _dart_clang_CXXMethod_isDefaulted _clang_CXXMethod_isDefaulted = - _clang_CXXMethod_isDefaulted_ptr - .asFunction<_dart_clang_CXXMethod_isDefaulted>(); + late final _clang_CXXMethod_isDefaulted = + _clang_CXXMethod_isDefaulted_ptr.asFunction(); /// Determine if a C++ member function or member function template is /// pure virtual. @@ -5081,9 +5021,8 @@ class LibClang { late final _clang_CXXMethod_isPureVirtual_ptr = _lookup>( 'clang_CXXMethod_isPureVirtual'); - late final _dart_clang_CXXMethod_isPureVirtual - _clang_CXXMethod_isPureVirtual = _clang_CXXMethod_isPureVirtual_ptr - .asFunction<_dart_clang_CXXMethod_isPureVirtual>(); + late final _clang_CXXMethod_isPureVirtual = + _clang_CXXMethod_isPureVirtual_ptr.asFunction(); /// Determine if a C++ member function or member function template is /// declared 'static'. @@ -5098,9 +5037,8 @@ class LibClang { late final _clang_CXXMethod_isStatic_ptr = _lookup>( 'clang_CXXMethod_isStatic'); - late final _dart_clang_CXXMethod_isStatic _clang_CXXMethod_isStatic = - _clang_CXXMethod_isStatic_ptr - .asFunction<_dart_clang_CXXMethod_isStatic>(); + late final _clang_CXXMethod_isStatic = + _clang_CXXMethod_isStatic_ptr.asFunction(); /// Determine if a C++ member function or member function template is /// explicitly declared 'virtual' or if it overrides a virtual method from @@ -5116,9 +5054,8 @@ class LibClang { late final _clang_CXXMethod_isVirtual_ptr = _lookup>( 'clang_CXXMethod_isVirtual'); - late final _dart_clang_CXXMethod_isVirtual _clang_CXXMethod_isVirtual = - _clang_CXXMethod_isVirtual_ptr - .asFunction<_dart_clang_CXXMethod_isVirtual>(); + late final _clang_CXXMethod_isVirtual = + _clang_CXXMethod_isVirtual_ptr.asFunction(); /// Determine if a C++ record is abstract, i.e. whether a class or struct /// has a pure virtual member function. @@ -5133,9 +5070,8 @@ class LibClang { late final _clang_CXXRecord_isAbstract_ptr = _lookup>( 'clang_CXXRecord_isAbstract'); - late final _dart_clang_CXXRecord_isAbstract _clang_CXXRecord_isAbstract = - _clang_CXXRecord_isAbstract_ptr - .asFunction<_dart_clang_CXXRecord_isAbstract>(); + late final _clang_CXXRecord_isAbstract = + _clang_CXXRecord_isAbstract_ptr.asFunction(); /// Determine if an enum declaration refers to a scoped enum. int clang_EnumDecl_isScoped( @@ -5149,8 +5085,8 @@ class LibClang { late final _clang_EnumDecl_isScoped_ptr = _lookup>( 'clang_EnumDecl_isScoped'); - late final _dart_clang_EnumDecl_isScoped _clang_EnumDecl_isScoped = - _clang_EnumDecl_isScoped_ptr.asFunction<_dart_clang_EnumDecl_isScoped>(); + late final _clang_EnumDecl_isScoped = + _clang_EnumDecl_isScoped_ptr.asFunction(); /// Determine if a C++ member function or member function template is /// declared 'const'. @@ -5165,8 +5101,8 @@ class LibClang { late final _clang_CXXMethod_isConst_ptr = _lookup>( 'clang_CXXMethod_isConst'); - late final _dart_clang_CXXMethod_isConst _clang_CXXMethod_isConst = - _clang_CXXMethod_isConst_ptr.asFunction<_dart_clang_CXXMethod_isConst>(); + late final _clang_CXXMethod_isConst = + _clang_CXXMethod_isConst_ptr.asFunction(); /// Given a cursor that represents a template, determine /// the cursor kind of the specializations would be generated by instantiating @@ -5194,9 +5130,8 @@ class LibClang { late final _clang_getTemplateCursorKind_ptr = _lookup>( 'clang_getTemplateCursorKind'); - late final _dart_clang_getTemplateCursorKind _clang_getTemplateCursorKind = - _clang_getTemplateCursorKind_ptr - .asFunction<_dart_clang_getTemplateCursorKind>(); + late final _clang_getTemplateCursorKind = + _clang_getTemplateCursorKind_ptr.asFunction(); /// Given a cursor that may represent a specialization or instantiation /// of a template, retrieve the cursor that represents the template that it @@ -5235,10 +5170,9 @@ class LibClang { late final _clang_getSpecializedCursorTemplate_ptr = _lookup>( 'clang_getSpecializedCursorTemplate'); - late final _dart_clang_getSpecializedCursorTemplate - _clang_getSpecializedCursorTemplate = + late final _clang_getSpecializedCursorTemplate = _clang_getSpecializedCursorTemplate_ptr - .asFunction<_dart_clang_getSpecializedCursorTemplate>(); + .asFunction(); /// Given a cursor that references something else, return the source range /// covering that reference. @@ -5271,10 +5205,9 @@ class LibClang { late final _clang_getCursorReferenceNameRange_ptr = _lookup>( 'clang_getCursorReferenceNameRange'); - late final _dart_clang_getCursorReferenceNameRange - _clang_getCursorReferenceNameRange = + late final _clang_getCursorReferenceNameRange = _clang_getCursorReferenceNameRange_ptr - .asFunction<_dart_clang_getCursorReferenceNameRange>(); + .asFunction(); /// Get the raw lexical token starting with the given location. /// @@ -5286,7 +5219,7 @@ class LibClang { /// exist. The returned pointer must be freed with clang_disposeTokens before the /// translation unit is destroyed. ffi.Pointer clang_getToken( - ffi.Pointer TU, + CXTranslationUnit TU, CXSourceLocation Location, ) { return _clang_getToken( @@ -5297,8 +5230,8 @@ class LibClang { late final _clang_getToken_ptr = _lookup>('clang_getToken'); - late final _dart_clang_getToken _clang_getToken = - _clang_getToken_ptr.asFunction<_dart_clang_getToken>(); + late final _clang_getToken = _clang_getToken_ptr.asFunction< + ffi.Pointer Function(CXTranslationUnit, CXSourceLocation)>(); /// Determine the kind of the given token. int clang_getTokenKind( @@ -5312,15 +5245,15 @@ class LibClang { late final _clang_getTokenKind_ptr = _lookup>( 'clang_getTokenKind'); - late final _dart_clang_getTokenKind _clang_getTokenKind = - _clang_getTokenKind_ptr.asFunction<_dart_clang_getTokenKind>(); + late final _clang_getTokenKind = + _clang_getTokenKind_ptr.asFunction(); /// Determine the spelling of the given token. /// /// The spelling of a token is the textual representation of that token, e.g., /// the text of an identifier or keyword. CXString clang_getTokenSpelling( - ffi.Pointer arg0, + CXTranslationUnit arg0, CXToken arg1, ) { return _clang_getTokenSpelling( @@ -5332,12 +5265,12 @@ class LibClang { late final _clang_getTokenSpelling_ptr = _lookup>( 'clang_getTokenSpelling'); - late final _dart_clang_getTokenSpelling _clang_getTokenSpelling = - _clang_getTokenSpelling_ptr.asFunction<_dart_clang_getTokenSpelling>(); + late final _clang_getTokenSpelling = _clang_getTokenSpelling_ptr + .asFunction(); /// Retrieve the source location of the given token. CXSourceLocation clang_getTokenLocation( - ffi.Pointer arg0, + CXTranslationUnit arg0, CXToken arg1, ) { return _clang_getTokenLocation( @@ -5349,12 +5282,12 @@ class LibClang { late final _clang_getTokenLocation_ptr = _lookup>( 'clang_getTokenLocation'); - late final _dart_clang_getTokenLocation _clang_getTokenLocation = - _clang_getTokenLocation_ptr.asFunction<_dart_clang_getTokenLocation>(); + late final _clang_getTokenLocation = _clang_getTokenLocation_ptr + .asFunction(); /// Retrieve a source range that covers the given token. CXSourceRange clang_getTokenExtent( - ffi.Pointer arg0, + CXTranslationUnit arg0, CXToken arg1, ) { return _clang_getTokenExtent( @@ -5366,8 +5299,8 @@ class LibClang { late final _clang_getTokenExtent_ptr = _lookup>( 'clang_getTokenExtent'); - late final _dart_clang_getTokenExtent _clang_getTokenExtent = - _clang_getTokenExtent_ptr.asFunction<_dart_clang_getTokenExtent>(); + late final _clang_getTokenExtent = _clang_getTokenExtent_ptr + .asFunction(); /// Tokenize the source code described by the given range into raw /// lexical tokens. @@ -5384,7 +5317,7 @@ class LibClang { /// \param NumTokens will be set to the number of tokens in the \c *Tokens /// array. void clang_tokenize( - ffi.Pointer TU, + CXTranslationUnit TU, CXSourceRange Range, ffi.Pointer> Tokens, ffi.Pointer NumTokens, @@ -5399,8 +5332,9 @@ class LibClang { late final _clang_tokenize_ptr = _lookup>('clang_tokenize'); - late final _dart_clang_tokenize _clang_tokenize = - _clang_tokenize_ptr.asFunction<_dart_clang_tokenize>(); + late final _clang_tokenize = _clang_tokenize_ptr.asFunction< + void Function(CXTranslationUnit, CXSourceRange, + ffi.Pointer>, ffi.Pointer)>(); /// Annotate the given set of tokens by providing cursors for each token /// that can be mapped to a specific entity within the abstract syntax tree. @@ -5431,7 +5365,7 @@ class LibClang { /// \param Cursors an array of \p NumTokens cursors, whose contents will be /// replaced with the cursors corresponding to each token. void clang_annotateTokens( - ffi.Pointer TU, + CXTranslationUnit TU, ffi.Pointer Tokens, int NumTokens, ffi.Pointer Cursors, @@ -5447,12 +5381,13 @@ class LibClang { late final _clang_annotateTokens_ptr = _lookup>( 'clang_annotateTokens'); - late final _dart_clang_annotateTokens _clang_annotateTokens = - _clang_annotateTokens_ptr.asFunction<_dart_clang_annotateTokens>(); + late final _clang_annotateTokens = _clang_annotateTokens_ptr.asFunction< + void Function(CXTranslationUnit, ffi.Pointer, int, + ffi.Pointer)>(); /// Free the given set of tokens. void clang_disposeTokens( - ffi.Pointer TU, + CXTranslationUnit TU, ffi.Pointer Tokens, int NumTokens, ) { @@ -5466,8 +5401,8 @@ class LibClang { late final _clang_disposeTokens_ptr = _lookup>( 'clang_disposeTokens'); - late final _dart_clang_disposeTokens _clang_disposeTokens = - _clang_disposeTokens_ptr.asFunction<_dart_clang_disposeTokens>(); + late final _clang_disposeTokens = _clang_disposeTokens_ptr.asFunction< + void Function(CXTranslationUnit, ffi.Pointer, int)>(); /// \defgroup CINDEX_DEBUG Debugging facilities /// @@ -5486,9 +5421,8 @@ class LibClang { late final _clang_getCursorKindSpelling_ptr = _lookup>( 'clang_getCursorKindSpelling'); - late final _dart_clang_getCursorKindSpelling _clang_getCursorKindSpelling = - _clang_getCursorKindSpelling_ptr - .asFunction<_dart_clang_getCursorKindSpelling>(); + late final _clang_getCursorKindSpelling = + _clang_getCursorKindSpelling_ptr.asFunction(); void clang_getDefinitionSpellingAndExtent( CXCursor arg0, @@ -5513,10 +5447,16 @@ class LibClang { late final _clang_getDefinitionSpellingAndExtent_ptr = _lookup>( 'clang_getDefinitionSpellingAndExtent'); - late final _dart_clang_getDefinitionSpellingAndExtent - _clang_getDefinitionSpellingAndExtent = - _clang_getDefinitionSpellingAndExtent_ptr - .asFunction<_dart_clang_getDefinitionSpellingAndExtent>(); + late final _clang_getDefinitionSpellingAndExtent = + _clang_getDefinitionSpellingAndExtent_ptr.asFunction< + void Function( + CXCursor, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); void clang_enableStackTraces() { return _clang_enableStackTraces(); @@ -5525,11 +5465,12 @@ class LibClang { late final _clang_enableStackTraces_ptr = _lookup>( 'clang_enableStackTraces'); - late final _dart_clang_enableStackTraces _clang_enableStackTraces = - _clang_enableStackTraces_ptr.asFunction<_dart_clang_enableStackTraces>(); + late final _clang_enableStackTraces = + _clang_enableStackTraces_ptr.asFunction(); void clang_executeOnThread( - ffi.Pointer> fn, + ffi.Pointer)>> + fn, ffi.Pointer user_data, int stack_size, ) { @@ -5543,8 +5484,12 @@ class LibClang { late final _clang_executeOnThread_ptr = _lookup>( 'clang_executeOnThread'); - late final _dart_clang_executeOnThread _clang_executeOnThread = - _clang_executeOnThread_ptr.asFunction<_dart_clang_executeOnThread>(); + late final _clang_executeOnThread = _clang_executeOnThread_ptr.asFunction< + void Function( + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Pointer, + int)>(); /// Determine the kind of a particular chunk within a completion string. /// @@ -5554,7 +5499,7 @@ class LibClang { /// /// \returns the kind of the chunk at the index \c chunk_number. int clang_getCompletionChunkKind( - ffi.Pointer completion_string, + CXCompletionString completion_string, int chunk_number, ) { return _clang_getCompletionChunkKind( @@ -5566,9 +5511,8 @@ class LibClang { late final _clang_getCompletionChunkKind_ptr = _lookup>( 'clang_getCompletionChunkKind'); - late final _dart_clang_getCompletionChunkKind _clang_getCompletionChunkKind = - _clang_getCompletionChunkKind_ptr - .asFunction<_dart_clang_getCompletionChunkKind>(); + late final _clang_getCompletionChunkKind = _clang_getCompletionChunkKind_ptr + .asFunction(); /// Retrieve the text associated with a particular chunk within a /// completion string. @@ -5579,7 +5523,7 @@ class LibClang { /// /// \returns the text associated with the chunk at index \c chunk_number. CXString clang_getCompletionChunkText( - ffi.Pointer completion_string, + CXCompletionString completion_string, int chunk_number, ) { return _clang_getCompletionChunkText( @@ -5591,9 +5535,8 @@ class LibClang { late final _clang_getCompletionChunkText_ptr = _lookup>( 'clang_getCompletionChunkText'); - late final _dart_clang_getCompletionChunkText _clang_getCompletionChunkText = - _clang_getCompletionChunkText_ptr - .asFunction<_dart_clang_getCompletionChunkText>(); + late final _clang_getCompletionChunkText = _clang_getCompletionChunkText_ptr + .asFunction(); /// Retrieve the completion string associated with a particular chunk /// within a completion string. @@ -5604,8 +5547,8 @@ class LibClang { /// /// \returns the completion string associated with the chunk at index /// \c chunk_number. - ffi.Pointer clang_getCompletionChunkCompletionString( - ffi.Pointer completion_string, + CXCompletionString clang_getCompletionChunkCompletionString( + CXCompletionString completion_string, int chunk_number, ) { return _clang_getCompletionChunkCompletionString( @@ -5617,14 +5560,13 @@ class LibClang { late final _clang_getCompletionChunkCompletionString_ptr = _lookup< ffi.NativeFunction>( 'clang_getCompletionChunkCompletionString'); - late final _dart_clang_getCompletionChunkCompletionString - _clang_getCompletionChunkCompletionString = + late final _clang_getCompletionChunkCompletionString = _clang_getCompletionChunkCompletionString_ptr - .asFunction<_dart_clang_getCompletionChunkCompletionString>(); + .asFunction(); /// Retrieve the number of chunks in the given code-completion string. int clang_getNumCompletionChunks( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getNumCompletionChunks( completion_string, @@ -5634,9 +5576,8 @@ class LibClang { late final _clang_getNumCompletionChunks_ptr = _lookup>( 'clang_getNumCompletionChunks'); - late final _dart_clang_getNumCompletionChunks _clang_getNumCompletionChunks = - _clang_getNumCompletionChunks_ptr - .asFunction<_dart_clang_getNumCompletionChunks>(); + late final _clang_getNumCompletionChunks = _clang_getNumCompletionChunks_ptr + .asFunction(); /// Determine the priority of this code completion. /// @@ -5649,7 +5590,7 @@ class LibClang { /// \returns The priority of this completion string. Smaller values indicate /// higher-priority (more likely) completions. int clang_getCompletionPriority( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionPriority( completion_string, @@ -5659,9 +5600,8 @@ class LibClang { late final _clang_getCompletionPriority_ptr = _lookup>( 'clang_getCompletionPriority'); - late final _dart_clang_getCompletionPriority _clang_getCompletionPriority = - _clang_getCompletionPriority_ptr - .asFunction<_dart_clang_getCompletionPriority>(); + late final _clang_getCompletionPriority = _clang_getCompletionPriority_ptr + .asFunction(); /// Determine the availability of the entity that this code-completion /// string refers to. @@ -5670,7 +5610,7 @@ class LibClang { /// /// \returns The availability of the completion string. int clang_getCompletionAvailability( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionAvailability( completion_string, @@ -5680,9 +5620,9 @@ class LibClang { late final _clang_getCompletionAvailability_ptr = _lookup>( 'clang_getCompletionAvailability'); - late final _dart_clang_getCompletionAvailability - _clang_getCompletionAvailability = _clang_getCompletionAvailability_ptr - .asFunction<_dart_clang_getCompletionAvailability>(); + late final _clang_getCompletionAvailability = + _clang_getCompletionAvailability_ptr + .asFunction(); /// Retrieve the number of annotations associated with the given /// completion string. @@ -5692,7 +5632,7 @@ class LibClang { /// \returns the number of annotations associated with the given completion /// string. int clang_getCompletionNumAnnotations( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionNumAnnotations( completion_string, @@ -5702,10 +5642,9 @@ class LibClang { late final _clang_getCompletionNumAnnotations_ptr = _lookup>( 'clang_getCompletionNumAnnotations'); - late final _dart_clang_getCompletionNumAnnotations - _clang_getCompletionNumAnnotations = + late final _clang_getCompletionNumAnnotations = _clang_getCompletionNumAnnotations_ptr - .asFunction<_dart_clang_getCompletionNumAnnotations>(); + .asFunction(); /// Retrieve the annotation associated with the given completion string. /// @@ -5717,7 +5656,7 @@ class LibClang { /// \returns annotation string associated with the completion at index /// \c annotation_number, or a NULL string if that annotation is not available. CXString clang_getCompletionAnnotation( - ffi.Pointer completion_string, + CXCompletionString completion_string, int annotation_number, ) { return _clang_getCompletionAnnotation( @@ -5729,9 +5668,8 @@ class LibClang { late final _clang_getCompletionAnnotation_ptr = _lookup>( 'clang_getCompletionAnnotation'); - late final _dart_clang_getCompletionAnnotation - _clang_getCompletionAnnotation = _clang_getCompletionAnnotation_ptr - .asFunction<_dart_clang_getCompletionAnnotation>(); + late final _clang_getCompletionAnnotation = _clang_getCompletionAnnotation_ptr + .asFunction(); /// Retrieve the parent context of the given completion string. /// @@ -5748,7 +5686,7 @@ class LibClang { /// \returns The name of the completion parent, e.g., "NSObject" if /// the completion string represents a method in the NSObject class. CXString clang_getCompletionParent( - ffi.Pointer completion_string, + CXCompletionString completion_string, ffi.Pointer kind, ) { return _clang_getCompletionParent( @@ -5760,14 +5698,14 @@ class LibClang { late final _clang_getCompletionParent_ptr = _lookup>( 'clang_getCompletionParent'); - late final _dart_clang_getCompletionParent _clang_getCompletionParent = - _clang_getCompletionParent_ptr - .asFunction<_dart_clang_getCompletionParent>(); + late final _clang_getCompletionParent = + _clang_getCompletionParent_ptr.asFunction< + CXString Function(CXCompletionString, ffi.Pointer)>(); /// Retrieve the brief documentation comment attached to the declaration /// that corresponds to the given completion string. CXString clang_getCompletionBriefComment( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionBriefComment( completion_string, @@ -5777,9 +5715,9 @@ class LibClang { late final _clang_getCompletionBriefComment_ptr = _lookup>( 'clang_getCompletionBriefComment'); - late final _dart_clang_getCompletionBriefComment - _clang_getCompletionBriefComment = _clang_getCompletionBriefComment_ptr - .asFunction<_dart_clang_getCompletionBriefComment>(); + late final _clang_getCompletionBriefComment = + _clang_getCompletionBriefComment_ptr + .asFunction(); /// Retrieve a completion string for an arbitrary declaration or macro /// definition cursor. @@ -5788,7 +5726,7 @@ class LibClang { /// /// \returns A non-context-sensitive completion string for declaration and macro /// definition cursors, or NULL for other kinds of cursors. - ffi.Pointer clang_getCursorCompletionString( + CXCompletionString clang_getCursorCompletionString( CXCursor cursor, ) { return _clang_getCursorCompletionString( @@ -5799,9 +5737,9 @@ class LibClang { late final _clang_getCursorCompletionString_ptr = _lookup>( 'clang_getCursorCompletionString'); - late final _dart_clang_getCursorCompletionString - _clang_getCursorCompletionString = _clang_getCursorCompletionString_ptr - .asFunction<_dart_clang_getCursorCompletionString>(); + late final _clang_getCursorCompletionString = + _clang_getCursorCompletionString_ptr + .asFunction(); /// Retrieve the number of fix-its for the given completion index. /// @@ -5827,9 +5765,8 @@ class LibClang { late final _clang_getCompletionNumFixIts_ptr = _lookup>( 'clang_getCompletionNumFixIts'); - late final _dart_clang_getCompletionNumFixIts _clang_getCompletionNumFixIts = - _clang_getCompletionNumFixIts_ptr - .asFunction<_dart_clang_getCompletionNumFixIts>(); + late final _clang_getCompletionNumFixIts = _clang_getCompletionNumFixIts_ptr + .asFunction, int)>(); /// Fix-its that *must* be applied before inserting the text for the /// corresponding completion. @@ -5889,9 +5826,10 @@ class LibClang { late final _clang_getCompletionFixIt_ptr = _lookup>( 'clang_getCompletionFixIt'); - late final _dart_clang_getCompletionFixIt _clang_getCompletionFixIt = - _clang_getCompletionFixIt_ptr - .asFunction<_dart_clang_getCompletionFixIt>(); + late final _clang_getCompletionFixIt = + _clang_getCompletionFixIt_ptr.asFunction< + CXString Function(ffi.Pointer, int, int, + ffi.Pointer)>(); /// Returns a default set of code-completion options that can be /// passed to\c clang_codeCompleteAt(). @@ -5902,9 +5840,8 @@ class LibClang { late final _clang_defaultCodeCompleteOptions_ptr = _lookup>( 'clang_defaultCodeCompleteOptions'); - late final _dart_clang_defaultCodeCompleteOptions - _clang_defaultCodeCompleteOptions = _clang_defaultCodeCompleteOptions_ptr - .asFunction<_dart_clang_defaultCodeCompleteOptions>(); + late final _clang_defaultCodeCompleteOptions = + _clang_defaultCodeCompleteOptions_ptr.asFunction(); /// Perform code completion at a given location in a translation unit. /// @@ -5973,7 +5910,7 @@ class LibClang { /// freed with \c clang_disposeCodeCompleteResults(). If code /// completion fails, returns NULL. ffi.Pointer clang_codeCompleteAt( - ffi.Pointer TU, + CXTranslationUnit TU, ffi.Pointer complete_filename, int complete_line, int complete_column, @@ -5995,8 +5932,15 @@ class LibClang { late final _clang_codeCompleteAt_ptr = _lookup>( 'clang_codeCompleteAt'); - late final _dart_clang_codeCompleteAt _clang_codeCompleteAt = - _clang_codeCompleteAt_ptr.asFunction<_dart_clang_codeCompleteAt>(); + late final _clang_codeCompleteAt = _clang_codeCompleteAt_ptr.asFunction< + ffi.Pointer Function( + CXTranslationUnit, + ffi.Pointer, + int, + int, + ffi.Pointer, + int, + int)>(); /// Sort the code-completion results in case-insensitive alphabetical /// order. @@ -6016,9 +5960,9 @@ class LibClang { late final _clang_sortCodeCompletionResults_ptr = _lookup>( 'clang_sortCodeCompletionResults'); - late final _dart_clang_sortCodeCompletionResults - _clang_sortCodeCompletionResults = _clang_sortCodeCompletionResults_ptr - .asFunction<_dart_clang_sortCodeCompletionResults>(); + late final _clang_sortCodeCompletionResults = + _clang_sortCodeCompletionResults_ptr + .asFunction, int)>(); /// Free the given set of code-completion results. void clang_disposeCodeCompleteResults( @@ -6032,9 +5976,9 @@ class LibClang { late final _clang_disposeCodeCompleteResults_ptr = _lookup>( 'clang_disposeCodeCompleteResults'); - late final _dart_clang_disposeCodeCompleteResults - _clang_disposeCodeCompleteResults = _clang_disposeCodeCompleteResults_ptr - .asFunction<_dart_clang_disposeCodeCompleteResults>(); + late final _clang_disposeCodeCompleteResults = + _clang_disposeCodeCompleteResults_ptr + .asFunction)>(); /// Determine the number of diagnostics produced prior to the /// location where code completion was performed. @@ -6049,10 +5993,9 @@ class LibClang { late final _clang_codeCompleteGetNumDiagnostics_ptr = _lookup>( 'clang_codeCompleteGetNumDiagnostics'); - late final _dart_clang_codeCompleteGetNumDiagnostics - _clang_codeCompleteGetNumDiagnostics = + late final _clang_codeCompleteGetNumDiagnostics = _clang_codeCompleteGetNumDiagnostics_ptr - .asFunction<_dart_clang_codeCompleteGetNumDiagnostics>(); + .asFunction)>(); /// Retrieve a diagnostic associated with the given code completion. /// @@ -6061,7 +6004,7 @@ class LibClang { /// /// \returns the requested diagnostic. This diagnostic must be freed /// via a call to \c clang_disposeDiagnostic(). - ffi.Pointer clang_codeCompleteGetDiagnostic( + CXDiagnostic clang_codeCompleteGetDiagnostic( ffi.Pointer Results, int Index, ) { @@ -6074,9 +6017,9 @@ class LibClang { late final _clang_codeCompleteGetDiagnostic_ptr = _lookup>( 'clang_codeCompleteGetDiagnostic'); - late final _dart_clang_codeCompleteGetDiagnostic - _clang_codeCompleteGetDiagnostic = _clang_codeCompleteGetDiagnostic_ptr - .asFunction<_dart_clang_codeCompleteGetDiagnostic>(); + late final _clang_codeCompleteGetDiagnostic = + _clang_codeCompleteGetDiagnostic_ptr.asFunction< + CXDiagnostic Function(ffi.Pointer, int)>(); /// Determines what completions are appropriate for the context /// the given code completion. @@ -6096,9 +6039,8 @@ class LibClang { late final _clang_codeCompleteGetContexts_ptr = _lookup>( 'clang_codeCompleteGetContexts'); - late final _dart_clang_codeCompleteGetContexts - _clang_codeCompleteGetContexts = _clang_codeCompleteGetContexts_ptr - .asFunction<_dart_clang_codeCompleteGetContexts>(); + late final _clang_codeCompleteGetContexts = _clang_codeCompleteGetContexts_ptr + .asFunction)>(); /// Returns the cursor kind for the container for the current code /// completion context. The container is only guaranteed to be set for @@ -6127,10 +6069,10 @@ class LibClang { late final _clang_codeCompleteGetContainerKind_ptr = _lookup>( 'clang_codeCompleteGetContainerKind'); - late final _dart_clang_codeCompleteGetContainerKind - _clang_codeCompleteGetContainerKind = - _clang_codeCompleteGetContainerKind_ptr - .asFunction<_dart_clang_codeCompleteGetContainerKind>(); + late final _clang_codeCompleteGetContainerKind = + _clang_codeCompleteGetContainerKind_ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); /// Returns the USR for the container for the current code completion /// context. If there is not a container for the current context, this @@ -6150,10 +6092,9 @@ class LibClang { late final _clang_codeCompleteGetContainerUSR_ptr = _lookup>( 'clang_codeCompleteGetContainerUSR'); - late final _dart_clang_codeCompleteGetContainerUSR - _clang_codeCompleteGetContainerUSR = + late final _clang_codeCompleteGetContainerUSR = _clang_codeCompleteGetContainerUSR_ptr - .asFunction<_dart_clang_codeCompleteGetContainerUSR>(); + .asFunction)>(); /// Returns the currently-entered selector for an Objective-C message /// send, formatted like "initWithFoo:bar:". Only guaranteed to return a @@ -6175,10 +6116,9 @@ class LibClang { late final _clang_codeCompleteGetObjCSelector_ptr = _lookup>( 'clang_codeCompleteGetObjCSelector'); - late final _dart_clang_codeCompleteGetObjCSelector - _clang_codeCompleteGetObjCSelector = + late final _clang_codeCompleteGetObjCSelector = _clang_codeCompleteGetObjCSelector_ptr - .asFunction<_dart_clang_codeCompleteGetObjCSelector>(); + .asFunction)>(); /// Return a version string, suitable for showing to a user, but not /// intended to be parsed (the format is not guaranteed to be stable). @@ -6189,8 +6129,8 @@ class LibClang { late final _clang_getClangVersion_ptr = _lookup>( 'clang_getClangVersion'); - late final _dart_clang_getClangVersion _clang_getClangVersion = - _clang_getClangVersion_ptr.asFunction<_dart_clang_getClangVersion>(); + late final _clang_getClangVersion = + _clang_getClangVersion_ptr.asFunction(); /// Enable/disable crash recovery. /// @@ -6207,18 +6147,17 @@ class LibClang { late final _clang_toggleCrashRecovery_ptr = _lookup>( 'clang_toggleCrashRecovery'); - late final _dart_clang_toggleCrashRecovery _clang_toggleCrashRecovery = - _clang_toggleCrashRecovery_ptr - .asFunction<_dart_clang_toggleCrashRecovery>(); + late final _clang_toggleCrashRecovery = + _clang_toggleCrashRecovery_ptr.asFunction(); /// Visit the set of preprocessor inclusions in a translation unit. /// The visitor function is called with the provided data for every included /// file. This does not include headers included by the PCH file (unless one /// is inspecting the inclusions in the PCH file itself). void clang_getInclusions( - ffi.Pointer tu, - ffi.Pointer> visitor, - ffi.Pointer client_data, + CXTranslationUnit tu, + CXInclusionVisitor visitor, + CXClientData client_data, ) { return _clang_getInclusions( tu, @@ -6230,13 +6169,13 @@ class LibClang { late final _clang_getInclusions_ptr = _lookup>( 'clang_getInclusions'); - late final _dart_clang_getInclusions _clang_getInclusions = - _clang_getInclusions_ptr.asFunction<_dart_clang_getInclusions>(); + late final _clang_getInclusions = _clang_getInclusions_ptr.asFunction< + void Function(CXTranslationUnit, CXInclusionVisitor, CXClientData)>(); /// If cursor is a statement declaration tries to evaluate the /// statement and if its variable, tries to evaluate its initializer, /// into its corresponding type. - ffi.Pointer clang_Cursor_Evaluate( + CXEvalResult clang_Cursor_Evaluate( CXCursor C, ) { return _clang_Cursor_Evaluate( @@ -6247,12 +6186,12 @@ class LibClang { late final _clang_Cursor_Evaluate_ptr = _lookup>( 'clang_Cursor_Evaluate'); - late final _dart_clang_Cursor_Evaluate _clang_Cursor_Evaluate = - _clang_Cursor_Evaluate_ptr.asFunction<_dart_clang_Cursor_Evaluate>(); + late final _clang_Cursor_Evaluate = + _clang_Cursor_Evaluate_ptr.asFunction(); /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getKind( E, @@ -6262,14 +6201,13 @@ class LibClang { late final _clang_EvalResult_getKind_ptr = _lookup>( 'clang_EvalResult_getKind'); - late final _dart_clang_EvalResult_getKind _clang_EvalResult_getKind = - _clang_EvalResult_getKind_ptr - .asFunction<_dart_clang_EvalResult_getKind>(); + late final _clang_EvalResult_getKind = + _clang_EvalResult_getKind_ptr.asFunction(); /// Returns the evaluation result as integer if the /// kind is Int. int clang_EvalResult_getAsInt( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsInt( E, @@ -6279,15 +6217,14 @@ class LibClang { late final _clang_EvalResult_getAsInt_ptr = _lookup>( 'clang_EvalResult_getAsInt'); - late final _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt = - _clang_EvalResult_getAsInt_ptr - .asFunction<_dart_clang_EvalResult_getAsInt>(); + late final _clang_EvalResult_getAsInt = + _clang_EvalResult_getAsInt_ptr.asFunction(); /// Returns the evaluation result as a long long integer if the /// kind is Int. This prevents overflows that may happen if the result is /// returned with clang_EvalResult_getAsInt. int clang_EvalResult_getAsLongLong( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsLongLong( E, @@ -6297,14 +6234,14 @@ class LibClang { late final _clang_EvalResult_getAsLongLong_ptr = _lookup>( 'clang_EvalResult_getAsLongLong'); - late final _dart_clang_EvalResult_getAsLongLong - _clang_EvalResult_getAsLongLong = _clang_EvalResult_getAsLongLong_ptr - .asFunction<_dart_clang_EvalResult_getAsLongLong>(); + late final _clang_EvalResult_getAsLongLong = + _clang_EvalResult_getAsLongLong_ptr + .asFunction(); /// Returns a non-zero value if the kind is Int and the evaluation /// result resulted in an unsigned integer. int clang_EvalResult_isUnsignedInt( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_isUnsignedInt( E, @@ -6314,14 +6251,14 @@ class LibClang { late final _clang_EvalResult_isUnsignedInt_ptr = _lookup>( 'clang_EvalResult_isUnsignedInt'); - late final _dart_clang_EvalResult_isUnsignedInt - _clang_EvalResult_isUnsignedInt = _clang_EvalResult_isUnsignedInt_ptr - .asFunction<_dart_clang_EvalResult_isUnsignedInt>(); + late final _clang_EvalResult_isUnsignedInt = + _clang_EvalResult_isUnsignedInt_ptr + .asFunction(); /// Returns the evaluation result as an unsigned integer if /// the kind is Int and clang_EvalResult_isUnsignedInt is non-zero. int clang_EvalResult_getAsUnsigned( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsUnsigned( E, @@ -6331,14 +6268,14 @@ class LibClang { late final _clang_EvalResult_getAsUnsigned_ptr = _lookup>( 'clang_EvalResult_getAsUnsigned'); - late final _dart_clang_EvalResult_getAsUnsigned - _clang_EvalResult_getAsUnsigned = _clang_EvalResult_getAsUnsigned_ptr - .asFunction<_dart_clang_EvalResult_getAsUnsigned>(); + late final _clang_EvalResult_getAsUnsigned = + _clang_EvalResult_getAsUnsigned_ptr + .asFunction(); /// Returns the evaluation result as double if the /// kind is double. double clang_EvalResult_getAsDouble( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsDouble( E, @@ -6348,16 +6285,15 @@ class LibClang { late final _clang_EvalResult_getAsDouble_ptr = _lookup>( 'clang_EvalResult_getAsDouble'); - late final _dart_clang_EvalResult_getAsDouble _clang_EvalResult_getAsDouble = - _clang_EvalResult_getAsDouble_ptr - .asFunction<_dart_clang_EvalResult_getAsDouble>(); + late final _clang_EvalResult_getAsDouble = _clang_EvalResult_getAsDouble_ptr + .asFunction(); /// Returns the evaluation result as a constant string if the /// kind is other than Int or float. User must not free this pointer, /// instead call clang_EvalResult_dispose on the CXEvalResult returned /// by clang_Cursor_Evaluate. ffi.Pointer clang_EvalResult_getAsStr( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsStr( E, @@ -6367,13 +6303,12 @@ class LibClang { late final _clang_EvalResult_getAsStr_ptr = _lookup>( 'clang_EvalResult_getAsStr'); - late final _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr = - _clang_EvalResult_getAsStr_ptr - .asFunction<_dart_clang_EvalResult_getAsStr>(); + late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStr_ptr + .asFunction Function(CXEvalResult)>(); /// Disposes the created Eval memory. void clang_EvalResult_dispose( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_dispose( E, @@ -6383,9 +6318,8 @@ class LibClang { late final _clang_EvalResult_dispose_ptr = _lookup>( 'clang_EvalResult_dispose'); - late final _dart_clang_EvalResult_dispose _clang_EvalResult_dispose = - _clang_EvalResult_dispose_ptr - .asFunction<_dart_clang_EvalResult_dispose>(); + late final _clang_EvalResult_dispose = + _clang_EvalResult_dispose_ptr.asFunction(); /// Retrieve a remapping. /// @@ -6393,7 +6327,7 @@ class LibClang { /// /// \returns the requested remapping. This remapping must be freed /// via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. - ffi.Pointer clang_getRemappings( + CXRemapping clang_getRemappings( ffi.Pointer path, ) { return _clang_getRemappings( @@ -6404,8 +6338,8 @@ class LibClang { late final _clang_getRemappings_ptr = _lookup>( 'clang_getRemappings'); - late final _dart_clang_getRemappings _clang_getRemappings = - _clang_getRemappings_ptr.asFunction<_dart_clang_getRemappings>(); + late final _clang_getRemappings = _clang_getRemappings_ptr + .asFunction)>(); /// Retrieve a remapping. /// @@ -6415,7 +6349,7 @@ class LibClang { /// /// \returns the requested remapping. This remapping must be freed /// via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. - ffi.Pointer clang_getRemappingsFromFileList( + CXRemapping clang_getRemappingsFromFileList( ffi.Pointer> filePaths, int numFiles, ) { @@ -6428,13 +6362,13 @@ class LibClang { late final _clang_getRemappingsFromFileList_ptr = _lookup>( 'clang_getRemappingsFromFileList'); - late final _dart_clang_getRemappingsFromFileList - _clang_getRemappingsFromFileList = _clang_getRemappingsFromFileList_ptr - .asFunction<_dart_clang_getRemappingsFromFileList>(); + late final _clang_getRemappingsFromFileList = + _clang_getRemappingsFromFileList_ptr.asFunction< + CXRemapping Function(ffi.Pointer>, int)>(); /// Determine the number of remappings. int clang_remap_getNumFiles( - ffi.Pointer arg0, + CXRemapping arg0, ) { return _clang_remap_getNumFiles( arg0, @@ -6444,8 +6378,8 @@ class LibClang { late final _clang_remap_getNumFiles_ptr = _lookup>( 'clang_remap_getNumFiles'); - late final _dart_clang_remap_getNumFiles _clang_remap_getNumFiles = - _clang_remap_getNumFiles_ptr.asFunction<_dart_clang_remap_getNumFiles>(); + late final _clang_remap_getNumFiles = + _clang_remap_getNumFiles_ptr.asFunction(); /// Get the original and the associated filename from the remapping. /// @@ -6454,7 +6388,7 @@ class LibClang { /// \param transformed If non-NULL, will be set to the filename that the original /// is associated with. void clang_remap_getFilenames( - ffi.Pointer arg0, + CXRemapping arg0, int index, ffi.Pointer original, ffi.Pointer transformed, @@ -6470,13 +6404,14 @@ class LibClang { late final _clang_remap_getFilenames_ptr = _lookup>( 'clang_remap_getFilenames'); - late final _dart_clang_remap_getFilenames _clang_remap_getFilenames = - _clang_remap_getFilenames_ptr - .asFunction<_dart_clang_remap_getFilenames>(); + late final _clang_remap_getFilenames = + _clang_remap_getFilenames_ptr.asFunction< + void Function(CXRemapping, int, ffi.Pointer, + ffi.Pointer)>(); /// Dispose the remapping. void clang_remap_dispose( - ffi.Pointer arg0, + CXRemapping arg0, ) { return _clang_remap_dispose( arg0, @@ -6486,8 +6421,8 @@ class LibClang { late final _clang_remap_dispose_ptr = _lookup>( 'clang_remap_dispose'); - late final _dart_clang_remap_dispose _clang_remap_dispose = - _clang_remap_dispose_ptr.asFunction<_dart_clang_remap_dispose>(); + late final _clang_remap_dispose = + _clang_remap_dispose_ptr.asFunction(); /// Find references of a declaration in a specific file. /// @@ -6503,7 +6438,7 @@ class LibClang { /// \returns one of the CXResult enumerators. int clang_findReferencesInFile( CXCursor cursor, - ffi.Pointer file, + CXFile file, CXCursorAndRangeVisitor visitor, ) { return _clang_findReferencesInFile( @@ -6516,9 +6451,8 @@ class LibClang { late final _clang_findReferencesInFile_ptr = _lookup>( 'clang_findReferencesInFile'); - late final _dart_clang_findReferencesInFile _clang_findReferencesInFile = - _clang_findReferencesInFile_ptr - .asFunction<_dart_clang_findReferencesInFile>(); + late final _clang_findReferencesInFile = _clang_findReferencesInFile_ptr + .asFunction(); /// Find #import/#include directives in a specific file. /// @@ -6531,8 +6465,8 @@ class LibClang { /// /// \returns one of the CXResult enumerators. int clang_findIncludesInFile( - ffi.Pointer TU, - ffi.Pointer file, + CXTranslationUnit TU, + CXFile file, CXCursorAndRangeVisitor visitor, ) { return _clang_findIncludesInFile( @@ -6545,9 +6479,9 @@ class LibClang { late final _clang_findIncludesInFile_ptr = _lookup>( 'clang_findIncludesInFile'); - late final _dart_clang_findIncludesInFile _clang_findIncludesInFile = - _clang_findIncludesInFile_ptr - .asFunction<_dart_clang_findIncludesInFile>(); + late final _clang_findIncludesInFile = + _clang_findIncludesInFile_ptr.asFunction< + int Function(CXTranslationUnit, CXFile, CXCursorAndRangeVisitor)>(); int clang_index_isEntityObjCContainerKind( int arg0, @@ -6560,10 +6494,9 @@ class LibClang { late final _clang_index_isEntityObjCContainerKind_ptr = _lookup>( 'clang_index_isEntityObjCContainerKind'); - late final _dart_clang_index_isEntityObjCContainerKind - _clang_index_isEntityObjCContainerKind = + late final _clang_index_isEntityObjCContainerKind = _clang_index_isEntityObjCContainerKind_ptr - .asFunction<_dart_clang_index_isEntityObjCContainerKind>(); + .asFunction(); ffi.Pointer clang_index_getObjCContainerDeclInfo( ffi.Pointer arg0, @@ -6576,10 +6509,10 @@ class LibClang { late final _clang_index_getObjCContainerDeclInfo_ptr = _lookup>( 'clang_index_getObjCContainerDeclInfo'); - late final _dart_clang_index_getObjCContainerDeclInfo - _clang_index_getObjCContainerDeclInfo = - _clang_index_getObjCContainerDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCContainerDeclInfo>(); + late final _clang_index_getObjCContainerDeclInfo = + _clang_index_getObjCContainerDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCInterfaceDeclInfo( ffi.Pointer arg0, @@ -6592,10 +6525,10 @@ class LibClang { late final _clang_index_getObjCInterfaceDeclInfo_ptr = _lookup>( 'clang_index_getObjCInterfaceDeclInfo'); - late final _dart_clang_index_getObjCInterfaceDeclInfo - _clang_index_getObjCInterfaceDeclInfo = - _clang_index_getObjCInterfaceDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCInterfaceDeclInfo>(); + late final _clang_index_getObjCInterfaceDeclInfo = + _clang_index_getObjCInterfaceDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCCategoryDeclInfo( ffi.Pointer arg0, @@ -6608,10 +6541,10 @@ class LibClang { late final _clang_index_getObjCCategoryDeclInfo_ptr = _lookup>( 'clang_index_getObjCCategoryDeclInfo'); - late final _dart_clang_index_getObjCCategoryDeclInfo - _clang_index_getObjCCategoryDeclInfo = - _clang_index_getObjCCategoryDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCCategoryDeclInfo>(); + late final _clang_index_getObjCCategoryDeclInfo = + _clang_index_getObjCCategoryDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCProtocolRefListInfo( @@ -6625,10 +6558,10 @@ class LibClang { late final _clang_index_getObjCProtocolRefListInfo_ptr = _lookup< ffi.NativeFunction>( 'clang_index_getObjCProtocolRefListInfo'); - late final _dart_clang_index_getObjCProtocolRefListInfo - _clang_index_getObjCProtocolRefListInfo = - _clang_index_getObjCProtocolRefListInfo_ptr - .asFunction<_dart_clang_index_getObjCProtocolRefListInfo>(); + late final _clang_index_getObjCProtocolRefListInfo = + _clang_index_getObjCProtocolRefListInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCPropertyDeclInfo( ffi.Pointer arg0, @@ -6641,10 +6574,10 @@ class LibClang { late final _clang_index_getObjCPropertyDeclInfo_ptr = _lookup>( 'clang_index_getObjCPropertyDeclInfo'); - late final _dart_clang_index_getObjCPropertyDeclInfo - _clang_index_getObjCPropertyDeclInfo = - _clang_index_getObjCPropertyDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCPropertyDeclInfo>(); + late final _clang_index_getObjCPropertyDeclInfo = + _clang_index_getObjCPropertyDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getIBOutletCollectionAttrInfo( @@ -6658,10 +6591,10 @@ class LibClang { late final _clang_index_getIBOutletCollectionAttrInfo_ptr = _lookup< ffi.NativeFunction>( 'clang_index_getIBOutletCollectionAttrInfo'); - late final _dart_clang_index_getIBOutletCollectionAttrInfo - _clang_index_getIBOutletCollectionAttrInfo = - _clang_index_getIBOutletCollectionAttrInfo_ptr - .asFunction<_dart_clang_index_getIBOutletCollectionAttrInfo>(); + late final _clang_index_getIBOutletCollectionAttrInfo = + _clang_index_getIBOutletCollectionAttrInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getCXXClassDeclInfo( ffi.Pointer arg0, @@ -6674,13 +6607,14 @@ class LibClang { late final _clang_index_getCXXClassDeclInfo_ptr = _lookup>( 'clang_index_getCXXClassDeclInfo'); - late final _dart_clang_index_getCXXClassDeclInfo - _clang_index_getCXXClassDeclInfo = _clang_index_getCXXClassDeclInfo_ptr - .asFunction<_dart_clang_index_getCXXClassDeclInfo>(); + late final _clang_index_getCXXClassDeclInfo = + _clang_index_getCXXClassDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); /// For retrieving a custom CXIdxClientContainer attached to a /// container. - ffi.Pointer clang_index_getClientContainer( + CXIdxClientContainer clang_index_getClientContainer( ffi.Pointer arg0, ) { return _clang_index_getClientContainer( @@ -6691,15 +6625,15 @@ class LibClang { late final _clang_index_getClientContainer_ptr = _lookup>( 'clang_index_getClientContainer'); - late final _dart_clang_index_getClientContainer - _clang_index_getClientContainer = _clang_index_getClientContainer_ptr - .asFunction<_dart_clang_index_getClientContainer>(); + late final _clang_index_getClientContainer = + _clang_index_getClientContainer_ptr.asFunction< + CXIdxClientContainer Function(ffi.Pointer)>(); /// For setting a custom CXIdxClientContainer attached to a /// container. void clang_index_setClientContainer( ffi.Pointer arg0, - ffi.Pointer arg1, + CXIdxClientContainer arg1, ) { return _clang_index_setClientContainer( arg0, @@ -6710,12 +6644,13 @@ class LibClang { late final _clang_index_setClientContainer_ptr = _lookup>( 'clang_index_setClientContainer'); - late final _dart_clang_index_setClientContainer - _clang_index_setClientContainer = _clang_index_setClientContainer_ptr - .asFunction<_dart_clang_index_setClientContainer>(); + late final _clang_index_setClientContainer = + _clang_index_setClientContainer_ptr.asFunction< + void Function( + ffi.Pointer, CXIdxClientContainer)>(); /// For retrieving a custom CXIdxClientEntity attached to an entity. - ffi.Pointer clang_index_getClientEntity( + CXIdxClientEntity clang_index_getClientEntity( ffi.Pointer arg0, ) { return _clang_index_getClientEntity( @@ -6726,14 +6661,13 @@ class LibClang { late final _clang_index_getClientEntity_ptr = _lookup>( 'clang_index_getClientEntity'); - late final _dart_clang_index_getClientEntity _clang_index_getClientEntity = - _clang_index_getClientEntity_ptr - .asFunction<_dart_clang_index_getClientEntity>(); + late final _clang_index_getClientEntity = _clang_index_getClientEntity_ptr + .asFunction)>(); /// For setting a custom CXIdxClientEntity attached to an entity. void clang_index_setClientEntity( ffi.Pointer arg0, - ffi.Pointer arg1, + CXIdxClientEntity arg1, ) { return _clang_index_setClientEntity( arg0, @@ -6744,16 +6678,16 @@ class LibClang { late final _clang_index_setClientEntity_ptr = _lookup>( 'clang_index_setClientEntity'); - late final _dart_clang_index_setClientEntity _clang_index_setClientEntity = - _clang_index_setClientEntity_ptr - .asFunction<_dart_clang_index_setClientEntity>(); + late final _clang_index_setClientEntity = + _clang_index_setClientEntity_ptr.asFunction< + void Function(ffi.Pointer, CXIdxClientEntity)>(); /// An indexing action/session, to be applied to one or multiple /// translation units. /// /// \param CIdx The index object with which the index action will be associated. - ffi.Pointer clang_IndexAction_create( - ffi.Pointer CIdx, + CXIndexAction clang_IndexAction_create( + CXIndex CIdx, ) { return _clang_IndexAction_create( CIdx, @@ -6763,16 +6697,15 @@ class LibClang { late final _clang_IndexAction_create_ptr = _lookup>( 'clang_IndexAction_create'); - late final _dart_clang_IndexAction_create _clang_IndexAction_create = - _clang_IndexAction_create_ptr - .asFunction<_dart_clang_IndexAction_create>(); + late final _clang_IndexAction_create = _clang_IndexAction_create_ptr + .asFunction(); /// Destroy the given index action. /// /// The index action must not be destroyed until all of the translation units /// created within that index action have been destroyed. void clang_IndexAction_dispose( - ffi.Pointer arg0, + CXIndexAction arg0, ) { return _clang_IndexAction_dispose( arg0, @@ -6782,9 +6715,8 @@ class LibClang { late final _clang_IndexAction_dispose_ptr = _lookup>( 'clang_IndexAction_dispose'); - late final _dart_clang_IndexAction_dispose _clang_IndexAction_dispose = - _clang_IndexAction_dispose_ptr - .asFunction<_dart_clang_IndexAction_dispose>(); + late final _clang_IndexAction_dispose = + _clang_IndexAction_dispose_ptr.asFunction(); /// Index the given source file and the translation unit corresponding /// to that file via callbacks implemented through #IndexerCallbacks. @@ -6810,8 +6742,8 @@ class LibClang { /// /// The rest of the parameters are the same as #clang_parseTranslationUnit. int clang_indexSourceFile( - ffi.Pointer arg0, - ffi.Pointer client_data, + CXIndexAction arg0, + CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, @@ -6820,7 +6752,7 @@ class LibClang { int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, int TU_options, ) { return _clang_indexSourceFile( @@ -6842,15 +6774,27 @@ class LibClang { late final _clang_indexSourceFile_ptr = _lookup>( 'clang_indexSourceFile'); - late final _dart_clang_indexSourceFile _clang_indexSourceFile = - _clang_indexSourceFile_ptr.asFunction<_dart_clang_indexSourceFile>(); + late final _clang_indexSourceFile = _clang_indexSourceFile_ptr.asFunction< + int Function( + CXIndexAction, + CXClientData, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + ffi.Pointer, + int)>(); /// Same as clang_indexSourceFile but requires a full command line /// for \c command_line_args including argv[0]. This is useful if the standard /// library paths are relative to the binary. int clang_indexSourceFileFullArgv( - ffi.Pointer arg0, - ffi.Pointer client_data, + CXIndexAction arg0, + CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, @@ -6859,7 +6803,7 @@ class LibClang { int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, int TU_options, ) { return _clang_indexSourceFileFullArgv( @@ -6881,9 +6825,21 @@ class LibClang { late final _clang_indexSourceFileFullArgv_ptr = _lookup>( 'clang_indexSourceFileFullArgv'); - late final _dart_clang_indexSourceFileFullArgv - _clang_indexSourceFileFullArgv = _clang_indexSourceFileFullArgv_ptr - .asFunction<_dart_clang_indexSourceFileFullArgv>(); + late final _clang_indexSourceFileFullArgv = + _clang_indexSourceFileFullArgv_ptr.asFunction< + int Function( + CXIndexAction, + CXClientData, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + ffi.Pointer, + int)>(); /// Index the given translation unit via callbacks implemented through /// #IndexerCallbacks. @@ -6900,12 +6856,12 @@ class LibClang { /// \returns If there is a failure from which there is no recovery, returns /// non-zero, otherwise returns 0. int clang_indexTranslationUnit( - ffi.Pointer arg0, - ffi.Pointer client_data, + CXIndexAction arg0, + CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer arg5, + CXTranslationUnit arg5, ) { return _clang_indexTranslationUnit( arg0, @@ -6920,9 +6876,10 @@ class LibClang { late final _clang_indexTranslationUnit_ptr = _lookup>( 'clang_indexTranslationUnit'); - late final _dart_clang_indexTranslationUnit _clang_indexTranslationUnit = - _clang_indexTranslationUnit_ptr - .asFunction<_dart_clang_indexTranslationUnit>(); + late final _clang_indexTranslationUnit = + _clang_indexTranslationUnit_ptr.asFunction< + int Function(CXIndexAction, CXClientData, + ffi.Pointer, int, int, CXTranslationUnit)>(); /// Retrieve the CXIdxFile, file, line, column, and offset represented by /// the given CXIdxLoc. @@ -6932,8 +6889,8 @@ class LibClang { /// retrieves the location of the argument. void clang_indexLoc_getFileLocation( CXIdxLoc loc, - ffi.Pointer> indexFile, - ffi.Pointer> file, + ffi.Pointer indexFile, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -6951,9 +6908,15 @@ class LibClang { late final _clang_indexLoc_getFileLocation_ptr = _lookup>( 'clang_indexLoc_getFileLocation'); - late final _dart_clang_indexLoc_getFileLocation - _clang_indexLoc_getFileLocation = _clang_indexLoc_getFileLocation_ptr - .asFunction<_dart_clang_indexLoc_getFileLocation>(); + late final _clang_indexLoc_getFileLocation = + _clang_indexLoc_getFileLocation_ptr.asFunction< + void Function( + CXIdxLoc, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the CXSourceLocation represented by the given CXIdxLoc. CXSourceLocation clang_indexLoc_getCXSourceLocation( @@ -6967,10 +6930,9 @@ class LibClang { late final _clang_indexLoc_getCXSourceLocation_ptr = _lookup>( 'clang_indexLoc_getCXSourceLocation'); - late final _dart_clang_indexLoc_getCXSourceLocation - _clang_indexLoc_getCXSourceLocation = + late final _clang_indexLoc_getCXSourceLocation = _clang_indexLoc_getCXSourceLocation_ptr - .asFunction<_dart_clang_indexLoc_getCXSourceLocation>(); + .asFunction(); /// Visit the fields of a particular type. /// @@ -6991,8 +6953,8 @@ class LibClang { /// prematurely by the visitor returning \c CXFieldVisit_Break. int clang_Type_visitFields( CXType T, - ffi.Pointer> visitor, - ffi.Pointer client_data, + CXFieldVisitor visitor, + CXClientData client_data, ) { return _clang_Type_visitFields( T, @@ -7004,8 +6966,8 @@ class LibClang { late final _clang_Type_visitFields_ptr = _lookup>( 'clang_Type_visitFields'); - late final _dart_clang_Type_visitFields _clang_Type_visitFields = - _clang_Type_visitFields_ptr.asFunction<_dart_clang_Type_visitFields>(); + late final _clang_Type_visitFields = _clang_Type_visitFields_ptr + .asFunction(); late final addresses = _SymbolAddresses(this); } @@ -7859,6 +7821,12 @@ class CXStringSet extends ffi.Struct { external int Count; } +typedef Native_clang_getCString = ffi.Pointer Function( + CXString string); +typedef Native_clang_disposeString = ffi.Void Function(CXString string); +typedef Native_clang_disposeStringSet = ffi.Void Function( + ffi.Pointer set_1); + class CXTargetInfoImpl extends ffi.Opaque {} class CXTranslationUnitImpl extends ffi.Opaque {} @@ -7902,6 +7870,14 @@ class CXVersion extends ffi.Struct { external int Subminor; } +typedef Native_clang_createIndex = CXIndex Function( + ffi.Int32 excludeDeclarationsFromPCH, ffi.Int32 displayDiagnostics); + +/// An "index" that consists of a set of translation units that would +/// typically be linked together into an executable or library. +typedef CXIndex = ffi.Pointer; +typedef Native_clang_disposeIndex = ffi.Void Function(CXIndex index); + abstract class CXGlobalOptFlags { /// Used to indicate that no special CXIndex options are needed. static const int CXGlobalOpt_None = 0; @@ -7925,6 +7901,18 @@ abstract class CXGlobalOptFlags { static const int CXGlobalOpt_ThreadBackgroundPriorityForAll = 3; } +typedef Native_clang_CXIndex_setGlobalOptions = ffi.Void Function( + CXIndex arg0, ffi.Uint32 options); +typedef Native_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( + CXIndex arg0); +typedef Native_clang_CXIndex_setInvocationEmissionPathOption = ffi.Void + Function(CXIndex arg0, ffi.Pointer Path); +typedef Native_clang_getFileName = CXString Function(CXFile SFile); + +/// A particular source file that is part of a translation unit. +typedef CXFile = ffi.Pointer; +typedef Native_clang_getFileTime = ffi.Int64 Function(CXFile SFile); + /// Uniquely identifies a CXFile, that refers to the same underlying file, /// across an indexing session. class CXFileUniqueID extends ffi.Struct { @@ -7932,6 +7920,21 @@ class CXFileUniqueID extends ffi.Struct { external ffi.Array data; } +typedef Native_clang_getFileUniqueID = ffi.Int32 Function( + CXFile file, ffi.Pointer outID); +typedef Native_clang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( + CXTranslationUnit tu, CXFile file); + +/// A single translation unit, which resides in an index. +typedef CXTranslationUnit = ffi.Pointer; +typedef Native_clang_getFile = CXFile Function( + CXTranslationUnit tu, ffi.Pointer file_name); +typedef Native_clang_getFileContents = ffi.Pointer Function( + CXTranslationUnit tu, CXFile file, ffi.Pointer size); +typedef Native_clang_File_isEqual = ffi.Int32 Function( + CXFile file1, CXFile file2); +typedef Native_clang_File_tryGetRealPathName = CXString Function(CXFile file); + /// Identifies a specific source location within a translation /// unit. /// @@ -7960,6 +7963,57 @@ class CXSourceRange extends ffi.Struct { external int end_int_data; } +typedef Native_clang_getNullLocation = CXSourceLocation Function(); +typedef Native_clang_equalLocations = ffi.Uint32 Function( + CXSourceLocation loc1, CXSourceLocation loc2); +typedef Native_clang_getLocation = CXSourceLocation Function( + CXTranslationUnit tu, CXFile file, ffi.Uint32 line, ffi.Uint32 column); +typedef Native_clang_getLocationForOffset = CXSourceLocation Function( + CXTranslationUnit tu, CXFile file, ffi.Uint32 offset); +typedef Native_clang_Location_isInSystemHeader = ffi.Int32 Function( + CXSourceLocation location); +typedef Native_clang_Location_isFromMainFile = ffi.Int32 Function( + CXSourceLocation location); +typedef Native_clang_getNullRange = CXSourceRange Function(); +typedef Native_clang_getRange = CXSourceRange Function( + CXSourceLocation begin, CXSourceLocation end); +typedef Native_clang_equalRanges = ffi.Uint32 Function( + CXSourceRange range1, CXSourceRange range2); +typedef Native_clang_Range_isNull = ffi.Int32 Function(CXSourceRange range); +typedef Native_clang_getExpansionLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); +typedef Native_clang_getPresumedLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer filename, + ffi.Pointer line, + ffi.Pointer column); +typedef Native_clang_getInstantiationLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); +typedef Native_clang_getSpellingLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); +typedef Native_clang_getFileLocation = ffi.Void Function( + CXSourceLocation location, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); +typedef Native_clang_getRangeStart = CXSourceLocation Function( + CXSourceRange range); +typedef Native_clang_getRangeEnd = CXSourceLocation Function( + CXSourceRange range); + /// Identifies an array of ranges. class CXSourceRangeList extends ffi.Struct { /// The number of ranges in the \c ranges array. @@ -7970,6 +8024,218 @@ class CXSourceRangeList extends ffi.Struct { external ffi.Pointer ranges; } +typedef Native_clang_getSkippedRanges = ffi.Pointer Function( + CXTranslationUnit tu, CXFile file); +typedef Native_clang_getAllSkippedRanges = ffi.Pointer + Function(CXTranslationUnit tu); +typedef Native_clang_disposeSourceRangeList = ffi.Void Function( + ffi.Pointer ranges); +typedef Native_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( + CXDiagnosticSet Diags); + +/// A group of CXDiagnostics. +typedef CXDiagnosticSet = ffi.Pointer; +typedef Native_clang_getDiagnosticInSet = CXDiagnostic Function( + CXDiagnosticSet Diags, ffi.Uint32 Index); + +/// A single diagnostic, containing the diagnostic's severity, +/// location, text, source ranges, and fix-it hints. +typedef CXDiagnostic = ffi.Pointer; +typedef Native_clang_loadDiagnostics = CXDiagnosticSet Function( + ffi.Pointer file, + ffi.Pointer error, + ffi.Pointer errorString); + +/// Describes the kind of error that occurred (if any) in a call to +/// \c clang_loadDiagnostics. +abstract class CXLoadDiag_Error { + /// Indicates that no error occurred. + static const int CXLoadDiag_None = 0; + + /// Indicates that an unknown error occurred while attempting to + /// deserialize diagnostics. + static const int CXLoadDiag_Unknown = 1; + + /// Indicates that the file containing the serialized diagnostics + /// could not be opened. + static const int CXLoadDiag_CannotLoad = 2; + + /// Indicates that the serialized diagnostics file is invalid or + /// corrupt. + static const int CXLoadDiag_InvalidFile = 3; +} + +typedef Native_clang_disposeDiagnosticSet = ffi.Void Function( + CXDiagnosticSet Diags); +typedef Native_clang_getChildDiagnostics = CXDiagnosticSet Function( + CXDiagnostic D); +typedef Native_clang_getNumDiagnostics = ffi.Uint32 Function( + CXTranslationUnit Unit); +typedef Native_clang_getDiagnostic = CXDiagnostic Function( + CXTranslationUnit Unit, ffi.Uint32 Index); +typedef Native_clang_getDiagnosticSetFromTU = CXDiagnosticSet Function( + CXTranslationUnit Unit); +typedef Native_clang_disposeDiagnostic = ffi.Void Function( + CXDiagnostic Diagnostic); +typedef Native_clang_formatDiagnostic = CXString Function( + CXDiagnostic Diagnostic, ffi.Uint32 Options); +typedef Native_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); +typedef Native_clang_getDiagnosticSeverity = ffi.Int32 Function( + CXDiagnostic arg0); + +/// Describes the severity of a particular diagnostic. +abstract class CXDiagnosticSeverity { + /// A diagnostic that has been suppressed, e.g., by a command-line + /// option. + static const int CXDiagnostic_Ignored = 0; + + /// This diagnostic is a note that should be attached to the + /// previous (non-note) diagnostic. + static const int CXDiagnostic_Note = 1; + + /// This diagnostic indicates suspicious code that may not be + /// wrong. + static const int CXDiagnostic_Warning = 2; + + /// This diagnostic indicates that the code is ill-formed. + static const int CXDiagnostic_Error = 3; + + /// This diagnostic indicates that the code is ill-formed such + /// that future parser recovery is unlikely to produce useful + /// results. + static const int CXDiagnostic_Fatal = 4; +} + +typedef Native_clang_getDiagnosticLocation = CXSourceLocation Function( + CXDiagnostic arg0); +typedef Native_clang_getDiagnosticSpelling = CXString Function( + CXDiagnostic arg0); +typedef Native_clang_getDiagnosticOption = CXString Function( + CXDiagnostic Diag, ffi.Pointer Disable); +typedef Native_clang_getDiagnosticCategory = ffi.Uint32 Function( + CXDiagnostic arg0); +typedef Native_clang_getDiagnosticCategoryName = CXString Function( + ffi.Uint32 Category); +typedef Native_clang_getDiagnosticCategoryText = CXString Function( + CXDiagnostic arg0); +typedef Native_clang_getDiagnosticNumRanges = ffi.Uint32 Function( + CXDiagnostic arg0); +typedef Native_clang_getDiagnosticRange = CXSourceRange Function( + CXDiagnostic Diagnostic, ffi.Uint32 Range); +typedef Native_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( + CXDiagnostic Diagnostic); +typedef Native_clang_getDiagnosticFixIt = CXString Function( + CXDiagnostic Diagnostic, + ffi.Uint32 FixIt, + ffi.Pointer ReplacementRange); +typedef Native_clang_getTranslationUnitSpelling = CXString Function( + CXTranslationUnit CTUnit); +typedef Native_clang_createTranslationUnitFromSourceFile + = CXTranslationUnit Function( + CXIndex CIdx, + ffi.Pointer source_filename, + ffi.Int32 num_clang_command_line_args, + ffi.Pointer> clang_command_line_args, + ffi.Uint32 num_unsaved_files, + ffi.Pointer unsaved_files); +typedef Native_clang_createTranslationUnit = CXTranslationUnit Function( + CXIndex CIdx, ffi.Pointer ast_filename); +typedef Native_clang_createTranslationUnit2 = ffi.Int32 Function(CXIndex CIdx, + ffi.Pointer ast_filename, ffi.Pointer out_TU); + +/// Error codes returned by libclang routines. +/// +/// Zero (\c CXError_Success) is the only error code indicating success. Other +/// error codes, including not yet assigned non-zero values, indicate errors. +abstract class CXErrorCode { + /// No error. + static const int CXError_Success = 0; + + /// A generic error code, no further details are available. + /// + /// Errors of this kind can get their own specific error codes in future + /// libclang versions. + static const int CXError_Failure = 1; + + /// libclang crashed while performing the requested operation. + static const int CXError_Crashed = 2; + + /// The function detected that the arguments violate the function + /// contract. + static const int CXError_InvalidArguments = 3; + + /// An AST deserialization error has occurred. + static const int CXError_ASTReadError = 4; +} + +typedef Native_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 + Function(); +typedef Native_clang_parseTranslationUnit = CXTranslationUnit Function( + CXIndex CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int32 num_command_line_args, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Uint32 options); +typedef Native_clang_parseTranslationUnit2 = ffi.Int32 Function( + CXIndex CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int32 num_command_line_args, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Uint32 options, + ffi.Pointer out_TU); +typedef Native_clang_parseTranslationUnit2FullArgv = ffi.Int32 Function( + CXIndex CIdx, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int32 num_command_line_args, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Uint32 options, + ffi.Pointer out_TU); +typedef Native_clang_defaultSaveOptions = ffi.Uint32 Function( + CXTranslationUnit TU); +typedef Native_clang_saveTranslationUnit = ffi.Int32 Function( + CXTranslationUnit TU, ffi.Pointer FileName, ffi.Uint32 options); +typedef Native_clang_suspendTranslationUnit = ffi.Uint32 Function( + CXTranslationUnit arg0); +typedef Native_clang_disposeTranslationUnit = ffi.Void Function( + CXTranslationUnit arg0); +typedef Native_clang_defaultReparseOptions = ffi.Uint32 Function( + CXTranslationUnit TU); +typedef Native_clang_reparseTranslationUnit = ffi.Int32 Function( + CXTranslationUnit TU, + ffi.Uint32 num_unsaved_files, + ffi.Pointer unsaved_files, + ffi.Uint32 options); +typedef Native_clang_getTUResourceUsageName = ffi.Pointer Function( + ffi.Int32 kind); + +/// Categorizes how memory is being used by a translation unit. +abstract class CXTUResourceUsageKind { + static const int CXTUResourceUsage_AST = 1; + static const int CXTUResourceUsage_Identifiers = 2; + static const int CXTUResourceUsage_Selectors = 3; + static const int CXTUResourceUsage_GlobalCompletionResults = 4; + static const int CXTUResourceUsage_SourceManagerContentCache = 5; + static const int CXTUResourceUsage_AST_SideTables = 6; + static const int CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7; + static const int CXTUResourceUsage_SourceManager_Membuffer_MMap = 8; + static const int CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9; + static const int CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10; + static const int CXTUResourceUsage_Preprocessor = 11; + static const int CXTUResourceUsage_PreprocessingRecord = 12; + static const int CXTUResourceUsage_SourceManager_DataStructures = 13; + static const int CXTUResourceUsage_Preprocessor_HeaderSearch = 14; + static const int CXTUResourceUsage_MEMORY_IN_BYTES_BEGIN = 1; + static const int CXTUResourceUsage_MEMORY_IN_BYTES_END = 14; + static const int CXTUResourceUsage_First = 1; + static const int CXTUResourceUsage_Last = 14; +} + class CXTUResourceUsageEntry extends ffi.Struct { @ffi.Int32() external int kind; @@ -7988,6 +8254,22 @@ class CXTUResourceUsage extends ffi.Struct { external ffi.Pointer entries; } +typedef Native_clang_getCXTUResourceUsage = CXTUResourceUsage Function( + CXTranslationUnit TU); +typedef Native_clang_disposeCXTUResourceUsage = ffi.Void Function( + CXTUResourceUsage usage); +typedef Native_clang_getTranslationUnitTargetInfo = CXTargetInfo Function( + CXTranslationUnit CTUnit); + +/// An opaque type representing target information for a given translation +/// unit. +typedef CXTargetInfo = ffi.Pointer; +typedef Native_clang_TargetInfo_dispose = ffi.Void Function(CXTargetInfo Info); +typedef Native_clang_TargetInfo_getTriple = CXString Function( + CXTargetInfo Info); +typedef Native_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( + CXTargetInfo Info); + /// A cursor representing some element in the abstract syntax tree for /// a translation unit. /// @@ -8015,3532 +8297,2372 @@ class CXCursor extends ffi.Struct { external ffi.Array> data; } -/// Describes the availability of a given entity on a particular platform, e.g., -/// a particular class might only be available on Mac OS 10.7 or newer. -class CXPlatformAvailability extends ffi.Struct { - /// A string that describes the platform for which this structure - /// provides availability information. +/// Describes the kind of entity that a cursor refers to. +abstract class CXCursorKind { + /// A declaration whose specific kind is not exposed via this + /// interface. /// - /// Possible values are "ios" or "macos". - external CXString Platform; + /// Unexposed declarations have the same operations as any other kind + /// of declaration; one can extract their location information, + /// spelling, find their definitions, etc. However, the specific kind + /// of the declaration is not reported. + static const int CXCursor_UnexposedDecl = 1; - /// The version number in which this entity was introduced. - external CXVersion Introduced; + /// A C or C++ struct. + static const int CXCursor_StructDecl = 2; - /// The version number in which this entity was deprecated (but is - /// still available). - external CXVersion Deprecated; + /// A C or C++ union. + static const int CXCursor_UnionDecl = 3; - /// The version number in which this entity was obsoleted, and therefore - /// is no longer available. - external CXVersion Obsoleted; + /// A C++ class. + static const int CXCursor_ClassDecl = 4; - /// Whether the entity is unconditionally unavailable on this platform. - @ffi.Int32() - external int Unavailable; + /// An enumeration. + static const int CXCursor_EnumDecl = 5; - /// An optional message to provide to a user of this API, e.g., to - /// suggest replacement APIs. - external CXString Message; -} + /// A field (in C) or non-static data member (in C++) in a + /// struct, union, or C++ class. + static const int CXCursor_FieldDecl = 6; -class CXCursorSetImpl extends ffi.Opaque {} + /// An enumerator constant. + static const int CXCursor_EnumConstantDecl = 7; -/// Describes the kind of type -abstract class CXTypeKind { - /// Represents an invalid type (e.g., where no type is available). - static const int CXType_Invalid = 0; + /// A function. + static const int CXCursor_FunctionDecl = 8; - /// A type whose specific kind is not exposed via this - /// interface. - static const int CXType_Unexposed = 1; - static const int CXType_Void = 2; - static const int CXType_Bool = 3; - static const int CXType_Char_U = 4; - static const int CXType_UChar = 5; - static const int CXType_Char16 = 6; - static const int CXType_Char32 = 7; - static const int CXType_UShort = 8; - static const int CXType_UInt = 9; - static const int CXType_ULong = 10; - static const int CXType_ULongLong = 11; - static const int CXType_UInt128 = 12; - static const int CXType_Char_S = 13; - static const int CXType_SChar = 14; - static const int CXType_WChar = 15; - static const int CXType_Short = 16; - static const int CXType_Int = 17; - static const int CXType_Long = 18; - static const int CXType_LongLong = 19; - static const int CXType_Int128 = 20; - static const int CXType_Float = 21; - static const int CXType_Double = 22; - static const int CXType_LongDouble = 23; - static const int CXType_NullPtr = 24; - static const int CXType_Overload = 25; - static const int CXType_Dependent = 26; - static const int CXType_ObjCId = 27; - static const int CXType_ObjCClass = 28; - static const int CXType_ObjCSel = 29; - static const int CXType_Float128 = 30; - static const int CXType_Half = 31; - static const int CXType_Float16 = 32; - static const int CXType_ShortAccum = 33; - static const int CXType_Accum = 34; - static const int CXType_LongAccum = 35; - static const int CXType_UShortAccum = 36; - static const int CXType_UAccum = 37; - static const int CXType_ULongAccum = 38; - static const int CXType_FirstBuiltin = 2; - static const int CXType_LastBuiltin = 38; - static const int CXType_Complex = 100; - static const int CXType_Pointer = 101; - static const int CXType_BlockPointer = 102; - static const int CXType_LValueReference = 103; - static const int CXType_RValueReference = 104; - static const int CXType_Record = 105; - static const int CXType_Enum = 106; - static const int CXType_Typedef = 107; - static const int CXType_ObjCInterface = 108; - static const int CXType_ObjCObjectPointer = 109; - static const int CXType_FunctionNoProto = 110; - static const int CXType_FunctionProto = 111; - static const int CXType_ConstantArray = 112; - static const int CXType_Vector = 113; - static const int CXType_IncompleteArray = 114; - static const int CXType_VariableArray = 115; - static const int CXType_DependentSizedArray = 116; - static const int CXType_MemberPointer = 117; - static const int CXType_Auto = 118; + /// A variable. + static const int CXCursor_VarDecl = 9; - /// Represents a type that was referred to using an elaborated type keyword. + /// A function or method parameter. + static const int CXCursor_ParmDecl = 10; + + /// An Objective-C \@interface. + static const int CXCursor_ObjCInterfaceDecl = 11; + + /// An Objective-C \@interface for a category. + static const int CXCursor_ObjCCategoryDecl = 12; + + /// An Objective-C \@protocol declaration. + static const int CXCursor_ObjCProtocolDecl = 13; + + /// An Objective-C \@property declaration. + static const int CXCursor_ObjCPropertyDecl = 14; + + /// An Objective-C instance variable. + static const int CXCursor_ObjCIvarDecl = 15; + + /// An Objective-C instance method. + static const int CXCursor_ObjCInstanceMethodDecl = 16; + + /// An Objective-C class method. + static const int CXCursor_ObjCClassMethodDecl = 17; + + /// An Objective-C \@implementation. + static const int CXCursor_ObjCImplementationDecl = 18; + + /// An Objective-C \@implementation for a category. + static const int CXCursor_ObjCCategoryImplDecl = 19; + + /// A typedef. + static const int CXCursor_TypedefDecl = 20; + + /// A C++ class method. + static const int CXCursor_CXXMethod = 21; + + /// A C++ namespace. + static const int CXCursor_Namespace = 22; + + /// A linkage specification, e.g. 'extern "C"'. + static const int CXCursor_LinkageSpec = 23; + + /// A C++ constructor. + static const int CXCursor_Constructor = 24; + + /// A C++ destructor. + static const int CXCursor_Destructor = 25; + + /// A C++ conversion function. + static const int CXCursor_ConversionFunction = 26; + + /// A C++ template type parameter. + static const int CXCursor_TemplateTypeParameter = 27; + + /// A C++ non-type template parameter. + static const int CXCursor_NonTypeTemplateParameter = 28; + + /// A C++ template template parameter. + static const int CXCursor_TemplateTemplateParameter = 29; + + /// A C++ function template. + static const int CXCursor_FunctionTemplate = 30; + + /// A C++ class template. + static const int CXCursor_ClassTemplate = 31; + + /// A C++ class template partial specialization. + static const int CXCursor_ClassTemplatePartialSpecialization = 32; + + /// A C++ namespace alias declaration. + static const int CXCursor_NamespaceAlias = 33; + + /// A C++ using directive. + static const int CXCursor_UsingDirective = 34; + + /// A C++ using declaration. + static const int CXCursor_UsingDeclaration = 35; + + /// A C++ alias declaration + static const int CXCursor_TypeAliasDecl = 36; + + /// An Objective-C \@synthesize definition. + static const int CXCursor_ObjCSynthesizeDecl = 37; + + /// An Objective-C \@dynamic definition. + static const int CXCursor_ObjCDynamicDecl = 38; + + /// An access specifier. + static const int CXCursor_CXXAccessSpecifier = 39; + static const int CXCursor_FirstDecl = 1; + static const int CXCursor_LastDecl = 39; + static const int CXCursor_FirstRef = 40; + static const int CXCursor_ObjCSuperClassRef = 40; + static const int CXCursor_ObjCProtocolRef = 41; + static const int CXCursor_ObjCClassRef = 42; + + /// A reference to a type declaration. /// - /// E.g., struct S, or via a qualified name, e.g., N::M::type, or both. - static const int CXType_Elaborated = 119; - static const int CXType_Pipe = 120; - static const int CXType_OCLImage1dRO = 121; - static const int CXType_OCLImage1dArrayRO = 122; - static const int CXType_OCLImage1dBufferRO = 123; - static const int CXType_OCLImage2dRO = 124; - static const int CXType_OCLImage2dArrayRO = 125; - static const int CXType_OCLImage2dDepthRO = 126; - static const int CXType_OCLImage2dArrayDepthRO = 127; - static const int CXType_OCLImage2dMSAARO = 128; - static const int CXType_OCLImage2dArrayMSAARO = 129; - static const int CXType_OCLImage2dMSAADepthRO = 130; - static const int CXType_OCLImage2dArrayMSAADepthRO = 131; - static const int CXType_OCLImage3dRO = 132; - static const int CXType_OCLImage1dWO = 133; - static const int CXType_OCLImage1dArrayWO = 134; - static const int CXType_OCLImage1dBufferWO = 135; - static const int CXType_OCLImage2dWO = 136; - static const int CXType_OCLImage2dArrayWO = 137; - static const int CXType_OCLImage2dDepthWO = 138; - static const int CXType_OCLImage2dArrayDepthWO = 139; - static const int CXType_OCLImage2dMSAAWO = 140; - static const int CXType_OCLImage2dArrayMSAAWO = 141; - static const int CXType_OCLImage2dMSAADepthWO = 142; - static const int CXType_OCLImage2dArrayMSAADepthWO = 143; - static const int CXType_OCLImage3dWO = 144; - static const int CXType_OCLImage1dRW = 145; - static const int CXType_OCLImage1dArrayRW = 146; - static const int CXType_OCLImage1dBufferRW = 147; - static const int CXType_OCLImage2dRW = 148; - static const int CXType_OCLImage2dArrayRW = 149; - static const int CXType_OCLImage2dDepthRW = 150; - static const int CXType_OCLImage2dArrayDepthRW = 151; - static const int CXType_OCLImage2dMSAARW = 152; - static const int CXType_OCLImage2dArrayMSAARW = 153; - static const int CXType_OCLImage2dMSAADepthRW = 154; - static const int CXType_OCLImage2dArrayMSAADepthRW = 155; - static const int CXType_OCLImage3dRW = 156; - static const int CXType_OCLSampler = 157; - static const int CXType_OCLEvent = 158; - static const int CXType_OCLQueue = 159; - static const int CXType_OCLReserveID = 160; - static const int CXType_ObjCObject = 161; - static const int CXType_ObjCTypeParam = 162; - static const int CXType_Attributed = 163; - static const int CXType_OCLIntelSubgroupAVCMcePayload = 164; - static const int CXType_OCLIntelSubgroupAVCImePayload = 165; - static const int CXType_OCLIntelSubgroupAVCRefPayload = 166; - static const int CXType_OCLIntelSubgroupAVCSicPayload = 167; - static const int CXType_OCLIntelSubgroupAVCMceResult = 168; - static const int CXType_OCLIntelSubgroupAVCImeResult = 169; - static const int CXType_OCLIntelSubgroupAVCRefResult = 170; - static const int CXType_OCLIntelSubgroupAVCSicResult = 171; - static const int CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout = 172; - static const int CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout = 173; - static const int CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174; - static const int CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175; - static const int CXType_ExtVector = 176; -} - -/// The type of an element in the abstract syntax tree. -class CXType extends ffi.Struct { - @ffi.Int32() - external int kind; - - @ffi.Array.multi([2]) - external ffi.Array> data; -} - -/// Describes a single preprocessing token. -class CXToken extends ffi.Struct { - @ffi.Array.multi([4]) - external ffi.Array int_data; - - external ffi.Pointer ptr_data; -} - -/// A single result of code completion. -class CXCompletionResult extends ffi.Struct { - /// The kind of entity that this completion refers to. + /// A type reference occurs anywhere where a type is named but not + /// declared. For example, given: /// - /// The cursor kind will be a macro, keyword, or a declaration (one of the - /// *Decl cursor kinds), describing the entity that the completion is - /// referring to. + /// \code + /// typedef unsigned size_type; + /// size_type size; + /// \endcode /// - /// \todo In the future, we would like to provide a full cursor, to allow - /// the client to extract additional information from declaration. - @ffi.Int32() - external int CursorKind; - - /// The code-completion string that describes how to insert this - /// code-completion result into the editing buffer. - external ffi.Pointer CompletionString; -} - -/// Contains the results of code-completion. -/// -/// This data structure contains the results of code completion, as -/// produced by \c clang_codeCompleteAt(). Its contents must be freed by -/// \c clang_disposeCodeCompleteResults. -class CXCodeCompleteResults extends ffi.Struct { - /// The code-completion results. - external ffi.Pointer Results; - - /// The number of code-completion results stored in the - /// \c Results array. - @ffi.Uint32() - external int NumResults; -} - -class CXCursorAndRangeVisitor extends ffi.Struct { - external ffi.Pointer context; - - external ffi.Pointer> visit; -} - -/// Source location passed to index callbacks. -class CXIdxLoc extends ffi.Struct { - @ffi.Array.multi([2]) - external ffi.Array> ptr_data; - - @ffi.Uint32() - external int int_data; -} - -/// Data for ppIncludedFile callback. -class CXIdxIncludedFileInfo extends ffi.Struct { - /// Location of '#' in the \#include/\#import directive. - external CXIdxLoc hashLoc; - - /// Filename as written in the \#include/\#import directive. - external ffi.Pointer filename; - - /// The actual file that the \#include/\#import directive resolved to. - external ffi.Pointer file; - - @ffi.Int32() - external int isImport; - - @ffi.Int32() - external int isAngled; + /// The typedef is a declaration of size_type (CXCursor_TypedefDecl), + /// while the type of the variable "size" is referenced. The cursor + /// referenced by the type of size is the typedef for size_type. + static const int CXCursor_TypeRef = 43; + static const int CXCursor_CXXBaseSpecifier = 44; - /// Non-zero if the directive was automatically turned into a module - /// import. - @ffi.Int32() - external int isModuleImport; -} - -/// Data for IndexerCallbacks#importedASTFile. -class CXIdxImportedASTFileInfo extends ffi.Struct { - /// Top level AST file containing the imported PCH, module or submodule. - external ffi.Pointer file; - - /// The imported module or NULL if the AST file is a PCH. - external ffi.Pointer module; - - /// Location where the file is imported. Applicable only for modules. - external CXIdxLoc loc; - - /// Non-zero if an inclusion directive was automatically turned into - /// a module import. Applicable only for modules. - @ffi.Int32() - external int isImplicit; -} - -class CXIdxAttrInfo extends ffi.Struct { - @ffi.Int32() - external int kind; - - external CXCursor cursor; - - external CXIdxLoc loc; -} - -class CXIdxEntityInfo extends ffi.Struct { - @ffi.Int32() - external int kind; - - @ffi.Int32() - external int templateKind; - - @ffi.Int32() - external int lang; - - external ffi.Pointer name; - - external ffi.Pointer USR; - - external CXCursor cursor; - - external ffi.Pointer> attributes; - - @ffi.Uint32() - external int numAttributes; -} - -class CXIdxContainerInfo extends ffi.Struct { - external CXCursor cursor; -} - -class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct { - external ffi.Pointer attrInfo; - - external ffi.Pointer objcClass; + /// A reference to a class template, function template, template + /// template parameter, or class template partial specialization. + static const int CXCursor_TemplateRef = 45; - external CXCursor classCursor; + /// A reference to a namespace or namespace alias. + static const int CXCursor_NamespaceRef = 46; - external CXIdxLoc classLoc; -} + /// A reference to a member of a struct, union, or class that occurs in + /// some non-expression context, e.g., a designated initializer. + static const int CXCursor_MemberRef = 47; -class CXIdxDeclInfo extends ffi.Struct { - external ffi.Pointer entityInfo; + /// A reference to a labeled statement. + /// + /// This cursor kind is used to describe the jump to "start_over" in the + /// goto statement in the following example: + /// + /// \code + /// start_over: + /// ++counter; + /// + /// goto start_over; + /// \endcode + /// + /// A label reference cursor refers to a label statement. + static const int CXCursor_LabelRef = 48; - external CXCursor cursor; + /// A reference to a set of overloaded functions or function templates + /// that has not yet been resolved to a specific function or function template. + /// + /// An overloaded declaration reference cursor occurs in C++ templates where + /// a dependent name refers to a function. For example: + /// + /// \code + /// template void swap(T&, T&); + /// + /// struct X { ... }; + /// void swap(X&, X&); + /// + /// template + /// void reverse(T* first, T* last) { + /// while (first < last - 1) { + /// swap(*first, *--last); + /// ++first; + /// } + /// } + /// + /// struct Y { }; + /// void swap(Y&, Y&); + /// \endcode + /// + /// Here, the identifier "swap" is associated with an overloaded declaration + /// reference. In the template definition, "swap" refers to either of the two + /// "swap" functions declared above, so both results will be available. At + /// instantiation time, "swap" may also refer to other functions found via + /// argument-dependent lookup (e.g., the "swap" function at the end of the + /// example). + /// + /// The functions \c clang_getNumOverloadedDecls() and + /// \c clang_getOverloadedDecl() can be used to retrieve the definitions + /// referenced by this cursor. + static const int CXCursor_OverloadedDeclRef = 49; + + /// A reference to a variable that occurs in some non-expression + /// context, e.g., a C++ lambda capture list. + static const int CXCursor_VariableRef = 50; + static const int CXCursor_LastRef = 50; + static const int CXCursor_FirstInvalid = 70; + static const int CXCursor_InvalidFile = 70; + static const int CXCursor_NoDeclFound = 71; + static const int CXCursor_NotImplemented = 72; + static const int CXCursor_InvalidCode = 73; + static const int CXCursor_LastInvalid = 73; + static const int CXCursor_FirstExpr = 100; + + /// An expression whose specific kind is not exposed via this + /// interface. + /// + /// Unexposed expressions have the same operations as any other kind + /// of expression; one can extract their location information, + /// spelling, children, etc. However, the specific kind of the + /// expression is not reported. + static const int CXCursor_UnexposedExpr = 100; - external CXIdxLoc loc; + /// An expression that refers to some value declaration, such + /// as a function, variable, or enumerator. + static const int CXCursor_DeclRefExpr = 101; - external ffi.Pointer semanticContainer; + /// An expression that refers to a member of a struct, union, + /// class, Objective-C class, etc. + static const int CXCursor_MemberRefExpr = 102; - /// Generally same as #semanticContainer but can be different in - /// cases like out-of-line C++ member functions. - external ffi.Pointer lexicalContainer; + /// An expression that calls a function. + static const int CXCursor_CallExpr = 103; - @ffi.Int32() - external int isRedeclaration; + /// An expression that sends a message to an Objective-C + /// object or class. + static const int CXCursor_ObjCMessageExpr = 104; - @ffi.Int32() - external int isDefinition; + /// An expression that represents a block literal. + static const int CXCursor_BlockExpr = 105; - @ffi.Int32() - external int isContainer; + /// An integer literal. + static const int CXCursor_IntegerLiteral = 106; - external ffi.Pointer declAsContainer; + /// A floating point number literal. + static const int CXCursor_FloatingLiteral = 107; - /// Whether the declaration exists in code or was created implicitly - /// by the compiler, e.g. implicit Objective-C methods for properties. - @ffi.Int32() - external int isImplicit; + /// An imaginary number literal. + static const int CXCursor_ImaginaryLiteral = 108; - external ffi.Pointer> attributes; + /// A string literal. + static const int CXCursor_StringLiteral = 109; - @ffi.Uint32() - external int numAttributes; + /// A character literal. + static const int CXCursor_CharacterLiteral = 110; - @ffi.Uint32() - external int flags; -} + /// A parenthesized expression, e.g. "(1)". + /// + /// This AST node is only formed if full location information is requested. + static const int CXCursor_ParenExpr = 111; -class CXIdxObjCContainerDeclInfo extends ffi.Struct { - external ffi.Pointer declInfo; + /// This represents the unary-expression's (except sizeof and + /// alignof). + static const int CXCursor_UnaryOperator = 112; - @ffi.Int32() - external int kind; -} + /// [C99 6.5.2.1] Array Subscripting. + static const int CXCursor_ArraySubscriptExpr = 113; -class CXIdxBaseClassInfo extends ffi.Struct { - external ffi.Pointer base; + /// A builtin binary operation expression such as "x + y" or + /// "x <= y". + static const int CXCursor_BinaryOperator = 114; - external CXCursor cursor; + /// Compound assignment such as "+=". + static const int CXCursor_CompoundAssignOperator = 115; - external CXIdxLoc loc; -} + /// The ?: ternary operator. + static const int CXCursor_ConditionalOperator = 116; -class CXIdxObjCProtocolRefInfo extends ffi.Struct { - external ffi.Pointer protocol; + /// An explicit cast in C (C99 6.5.4) or a C-style cast in C++ + /// (C++ [expr.cast]), which uses the syntax (Type)expr. + /// + /// For example: (int)f. + static const int CXCursor_CStyleCastExpr = 117; - external CXCursor cursor; + /// [C99 6.5.2.5] + static const int CXCursor_CompoundLiteralExpr = 118; - external CXIdxLoc loc; -} + /// Describes an C or C++ initializer list. + static const int CXCursor_InitListExpr = 119; -class CXIdxObjCProtocolRefListInfo extends ffi.Struct { - external ffi.Pointer> protocols; + /// The GNU address of label extension, representing &&label. + static const int CXCursor_AddrLabelExpr = 120; - @ffi.Uint32() - external int numProtocols; -} + /// This is the GNU Statement Expression extension: ({int X=4; X;}) + static const int CXCursor_StmtExpr = 121; -class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { - external ffi.Pointer containerInfo; - - external ffi.Pointer superInfo; - - external ffi.Pointer protocols; -} - -class CXIdxObjCCategoryDeclInfo extends ffi.Struct { - external ffi.Pointer containerInfo; - - external ffi.Pointer objcClass; - - external CXCursor classCursor; - - external CXIdxLoc classLoc; - - external ffi.Pointer protocols; -} - -class CXIdxObjCPropertyDeclInfo extends ffi.Struct { - external ffi.Pointer declInfo; - - external ffi.Pointer getter; - - external ffi.Pointer setter; -} - -class CXIdxCXXClassDeclInfo extends ffi.Struct { - external ffi.Pointer declInfo; - - external ffi.Pointer> bases; - - @ffi.Uint32() - external int numBases; -} - -/// Data for IndexerCallbacks#indexEntityReference. -class CXIdxEntityRefInfo extends ffi.Struct { - @ffi.Int32() - external int kind; - - /// Reference cursor. - external CXCursor cursor; - - external CXIdxLoc loc; - - /// The entity that gets referenced. - external ffi.Pointer referencedEntity; - - /// Immediate "parent" of the reference. For example: - /// - /// \code - /// Foo *var; - /// \endcode - /// - /// The parent of reference of type 'Foo' is the variable 'var'. - /// For references inside statement bodies of functions/methods, - /// the parentEntity will be the function/method. - external ffi.Pointer parentEntity; - - /// Lexical container context of the reference. - external ffi.Pointer container; - - /// Sets of symbol roles of the reference. - @ffi.Int32() - external int role; -} - -/// A group of callbacks used by #clang_indexSourceFile and -/// #clang_indexTranslationUnit. -class IndexerCallbacks extends ffi.Struct { - /// Called periodically to check whether indexing should be aborted. - /// Should return 0 to continue, and non-zero to abort. - external ffi.Pointer> abortQuery; - - /// Called at the end of indexing; passes the complete diagnostic set. - external ffi.Pointer> diagnostic; - - external ffi.Pointer> enteredMainFile; - - /// Called when a file gets \#included/\#imported. - external ffi.Pointer> ppIncludedFile; - - /// Called when a AST file (PCH or module) gets imported. - /// - /// AST files will not get indexed (there will not be callbacks to index all - /// the entities in an AST file). The recommended action is that, if the AST - /// file is not already indexed, to initiate a new indexing job specific to - /// the AST file. - external ffi.Pointer> importedASTFile; - - /// Called at the beginning of indexing a translation unit. - external ffi.Pointer> startedTranslationUnit; - - external ffi.Pointer> indexDeclaration; - - /// Called to index a reference of an entity. - external ffi.Pointer> indexEntityReference; -} - -const int CINDEX_VERSION_MAJOR = 0; - -const int CINDEX_VERSION_MINOR = 59; - -const int CINDEX_VERSION = 59; - -const String CINDEX_VERSION_STRING = '0.59'; - -typedef Native_clang_getCString = ffi.Pointer Function( - CXString string, -); - -typedef _dart_clang_getCString = ffi.Pointer Function( - CXString string, -); - -typedef Native_clang_disposeString = ffi.Void Function( - CXString string, -); - -typedef _dart_clang_disposeString = void Function( - CXString string, -); - -typedef Native_clang_disposeStringSet = ffi.Void Function( - ffi.Pointer set_1, -); - -typedef _dart_clang_disposeStringSet = void Function( - ffi.Pointer set_1, -); - -typedef Native_clang_createIndex = ffi.Pointer Function( - ffi.Int32 excludeDeclarationsFromPCH, - ffi.Int32 displayDiagnostics, -); - -typedef _dart_clang_createIndex = ffi.Pointer Function( - int excludeDeclarationsFromPCH, - int displayDiagnostics, -); - -typedef Native_clang_disposeIndex = ffi.Void Function( - ffi.Pointer index, -); - -typedef _dart_clang_disposeIndex = void Function( - ffi.Pointer index, -); - -typedef Native_clang_CXIndex_setGlobalOptions = ffi.Void Function( - ffi.Pointer arg0, - ffi.Uint32 options, -); - -typedef _dart_clang_CXIndex_setGlobalOptions = void Function( - ffi.Pointer arg0, - int options, -); - -typedef Native_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_CXIndex_getGlobalOptions = int Function( - ffi.Pointer arg0, -); - -typedef Native_clang_CXIndex_setInvocationEmissionPathOption = ffi.Void - Function( - ffi.Pointer arg0, - ffi.Pointer Path, -); - -typedef _dart_clang_CXIndex_setInvocationEmissionPathOption = void Function( - ffi.Pointer arg0, - ffi.Pointer Path, -); - -typedef Native_clang_getFileName = CXString Function( - ffi.Pointer SFile, -); - -typedef _dart_clang_getFileName = CXString Function( - ffi.Pointer SFile, -); - -typedef Native_clang_getFileTime = ffi.Int64 Function( - ffi.Pointer SFile, -); - -typedef _dart_clang_getFileTime = int Function( - ffi.Pointer SFile, -); - -typedef Native_clang_getFileUniqueID = ffi.Int32 Function( - ffi.Pointer file, - ffi.Pointer outID, -); - -typedef _dart_clang_getFileUniqueID = int Function( - ffi.Pointer file, - ffi.Pointer outID, -); - -typedef Native_clang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( - ffi.Pointer tu, - ffi.Pointer file, -); - -typedef _dart_clang_isFileMultipleIncludeGuarded = int Function( - ffi.Pointer tu, - ffi.Pointer file, -); - -typedef Native_clang_getFile = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file_name, -); - -typedef _dart_clang_getFile = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file_name, -); - -typedef Native_clang_getFileContents = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, -); - -typedef _dart_clang_getFileContents = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, -); - -typedef Native_clang_File_isEqual = ffi.Int32 Function( - ffi.Pointer file1, - ffi.Pointer file2, -); - -typedef _dart_clang_File_isEqual = int Function( - ffi.Pointer file1, - ffi.Pointer file2, -); - -typedef Native_clang_File_tryGetRealPathName = CXString Function( - ffi.Pointer file, -); - -typedef _dart_clang_File_tryGetRealPathName = CXString Function( - ffi.Pointer file, -); - -typedef Native_clang_getNullLocation = CXSourceLocation Function(); - -typedef _dart_clang_getNullLocation = CXSourceLocation Function(); - -typedef Native_clang_equalLocations = ffi.Uint32 Function( - CXSourceLocation loc1, - CXSourceLocation loc2, -); - -typedef _dart_clang_equalLocations = int Function( - CXSourceLocation loc1, - CXSourceLocation loc2, -); - -typedef Native_clang_getLocation = CXSourceLocation Function( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Uint32 line, - ffi.Uint32 column, -); - -typedef _dart_clang_getLocation = CXSourceLocation Function( - ffi.Pointer tu, - ffi.Pointer file, - int line, - int column, -); - -typedef Native_clang_getLocationForOffset = CXSourceLocation Function( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Uint32 offset, -); - -typedef _dart_clang_getLocationForOffset = CXSourceLocation Function( - ffi.Pointer tu, - ffi.Pointer file, - int offset, -); - -typedef Native_clang_Location_isInSystemHeader = ffi.Int32 Function( - CXSourceLocation location, -); - -typedef _dart_clang_Location_isInSystemHeader = int Function( - CXSourceLocation location, -); - -typedef Native_clang_Location_isFromMainFile = ffi.Int32 Function( - CXSourceLocation location, -); - -typedef _dart_clang_Location_isFromMainFile = int Function( - CXSourceLocation location, -); - -typedef Native_clang_getNullRange = CXSourceRange Function(); - -typedef _dart_clang_getNullRange = CXSourceRange Function(); - -typedef Native_clang_getRange = CXSourceRange Function( - CXSourceLocation begin, - CXSourceLocation end, -); - -typedef _dart_clang_getRange = CXSourceRange Function( - CXSourceLocation begin, - CXSourceLocation end, -); - -typedef Native_clang_equalRanges = ffi.Uint32 Function( - CXSourceRange range1, - CXSourceRange range2, -); - -typedef _dart_clang_equalRanges = int Function( - CXSourceRange range1, - CXSourceRange range2, -); - -typedef Native_clang_Range_isNull = ffi.Int32 Function( - CXSourceRange range, -); - -typedef _dart_clang_Range_isNull = int Function( - CXSourceRange range, -); - -typedef Native_clang_getExpansionLocation = ffi.Void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _dart_clang_getExpansionLocation = void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef Native_clang_getPresumedLocation = ffi.Void Function( - CXSourceLocation location, - ffi.Pointer filename, - ffi.Pointer line, - ffi.Pointer column, -); - -typedef _dart_clang_getPresumedLocation = void Function( - CXSourceLocation location, - ffi.Pointer filename, - ffi.Pointer line, - ffi.Pointer column, -); - -typedef Native_clang_getInstantiationLocation = ffi.Void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _dart_clang_getInstantiationLocation = void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef Native_clang_getSpellingLocation = ffi.Void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _dart_clang_getSpellingLocation = void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef Native_clang_getFileLocation = ffi.Void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _dart_clang_getFileLocation = void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef Native_clang_getRangeStart = CXSourceLocation Function( - CXSourceRange range, -); - -typedef _dart_clang_getRangeStart = CXSourceLocation Function( - CXSourceRange range, -); - -typedef Native_clang_getRangeEnd = CXSourceLocation Function( - CXSourceRange range, -); - -typedef _dart_clang_getRangeEnd = CXSourceLocation Function( - CXSourceRange range, -); - -typedef Native_clang_getSkippedRanges = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, -); - -typedef _dart_clang_getSkippedRanges = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, -); - -typedef Native_clang_getAllSkippedRanges = ffi.Pointer - Function( - ffi.Pointer tu, -); - -typedef _dart_clang_getAllSkippedRanges = ffi.Pointer - Function( - ffi.Pointer tu, -); - -typedef Native_clang_disposeSourceRangeList = ffi.Void Function( - ffi.Pointer ranges, -); - -typedef _dart_clang_disposeSourceRangeList = void Function( - ffi.Pointer ranges, -); - -typedef Native_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( - ffi.Pointer Diags, -); - -typedef _dart_clang_getNumDiagnosticsInSet = int Function( - ffi.Pointer Diags, -); - -typedef Native_clang_getDiagnosticInSet = ffi.Pointer Function( - ffi.Pointer Diags, - ffi.Uint32 Index, -); - -typedef _dart_clang_getDiagnosticInSet = ffi.Pointer Function( - ffi.Pointer Diags, - int Index, -); - -typedef Native_clang_loadDiagnostics = ffi.Pointer Function( - ffi.Pointer file, - ffi.Pointer error, - ffi.Pointer errorString, -); - -typedef _dart_clang_loadDiagnostics = ffi.Pointer Function( - ffi.Pointer file, - ffi.Pointer error, - ffi.Pointer errorString, -); - -typedef Native_clang_disposeDiagnosticSet = ffi.Void Function( - ffi.Pointer Diags, -); - -typedef _dart_clang_disposeDiagnosticSet = void Function( - ffi.Pointer Diags, -); - -typedef Native_clang_getChildDiagnostics = ffi.Pointer Function( - ffi.Pointer D, -); - -typedef _dart_clang_getChildDiagnostics = ffi.Pointer Function( - ffi.Pointer D, -); - -typedef Native_clang_getNumDiagnostics = ffi.Uint32 Function( - ffi.Pointer Unit, -); - -typedef _dart_clang_getNumDiagnostics = int Function( - ffi.Pointer Unit, -); - -typedef Native_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - ffi.Uint32 Index, -); - -typedef _dart_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - int Index, -); - -typedef Native_clang_getDiagnosticSetFromTU = ffi.Pointer Function( - ffi.Pointer Unit, -); - -typedef _dart_clang_getDiagnosticSetFromTU = ffi.Pointer Function( - ffi.Pointer Unit, -); - -typedef Native_clang_disposeDiagnostic = ffi.Void Function( - ffi.Pointer Diagnostic, -); - -typedef _dart_clang_disposeDiagnostic = void Function( - ffi.Pointer Diagnostic, -); - -typedef Native_clang_formatDiagnostic = CXString Function( - ffi.Pointer Diagnostic, - ffi.Uint32 Options, -); - -typedef _dart_clang_formatDiagnostic = CXString Function( - ffi.Pointer Diagnostic, - int Options, -); - -typedef Native_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); - -typedef _dart_clang_defaultDiagnosticDisplayOptions = int Function(); - -typedef Native_clang_getDiagnosticSeverity = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticSeverity = int Function( - ffi.Pointer arg0, -); - -typedef Native_clang_getDiagnosticLocation = CXSourceLocation Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticLocation = CXSourceLocation Function( - ffi.Pointer arg0, -); - -typedef Native_clang_getDiagnosticSpelling = CXString Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticSpelling = CXString Function( - ffi.Pointer arg0, -); - -typedef Native_clang_getDiagnosticOption = CXString Function( - ffi.Pointer Diag, - ffi.Pointer Disable, -); - -typedef _dart_clang_getDiagnosticOption = CXString Function( - ffi.Pointer Diag, - ffi.Pointer Disable, -); - -typedef Native_clang_getDiagnosticCategory = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticCategory = int Function( - ffi.Pointer arg0, -); - -typedef Native_clang_getDiagnosticCategoryName = CXString Function( - ffi.Uint32 Category, -); - -typedef _dart_clang_getDiagnosticCategoryName = CXString Function( - int Category, -); - -typedef Native_clang_getDiagnosticCategoryText = CXString Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticCategoryText = CXString Function( - ffi.Pointer arg0, -); - -typedef Native_clang_getDiagnosticNumRanges = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticNumRanges = int Function( - ffi.Pointer arg0, -); - -typedef Native_clang_getDiagnosticRange = CXSourceRange Function( - ffi.Pointer Diagnostic, - ffi.Uint32 Range, -); - -typedef _dart_clang_getDiagnosticRange = CXSourceRange Function( - ffi.Pointer Diagnostic, - int Range, -); - -typedef Native_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( - ffi.Pointer Diagnostic, -); - -typedef _dart_clang_getDiagnosticNumFixIts = int Function( - ffi.Pointer Diagnostic, -); - -typedef Native_clang_getDiagnosticFixIt = CXString Function( - ffi.Pointer Diagnostic, - ffi.Uint32 FixIt, - ffi.Pointer ReplacementRange, -); - -typedef _dart_clang_getDiagnosticFixIt = CXString Function( - ffi.Pointer Diagnostic, - int FixIt, - ffi.Pointer ReplacementRange, -); - -typedef Native_clang_getTranslationUnitSpelling = CXString Function( - ffi.Pointer CTUnit, -); - -typedef _dart_clang_getTranslationUnitSpelling = CXString Function( - ffi.Pointer CTUnit, -); - -typedef Native_clang_createTranslationUnitFromSourceFile - = ffi.Pointer Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Int32 num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, - ffi.Uint32 num_unsaved_files, - ffi.Pointer unsaved_files, -); - -typedef _dart_clang_createTranslationUnitFromSourceFile - = ffi.Pointer Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - int num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, - int num_unsaved_files, - ffi.Pointer unsaved_files, -); - -typedef Native_clang_createTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, -); - -typedef _dart_clang_createTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, -); - -typedef Native_clang_createTranslationUnit2 = ffi.Int32 Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, - ffi.Pointer> out_TU, -); - -typedef _dart_clang_createTranslationUnit2 = int Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, - ffi.Pointer> out_TU, -); - -typedef Native_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 - Function(); - -typedef _dart_clang_defaultEditingTranslationUnitOptions = int Function(); - -typedef Native_clang_parseTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, -); - -typedef _dart_clang_parseTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, -); - -typedef Native_clang_parseTranslationUnit2 = ffi.Int32 Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, - ffi.Pointer> out_TU, -); - -typedef _dart_clang_parseTranslationUnit2 = int Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, - ffi.Pointer> out_TU, -); - -typedef Native_clang_parseTranslationUnit2FullArgv = ffi.Int32 Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, - ffi.Pointer> out_TU, -); - -typedef _dart_clang_parseTranslationUnit2FullArgv = int Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, - ffi.Pointer> out_TU, -); - -typedef Native_clang_defaultSaveOptions = ffi.Uint32 Function( - ffi.Pointer TU, -); - -typedef _dart_clang_defaultSaveOptions = int Function( - ffi.Pointer TU, -); - -typedef Native_clang_saveTranslationUnit = ffi.Int32 Function( - ffi.Pointer TU, - ffi.Pointer FileName, - ffi.Uint32 options, -); - -typedef _dart_clang_saveTranslationUnit = int Function( - ffi.Pointer TU, - ffi.Pointer FileName, - int options, -); - -typedef Native_clang_suspendTranslationUnit = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_suspendTranslationUnit = int Function( - ffi.Pointer arg0, -); - -typedef Native_clang_disposeTranslationUnit = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_disposeTranslationUnit = void Function( - ffi.Pointer arg0, -); - -typedef Native_clang_defaultReparseOptions = ffi.Uint32 Function( - ffi.Pointer TU, -); - -typedef _dart_clang_defaultReparseOptions = int Function( - ffi.Pointer TU, -); - -typedef Native_clang_reparseTranslationUnit = ffi.Int32 Function( - ffi.Pointer TU, - ffi.Uint32 num_unsaved_files, - ffi.Pointer unsaved_files, - ffi.Uint32 options, -); - -typedef _dart_clang_reparseTranslationUnit = int Function( - ffi.Pointer TU, - int num_unsaved_files, - ffi.Pointer unsaved_files, - int options, -); - -typedef Native_clang_getTUResourceUsageName = ffi.Pointer Function( - ffi.Int32 kind, -); - -typedef _dart_clang_getTUResourceUsageName = ffi.Pointer Function( - int kind, -); - -typedef Native_clang_getCXTUResourceUsage = CXTUResourceUsage Function( - ffi.Pointer TU, -); - -typedef _dart_clang_getCXTUResourceUsage = CXTUResourceUsage Function( - ffi.Pointer TU, -); - -typedef Native_clang_disposeCXTUResourceUsage = ffi.Void Function( - CXTUResourceUsage usage, -); - -typedef _dart_clang_disposeCXTUResourceUsage = void Function( - CXTUResourceUsage usage, -); - -typedef Native_clang_getTranslationUnitTargetInfo - = ffi.Pointer Function( - ffi.Pointer CTUnit, -); - -typedef _dart_clang_getTranslationUnitTargetInfo = ffi.Pointer - Function( - ffi.Pointer CTUnit, -); - -typedef Native_clang_TargetInfo_dispose = ffi.Void Function( - ffi.Pointer Info, -); - -typedef _dart_clang_TargetInfo_dispose = void Function( - ffi.Pointer Info, -); - -typedef Native_clang_TargetInfo_getTriple = CXString Function( - ffi.Pointer Info, -); - -typedef _dart_clang_TargetInfo_getTriple = CXString Function( - ffi.Pointer Info, -); - -typedef Native_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( - ffi.Pointer Info, -); - -typedef _dart_clang_TargetInfo_getPointerWidth = int Function( - ffi.Pointer Info, -); - -typedef Native_clang_getNullCursor = CXCursor Function(); - -typedef _dart_clang_getNullCursor = CXCursor Function(); - -typedef Native_clang_getTranslationUnitCursor = CXCursor Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getTranslationUnitCursor = CXCursor Function( - ffi.Pointer arg0, -); - -typedef Native_clang_equalCursors = ffi.Uint32 Function( - CXCursor arg0, - CXCursor arg1, -); - -typedef _dart_clang_equalCursors = int Function( - CXCursor arg0, - CXCursor arg1, -); - -typedef Native_clang_Cursor_isNull = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_Cursor_isNull = int Function( - CXCursor cursor, -); - -typedef Native_clang_hashCursor = ffi.Uint32 Function( - CXCursor arg0, -); - -typedef _dart_clang_hashCursor = int Function( - CXCursor arg0, -); - -typedef Native_clang_getCursorKind = ffi.Int32 Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorKind = int Function( - CXCursor arg0, -); - -typedef Native_clang_isDeclaration = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isDeclaration = int Function( - int arg0, -); - -typedef Native_clang_isInvalidDeclaration = ffi.Uint32 Function( - CXCursor arg0, -); - -typedef _dart_clang_isInvalidDeclaration = int Function( - CXCursor arg0, -); - -typedef Native_clang_isReference = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isReference = int Function( - int arg0, -); - -typedef Native_clang_isExpression = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isExpression = int Function( - int arg0, -); - -typedef Native_clang_isStatement = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isStatement = int Function( - int arg0, -); - -typedef Native_clang_isAttribute = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isAttribute = int Function( - int arg0, -); - -typedef Native_clang_Cursor_hasAttrs = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_hasAttrs = int Function( - CXCursor C, -); - -typedef Native_clang_isInvalid = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isInvalid = int Function( - int arg0, -); - -typedef Native_clang_isTranslationUnit = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isTranslationUnit = int Function( - int arg0, -); - -typedef Native_clang_isPreprocessing = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isPreprocessing = int Function( - int arg0, -); - -typedef Native_clang_isUnexposed = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isUnexposed = int Function( - int arg0, -); - -typedef Native_clang_getCursorLinkage = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getCursorLinkage = int Function( - CXCursor cursor, -); - -typedef Native_clang_getCursorVisibility = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getCursorVisibility = int Function( - CXCursor cursor, -); - -typedef Native_clang_getCursorAvailability = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getCursorAvailability = int Function( - CXCursor cursor, -); - -typedef Native_clang_getCursorPlatformAvailability = ffi.Int32 Function( - CXCursor cursor, - ffi.Pointer always_deprecated, - ffi.Pointer deprecated_message, - ffi.Pointer always_unavailable, - ffi.Pointer unavailable_message, - ffi.Pointer availability, - ffi.Int32 availability_size, -); - -typedef _dart_clang_getCursorPlatformAvailability = int Function( - CXCursor cursor, - ffi.Pointer always_deprecated, - ffi.Pointer deprecated_message, - ffi.Pointer always_unavailable, - ffi.Pointer unavailable_message, - ffi.Pointer availability, - int availability_size, -); + /// Represents a C11 generic selection. + static const int CXCursor_GenericSelectionExpr = 122; -typedef Native_clang_disposeCXPlatformAvailability = ffi.Void Function( - ffi.Pointer availability, -); + /// Implements the GNU __null extension, which is a name for a null + /// pointer constant that has integral type (e.g., int or long) and is the same + /// size and alignment as a pointer. + /// + /// The __null extension is typically only used by system headers, which define + /// NULL as __null in C++ rather than using 0 (which is an integer that may not + /// match the size of a pointer). + static const int CXCursor_GNUNullExpr = 123; -typedef _dart_clang_disposeCXPlatformAvailability = void Function( - ffi.Pointer availability, -); + /// C++'s static_cast<> expression. + static const int CXCursor_CXXStaticCastExpr = 124; -typedef Native_clang_getCursorLanguage = ffi.Int32 Function( - CXCursor cursor, -); + /// C++'s dynamic_cast<> expression. + static const int CXCursor_CXXDynamicCastExpr = 125; -typedef _dart_clang_getCursorLanguage = int Function( - CXCursor cursor, -); + /// C++'s reinterpret_cast<> expression. + static const int CXCursor_CXXReinterpretCastExpr = 126; -typedef Native_clang_getCursorTLSKind = ffi.Int32 Function( - CXCursor cursor, -); + /// C++'s const_cast<> expression. + static const int CXCursor_CXXConstCastExpr = 127; -typedef _dart_clang_getCursorTLSKind = int Function( - CXCursor cursor, -); + /// Represents an explicit C++ type conversion that uses "functional" + /// notion (C++ [expr.type.conv]). + /// + /// Example: + /// \code + /// x = int(0.5); + /// \endcode + static const int CXCursor_CXXFunctionalCastExpr = 128; -typedef Native_clang_Cursor_getTranslationUnit - = ffi.Pointer Function( - CXCursor arg0, -); + /// A C++ typeid expression (C++ [expr.typeid]). + static const int CXCursor_CXXTypeidExpr = 129; -typedef _dart_clang_Cursor_getTranslationUnit - = ffi.Pointer Function( - CXCursor arg0, -); + /// [C++ 2.13.5] C++ Boolean Literal. + static const int CXCursor_CXXBoolLiteralExpr = 130; -typedef Native_clang_createCXCursorSet = ffi.Pointer - Function(); + /// [C++0x 2.14.7] C++ Pointer Literal. + static const int CXCursor_CXXNullPtrLiteralExpr = 131; -typedef _dart_clang_createCXCursorSet = ffi.Pointer Function(); + /// Represents the "this" expression in C++ + static const int CXCursor_CXXThisExpr = 132; -typedef Native_clang_disposeCXCursorSet = ffi.Void Function( - ffi.Pointer cset, -); + /// [C++ 15] C++ Throw Expression. + /// + /// This handles 'throw' and 'throw' assignment-expression. When + /// assignment-expression isn't present, Op will be null. + static const int CXCursor_CXXThrowExpr = 133; -typedef _dart_clang_disposeCXCursorSet = void Function( - ffi.Pointer cset, -); + /// A new expression for memory allocation and constructor calls, e.g: + /// "new CXXNewExpr(foo)". + static const int CXCursor_CXXNewExpr = 134; -typedef Native_clang_CXCursorSet_contains = ffi.Uint32 Function( - ffi.Pointer cset, - CXCursor cursor, -); + /// A delete expression for memory deallocation and destructor calls, + /// e.g. "delete[] pArray". + static const int CXCursor_CXXDeleteExpr = 135; -typedef _dart_clang_CXCursorSet_contains = int Function( - ffi.Pointer cset, - CXCursor cursor, -); + /// A unary expression. (noexcept, sizeof, or other traits) + static const int CXCursor_UnaryExpr = 136; -typedef Native_clang_CXCursorSet_insert = ffi.Uint32 Function( - ffi.Pointer cset, - CXCursor cursor, -); + /// An Objective-C string literal i.e. @"foo". + static const int CXCursor_ObjCStringLiteral = 137; -typedef _dart_clang_CXCursorSet_insert = int Function( - ffi.Pointer cset, - CXCursor cursor, -); + /// An Objective-C \@encode expression. + static const int CXCursor_ObjCEncodeExpr = 138; -typedef Native_clang_getCursorSemanticParent = CXCursor Function( - CXCursor cursor, -); + /// An Objective-C \@selector expression. + static const int CXCursor_ObjCSelectorExpr = 139; -typedef _dart_clang_getCursorSemanticParent = CXCursor Function( - CXCursor cursor, -); + /// An Objective-C \@protocol expression. + static const int CXCursor_ObjCProtocolExpr = 140; -typedef Native_clang_getCursorLexicalParent = CXCursor Function( - CXCursor cursor, -); + /// An Objective-C "bridged" cast expression, which casts between + /// Objective-C pointers and C pointers, transferring ownership in the process. + /// + /// \code + /// NSString *str = (__bridge_transfer NSString *)CFCreateString(); + /// \endcode + static const int CXCursor_ObjCBridgedCastExpr = 141; -typedef _dart_clang_getCursorLexicalParent = CXCursor Function( - CXCursor cursor, -); + /// Represents a C++0x pack expansion that produces a sequence of + /// expressions. + /// + /// A pack expansion expression contains a pattern (which itself is an + /// expression) followed by an ellipsis. For example: + /// + /// \code + /// template + /// void forward(F f, Types &&...args) { + /// f(static_cast(args)...); + /// } + /// \endcode + static const int CXCursor_PackExpansionExpr = 142; -typedef Native_clang_getOverriddenCursors = ffi.Void Function( - CXCursor cursor, - ffi.Pointer> overridden, - ffi.Pointer num_overridden, -); + /// Represents an expression that computes the length of a parameter + /// pack. + /// + /// \code + /// template + /// struct count { + /// static const unsigned value = sizeof...(Types); + /// }; + /// \endcode + static const int CXCursor_SizeOfPackExpr = 143; + static const int CXCursor_LambdaExpr = 144; -typedef _dart_clang_getOverriddenCursors = void Function( - CXCursor cursor, - ffi.Pointer> overridden, - ffi.Pointer num_overridden, -); + /// Objective-c Boolean Literal. + static const int CXCursor_ObjCBoolLiteralExpr = 145; -typedef Native_clang_disposeOverriddenCursors = ffi.Void Function( - ffi.Pointer overridden, -); + /// Represents the "self" expression in an Objective-C method. + static const int CXCursor_ObjCSelfExpr = 146; -typedef _dart_clang_disposeOverriddenCursors = void Function( - ffi.Pointer overridden, -); + /// OpenMP 4.0 [2.4, Array Section]. + static const int CXCursor_OMPArraySectionExpr = 147; -typedef Native_clang_getIncludedFile = ffi.Pointer Function( - CXCursor cursor, -); + /// Represents an @available(...) check. + static const int CXCursor_ObjCAvailabilityCheckExpr = 148; -typedef _dart_clang_getIncludedFile = ffi.Pointer Function( - CXCursor cursor, -); + /// Fixed point literal + static const int CXCursor_FixedPointLiteral = 149; + static const int CXCursor_LastExpr = 149; + static const int CXCursor_FirstStmt = 200; -typedef Native_clang_getCursor = CXCursor Function( - ffi.Pointer arg0, - CXSourceLocation arg1, -); + /// A statement whose specific kind is not exposed via this + /// interface. + /// + /// Unexposed statements have the same operations as any other kind of + /// statement; one can extract their location information, spelling, + /// children, etc. However, the specific kind of the statement is not + /// reported. + static const int CXCursor_UnexposedStmt = 200; -typedef _dart_clang_getCursor = CXCursor Function( - ffi.Pointer arg0, - CXSourceLocation arg1, -); + /// A labelled statement in a function. + /// + /// This cursor kind is used to describe the "start_over:" label statement in + /// the following example: + /// + /// \code + /// start_over: + /// ++counter; + /// \endcode + static const int CXCursor_LabelStmt = 201; -typedef Native_clang_getCursorLocation = CXSourceLocation Function( - CXCursor arg0, -); + /// A group of statements like { stmt stmt }. + /// + /// This cursor kind is used to describe compound statements, e.g. function + /// bodies. + static const int CXCursor_CompoundStmt = 202; -typedef _dart_clang_getCursorLocation = CXSourceLocation Function( - CXCursor arg0, -); + /// A case statement. + static const int CXCursor_CaseStmt = 203; -typedef Native_clang_getCursorExtent = CXSourceRange Function( - CXCursor arg0, -); + /// A default statement. + static const int CXCursor_DefaultStmt = 204; -typedef _dart_clang_getCursorExtent = CXSourceRange Function( - CXCursor arg0, -); + /// An if statement + static const int CXCursor_IfStmt = 205; -typedef Native_clang_getCursorType = CXType Function( - CXCursor C, -); + /// A switch statement. + static const int CXCursor_SwitchStmt = 206; -typedef _dart_clang_getCursorType = CXType Function( - CXCursor C, -); + /// A while statement. + static const int CXCursor_WhileStmt = 207; -typedef Native_clang_getTypeSpelling = CXString Function( - CXType CT, -); + /// A do statement. + static const int CXCursor_DoStmt = 208; -typedef _dart_clang_getTypeSpelling = CXString Function( - CXType CT, -); + /// A for statement. + static const int CXCursor_ForStmt = 209; -typedef Native_clang_getTypedefDeclUnderlyingType = CXType Function( - CXCursor C, -); + /// A goto statement. + static const int CXCursor_GotoStmt = 210; -typedef _dart_clang_getTypedefDeclUnderlyingType = CXType Function( - CXCursor C, -); + /// An indirect goto statement. + static const int CXCursor_IndirectGotoStmt = 211; -typedef Native_clang_getEnumDeclIntegerType = CXType Function( - CXCursor C, -); + /// A continue statement. + static const int CXCursor_ContinueStmt = 212; -typedef _dart_clang_getEnumDeclIntegerType = CXType Function( - CXCursor C, -); + /// A break statement. + static const int CXCursor_BreakStmt = 213; -typedef Native_clang_getEnumConstantDeclValue = ffi.Int64 Function( - CXCursor C, -); + /// A return statement. + static const int CXCursor_ReturnStmt = 214; -typedef _dart_clang_getEnumConstantDeclValue = int Function( - CXCursor C, -); + /// A GCC inline assembly statement extension. + static const int CXCursor_GCCAsmStmt = 215; + static const int CXCursor_AsmStmt = 215; -typedef Native_clang_getEnumConstantDeclUnsignedValue = ffi.Uint64 Function( - CXCursor C, -); + /// Objective-C's overall \@try-\@catch-\@finally statement. + static const int CXCursor_ObjCAtTryStmt = 216; -typedef _dart_clang_getEnumConstantDeclUnsignedValue = int Function( - CXCursor C, -); + /// Objective-C's \@catch statement. + static const int CXCursor_ObjCAtCatchStmt = 217; -typedef Native_clang_getFieldDeclBitWidth = ffi.Int32 Function( - CXCursor C, -); + /// Objective-C's \@finally statement. + static const int CXCursor_ObjCAtFinallyStmt = 218; -typedef _dart_clang_getFieldDeclBitWidth = int Function( - CXCursor C, -); + /// Objective-C's \@throw statement. + static const int CXCursor_ObjCAtThrowStmt = 219; -typedef Native_clang_Cursor_getNumArguments = ffi.Int32 Function( - CXCursor C, -); + /// Objective-C's \@synchronized statement. + static const int CXCursor_ObjCAtSynchronizedStmt = 220; -typedef _dart_clang_Cursor_getNumArguments = int Function( - CXCursor C, -); + /// Objective-C's autorelease pool statement. + static const int CXCursor_ObjCAutoreleasePoolStmt = 221; -typedef Native_clang_Cursor_getArgument = CXCursor Function( - CXCursor C, - ffi.Uint32 i, -); + /// Objective-C's collection statement. + static const int CXCursor_ObjCForCollectionStmt = 222; -typedef _dart_clang_Cursor_getArgument = CXCursor Function( - CXCursor C, - int i, -); + /// C++'s catch statement. + static const int CXCursor_CXXCatchStmt = 223; -typedef Native_clang_Cursor_getNumTemplateArguments = ffi.Int32 Function( - CXCursor C, -); + /// C++'s try statement. + static const int CXCursor_CXXTryStmt = 224; -typedef _dart_clang_Cursor_getNumTemplateArguments = int Function( - CXCursor C, -); + /// C++'s for (* : *) statement. + static const int CXCursor_CXXForRangeStmt = 225; -typedef Native_clang_Cursor_getTemplateArgumentKind = ffi.Int32 Function( - CXCursor C, - ffi.Uint32 I, -); + /// Windows Structured Exception Handling's try statement. + static const int CXCursor_SEHTryStmt = 226; -typedef _dart_clang_Cursor_getTemplateArgumentKind = int Function( - CXCursor C, - int I, -); + /// Windows Structured Exception Handling's except statement. + static const int CXCursor_SEHExceptStmt = 227; -typedef Native_clang_Cursor_getTemplateArgumentType = CXType Function( - CXCursor C, - ffi.Uint32 I, -); + /// Windows Structured Exception Handling's finally statement. + static const int CXCursor_SEHFinallyStmt = 228; -typedef _dart_clang_Cursor_getTemplateArgumentType = CXType Function( - CXCursor C, - int I, -); + /// A MS inline assembly statement extension. + static const int CXCursor_MSAsmStmt = 229; -typedef Native_clang_Cursor_getTemplateArgumentValue = ffi.Int64 Function( - CXCursor C, - ffi.Uint32 I, -); + /// The null statement ";": C99 6.8.3p3. + /// + /// This cursor kind is used to describe the null statement. + static const int CXCursor_NullStmt = 230; -typedef _dart_clang_Cursor_getTemplateArgumentValue = int Function( - CXCursor C, - int I, -); + /// Adaptor class for mixing declarations with statements and + /// expressions. + static const int CXCursor_DeclStmt = 231; -typedef Native_clang_Cursor_getTemplateArgumentUnsignedValue = ffi.Uint64 - Function( - CXCursor C, - ffi.Uint32 I, -); - -typedef _dart_clang_Cursor_getTemplateArgumentUnsignedValue = int Function( - CXCursor C, - int I, -); - -typedef Native_clang_equalTypes = ffi.Uint32 Function( - CXType A, - CXType B, -); - -typedef _dart_clang_equalTypes = int Function( - CXType A, - CXType B, -); - -typedef Native_clang_getCanonicalType = CXType Function( - CXType T, -); - -typedef _dart_clang_getCanonicalType = CXType Function( - CXType T, -); - -typedef Native_clang_isConstQualifiedType = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_isConstQualifiedType = int Function( - CXType T, -); + /// OpenMP parallel directive. + static const int CXCursor_OMPParallelDirective = 232; -typedef Native_clang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( - CXCursor C, -); + /// OpenMP SIMD directive. + static const int CXCursor_OMPSimdDirective = 233; -typedef _dart_clang_Cursor_isMacroFunctionLike = int Function( - CXCursor C, -); + /// OpenMP for directive. + static const int CXCursor_OMPForDirective = 234; -typedef Native_clang_Cursor_isMacroBuiltin = ffi.Uint32 Function( - CXCursor C, -); + /// OpenMP sections directive. + static const int CXCursor_OMPSectionsDirective = 235; -typedef _dart_clang_Cursor_isMacroBuiltin = int Function( - CXCursor C, -); + /// OpenMP section directive. + static const int CXCursor_OMPSectionDirective = 236; -typedef Native_clang_Cursor_isFunctionInlined = ffi.Uint32 Function( - CXCursor C, -); + /// OpenMP single directive. + static const int CXCursor_OMPSingleDirective = 237; -typedef _dart_clang_Cursor_isFunctionInlined = int Function( - CXCursor C, -); + /// OpenMP parallel for directive. + static const int CXCursor_OMPParallelForDirective = 238; -typedef Native_clang_isVolatileQualifiedType = ffi.Uint32 Function( - CXType T, -); + /// OpenMP parallel sections directive. + static const int CXCursor_OMPParallelSectionsDirective = 239; -typedef _dart_clang_isVolatileQualifiedType = int Function( - CXType T, -); + /// OpenMP task directive. + static const int CXCursor_OMPTaskDirective = 240; -typedef Native_clang_isRestrictQualifiedType = ffi.Uint32 Function( - CXType T, -); + /// OpenMP master directive. + static const int CXCursor_OMPMasterDirective = 241; -typedef _dart_clang_isRestrictQualifiedType = int Function( - CXType T, -); + /// OpenMP critical directive. + static const int CXCursor_OMPCriticalDirective = 242; -typedef Native_clang_getAddressSpace = ffi.Uint32 Function( - CXType T, -); + /// OpenMP taskyield directive. + static const int CXCursor_OMPTaskyieldDirective = 243; -typedef _dart_clang_getAddressSpace = int Function( - CXType T, -); + /// OpenMP barrier directive. + static const int CXCursor_OMPBarrierDirective = 244; -typedef Native_clang_getTypedefName = CXString Function( - CXType CT, -); + /// OpenMP taskwait directive. + static const int CXCursor_OMPTaskwaitDirective = 245; -typedef _dart_clang_getTypedefName = CXString Function( - CXType CT, -); + /// OpenMP flush directive. + static const int CXCursor_OMPFlushDirective = 246; -typedef Native_clang_getPointeeType = CXType Function( - CXType T, -); + /// Windows Structured Exception Handling's leave statement. + static const int CXCursor_SEHLeaveStmt = 247; -typedef _dart_clang_getPointeeType = CXType Function( - CXType T, -); + /// OpenMP ordered directive. + static const int CXCursor_OMPOrderedDirective = 248; -typedef Native_clang_getTypeDeclaration = CXCursor Function( - CXType T, -); + /// OpenMP atomic directive. + static const int CXCursor_OMPAtomicDirective = 249; -typedef _dart_clang_getTypeDeclaration = CXCursor Function( - CXType T, -); + /// OpenMP for SIMD directive. + static const int CXCursor_OMPForSimdDirective = 250; -typedef Native_clang_getDeclObjCTypeEncoding = CXString Function( - CXCursor C, -); + /// OpenMP parallel for SIMD directive. + static const int CXCursor_OMPParallelForSimdDirective = 251; -typedef _dart_clang_getDeclObjCTypeEncoding = CXString Function( - CXCursor C, -); + /// OpenMP target directive. + static const int CXCursor_OMPTargetDirective = 252; -typedef Native_clang_Type_getObjCEncoding = CXString Function( - CXType type, -); + /// OpenMP teams directive. + static const int CXCursor_OMPTeamsDirective = 253; -typedef _dart_clang_Type_getObjCEncoding = CXString Function( - CXType type, -); + /// OpenMP taskgroup directive. + static const int CXCursor_OMPTaskgroupDirective = 254; -typedef Native_clang_getTypeKindSpelling = CXString Function( - ffi.Int32 K, -); + /// OpenMP cancellation point directive. + static const int CXCursor_OMPCancellationPointDirective = 255; -typedef _dart_clang_getTypeKindSpelling = CXString Function( - int K, -); + /// OpenMP cancel directive. + static const int CXCursor_OMPCancelDirective = 256; -typedef Native_clang_getFunctionTypeCallingConv = ffi.Int32 Function( - CXType T, -); + /// OpenMP target data directive. + static const int CXCursor_OMPTargetDataDirective = 257; -typedef _dart_clang_getFunctionTypeCallingConv = int Function( - CXType T, -); + /// OpenMP taskloop directive. + static const int CXCursor_OMPTaskLoopDirective = 258; -typedef Native_clang_getResultType = CXType Function( - CXType T, -); + /// OpenMP taskloop simd directive. + static const int CXCursor_OMPTaskLoopSimdDirective = 259; -typedef _dart_clang_getResultType = CXType Function( - CXType T, -); + /// OpenMP distribute directive. + static const int CXCursor_OMPDistributeDirective = 260; -typedef Native_clang_getExceptionSpecificationType = ffi.Int32 Function( - CXType T, -); + /// OpenMP target enter data directive. + static const int CXCursor_OMPTargetEnterDataDirective = 261; -typedef _dart_clang_getExceptionSpecificationType = int Function( - CXType T, -); + /// OpenMP target exit data directive. + static const int CXCursor_OMPTargetExitDataDirective = 262; -typedef Native_clang_getNumArgTypes = ffi.Int32 Function( - CXType T, -); + /// OpenMP target parallel directive. + static const int CXCursor_OMPTargetParallelDirective = 263; -typedef _dart_clang_getNumArgTypes = int Function( - CXType T, -); + /// OpenMP target parallel for directive. + static const int CXCursor_OMPTargetParallelForDirective = 264; -typedef Native_clang_getArgType = CXType Function( - CXType T, - ffi.Uint32 i, -); + /// OpenMP target update directive. + static const int CXCursor_OMPTargetUpdateDirective = 265; -typedef _dart_clang_getArgType = CXType Function( - CXType T, - int i, -); + /// OpenMP distribute parallel for directive. + static const int CXCursor_OMPDistributeParallelForDirective = 266; -typedef Native_clang_Type_getObjCObjectBaseType = CXType Function( - CXType T, -); + /// OpenMP distribute parallel for simd directive. + static const int CXCursor_OMPDistributeParallelForSimdDirective = 267; -typedef _dart_clang_Type_getObjCObjectBaseType = CXType Function( - CXType T, -); + /// OpenMP distribute simd directive. + static const int CXCursor_OMPDistributeSimdDirective = 268; -typedef Native_clang_Type_getNumObjCProtocolRefs = ffi.Uint32 Function( - CXType T, -); + /// OpenMP target parallel for simd directive. + static const int CXCursor_OMPTargetParallelForSimdDirective = 269; -typedef _dart_clang_Type_getNumObjCProtocolRefs = int Function( - CXType T, -); + /// OpenMP target simd directive. + static const int CXCursor_OMPTargetSimdDirective = 270; -typedef Native_clang_Type_getObjCProtocolDecl = CXCursor Function( - CXType T, - ffi.Uint32 i, -); + /// OpenMP teams distribute directive. + static const int CXCursor_OMPTeamsDistributeDirective = 271; -typedef _dart_clang_Type_getObjCProtocolDecl = CXCursor Function( - CXType T, - int i, -); + /// OpenMP teams distribute simd directive. + static const int CXCursor_OMPTeamsDistributeSimdDirective = 272; -typedef Native_clang_Type_getNumObjCTypeArgs = ffi.Uint32 Function( - CXType T, -); + /// OpenMP teams distribute parallel for simd directive. + static const int CXCursor_OMPTeamsDistributeParallelForSimdDirective = 273; -typedef _dart_clang_Type_getNumObjCTypeArgs = int Function( - CXType T, -); + /// OpenMP teams distribute parallel for directive. + static const int CXCursor_OMPTeamsDistributeParallelForDirective = 274; -typedef Native_clang_Type_getObjCTypeArg = CXType Function( - CXType T, - ffi.Uint32 i, -); + /// OpenMP target teams directive. + static const int CXCursor_OMPTargetTeamsDirective = 275; -typedef _dart_clang_Type_getObjCTypeArg = CXType Function( - CXType T, - int i, -); + /// OpenMP target teams distribute directive. + static const int CXCursor_OMPTargetTeamsDistributeDirective = 276; -typedef Native_clang_isFunctionTypeVariadic = ffi.Uint32 Function( - CXType T, -); + /// OpenMP target teams distribute parallel for directive. + static const int CXCursor_OMPTargetTeamsDistributeParallelForDirective = 277; -typedef _dart_clang_isFunctionTypeVariadic = int Function( - CXType T, -); + /// OpenMP target teams distribute parallel for simd directive. + static const int CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective = + 278; -typedef Native_clang_getCursorResultType = CXType Function( - CXCursor C, -); + /// OpenMP target teams distribute simd directive. + static const int CXCursor_OMPTargetTeamsDistributeSimdDirective = 279; -typedef _dart_clang_getCursorResultType = CXType Function( - CXCursor C, -); + /// C++2a std::bit_cast expression. + static const int CXCursor_BuiltinBitCastExpr = 280; -typedef Native_clang_getCursorExceptionSpecificationType = ffi.Int32 Function( - CXCursor C, -); + /// OpenMP master taskloop directive. + static const int CXCursor_OMPMasterTaskLoopDirective = 281; -typedef _dart_clang_getCursorExceptionSpecificationType = int Function( - CXCursor C, -); + /// OpenMP parallel master taskloop directive. + static const int CXCursor_OMPParallelMasterTaskLoopDirective = 282; -typedef Native_clang_isPODType = ffi.Uint32 Function( - CXType T, -); + /// OpenMP master taskloop simd directive. + static const int CXCursor_OMPMasterTaskLoopSimdDirective = 283; -typedef _dart_clang_isPODType = int Function( - CXType T, -); + /// OpenMP parallel master taskloop simd directive. + static const int CXCursor_OMPParallelMasterTaskLoopSimdDirective = 284; -typedef Native_clang_getElementType = CXType Function( - CXType T, -); + /// OpenMP parallel master directive. + static const int CXCursor_OMPParallelMasterDirective = 285; + static const int CXCursor_LastStmt = 285; -typedef _dart_clang_getElementType = CXType Function( - CXType T, -); + /// Cursor that represents the translation unit itself. + /// + /// The translation unit cursor exists primarily to act as the root + /// cursor for traversing the contents of a translation unit. + static const int CXCursor_TranslationUnit = 300; + static const int CXCursor_FirstAttr = 400; -typedef Native_clang_getNumElements = ffi.Int64 Function( - CXType T, -); + /// An attribute whose specific kind is not exposed via this + /// interface. + static const int CXCursor_UnexposedAttr = 400; + static const int CXCursor_IBActionAttr = 401; + static const int CXCursor_IBOutletAttr = 402; + static const int CXCursor_IBOutletCollectionAttr = 403; + static const int CXCursor_CXXFinalAttr = 404; + static const int CXCursor_CXXOverrideAttr = 405; + static const int CXCursor_AnnotateAttr = 406; + static const int CXCursor_AsmLabelAttr = 407; + static const int CXCursor_PackedAttr = 408; + static const int CXCursor_PureAttr = 409; + static const int CXCursor_ConstAttr = 410; + static const int CXCursor_NoDuplicateAttr = 411; + static const int CXCursor_CUDAConstantAttr = 412; + static const int CXCursor_CUDADeviceAttr = 413; + static const int CXCursor_CUDAGlobalAttr = 414; + static const int CXCursor_CUDAHostAttr = 415; + static const int CXCursor_CUDASharedAttr = 416; + static const int CXCursor_VisibilityAttr = 417; + static const int CXCursor_DLLExport = 418; + static const int CXCursor_DLLImport = 419; + static const int CXCursor_NSReturnsRetained = 420; + static const int CXCursor_NSReturnsNotRetained = 421; + static const int CXCursor_NSReturnsAutoreleased = 422; + static const int CXCursor_NSConsumesSelf = 423; + static const int CXCursor_NSConsumed = 424; + static const int CXCursor_ObjCException = 425; + static const int CXCursor_ObjCNSObject = 426; + static const int CXCursor_ObjCIndependentClass = 427; + static const int CXCursor_ObjCPreciseLifetime = 428; + static const int CXCursor_ObjCReturnsInnerPointer = 429; + static const int CXCursor_ObjCRequiresSuper = 430; + static const int CXCursor_ObjCRootClass = 431; + static const int CXCursor_ObjCSubclassingRestricted = 432; + static const int CXCursor_ObjCExplicitProtocolImpl = 433; + static const int CXCursor_ObjCDesignatedInitializer = 434; + static const int CXCursor_ObjCRuntimeVisible = 435; + static const int CXCursor_ObjCBoxable = 436; + static const int CXCursor_FlagEnum = 437; + static const int CXCursor_ConvergentAttr = 438; + static const int CXCursor_WarnUnusedAttr = 439; + static const int CXCursor_WarnUnusedResultAttr = 440; + static const int CXCursor_AlignedAttr = 441; + static const int CXCursor_LastAttr = 441; + static const int CXCursor_PreprocessingDirective = 500; + static const int CXCursor_MacroDefinition = 501; + static const int CXCursor_MacroExpansion = 502; + static const int CXCursor_MacroInstantiation = 502; + static const int CXCursor_InclusionDirective = 503; + static const int CXCursor_FirstPreprocessing = 500; + static const int CXCursor_LastPreprocessing = 503; + + /// A module import declaration. + static const int CXCursor_ModuleImportDecl = 600; + static const int CXCursor_TypeAliasTemplateDecl = 601; + + /// A static_assert or _Static_assert node + static const int CXCursor_StaticAssert = 602; + + /// a friend declaration. + static const int CXCursor_FriendDecl = 603; + static const int CXCursor_FirstExtraDecl = 600; + static const int CXCursor_LastExtraDecl = 603; + + /// A code completion overload candidate. + static const int CXCursor_OverloadCandidate = 700; +} -typedef _dart_clang_getNumElements = int Function( - CXType T, -); +typedef Native_clang_getNullCursor = CXCursor Function(); +typedef Native_clang_getTranslationUnitCursor = CXCursor Function( + CXTranslationUnit arg0); +typedef Native_clang_equalCursors = ffi.Uint32 Function( + CXCursor arg0, CXCursor arg1); +typedef Native_clang_Cursor_isNull = ffi.Int32 Function(CXCursor cursor); +typedef Native_clang_hashCursor = ffi.Uint32 Function(CXCursor arg0); +typedef Native_clang_getCursorKind = ffi.Int32 Function(CXCursor arg0); +typedef Native_clang_isDeclaration = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_isInvalidDeclaration = ffi.Uint32 Function(CXCursor arg0); +typedef Native_clang_isReference = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_isExpression = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_isStatement = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_isAttribute = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_Cursor_hasAttrs = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_isInvalid = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_isTranslationUnit = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_isPreprocessing = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_isUnexposed = ffi.Uint32 Function(ffi.Int32 arg0); +typedef Native_clang_getCursorLinkage = ffi.Int32 Function(CXCursor cursor); + +/// Describe the linkage of the entity referred to by a cursor. +abstract class CXLinkageKind { + /// This value indicates that no linkage information is available + /// for a provided CXCursor. + static const int CXLinkage_Invalid = 0; + + /// This is the linkage for variables, parameters, and so on that + /// have automatic storage. This covers normal (non-extern) local variables. + static const int CXLinkage_NoLinkage = 1; + + /// This is the linkage for static variables and static functions. + static const int CXLinkage_Internal = 2; + + /// This is the linkage for entities with external linkage that live + /// in C++ anonymous namespaces. + static const int CXLinkage_UniqueExternal = 3; + + /// This is the linkage for entities with true, external linkage. + static const int CXLinkage_External = 4; +} -typedef Native_clang_getArrayElementType = CXType Function( - CXType T, -); +typedef Native_clang_getCursorVisibility = ffi.Int32 Function(CXCursor cursor); -typedef _dart_clang_getArrayElementType = CXType Function( - CXType T, -); +abstract class CXVisibilityKind { + /// This value indicates that no visibility information is available + /// for a provided CXCursor. + static const int CXVisibility_Invalid = 0; -typedef Native_clang_getArraySize = ffi.Int64 Function( - CXType T, -); + /// Symbol not seen by the linker. + static const int CXVisibility_Hidden = 1; -typedef _dart_clang_getArraySize = int Function( - CXType T, -); + /// Symbol seen by the linker but resolves to a symbol inside this object. + static const int CXVisibility_Protected = 2; -typedef Native_clang_Type_getNamedType = CXType Function( - CXType T, -); + /// Symbol seen by the linker and acts like a normal symbol. + static const int CXVisibility_Default = 3; +} -typedef _dart_clang_Type_getNamedType = CXType Function( - CXType T, -); +typedef Native_clang_getCursorAvailability = ffi.Int32 Function( + CXCursor cursor); -typedef Native_clang_Type_isTransparentTagTypedef = ffi.Uint32 Function( - CXType T, -); +/// Describes the availability of a particular entity, which indicates +/// whether the use of this entity will result in a warning or error due to +/// it being deprecated or unavailable. +abstract class CXAvailabilityKind { + /// The entity is available. + static const int CXAvailability_Available = 0; -typedef _dart_clang_Type_isTransparentTagTypedef = int Function( - CXType T, -); + /// The entity is available, but has been deprecated (and its use is + /// not recommended). + static const int CXAvailability_Deprecated = 1; -typedef Native_clang_Type_getNullability = ffi.Int32 Function( - CXType T, -); + /// The entity is not available; any use of it will be an error. + static const int CXAvailability_NotAvailable = 2; -typedef _dart_clang_Type_getNullability = int Function( - CXType T, -); + /// The entity is available, but not accessible; any use of it will be + /// an error. + static const int CXAvailability_NotAccessible = 3; +} -typedef Native_clang_Type_getAlignOf = ffi.Int64 Function( - CXType T, -); +/// Describes the availability of a given entity on a particular platform, e.g., +/// a particular class might only be available on Mac OS 10.7 or newer. +class CXPlatformAvailability extends ffi.Struct { + /// A string that describes the platform for which this structure + /// provides availability information. + /// + /// Possible values are "ios" or "macos". + external CXString Platform; -typedef _dart_clang_Type_getAlignOf = int Function( - CXType T, -); + /// The version number in which this entity was introduced. + external CXVersion Introduced; -typedef Native_clang_Type_getClassType = CXType Function( - CXType T, -); + /// The version number in which this entity was deprecated (but is + /// still available). + external CXVersion Deprecated; -typedef _dart_clang_Type_getClassType = CXType Function( - CXType T, -); + /// The version number in which this entity was obsoleted, and therefore + /// is no longer available. + external CXVersion Obsoleted; -typedef Native_clang_Type_getSizeOf = ffi.Int64 Function( - CXType T, -); + /// Whether the entity is unconditionally unavailable on this platform. + @ffi.Int32() + external int Unavailable; -typedef _dart_clang_Type_getSizeOf = int Function( - CXType T, -); + /// An optional message to provide to a user of this API, e.g., to + /// suggest replacement APIs. + external CXString Message; +} -typedef Native_clang_Type_getOffsetOf = ffi.Int64 Function( - CXType T, - ffi.Pointer S, -); +typedef Native_clang_getCursorPlatformAvailability = ffi.Int32 Function( + CXCursor cursor, + ffi.Pointer always_deprecated, + ffi.Pointer deprecated_message, + ffi.Pointer always_unavailable, + ffi.Pointer unavailable_message, + ffi.Pointer availability, + ffi.Int32 availability_size); +typedef Native_clang_disposeCXPlatformAvailability = ffi.Void Function( + ffi.Pointer availability); +typedef Native_clang_getCursorLanguage = ffi.Int32 Function(CXCursor cursor); + +/// Describe the "language" of the entity referred to by a cursor. +abstract class CXLanguageKind { + static const int CXLanguage_Invalid = 0; + static const int CXLanguage_C = 1; + static const int CXLanguage_ObjC = 2; + static const int CXLanguage_CPlusPlus = 3; +} -typedef _dart_clang_Type_getOffsetOf = int Function( - CXType T, - ffi.Pointer S, -); +typedef Native_clang_getCursorTLSKind = ffi.Int32 Function(CXCursor cursor); -typedef Native_clang_Type_getModifiedType = CXType Function( - CXType T, -); +/// Describe the "thread-local storage (TLS) kind" of the declaration +/// referred to by a cursor. +abstract class CXTLSKind { + static const int CXTLS_None = 0; + static const int CXTLS_Dynamic = 1; + static const int CXTLS_Static = 2; +} -typedef _dart_clang_Type_getModifiedType = CXType Function( - CXType T, -); +typedef Native_clang_Cursor_getTranslationUnit = CXTranslationUnit Function( + CXCursor arg0); -typedef Native_clang_Cursor_getOffsetOfField = ffi.Int64 Function( - CXCursor C, -); +class CXCursorSetImpl extends ffi.Opaque {} -typedef _dart_clang_Cursor_getOffsetOfField = int Function( - CXCursor C, -); +typedef Native_clang_createCXCursorSet = CXCursorSet Function(); -typedef Native_clang_Cursor_isAnonymous = ffi.Uint32 Function( - CXCursor C, -); +/// A fast container representing a set of CXCursors. +typedef CXCursorSet = ffi.Pointer; +typedef Native_clang_disposeCXCursorSet = ffi.Void Function(CXCursorSet cset); +typedef Native_clang_CXCursorSet_contains = ffi.Uint32 Function( + CXCursorSet cset, CXCursor cursor); +typedef Native_clang_CXCursorSet_insert = ffi.Uint32 Function( + CXCursorSet cset, CXCursor cursor); +typedef Native_clang_getCursorSemanticParent = CXCursor Function( + CXCursor cursor); +typedef Native_clang_getCursorLexicalParent = CXCursor Function( + CXCursor cursor); +typedef Native_clang_getOverriddenCursors = ffi.Void Function( + CXCursor cursor, + ffi.Pointer> overridden, + ffi.Pointer num_overridden); +typedef Native_clang_disposeOverriddenCursors = ffi.Void Function( + ffi.Pointer overridden); +typedef Native_clang_getIncludedFile = CXFile Function(CXCursor cursor); +typedef Native_clang_getCursor = CXCursor Function( + CXTranslationUnit arg0, CXSourceLocation arg1); +typedef Native_clang_getCursorLocation = CXSourceLocation Function( + CXCursor arg0); +typedef Native_clang_getCursorExtent = CXSourceRange Function(CXCursor arg0); -typedef _dart_clang_Cursor_isAnonymous = int Function( - CXCursor C, -); +/// Describes the kind of type +abstract class CXTypeKind { + /// Represents an invalid type (e.g., where no type is available). + static const int CXType_Invalid = 0; -typedef Native_clang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( - CXCursor C, -); + /// A type whose specific kind is not exposed via this + /// interface. + static const int CXType_Unexposed = 1; + static const int CXType_Void = 2; + static const int CXType_Bool = 3; + static const int CXType_Char_U = 4; + static const int CXType_UChar = 5; + static const int CXType_Char16 = 6; + static const int CXType_Char32 = 7; + static const int CXType_UShort = 8; + static const int CXType_UInt = 9; + static const int CXType_ULong = 10; + static const int CXType_ULongLong = 11; + static const int CXType_UInt128 = 12; + static const int CXType_Char_S = 13; + static const int CXType_SChar = 14; + static const int CXType_WChar = 15; + static const int CXType_Short = 16; + static const int CXType_Int = 17; + static const int CXType_Long = 18; + static const int CXType_LongLong = 19; + static const int CXType_Int128 = 20; + static const int CXType_Float = 21; + static const int CXType_Double = 22; + static const int CXType_LongDouble = 23; + static const int CXType_NullPtr = 24; + static const int CXType_Overload = 25; + static const int CXType_Dependent = 26; + static const int CXType_ObjCId = 27; + static const int CXType_ObjCClass = 28; + static const int CXType_ObjCSel = 29; + static const int CXType_Float128 = 30; + static const int CXType_Half = 31; + static const int CXType_Float16 = 32; + static const int CXType_ShortAccum = 33; + static const int CXType_Accum = 34; + static const int CXType_LongAccum = 35; + static const int CXType_UShortAccum = 36; + static const int CXType_UAccum = 37; + static const int CXType_ULongAccum = 38; + static const int CXType_FirstBuiltin = 2; + static const int CXType_LastBuiltin = 38; + static const int CXType_Complex = 100; + static const int CXType_Pointer = 101; + static const int CXType_BlockPointer = 102; + static const int CXType_LValueReference = 103; + static const int CXType_RValueReference = 104; + static const int CXType_Record = 105; + static const int CXType_Enum = 106; + static const int CXType_Typedef = 107; + static const int CXType_ObjCInterface = 108; + static const int CXType_ObjCObjectPointer = 109; + static const int CXType_FunctionNoProto = 110; + static const int CXType_FunctionProto = 111; + static const int CXType_ConstantArray = 112; + static const int CXType_Vector = 113; + static const int CXType_IncompleteArray = 114; + static const int CXType_VariableArray = 115; + static const int CXType_DependentSizedArray = 116; + static const int CXType_MemberPointer = 117; + static const int CXType_Auto = 118; -typedef _dart_clang_Cursor_isAnonymousRecordDecl = int Function( - CXCursor C, -); + /// Represents a type that was referred to using an elaborated type keyword. + /// + /// E.g., struct S, or via a qualified name, e.g., N::M::type, or both. + static const int CXType_Elaborated = 119; + static const int CXType_Pipe = 120; + static const int CXType_OCLImage1dRO = 121; + static const int CXType_OCLImage1dArrayRO = 122; + static const int CXType_OCLImage1dBufferRO = 123; + static const int CXType_OCLImage2dRO = 124; + static const int CXType_OCLImage2dArrayRO = 125; + static const int CXType_OCLImage2dDepthRO = 126; + static const int CXType_OCLImage2dArrayDepthRO = 127; + static const int CXType_OCLImage2dMSAARO = 128; + static const int CXType_OCLImage2dArrayMSAARO = 129; + static const int CXType_OCLImage2dMSAADepthRO = 130; + static const int CXType_OCLImage2dArrayMSAADepthRO = 131; + static const int CXType_OCLImage3dRO = 132; + static const int CXType_OCLImage1dWO = 133; + static const int CXType_OCLImage1dArrayWO = 134; + static const int CXType_OCLImage1dBufferWO = 135; + static const int CXType_OCLImage2dWO = 136; + static const int CXType_OCLImage2dArrayWO = 137; + static const int CXType_OCLImage2dDepthWO = 138; + static const int CXType_OCLImage2dArrayDepthWO = 139; + static const int CXType_OCLImage2dMSAAWO = 140; + static const int CXType_OCLImage2dArrayMSAAWO = 141; + static const int CXType_OCLImage2dMSAADepthWO = 142; + static const int CXType_OCLImage2dArrayMSAADepthWO = 143; + static const int CXType_OCLImage3dWO = 144; + static const int CXType_OCLImage1dRW = 145; + static const int CXType_OCLImage1dArrayRW = 146; + static const int CXType_OCLImage1dBufferRW = 147; + static const int CXType_OCLImage2dRW = 148; + static const int CXType_OCLImage2dArrayRW = 149; + static const int CXType_OCLImage2dDepthRW = 150; + static const int CXType_OCLImage2dArrayDepthRW = 151; + static const int CXType_OCLImage2dMSAARW = 152; + static const int CXType_OCLImage2dArrayMSAARW = 153; + static const int CXType_OCLImage2dMSAADepthRW = 154; + static const int CXType_OCLImage2dArrayMSAADepthRW = 155; + static const int CXType_OCLImage3dRW = 156; + static const int CXType_OCLSampler = 157; + static const int CXType_OCLEvent = 158; + static const int CXType_OCLQueue = 159; + static const int CXType_OCLReserveID = 160; + static const int CXType_ObjCObject = 161; + static const int CXType_ObjCTypeParam = 162; + static const int CXType_Attributed = 163; + static const int CXType_OCLIntelSubgroupAVCMcePayload = 164; + static const int CXType_OCLIntelSubgroupAVCImePayload = 165; + static const int CXType_OCLIntelSubgroupAVCRefPayload = 166; + static const int CXType_OCLIntelSubgroupAVCSicPayload = 167; + static const int CXType_OCLIntelSubgroupAVCMceResult = 168; + static const int CXType_OCLIntelSubgroupAVCImeResult = 169; + static const int CXType_OCLIntelSubgroupAVCRefResult = 170; + static const int CXType_OCLIntelSubgroupAVCSicResult = 171; + static const int CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout = 172; + static const int CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout = 173; + static const int CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174; + static const int CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175; + static const int CXType_ExtVector = 176; +} -typedef Native_clang_Cursor_isInlineNamespace = ffi.Uint32 Function( - CXCursor C, -); +/// The type of an element in the abstract syntax tree. +class CXType extends ffi.Struct { + @ffi.Int32() + external int kind; -typedef _dart_clang_Cursor_isInlineNamespace = int Function( - CXCursor C, -); + @ffi.Array.multi([2]) + external ffi.Array> data; +} -typedef Native_clang_Type_getNumTemplateArguments = ffi.Int32 Function( - CXType T, -); +typedef Native_clang_getCursorType = CXType Function(CXCursor C); +typedef Native_clang_getTypeSpelling = CXString Function(CXType CT); +typedef Native_clang_getTypedefDeclUnderlyingType = CXType Function(CXCursor C); +typedef Native_clang_getEnumDeclIntegerType = CXType Function(CXCursor C); +typedef Native_clang_getEnumConstantDeclValue = ffi.Int64 Function(CXCursor C); +typedef Native_clang_getEnumConstantDeclUnsignedValue = ffi.Uint64 Function( + CXCursor C); +typedef Native_clang_getFieldDeclBitWidth = ffi.Int32 Function(CXCursor C); +typedef Native_clang_Cursor_getNumArguments = ffi.Int32 Function(CXCursor C); +typedef Native_clang_Cursor_getArgument = CXCursor Function( + CXCursor C, ffi.Uint32 i); +typedef Native_clang_Cursor_getNumTemplateArguments = ffi.Int32 Function( + CXCursor C); +typedef Native_clang_Cursor_getTemplateArgumentKind = ffi.Int32 Function( + CXCursor C, ffi.Uint32 I); -typedef _dart_clang_Type_getNumTemplateArguments = int Function( - CXType T, -); +/// Describes the kind of a template argument. +/// +/// See the definition of llvm::clang::TemplateArgument::ArgKind for full +/// element descriptions. +abstract class CXTemplateArgumentKind { + static const int CXTemplateArgumentKind_Null = 0; + static const int CXTemplateArgumentKind_Type = 1; + static const int CXTemplateArgumentKind_Declaration = 2; + static const int CXTemplateArgumentKind_NullPtr = 3; + static const int CXTemplateArgumentKind_Integral = 4; + static const int CXTemplateArgumentKind_Template = 5; + static const int CXTemplateArgumentKind_TemplateExpansion = 6; + static const int CXTemplateArgumentKind_Expression = 7; + static const int CXTemplateArgumentKind_Pack = 8; + static const int CXTemplateArgumentKind_Invalid = 9; +} -typedef Native_clang_Type_getTemplateArgumentAsType = CXType Function( - CXType T, - ffi.Uint32 i, -); +typedef Native_clang_Cursor_getTemplateArgumentType = CXType Function( + CXCursor C, ffi.Uint32 I); +typedef Native_clang_Cursor_getTemplateArgumentValue = ffi.Int64 Function( + CXCursor C, ffi.Uint32 I); +typedef Native_clang_Cursor_getTemplateArgumentUnsignedValue = ffi.Uint64 + Function(CXCursor C, ffi.Uint32 I); +typedef Native_clang_equalTypes = ffi.Uint32 Function(CXType A, CXType B); +typedef Native_clang_getCanonicalType = CXType Function(CXType T); +typedef Native_clang_isConstQualifiedType = ffi.Uint32 Function(CXType T); +typedef Native_clang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( + CXCursor C); +typedef Native_clang_Cursor_isMacroBuiltin = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_Cursor_isFunctionInlined = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_isVolatileQualifiedType = ffi.Uint32 Function(CXType T); +typedef Native_clang_isRestrictQualifiedType = ffi.Uint32 Function(CXType T); +typedef Native_clang_getAddressSpace = ffi.Uint32 Function(CXType T); +typedef Native_clang_getTypedefName = CXString Function(CXType CT); +typedef Native_clang_getPointeeType = CXType Function(CXType T); +typedef Native_clang_getTypeDeclaration = CXCursor Function(CXType T); +typedef Native_clang_getDeclObjCTypeEncoding = CXString Function(CXCursor C); +typedef Native_clang_Type_getObjCEncoding = CXString Function(CXType type); +typedef Native_clang_getTypeKindSpelling = CXString Function(ffi.Int32 K); +typedef Native_clang_getFunctionTypeCallingConv = ffi.Int32 Function(CXType T); + +/// Describes the calling convention of a function type +abstract class CXCallingConv { + static const int CXCallingConv_Default = 0; + static const int CXCallingConv_C = 1; + static const int CXCallingConv_X86StdCall = 2; + static const int CXCallingConv_X86FastCall = 3; + static const int CXCallingConv_X86ThisCall = 4; + static const int CXCallingConv_X86Pascal = 5; + static const int CXCallingConv_AAPCS = 6; + static const int CXCallingConv_AAPCS_VFP = 7; + static const int CXCallingConv_X86RegCall = 8; + static const int CXCallingConv_IntelOclBicc = 9; + static const int CXCallingConv_Win64 = 10; + static const int CXCallingConv_X86_64Win64 = 10; + static const int CXCallingConv_X86_64SysV = 11; + static const int CXCallingConv_X86VectorCall = 12; + static const int CXCallingConv_Swift = 13; + static const int CXCallingConv_PreserveMost = 14; + static const int CXCallingConv_PreserveAll = 15; + static const int CXCallingConv_AArch64VectorCall = 16; + static const int CXCallingConv_Invalid = 100; + static const int CXCallingConv_Unexposed = 200; +} -typedef _dart_clang_Type_getTemplateArgumentAsType = CXType Function( - CXType T, - int i, -); +typedef Native_clang_getResultType = CXType Function(CXType T); +typedef Native_clang_getExceptionSpecificationType = ffi.Int32 Function( + CXType T); +typedef Native_clang_getNumArgTypes = ffi.Int32 Function(CXType T); +typedef Native_clang_getArgType = CXType Function(CXType T, ffi.Uint32 i); +typedef Native_clang_Type_getObjCObjectBaseType = CXType Function(CXType T); +typedef Native_clang_Type_getNumObjCProtocolRefs = ffi.Uint32 Function( + CXType T); +typedef Native_clang_Type_getObjCProtocolDecl = CXCursor Function( + CXType T, ffi.Uint32 i); +typedef Native_clang_Type_getNumObjCTypeArgs = ffi.Uint32 Function(CXType T); +typedef Native_clang_Type_getObjCTypeArg = CXType Function( + CXType T, ffi.Uint32 i); +typedef Native_clang_isFunctionTypeVariadic = ffi.Uint32 Function(CXType T); +typedef Native_clang_getCursorResultType = CXType Function(CXCursor C); +typedef Native_clang_getCursorExceptionSpecificationType = ffi.Int32 Function( + CXCursor C); +typedef Native_clang_isPODType = ffi.Uint32 Function(CXType T); +typedef Native_clang_getElementType = CXType Function(CXType T); +typedef Native_clang_getNumElements = ffi.Int64 Function(CXType T); +typedef Native_clang_getArrayElementType = CXType Function(CXType T); +typedef Native_clang_getArraySize = ffi.Int64 Function(CXType T); +typedef Native_clang_Type_getNamedType = CXType Function(CXType T); +typedef Native_clang_Type_isTransparentTagTypedef = ffi.Uint32 Function( + CXType T); +typedef Native_clang_Type_getNullability = ffi.Int32 Function(CXType T); -typedef Native_clang_Type_getCXXRefQualifier = ffi.Int32 Function( - CXType T, -); +abstract class CXTypeNullabilityKind { + /// Values of this type can never be null. + static const int CXTypeNullability_NonNull = 0; -typedef _dart_clang_Type_getCXXRefQualifier = int Function( - CXType T, -); + /// Values of this type can be null. + static const int CXTypeNullability_Nullable = 1; -typedef Native_clang_Cursor_isBitField = ffi.Uint32 Function( - CXCursor C, -); + /// Whether values of this type can be null is (explicitly) + /// unspecified. This captures a (fairly rare) case where we + /// can't conclude anything about the nullability of the type even + /// though it has been considered. + static const int CXTypeNullability_Unspecified = 2; -typedef _dart_clang_Cursor_isBitField = int Function( - CXCursor C, -); + /// Nullability is not applicable to this type. + static const int CXTypeNullability_Invalid = 3; +} -typedef Native_clang_isVirtualBase = ffi.Uint32 Function( - CXCursor arg0, -); +typedef Native_clang_Type_getAlignOf = ffi.Int64 Function(CXType T); +typedef Native_clang_Type_getClassType = CXType Function(CXType T); +typedef Native_clang_Type_getSizeOf = ffi.Int64 Function(CXType T); +typedef Native_clang_Type_getOffsetOf = ffi.Int64 Function( + CXType T, ffi.Pointer S); +typedef Native_clang_Type_getModifiedType = CXType Function(CXType T); +typedef Native_clang_Cursor_getOffsetOfField = ffi.Int64 Function(CXCursor C); +typedef Native_clang_Cursor_isAnonymous = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( + CXCursor C); +typedef Native_clang_Cursor_isInlineNamespace = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_Type_getNumTemplateArguments = ffi.Int32 Function( + CXType T); +typedef Native_clang_Type_getTemplateArgumentAsType = CXType Function( + CXType T, ffi.Uint32 i); +typedef Native_clang_Type_getCXXRefQualifier = ffi.Int32 Function(CXType T); -typedef _dart_clang_isVirtualBase = int Function( - CXCursor arg0, -); +abstract class CXRefQualifierKind { + /// No ref-qualifier was provided. + static const int CXRefQualifier_None = 0; -typedef Native_clang_getCXXAccessSpecifier = ffi.Int32 Function( - CXCursor arg0, -); + /// An lvalue ref-qualifier was provided (\c &). + static const int CXRefQualifier_LValue = 1; -typedef _dart_clang_getCXXAccessSpecifier = int Function( - CXCursor arg0, -); + /// An rvalue ref-qualifier was provided (\c &&). + static const int CXRefQualifier_RValue = 2; +} -typedef Native_clang_Cursor_getStorageClass = ffi.Int32 Function( - CXCursor arg0, -); +typedef Native_clang_Cursor_isBitField = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_isVirtualBase = ffi.Uint32 Function(CXCursor arg0); +typedef Native_clang_getCXXAccessSpecifier = ffi.Int32 Function(CXCursor arg0); + +/// Represents the C++ access control level to a base class for a +/// cursor with kind CX_CXXBaseSpecifier. +abstract class CX_CXXAccessSpecifier { + static const int CX_CXXInvalidAccessSpecifier = 0; + static const int CX_CXXPublic = 1; + static const int CX_CXXProtected = 2; + static const int CX_CXXPrivate = 3; +} -typedef _dart_clang_Cursor_getStorageClass = int Function( - CXCursor arg0, -); +typedef Native_clang_Cursor_getStorageClass = ffi.Int32 Function(CXCursor arg0); + +/// Represents the storage classes as declared in the source. CX_SC_Invalid +/// was added for the case that the passed cursor in not a declaration. +abstract class CX_StorageClass { + static const int CX_SC_Invalid = 0; + static const int CX_SC_None = 1; + static const int CX_SC_Extern = 2; + static const int CX_SC_Static = 3; + static const int CX_SC_PrivateExtern = 4; + static const int CX_SC_OpenCLWorkGroupLocal = 5; + static const int CX_SC_Auto = 6; + static const int CX_SC_Register = 7; +} typedef Native_clang_getNumOverloadedDecls = ffi.Uint32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getNumOverloadedDecls = int Function( - CXCursor cursor, -); - + CXCursor cursor); typedef Native_clang_getOverloadedDecl = CXCursor Function( - CXCursor cursor, - ffi.Uint32 index, -); - -typedef _dart_clang_getOverloadedDecl = CXCursor Function( - CXCursor cursor, - int index, -); - -typedef Native_clang_getIBOutletCollectionType = CXType Function( - CXCursor arg0, -); - -typedef _dart_clang_getIBOutletCollectionType = CXType Function( - CXCursor arg0, -); - -typedef CXCursorVisitor = ffi.Int32 Function( - CXCursor, - CXCursor, - ffi.Pointer, -); - + CXCursor cursor, ffi.Uint32 index); +typedef Native_clang_getIBOutletCollectionType = CXType Function(CXCursor arg0); typedef Native_clang_visitChildren = ffi.Uint32 Function( - CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _dart_clang_visitChildren = int Function( - CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); + CXCursor parent, CXCursorVisitor visitor, CXClientData client_data); -typedef Native_clang_getCursorUSR = CXString Function( - CXCursor arg0, -); +/// Visitor invoked for each cursor found by a traversal. +/// +/// This visitor function will be invoked for each cursor found by +/// clang_visitCursorChildren(). Its first argument is the cursor being +/// visited, its second argument is the parent visitor for that cursor, +/// and its third argument is the client data provided to +/// clang_visitCursorChildren(). +/// +/// The visitor should return one of the \c CXChildVisitResult values +/// to direct clang_visitCursorChildren(). +typedef CXCursorVisitor = ffi.Pointer< + ffi.NativeFunction>; -typedef _dart_clang_getCursorUSR = CXString Function( - CXCursor arg0, -); +/// Describes how the traversal of the children of a particular +/// cursor should proceed after visiting a particular child cursor. +/// +/// A value of this enumeration type should be returned by each +/// \c CXCursorVisitor to indicate how clang_visitChildren() proceed. +abstract class CXChildVisitResult { + /// Terminates the cursor traversal. + static const int CXChildVisit_Break = 0; + + /// Continues the cursor traversal with the next sibling of + /// the cursor just visited, without visiting its children. + static const int CXChildVisit_Continue = 1; + + /// Recursively traverse the children of this cursor, using + /// the same visitor and client data. + static const int CXChildVisit_Recurse = 2; +} +/// Opaque pointer representing client data that will be passed through +/// to various callbacks and visitors. +typedef CXClientData = ffi.Pointer; +typedef Native_clang_getCursorUSR = CXString Function(CXCursor arg0); typedef Native_clang_constructUSR_ObjCClass = CXString Function( - ffi.Pointer class_name, -); - -typedef _dart_clang_constructUSR_ObjCClass = CXString Function( - ffi.Pointer class_name, -); - + ffi.Pointer class_name); typedef Native_clang_constructUSR_ObjCCategory = CXString Function( - ffi.Pointer class_name, - ffi.Pointer category_name, -); - -typedef _dart_clang_constructUSR_ObjCCategory = CXString Function( - ffi.Pointer class_name, - ffi.Pointer category_name, -); - + ffi.Pointer class_name, ffi.Pointer category_name); typedef Native_clang_constructUSR_ObjCProtocol = CXString Function( - ffi.Pointer protocol_name, -); - -typedef _dart_clang_constructUSR_ObjCProtocol = CXString Function( - ffi.Pointer protocol_name, -); - + ffi.Pointer protocol_name); typedef Native_clang_constructUSR_ObjCIvar = CXString Function( - ffi.Pointer name, - CXString classUSR, -); - -typedef _dart_clang_constructUSR_ObjCIvar = CXString Function( - ffi.Pointer name, - CXString classUSR, -); - + ffi.Pointer name, CXString classUSR); typedef Native_clang_constructUSR_ObjCMethod = CXString Function( - ffi.Pointer name, - ffi.Uint32 isInstanceMethod, - CXString classUSR, -); - -typedef _dart_clang_constructUSR_ObjCMethod = CXString Function( - ffi.Pointer name, - int isInstanceMethod, - CXString classUSR, -); - + ffi.Pointer name, ffi.Uint32 isInstanceMethod, CXString classUSR); typedef Native_clang_constructUSR_ObjCProperty = CXString Function( - ffi.Pointer property, - CXString classUSR, -); - -typedef _dart_clang_constructUSR_ObjCProperty = CXString Function( - ffi.Pointer property, - CXString classUSR, -); - -typedef Native_clang_getCursorSpelling = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorSpelling = CXString Function( - CXCursor arg0, -); - + ffi.Pointer property, CXString classUSR); +typedef Native_clang_getCursorSpelling = CXString Function(CXCursor arg0); typedef Native_clang_Cursor_getSpellingNameRange = CXSourceRange Function( - CXCursor arg0, - ffi.Uint32 pieceIndex, - ffi.Uint32 options, -); - -typedef _dart_clang_Cursor_getSpellingNameRange = CXSourceRange Function( - CXCursor arg0, - int pieceIndex, - int options, -); - + CXCursor arg0, ffi.Uint32 pieceIndex, ffi.Uint32 options); typedef Native_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( - ffi.Pointer Policy, - ffi.Int32 Property, -); - -typedef _dart_clang_PrintingPolicy_getProperty = int Function( - ffi.Pointer Policy, - int Property, -); - -typedef Native_clang_PrintingPolicy_setProperty = ffi.Void Function( - ffi.Pointer Policy, - ffi.Int32 Property, - ffi.Uint32 Value, -); - -typedef _dart_clang_PrintingPolicy_setProperty = void Function( - ffi.Pointer Policy, - int Property, - int Value, -); + CXPrintingPolicy Policy, ffi.Int32 Property); -typedef Native_clang_getCursorPrintingPolicy = ffi.Pointer Function( - CXCursor arg0, -); +/// Opaque pointer representing a policy that controls pretty printing +/// for \c clang_getCursorPrettyPrinted. +typedef CXPrintingPolicy = ffi.Pointer; -typedef _dart_clang_getCursorPrintingPolicy = ffi.Pointer Function( - CXCursor arg0, -); +/// Properties for the printing policy. +/// +/// See \c clang::PrintingPolicy for more information. +abstract class CXPrintingPolicyProperty { + static const int CXPrintingPolicy_Indentation = 0; + static const int CXPrintingPolicy_SuppressSpecifiers = 1; + static const int CXPrintingPolicy_SuppressTagKeyword = 2; + static const int CXPrintingPolicy_IncludeTagDefinition = 3; + static const int CXPrintingPolicy_SuppressScope = 4; + static const int CXPrintingPolicy_SuppressUnwrittenScope = 5; + static const int CXPrintingPolicy_SuppressInitializers = 6; + static const int CXPrintingPolicy_ConstantArraySizeAsWritten = 7; + static const int CXPrintingPolicy_AnonymousTagLocations = 8; + static const int CXPrintingPolicy_SuppressStrongLifetime = 9; + static const int CXPrintingPolicy_SuppressLifetimeQualifiers = 10; + static const int CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors = 11; + static const int CXPrintingPolicy_Bool = 12; + static const int CXPrintingPolicy_Restrict = 13; + static const int CXPrintingPolicy_Alignof = 14; + static const int CXPrintingPolicy_UnderscoreAlignof = 15; + static const int CXPrintingPolicy_UseVoidForZeroParams = 16; + static const int CXPrintingPolicy_TerseOutput = 17; + static const int CXPrintingPolicy_PolishForDeclaration = 18; + static const int CXPrintingPolicy_Half = 19; + static const int CXPrintingPolicy_MSWChar = 20; + static const int CXPrintingPolicy_IncludeNewlines = 21; + static const int CXPrintingPolicy_MSVCFormatting = 22; + static const int CXPrintingPolicy_ConstantsAsWritten = 23; + static const int CXPrintingPolicy_SuppressImplicitBase = 24; + static const int CXPrintingPolicy_FullyQualifiedName = 25; + static const int CXPrintingPolicy_LastProperty = 25; +} +typedef Native_clang_PrintingPolicy_setProperty = ffi.Void Function( + CXPrintingPolicy Policy, ffi.Int32 Property, ffi.Uint32 Value); +typedef Native_clang_getCursorPrintingPolicy = CXPrintingPolicy Function( + CXCursor arg0); typedef Native_clang_PrintingPolicy_dispose = ffi.Void Function( - ffi.Pointer Policy, -); - -typedef _dart_clang_PrintingPolicy_dispose = void Function( - ffi.Pointer Policy, -); - + CXPrintingPolicy Policy); typedef Native_clang_getCursorPrettyPrinted = CXString Function( - CXCursor Cursor, - ffi.Pointer Policy, -); - -typedef _dart_clang_getCursorPrettyPrinted = CXString Function( - CXCursor Cursor, - ffi.Pointer Policy, -); - -typedef Native_clang_getCursorDisplayName = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorDisplayName = CXString Function( - CXCursor arg0, -); - -typedef Native_clang_getCursorReferenced = CXCursor Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorReferenced = CXCursor Function( - CXCursor arg0, -); - -typedef Native_clang_getCursorDefinition = CXCursor Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorDefinition = CXCursor Function( - CXCursor arg0, -); - -typedef Native_clang_isCursorDefinition = ffi.Uint32 Function( - CXCursor arg0, -); - -typedef _dart_clang_isCursorDefinition = int Function( - CXCursor arg0, -); - -typedef Native_clang_getCanonicalCursor = CXCursor Function( - CXCursor arg0, -); - -typedef _dart_clang_getCanonicalCursor = CXCursor Function( - CXCursor arg0, -); - + CXCursor Cursor, CXPrintingPolicy Policy); +typedef Native_clang_getCursorDisplayName = CXString Function(CXCursor arg0); +typedef Native_clang_getCursorReferenced = CXCursor Function(CXCursor arg0); +typedef Native_clang_getCursorDefinition = CXCursor Function(CXCursor arg0); +typedef Native_clang_isCursorDefinition = ffi.Uint32 Function(CXCursor arg0); +typedef Native_clang_getCanonicalCursor = CXCursor Function(CXCursor arg0); typedef Native_clang_Cursor_getObjCSelectorIndex = ffi.Int32 Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getObjCSelectorIndex = int Function( - CXCursor arg0, -); - -typedef Native_clang_Cursor_isDynamicCall = ffi.Int32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isDynamicCall = int Function( - CXCursor C, -); - -typedef Native_clang_Cursor_getReceiverType = CXType Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getReceiverType = CXType Function( - CXCursor C, -); - + CXCursor arg0); +typedef Native_clang_Cursor_isDynamicCall = ffi.Int32 Function(CXCursor C); +typedef Native_clang_Cursor_getReceiverType = CXType Function(CXCursor C); typedef Native_clang_Cursor_getObjCPropertyAttributes = ffi.Uint32 Function( - CXCursor C, - ffi.Uint32 reserved, -); - -typedef _dart_clang_Cursor_getObjCPropertyAttributes = int Function( - CXCursor C, - int reserved, -); - + CXCursor C, ffi.Uint32 reserved); typedef Native_clang_Cursor_getObjCPropertyGetterName = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getObjCPropertyGetterName = CXString Function( - CXCursor C, -); - + CXCursor C); typedef Native_clang_Cursor_getObjCPropertySetterName = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getObjCPropertySetterName = CXString Function( - CXCursor C, -); - + CXCursor C); typedef Native_clang_Cursor_getObjCDeclQualifiers = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getObjCDeclQualifiers = int Function( - CXCursor C, -); - -typedef Native_clang_Cursor_isObjCOptional = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isObjCOptional = int Function( - CXCursor C, -); - -typedef Native_clang_Cursor_isVariadic = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isVariadic = int Function( - CXCursor C, -); - + CXCursor C); +typedef Native_clang_Cursor_isObjCOptional = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_Cursor_isVariadic = ffi.Uint32 Function(CXCursor C); typedef Native_clang_Cursor_isExternalSymbol = ffi.Uint32 Function( - CXCursor C, - ffi.Pointer language, - ffi.Pointer definedIn, - ffi.Pointer isGenerated, -); - -typedef _dart_clang_Cursor_isExternalSymbol = int Function( - CXCursor C, - ffi.Pointer language, - ffi.Pointer definedIn, - ffi.Pointer isGenerated, -); - + CXCursor C, + ffi.Pointer language, + ffi.Pointer definedIn, + ffi.Pointer isGenerated); typedef Native_clang_Cursor_getCommentRange = CXSourceRange Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getCommentRange = CXSourceRange Function( - CXCursor C, -); - -typedef Native_clang_Cursor_getRawCommentText = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getRawCommentText = CXString Function( - CXCursor C, -); - -typedef Native_clang_Cursor_getBriefCommentText = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getBriefCommentText = CXString Function( - CXCursor C, -); - -typedef Native_clang_Cursor_getMangling = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getMangling = CXString Function( - CXCursor arg0, -); - + CXCursor C); +typedef Native_clang_Cursor_getRawCommentText = CXString Function(CXCursor C); +typedef Native_clang_Cursor_getBriefCommentText = CXString Function(CXCursor C); +typedef Native_clang_Cursor_getMangling = CXString Function(CXCursor arg0); typedef Native_clang_Cursor_getCXXManglings = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getCXXManglings = ffi.Pointer Function( - CXCursor arg0, -); - + CXCursor arg0); typedef Native_clang_Cursor_getObjCManglings = ffi.Pointer - Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getObjCManglings = ffi.Pointer Function( - CXCursor arg0, -); - -typedef Native_clang_Cursor_getModule = ffi.Pointer Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getModule = ffi.Pointer Function( - CXCursor C, -); - -typedef Native_clang_getModuleForFile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_clang_getModuleForFile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef Native_clang_Module_getASTFile = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getASTFile = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef Native_clang_Module_getParent = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getParent = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef Native_clang_Module_getName = CXString Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getName = CXString Function( - ffi.Pointer Module, -); - -typedef Native_clang_Module_getFullName = CXString Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getFullName = CXString Function( - ffi.Pointer Module, -); - -typedef Native_clang_Module_isSystem = ffi.Int32 Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_isSystem = int Function( - ffi.Pointer Module, -); + Function(CXCursor arg0); +typedef Native_clang_Cursor_getModule = CXModule Function(CXCursor C); +/// \defgroup CINDEX_MODULE Module introspection +/// +/// The functions in this group provide access to information about modules. +/// +/// @{ +typedef CXModule = ffi.Pointer; +typedef Native_clang_getModuleForFile = CXModule Function( + CXTranslationUnit arg0, CXFile arg1); +typedef Native_clang_Module_getASTFile = CXFile Function(CXModule Module); +typedef Native_clang_Module_getParent = CXModule Function(CXModule Module); +typedef Native_clang_Module_getName = CXString Function(CXModule Module); +typedef Native_clang_Module_getFullName = CXString Function(CXModule Module); +typedef Native_clang_Module_isSystem = ffi.Int32 Function(CXModule Module); typedef Native_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( - ffi.Pointer arg0, - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getNumTopLevelHeaders = int Function( - ffi.Pointer arg0, - ffi.Pointer Module, -); - -typedef Native_clang_Module_getTopLevelHeader = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer Module, - ffi.Uint32 Index, -); - -typedef _dart_clang_Module_getTopLevelHeader = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer Module, - int Index, -); - + CXTranslationUnit arg0, CXModule Module); +typedef Native_clang_Module_getTopLevelHeader = CXFile Function( + CXTranslationUnit arg0, CXModule Module, ffi.Uint32 Index); typedef Native_clang_CXXConstructor_isConvertingConstructor = ffi.Uint32 - Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isConvertingConstructor = int Function( - CXCursor C, -); - + Function(CXCursor C); typedef Native_clang_CXXConstructor_isCopyConstructor = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isCopyConstructor = int Function( - CXCursor C, -); - + CXCursor C); typedef Native_clang_CXXConstructor_isDefaultConstructor = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isDefaultConstructor = int Function( - CXCursor C, -); - + CXCursor C); typedef Native_clang_CXXConstructor_isMoveConstructor = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isMoveConstructor = int Function( - CXCursor C, -); - -typedef Native_clang_CXXField_isMutable = ffi.Uint32 Function( - CXCursor C, -); + CXCursor C); +typedef Native_clang_CXXField_isMutable = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_CXXMethod_isDefaulted = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_CXXMethod_isPureVirtual = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_CXXMethod_isStatic = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_CXXMethod_isVirtual = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_CXXRecord_isAbstract = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_EnumDecl_isScoped = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_CXXMethod_isConst = ffi.Uint32 Function(CXCursor C); +typedef Native_clang_getTemplateCursorKind = ffi.Int32 Function(CXCursor C); +typedef Native_clang_getSpecializedCursorTemplate = CXCursor Function( + CXCursor C); +typedef Native_clang_getCursorReferenceNameRange = CXSourceRange Function( + CXCursor C, ffi.Uint32 NameFlags, ffi.Uint32 PieceIndex); -typedef _dart_clang_CXXField_isMutable = int Function( - CXCursor C, -); +/// Describes a single preprocessing token. +class CXToken extends ffi.Struct { + @ffi.Array.multi([4]) + external ffi.Array int_data; -typedef Native_clang_CXXMethod_isDefaulted = ffi.Uint32 Function( - CXCursor C, -); + external ffi.Pointer ptr_data; +} -typedef _dart_clang_CXXMethod_isDefaulted = int Function( - CXCursor C, -); +typedef Native_clang_getToken = ffi.Pointer Function( + CXTranslationUnit TU, CXSourceLocation Location); +typedef Native_clang_getTokenKind = ffi.Int32 Function(CXToken arg0); -typedef Native_clang_CXXMethod_isPureVirtual = ffi.Uint32 Function( - CXCursor C, -); +/// Describes a kind of token. +abstract class CXTokenKind { + /// A token that contains some kind of punctuation. + static const int CXToken_Punctuation = 0; -typedef _dart_clang_CXXMethod_isPureVirtual = int Function( - CXCursor C, -); + /// A language keyword. + static const int CXToken_Keyword = 1; -typedef Native_clang_CXXMethod_isStatic = ffi.Uint32 Function( - CXCursor C, -); + /// An identifier (that is not a keyword). + static const int CXToken_Identifier = 2; -typedef _dart_clang_CXXMethod_isStatic = int Function( - CXCursor C, -); + /// A numeric, string, or character literal. + static const int CXToken_Literal = 3; -typedef Native_clang_CXXMethod_isVirtual = ffi.Uint32 Function( - CXCursor C, -); + /// A comment. + static const int CXToken_Comment = 4; +} -typedef _dart_clang_CXXMethod_isVirtual = int Function( - CXCursor C, -); +typedef Native_clang_getTokenSpelling = CXString Function( + CXTranslationUnit arg0, CXToken arg1); +typedef Native_clang_getTokenLocation = CXSourceLocation Function( + CXTranslationUnit arg0, CXToken arg1); +typedef Native_clang_getTokenExtent = CXSourceRange Function( + CXTranslationUnit arg0, CXToken arg1); +typedef Native_clang_tokenize = ffi.Void Function( + CXTranslationUnit TU, + CXSourceRange Range, + ffi.Pointer> Tokens, + ffi.Pointer NumTokens); +typedef Native_clang_annotateTokens = ffi.Void Function( + CXTranslationUnit TU, + ffi.Pointer Tokens, + ffi.Uint32 NumTokens, + ffi.Pointer Cursors); +typedef Native_clang_disposeTokens = ffi.Void Function( + CXTranslationUnit TU, ffi.Pointer Tokens, ffi.Uint32 NumTokens); +typedef Native_clang_getCursorKindSpelling = CXString Function(ffi.Int32 Kind); +typedef Native_clang_getDefinitionSpellingAndExtent = ffi.Void Function( + CXCursor arg0, + ffi.Pointer> startBuf, + ffi.Pointer> endBuf, + ffi.Pointer startLine, + ffi.Pointer startColumn, + ffi.Pointer endLine, + ffi.Pointer endColumn); +typedef Native_clang_enableStackTraces = ffi.Void Function(); +typedef Native_clang_executeOnThread = ffi.Void Function( + ffi.Pointer)>> + fn, + ffi.Pointer user_data, + ffi.Uint32 stack_size); -typedef Native_clang_CXXRecord_isAbstract = ffi.Uint32 Function( - CXCursor C, -); +/// A single result of code completion. +class CXCompletionResult extends ffi.Struct { + /// The kind of entity that this completion refers to. + /// + /// The cursor kind will be a macro, keyword, or a declaration (one of the + /// *Decl cursor kinds), describing the entity that the completion is + /// referring to. + /// + /// \todo In the future, we would like to provide a full cursor, to allow + /// the client to extract additional information from declaration. + @ffi.Int32() + external int CursorKind; -typedef _dart_clang_CXXRecord_isAbstract = int Function( - CXCursor C, -); + /// The code-completion string that describes how to insert this + /// code-completion result into the editing buffer. + external CXCompletionString CompletionString; +} -typedef Native_clang_EnumDecl_isScoped = ffi.Uint32 Function( - CXCursor C, -); +/// A semantic string that describes a code-completion result. +/// +/// A semantic string that describes the formatting of a code-completion +/// result as a single "template" of text that should be inserted into the +/// source buffer when a particular code-completion result is selected. +/// Each semantic string is made up of some number of "chunks", each of which +/// contains some text along with a description of what that text means, e.g., +/// the name of the entity being referenced, whether the text chunk is part of +/// the template, or whether it is a "placeholder" that the user should replace +/// with actual code,of a specific kind. See \c CXCompletionChunkKind for a +/// description of the different kinds of chunks. +typedef CXCompletionString = ffi.Pointer; +typedef Native_clang_getCompletionChunkKind = ffi.Int32 Function( + CXCompletionString completion_string, ffi.Uint32 chunk_number); -typedef _dart_clang_EnumDecl_isScoped = int Function( - CXCursor C, -); +/// Describes a single piece of text within a code-completion string. +/// +/// Each "chunk" within a code-completion string (\c CXCompletionString) is +/// either a piece of text with a specific "kind" that describes how that text +/// should be interpreted by the client or is another completion string. +abstract class CXCompletionChunkKind { + /// A code-completion string that describes "optional" text that + /// could be a part of the template (but is not required). + /// + /// The Optional chunk is the only kind of chunk that has a code-completion + /// string for its representation, which is accessible via + /// \c clang_getCompletionChunkCompletionString(). The code-completion string + /// describes an additional part of the template that is completely optional. + /// For example, optional chunks can be used to describe the placeholders for + /// arguments that match up with defaulted function parameters, e.g. given: + /// + /// \code + /// void f(int x, float y = 3.14, double z = 2.71828); + /// \endcode + /// + /// The code-completion string for this function would contain: + /// - a TypedText chunk for "f". + /// - a LeftParen chunk for "(". + /// - a Placeholder chunk for "int x" + /// - an Optional chunk containing the remaining defaulted arguments, e.g., + /// - a Comma chunk for "," + /// - a Placeholder chunk for "float y" + /// - an Optional chunk containing the last defaulted argument: + /// - a Comma chunk for "," + /// - a Placeholder chunk for "double z" + /// - a RightParen chunk for ")" + /// + /// There are many ways to handle Optional chunks. Two simple approaches are: + /// - Completely ignore optional chunks, in which case the template for the + /// function "f" would only include the first parameter ("int x"). + /// - Fully expand all optional chunks, in which case the template for the + /// function "f" would have all of the parameters. + static const int CXCompletionChunk_Optional = 0; + + /// Text that a user would be expected to type to get this + /// code-completion result. + /// + /// There will be exactly one "typed text" chunk in a semantic string, which + /// will typically provide the spelling of a keyword or the name of a + /// declaration that could be used at the current code point. Clients are + /// expected to filter the code-completion results based on the text in this + /// chunk. + static const int CXCompletionChunk_TypedText = 1; + + /// Text that should be inserted as part of a code-completion result. + /// + /// A "text" chunk represents text that is part of the template to be + /// inserted into user code should this particular code-completion result + /// be selected. + static const int CXCompletionChunk_Text = 2; + + /// Placeholder text that should be replaced by the user. + /// + /// A "placeholder" chunk marks a place where the user should insert text + /// into the code-completion template. For example, placeholders might mark + /// the function parameters for a function declaration, to indicate that the + /// user should provide arguments for each of those parameters. The actual + /// text in a placeholder is a suggestion for the text to display before + /// the user replaces the placeholder with real code. + static const int CXCompletionChunk_Placeholder = 3; + + /// Informative text that should be displayed but never inserted as + /// part of the template. + /// + /// An "informative" chunk contains annotations that can be displayed to + /// help the user decide whether a particular code-completion result is the + /// right option, but which is not part of the actual template to be inserted + /// by code completion. + static const int CXCompletionChunk_Informative = 4; + + /// Text that describes the current parameter when code-completion is + /// referring to function call, message send, or template specialization. + /// + /// A "current parameter" chunk occurs when code-completion is providing + /// information about a parameter corresponding to the argument at the + /// code-completion point. For example, given a function + /// + /// \code + /// int add(int x, int y); + /// \endcode + /// + /// and the source code \c add(, where the code-completion point is after the + /// "(", the code-completion string will contain a "current parameter" chunk + /// for "int x", indicating that the current argument will initialize that + /// parameter. After typing further, to \c add(17, (where the code-completion + /// point is after the ","), the code-completion string will contain a + /// "current parameter" chunk to "int y". + static const int CXCompletionChunk_CurrentParameter = 5; -typedef Native_clang_CXXMethod_isConst = ffi.Uint32 Function( - CXCursor C, -); + /// A left parenthesis ('('), used to initiate a function call or + /// signal the beginning of a function parameter list. + static const int CXCompletionChunk_LeftParen = 6; -typedef _dart_clang_CXXMethod_isConst = int Function( - CXCursor C, -); + /// A right parenthesis (')'), used to finish a function call or + /// signal the end of a function parameter list. + static const int CXCompletionChunk_RightParen = 7; -typedef Native_clang_getTemplateCursorKind = ffi.Int32 Function( - CXCursor C, -); + /// A left bracket ('['). + static const int CXCompletionChunk_LeftBracket = 8; -typedef _dart_clang_getTemplateCursorKind = int Function( - CXCursor C, -); + /// A right bracket (']'). + static const int CXCompletionChunk_RightBracket = 9; -typedef Native_clang_getSpecializedCursorTemplate = CXCursor Function( - CXCursor C, -); + /// A left brace ('{'). + static const int CXCompletionChunk_LeftBrace = 10; -typedef _dart_clang_getSpecializedCursorTemplate = CXCursor Function( - CXCursor C, -); + /// A right brace ('}'). + static const int CXCompletionChunk_RightBrace = 11; -typedef Native_clang_getCursorReferenceNameRange = CXSourceRange Function( - CXCursor C, - ffi.Uint32 NameFlags, - ffi.Uint32 PieceIndex, -); + /// A left angle bracket ('<'). + static const int CXCompletionChunk_LeftAngle = 12; -typedef _dart_clang_getCursorReferenceNameRange = CXSourceRange Function( - CXCursor C, - int NameFlags, - int PieceIndex, -); + /// A right angle bracket ('>'). + static const int CXCompletionChunk_RightAngle = 13; -typedef Native_clang_getToken = ffi.Pointer Function( - ffi.Pointer TU, - CXSourceLocation Location, -); + /// A comma separator (','). + static const int CXCompletionChunk_Comma = 14; -typedef _dart_clang_getToken = ffi.Pointer Function( - ffi.Pointer TU, - CXSourceLocation Location, -); + /// Text that specifies the result type of a given result. + /// + /// This special kind of informative chunk is not meant to be inserted into + /// the text buffer. Rather, it is meant to illustrate the type that an + /// expression using the given completion string would have. + static const int CXCompletionChunk_ResultType = 15; -typedef Native_clang_getTokenKind = ffi.Int32 Function( - CXToken arg0, -); + /// A colon (':'). + static const int CXCompletionChunk_Colon = 16; -typedef _dart_clang_getTokenKind = int Function( - CXToken arg0, -); + /// A semicolon (';'). + static const int CXCompletionChunk_SemiColon = 17; -typedef Native_clang_getTokenSpelling = CXString Function( - ffi.Pointer arg0, - CXToken arg1, -); + /// An '=' sign. + static const int CXCompletionChunk_Equal = 18; -typedef _dart_clang_getTokenSpelling = CXString Function( - ffi.Pointer arg0, - CXToken arg1, -); + /// Horizontal space (' '). + static const int CXCompletionChunk_HorizontalSpace = 19; -typedef Native_clang_getTokenLocation = CXSourceLocation Function( - ffi.Pointer arg0, - CXToken arg1, -); + /// Vertical space ('\\n'), after which it is generally a good idea to + /// perform indentation. + static const int CXCompletionChunk_VerticalSpace = 20; +} -typedef _dart_clang_getTokenLocation = CXSourceLocation Function( - ffi.Pointer arg0, - CXToken arg1, -); +typedef Native_clang_getCompletionChunkText = CXString Function( + CXCompletionString completion_string, ffi.Uint32 chunk_number); +typedef Native_clang_getCompletionChunkCompletionString = CXCompletionString + Function(CXCompletionString completion_string, ffi.Uint32 chunk_number); +typedef Native_clang_getNumCompletionChunks = ffi.Uint32 Function( + CXCompletionString completion_string); +typedef Native_clang_getCompletionPriority = ffi.Uint32 Function( + CXCompletionString completion_string); +typedef Native_clang_getCompletionAvailability = ffi.Int32 Function( + CXCompletionString completion_string); +typedef Native_clang_getCompletionNumAnnotations = ffi.Uint32 Function( + CXCompletionString completion_string); +typedef Native_clang_getCompletionAnnotation = CXString Function( + CXCompletionString completion_string, ffi.Uint32 annotation_number); +typedef Native_clang_getCompletionParent = CXString Function( + CXCompletionString completion_string, ffi.Pointer kind); +typedef Native_clang_getCompletionBriefComment = CXString Function( + CXCompletionString completion_string); +typedef Native_clang_getCursorCompletionString = CXCompletionString Function( + CXCursor cursor); -typedef Native_clang_getTokenExtent = CXSourceRange Function( - ffi.Pointer arg0, - CXToken arg1, -); +/// Contains the results of code-completion. +/// +/// This data structure contains the results of code completion, as +/// produced by \c clang_codeCompleteAt(). Its contents must be freed by +/// \c clang_disposeCodeCompleteResults. +class CXCodeCompleteResults extends ffi.Struct { + /// The code-completion results. + external ffi.Pointer Results; -typedef _dart_clang_getTokenExtent = CXSourceRange Function( - ffi.Pointer arg0, - CXToken arg1, -); + /// The number of code-completion results stored in the + /// \c Results array. + @ffi.Uint32() + external int NumResults; +} -typedef Native_clang_tokenize = ffi.Void Function( - ffi.Pointer TU, - CXSourceRange Range, - ffi.Pointer> Tokens, - ffi.Pointer NumTokens, -); - -typedef _dart_clang_tokenize = void Function( - ffi.Pointer TU, - CXSourceRange Range, - ffi.Pointer> Tokens, - ffi.Pointer NumTokens, -); +typedef Native_clang_getCompletionNumFixIts = ffi.Uint32 Function( + ffi.Pointer results, ffi.Uint32 completion_index); +typedef Native_clang_getCompletionFixIt = CXString Function( + ffi.Pointer results, + ffi.Uint32 completion_index, + ffi.Uint32 fixit_index, + ffi.Pointer replacement_range); +typedef Native_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); +typedef Native_clang_codeCompleteAt + = ffi.Pointer Function( + CXTranslationUnit TU, + ffi.Pointer complete_filename, + ffi.Uint32 complete_line, + ffi.Uint32 complete_column, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Uint32 options); +typedef Native_clang_sortCodeCompletionResults = ffi.Void Function( + ffi.Pointer Results, ffi.Uint32 NumResults); +typedef Native_clang_disposeCodeCompleteResults = ffi.Void Function( + ffi.Pointer Results); +typedef Native_clang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( + ffi.Pointer Results); +typedef Native_clang_codeCompleteGetDiagnostic = CXDiagnostic Function( + ffi.Pointer Results, ffi.Uint32 Index); +typedef Native_clang_codeCompleteGetContexts = ffi.Uint64 Function( + ffi.Pointer Results); +typedef Native_clang_codeCompleteGetContainerKind = ffi.Int32 Function( + ffi.Pointer Results, + ffi.Pointer IsIncomplete); +typedef Native_clang_codeCompleteGetContainerUSR = CXString Function( + ffi.Pointer Results); +typedef Native_clang_codeCompleteGetObjCSelector = CXString Function( + ffi.Pointer Results); +typedef Native_clang_getClangVersion = CXString Function(); +typedef Native_clang_toggleCrashRecovery = ffi.Void Function( + ffi.Uint32 isEnabled); +typedef Native_clang_getInclusions = ffi.Void Function( + CXTranslationUnit tu, CXInclusionVisitor visitor, CXClientData client_data); -typedef Native_clang_annotateTokens = ffi.Void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - ffi.Uint32 NumTokens, - ffi.Pointer Cursors, -); - -typedef _dart_clang_annotateTokens = void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - int NumTokens, - ffi.Pointer Cursors, -); +/// Visitor invoked for each file in a translation unit +/// (used with clang_getInclusions()). +/// +/// This visitor function will be invoked by clang_getInclusions() for each +/// file included (either at the top-level or by \#include directives) within +/// a translation unit. The first argument is the file being included, and +/// the second and third arguments provide the inclusion stack. The +/// array is sorted in order of immediate inclusion. For example, +/// the first element refers to the location that included 'included_file'. +typedef CXInclusionVisitor = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + CXFile, ffi.Pointer, ffi.Uint32, CXClientData)>>; +typedef Native_clang_Cursor_Evaluate = CXEvalResult Function(CXCursor C); + +/// Evaluation result of a cursor +typedef CXEvalResult = ffi.Pointer; +typedef Native_clang_EvalResult_getKind = ffi.Int32 Function(CXEvalResult E); + +abstract class CXEvalResultKind { + static const int CXEval_Int = 1; + static const int CXEval_Float = 2; + static const int CXEval_ObjCStrLiteral = 3; + static const int CXEval_StrLiteral = 4; + static const int CXEval_CFStr = 5; + static const int CXEval_Other = 6; + static const int CXEval_UnExposed = 0; +} -typedef Native_clang_disposeTokens = ffi.Void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - ffi.Uint32 NumTokens, -); +typedef Native_clang_EvalResult_getAsInt = ffi.Int32 Function(CXEvalResult E); +typedef Native_clang_EvalResult_getAsLongLong = ffi.Int64 Function( + CXEvalResult E); +typedef Native_clang_EvalResult_isUnsignedInt = ffi.Uint32 Function( + CXEvalResult E); +typedef Native_clang_EvalResult_getAsUnsigned = ffi.Uint64 Function( + CXEvalResult E); +typedef Native_clang_EvalResult_getAsDouble = ffi.Double Function( + CXEvalResult E); +typedef Native_clang_EvalResult_getAsStr = ffi.Pointer Function( + CXEvalResult E); +typedef Native_clang_EvalResult_dispose = ffi.Void Function(CXEvalResult E); +typedef Native_clang_getRemappings = CXRemapping Function( + ffi.Pointer path); + +/// A remapping of original source files and their translated files. +typedef CXRemapping = ffi.Pointer; +typedef Native_clang_getRemappingsFromFileList = CXRemapping Function( + ffi.Pointer> filePaths, ffi.Uint32 numFiles); +typedef Native_clang_remap_getNumFiles = ffi.Uint32 Function(CXRemapping arg0); +typedef Native_clang_remap_getFilenames = ffi.Void Function( + CXRemapping arg0, + ffi.Uint32 index, + ffi.Pointer original, + ffi.Pointer transformed); +typedef Native_clang_remap_dispose = ffi.Void Function(CXRemapping arg0); -typedef _dart_clang_disposeTokens = void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - int NumTokens, -); +class CXCursorAndRangeVisitor extends ffi.Struct { + external ffi.Pointer context; -typedef Native_clang_getCursorKindSpelling = CXString Function( - ffi.Int32 Kind, -); + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, CXCursor, CXSourceRange)>> visit; +} -typedef _dart_clang_getCursorKindSpelling = CXString Function( - int Kind, -); +/// \defgroup CINDEX_HIGH Higher level API functions +/// +/// @{ +abstract class CXVisitorResult { + static const int CXVisit_Break = 0; + static const int CXVisit_Continue = 1; +} -typedef Native_clang_getDefinitionSpellingAndExtent = ffi.Void Function( - CXCursor arg0, - ffi.Pointer> startBuf, - ffi.Pointer> endBuf, - ffi.Pointer startLine, - ffi.Pointer startColumn, - ffi.Pointer endLine, - ffi.Pointer endColumn, -); - -typedef _dart_clang_getDefinitionSpellingAndExtent = void Function( - CXCursor arg0, - ffi.Pointer> startBuf, - ffi.Pointer> endBuf, - ffi.Pointer startLine, - ffi.Pointer startColumn, - ffi.Pointer endLine, - ffi.Pointer endColumn, -); +typedef Native_clang_findReferencesInFile = ffi.Int32 Function( + CXCursor cursor, CXFile file, CXCursorAndRangeVisitor visitor); -typedef Native_clang_enableStackTraces = ffi.Void Function(); +abstract class CXResult { + /// Function returned successfully. + static const int CXResult_Success = 0; -typedef _dart_clang_enableStackTraces = void Function(); + /// One of the parameters was invalid for the function. + static const int CXResult_Invalid = 1; -typedef _typedefC_1 = ffi.Void Function( - ffi.Pointer, -); + /// The function was terminated by a callback (e.g. it returned + /// CXVisit_Break) + static const int CXResult_VisitBreak = 2; +} -typedef Native_clang_executeOnThread = ffi.Void Function( - ffi.Pointer> fn, - ffi.Pointer user_data, - ffi.Uint32 stack_size, -); +typedef Native_clang_findIncludesInFile = ffi.Int32 Function( + CXTranslationUnit TU, CXFile file, CXCursorAndRangeVisitor visitor); -typedef _dart_clang_executeOnThread = void Function( - ffi.Pointer> fn, - ffi.Pointer user_data, - int stack_size, -); +/// Source location passed to index callbacks. +class CXIdxLoc extends ffi.Struct { + @ffi.Array.multi([2]) + external ffi.Array> ptr_data; -typedef Native_clang_getCompletionChunkKind = ffi.Int32 Function( - ffi.Pointer completion_string, - ffi.Uint32 chunk_number, -); + @ffi.Uint32() + external int int_data; +} -typedef _dart_clang_getCompletionChunkKind = int Function( - ffi.Pointer completion_string, - int chunk_number, -); +/// Data for ppIncludedFile callback. +class CXIdxIncludedFileInfo extends ffi.Struct { + /// Location of '#' in the \#include/\#import directive. + external CXIdxLoc hashLoc; -typedef Native_clang_getCompletionChunkText = CXString Function( - ffi.Pointer completion_string, - ffi.Uint32 chunk_number, -); - -typedef _dart_clang_getCompletionChunkText = CXString Function( - ffi.Pointer completion_string, - int chunk_number, -); - -typedef Native_clang_getCompletionChunkCompletionString = ffi.Pointer - Function( - ffi.Pointer completion_string, - ffi.Uint32 chunk_number, -); - -typedef _dart_clang_getCompletionChunkCompletionString = ffi.Pointer - Function( - ffi.Pointer completion_string, - int chunk_number, -); + /// Filename as written in the \#include/\#import directive. + external ffi.Pointer filename; -typedef Native_clang_getNumCompletionChunks = ffi.Uint32 Function( - ffi.Pointer completion_string, -); + /// The actual file that the \#include/\#import directive resolved to. + external CXFile file; -typedef _dart_clang_getNumCompletionChunks = int Function( - ffi.Pointer completion_string, -); + @ffi.Int32() + external int isImport; -typedef Native_clang_getCompletionPriority = ffi.Uint32 Function( - ffi.Pointer completion_string, -); + @ffi.Int32() + external int isAngled; -typedef _dart_clang_getCompletionPriority = int Function( - ffi.Pointer completion_string, -); + /// Non-zero if the directive was automatically turned into a module + /// import. + @ffi.Int32() + external int isModuleImport; +} -typedef Native_clang_getCompletionAvailability = ffi.Int32 Function( - ffi.Pointer completion_string, -); +/// Data for IndexerCallbacks#importedASTFile. +class CXIdxImportedASTFileInfo extends ffi.Struct { + /// Top level AST file containing the imported PCH, module or submodule. + external CXFile file; -typedef _dart_clang_getCompletionAvailability = int Function( - ffi.Pointer completion_string, -); + /// The imported module or NULL if the AST file is a PCH. + external CXModule module; -typedef Native_clang_getCompletionNumAnnotations = ffi.Uint32 Function( - ffi.Pointer completion_string, -); + /// Location where the file is imported. Applicable only for modules. + external CXIdxLoc loc; -typedef _dart_clang_getCompletionNumAnnotations = int Function( - ffi.Pointer completion_string, -); + /// Non-zero if an inclusion directive was automatically turned into + /// a module import. Applicable only for modules. + @ffi.Int32() + external int isImplicit; +} -typedef Native_clang_getCompletionAnnotation = CXString Function( - ffi.Pointer completion_string, - ffi.Uint32 annotation_number, -); +class CXIdxAttrInfo extends ffi.Struct { + @ffi.Int32() + external int kind; -typedef _dart_clang_getCompletionAnnotation = CXString Function( - ffi.Pointer completion_string, - int annotation_number, -); + external CXCursor cursor; -typedef Native_clang_getCompletionParent = CXString Function( - ffi.Pointer completion_string, - ffi.Pointer kind, -); + external CXIdxLoc loc; +} -typedef _dart_clang_getCompletionParent = CXString Function( - ffi.Pointer completion_string, - ffi.Pointer kind, -); +abstract class CXIdxAttrKind { + static const int CXIdxAttr_Unexposed = 0; + static const int CXIdxAttr_IBAction = 1; + static const int CXIdxAttr_IBOutlet = 2; + static const int CXIdxAttr_IBOutletCollection = 3; +} -typedef Native_clang_getCompletionBriefComment = CXString Function( - ffi.Pointer completion_string, -); +class CXIdxEntityInfo extends ffi.Struct { + @ffi.Int32() + external int kind; -typedef _dart_clang_getCompletionBriefComment = CXString Function( - ffi.Pointer completion_string, -); + @ffi.Int32() + external int templateKind; -typedef Native_clang_getCursorCompletionString = ffi.Pointer Function( - CXCursor cursor, -); + @ffi.Int32() + external int lang; -typedef _dart_clang_getCursorCompletionString = ffi.Pointer Function( - CXCursor cursor, -); + external ffi.Pointer name; -typedef Native_clang_getCompletionNumFixIts = ffi.Uint32 Function( - ffi.Pointer results, - ffi.Uint32 completion_index, -); + external ffi.Pointer USR; -typedef _dart_clang_getCompletionNumFixIts = int Function( - ffi.Pointer results, - int completion_index, -); + external CXCursor cursor; -typedef Native_clang_getCompletionFixIt = CXString Function( - ffi.Pointer results, - ffi.Uint32 completion_index, - ffi.Uint32 fixit_index, - ffi.Pointer replacement_range, -); - -typedef _dart_clang_getCompletionFixIt = CXString Function( - ffi.Pointer results, - int completion_index, - int fixit_index, - ffi.Pointer replacement_range, -); + external ffi.Pointer> attributes; -typedef Native_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); + @ffi.Uint32() + external int numAttributes; +} -typedef _dart_clang_defaultCodeCompleteOptions = int Function(); - -typedef Native_clang_codeCompleteAt = ffi.Pointer - Function( - ffi.Pointer TU, - ffi.Pointer complete_filename, - ffi.Uint32 complete_line, - ffi.Uint32 complete_column, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, -); - -typedef _dart_clang_codeCompleteAt = ffi.Pointer - Function( - ffi.Pointer TU, - ffi.Pointer complete_filename, - int complete_line, - int complete_column, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, -); +abstract class CXIdxEntityKind { + static const int CXIdxEntity_Unexposed = 0; + static const int CXIdxEntity_Typedef = 1; + static const int CXIdxEntity_Function = 2; + static const int CXIdxEntity_Variable = 3; + static const int CXIdxEntity_Field = 4; + static const int CXIdxEntity_EnumConstant = 5; + static const int CXIdxEntity_ObjCClass = 6; + static const int CXIdxEntity_ObjCProtocol = 7; + static const int CXIdxEntity_ObjCCategory = 8; + static const int CXIdxEntity_ObjCInstanceMethod = 9; + static const int CXIdxEntity_ObjCClassMethod = 10; + static const int CXIdxEntity_ObjCProperty = 11; + static const int CXIdxEntity_ObjCIvar = 12; + static const int CXIdxEntity_Enum = 13; + static const int CXIdxEntity_Struct = 14; + static const int CXIdxEntity_Union = 15; + static const int CXIdxEntity_CXXClass = 16; + static const int CXIdxEntity_CXXNamespace = 17; + static const int CXIdxEntity_CXXNamespaceAlias = 18; + static const int CXIdxEntity_CXXStaticVariable = 19; + static const int CXIdxEntity_CXXStaticMethod = 20; + static const int CXIdxEntity_CXXInstanceMethod = 21; + static const int CXIdxEntity_CXXConstructor = 22; + static const int CXIdxEntity_CXXDestructor = 23; + static const int CXIdxEntity_CXXConversionFunction = 24; + static const int CXIdxEntity_CXXTypeAlias = 25; + static const int CXIdxEntity_CXXInterface = 26; +} -typedef Native_clang_sortCodeCompletionResults = ffi.Void Function( - ffi.Pointer Results, - ffi.Uint32 NumResults, -); +/// Extra C++ template information for an entity. This can apply to: +/// CXIdxEntity_Function +/// CXIdxEntity_CXXClass +/// CXIdxEntity_CXXStaticMethod +/// CXIdxEntity_CXXInstanceMethod +/// CXIdxEntity_CXXConstructor +/// CXIdxEntity_CXXConversionFunction +/// CXIdxEntity_CXXTypeAlias +abstract class CXIdxEntityCXXTemplateKind { + static const int CXIdxEntity_NonTemplate = 0; + static const int CXIdxEntity_Template = 1; + static const int CXIdxEntity_TemplatePartialSpecialization = 2; + static const int CXIdxEntity_TemplateSpecialization = 3; +} -typedef _dart_clang_sortCodeCompletionResults = void Function( - ffi.Pointer Results, - int NumResults, -); +abstract class CXIdxEntityLanguage { + static const int CXIdxEntityLang_None = 0; + static const int CXIdxEntityLang_C = 1; + static const int CXIdxEntityLang_ObjC = 2; + static const int CXIdxEntityLang_CXX = 3; + static const int CXIdxEntityLang_Swift = 4; +} -typedef Native_clang_disposeCodeCompleteResults = ffi.Void Function( - ffi.Pointer Results, -); +class CXIdxContainerInfo extends ffi.Struct { + external CXCursor cursor; +} -typedef _dart_clang_disposeCodeCompleteResults = void Function( - ffi.Pointer Results, -); +class CXIdxIBOutletCollectionAttrInfo extends ffi.Struct { + external ffi.Pointer attrInfo; -typedef Native_clang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( - ffi.Pointer Results, -); + external ffi.Pointer objcClass; -typedef _dart_clang_codeCompleteGetNumDiagnostics = int Function( - ffi.Pointer Results, -); + external CXCursor classCursor; -typedef Native_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( - ffi.Pointer Results, - ffi.Uint32 Index, -); + external CXIdxLoc classLoc; +} -typedef _dart_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( - ffi.Pointer Results, - int Index, -); +class CXIdxDeclInfo extends ffi.Struct { + external ffi.Pointer entityInfo; -typedef Native_clang_codeCompleteGetContexts = ffi.Uint64 Function( - ffi.Pointer Results, -); + external CXCursor cursor; -typedef _dart_clang_codeCompleteGetContexts = int Function( - ffi.Pointer Results, -); + external CXIdxLoc loc; -typedef Native_clang_codeCompleteGetContainerKind = ffi.Int32 Function( - ffi.Pointer Results, - ffi.Pointer IsIncomplete, -); + external ffi.Pointer semanticContainer; -typedef _dart_clang_codeCompleteGetContainerKind = int Function( - ffi.Pointer Results, - ffi.Pointer IsIncomplete, -); + /// Generally same as #semanticContainer but can be different in + /// cases like out-of-line C++ member functions. + external ffi.Pointer lexicalContainer; -typedef Native_clang_codeCompleteGetContainerUSR = CXString Function( - ffi.Pointer Results, -); + @ffi.Int32() + external int isRedeclaration; -typedef _dart_clang_codeCompleteGetContainerUSR = CXString Function( - ffi.Pointer Results, -); + @ffi.Int32() + external int isDefinition; -typedef Native_clang_codeCompleteGetObjCSelector = CXString Function( - ffi.Pointer Results, -); + @ffi.Int32() + external int isContainer; -typedef _dart_clang_codeCompleteGetObjCSelector = CXString Function( - ffi.Pointer Results, -); + external ffi.Pointer declAsContainer; -typedef Native_clang_getClangVersion = CXString Function(); + /// Whether the declaration exists in code or was created implicitly + /// by the compiler, e.g. implicit Objective-C methods for properties. + @ffi.Int32() + external int isImplicit; -typedef _dart_clang_getClangVersion = CXString Function(); + external ffi.Pointer> attributes; -typedef Native_clang_toggleCrashRecovery = ffi.Void Function( - ffi.Uint32 isEnabled, -); + @ffi.Uint32() + external int numAttributes; -typedef _dart_clang_toggleCrashRecovery = void Function( - int isEnabled, -); + @ffi.Uint32() + external int flags; +} -typedef CXInclusionVisitor = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint32, - ffi.Pointer, -); +class CXIdxObjCContainerDeclInfo extends ffi.Struct { + external ffi.Pointer declInfo; -typedef Native_clang_getInclusions = ffi.Void Function( - ffi.Pointer tu, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); + @ffi.Int32() + external int kind; +} -typedef _dart_clang_getInclusions = void Function( - ffi.Pointer tu, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); +abstract class CXIdxObjCContainerKind { + static const int CXIdxObjCContainer_ForwardRef = 0; + static const int CXIdxObjCContainer_Interface = 1; + static const int CXIdxObjCContainer_Implementation = 2; +} -typedef Native_clang_Cursor_Evaluate = ffi.Pointer Function( - CXCursor C, -); +class CXIdxBaseClassInfo extends ffi.Struct { + external ffi.Pointer base; -typedef _dart_clang_Cursor_Evaluate = ffi.Pointer Function( - CXCursor C, -); + external CXCursor cursor; -typedef Native_clang_EvalResult_getKind = ffi.Int32 Function( - ffi.Pointer E, -); + external CXIdxLoc loc; +} -typedef _dart_clang_EvalResult_getKind = int Function( - ffi.Pointer E, -); +class CXIdxObjCProtocolRefInfo extends ffi.Struct { + external ffi.Pointer protocol; -typedef Native_clang_EvalResult_getAsInt = ffi.Int32 Function( - ffi.Pointer E, -); + external CXCursor cursor; -typedef _dart_clang_EvalResult_getAsInt = int Function( - ffi.Pointer E, -); + external CXIdxLoc loc; +} -typedef Native_clang_EvalResult_getAsLongLong = ffi.Int64 Function( - ffi.Pointer E, -); +class CXIdxObjCProtocolRefListInfo extends ffi.Struct { + external ffi.Pointer> protocols; -typedef _dart_clang_EvalResult_getAsLongLong = int Function( - ffi.Pointer E, -); + @ffi.Uint32() + external int numProtocols; +} -typedef Native_clang_EvalResult_isUnsignedInt = ffi.Uint32 Function( - ffi.Pointer E, -); +class CXIdxObjCInterfaceDeclInfo extends ffi.Struct { + external ffi.Pointer containerInfo; -typedef _dart_clang_EvalResult_isUnsignedInt = int Function( - ffi.Pointer E, -); + external ffi.Pointer superInfo; -typedef Native_clang_EvalResult_getAsUnsigned = ffi.Uint64 Function( - ffi.Pointer E, -); + external ffi.Pointer protocols; +} -typedef _dart_clang_EvalResult_getAsUnsigned = int Function( - ffi.Pointer E, -); +class CXIdxObjCCategoryDeclInfo extends ffi.Struct { + external ffi.Pointer containerInfo; -typedef Native_clang_EvalResult_getAsDouble = ffi.Double Function( - ffi.Pointer E, -); + external ffi.Pointer objcClass; -typedef _dart_clang_EvalResult_getAsDouble = double Function( - ffi.Pointer E, -); + external CXCursor classCursor; -typedef Native_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); + external CXIdxLoc classLoc; -typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); + external ffi.Pointer protocols; +} -typedef Native_clang_EvalResult_dispose = ffi.Void Function( - ffi.Pointer E, -); +class CXIdxObjCPropertyDeclInfo extends ffi.Struct { + external ffi.Pointer declInfo; -typedef _dart_clang_EvalResult_dispose = void Function( - ffi.Pointer E, -); + external ffi.Pointer getter; -typedef Native_clang_getRemappings = ffi.Pointer Function( - ffi.Pointer path, -); + external ffi.Pointer setter; +} -typedef _dart_clang_getRemappings = ffi.Pointer Function( - ffi.Pointer path, -); +class CXIdxCXXClassDeclInfo extends ffi.Struct { + external ffi.Pointer declInfo; -typedef Native_clang_getRemappingsFromFileList = ffi.Pointer Function( - ffi.Pointer> filePaths, - ffi.Uint32 numFiles, -); + external ffi.Pointer> bases; -typedef _dart_clang_getRemappingsFromFileList = ffi.Pointer Function( - ffi.Pointer> filePaths, - int numFiles, -); + @ffi.Uint32() + external int numBases; +} -typedef Native_clang_remap_getNumFiles = ffi.Uint32 Function( - ffi.Pointer arg0, -); +/// Data for IndexerCallbacks#indexEntityReference. +class CXIdxEntityRefInfo extends ffi.Struct { + @ffi.Int32() + external int kind; -typedef _dart_clang_remap_getNumFiles = int Function( - ffi.Pointer arg0, -); + /// Reference cursor. + external CXCursor cursor; -typedef Native_clang_remap_getFilenames = ffi.Void Function( - ffi.Pointer arg0, - ffi.Uint32 index, - ffi.Pointer original, - ffi.Pointer transformed, -); - -typedef _dart_clang_remap_getFilenames = void Function( - ffi.Pointer arg0, - int index, - ffi.Pointer original, - ffi.Pointer transformed, -); - -typedef Native_clang_remap_dispose = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_remap_dispose = void Function( - ffi.Pointer arg0, -); + external CXIdxLoc loc; -typedef Native_clang_findReferencesInFile = ffi.Int32 Function( - CXCursor cursor, - ffi.Pointer file, - CXCursorAndRangeVisitor visitor, -); + /// The entity that gets referenced. + external ffi.Pointer referencedEntity; -typedef _dart_clang_findReferencesInFile = int Function( - CXCursor cursor, - ffi.Pointer file, - CXCursorAndRangeVisitor visitor, -); + /// Immediate "parent" of the reference. For example: + /// + /// \code + /// Foo *var; + /// \endcode + /// + /// The parent of reference of type 'Foo' is the variable 'var'. + /// For references inside statement bodies of functions/methods, + /// the parentEntity will be the function/method. + external ffi.Pointer parentEntity; -typedef Native_clang_findIncludesInFile = ffi.Int32 Function( - ffi.Pointer TU, - ffi.Pointer file, - CXCursorAndRangeVisitor visitor, -); + /// Lexical container context of the reference. + external ffi.Pointer container; -typedef _dart_clang_findIncludesInFile = int Function( - ffi.Pointer TU, - ffi.Pointer file, - CXCursorAndRangeVisitor visitor, -); + /// Sets of symbol roles of the reference. + @ffi.Int32() + external int role; +} -typedef Native_clang_index_isEntityObjCContainerKind = ffi.Int32 Function( - ffi.Int32 arg0, -); +/// Data for IndexerCallbacks#indexEntityReference. +/// +/// This may be deprecated in a future version as this duplicates +/// the \c CXSymbolRole_Implicit bit in \c CXSymbolRole. +abstract class CXIdxEntityRefKind { + /// The entity is referenced directly in user's code. + static const int CXIdxEntityRef_Direct = 1; + + /// An implicit reference, e.g. a reference of an Objective-C method + /// via the dot syntax. + static const int CXIdxEntityRef_Implicit = 2; +} -typedef _dart_clang_index_isEntityObjCContainerKind = int Function( - int arg0, -); +/// Roles that are attributed to symbol occurrences. +/// +/// Internal: this currently mirrors low 9 bits of clang::index::SymbolRole with +/// higher bits zeroed. These high bits may be exposed in the future. +abstract class CXSymbolRole { + static const int CXSymbolRole_None = 0; + static const int CXSymbolRole_Declaration = 1; + static const int CXSymbolRole_Definition = 2; + static const int CXSymbolRole_Reference = 4; + static const int CXSymbolRole_Read = 8; + static const int CXSymbolRole_Write = 16; + static const int CXSymbolRole_Call = 32; + static const int CXSymbolRole_Dynamic = 64; + static const int CXSymbolRole_AddressOf = 128; + static const int CXSymbolRole_Implicit = 256; +} +typedef Native_clang_index_isEntityObjCContainerKind = ffi.Int32 Function( + ffi.Int32 arg0); typedef Native_clang_index_getObjCContainerDeclInfo = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCContainerDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - + ffi.Pointer arg0); typedef Native_clang_index_getObjCInterfaceDeclInfo = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCInterfaceDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - + ffi.Pointer arg0); typedef Native_clang_index_getObjCCategoryDeclInfo = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCCategoryDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - + ffi.Pointer arg0); typedef Native_clang_index_getObjCProtocolRefListInfo = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCProtocolRefListInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - + ffi.Pointer arg0); typedef Native_clang_index_getObjCPropertyDeclInfo = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCPropertyDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - + ffi.Pointer arg0); typedef Native_clang_index_getIBOutletCollectionAttrInfo = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getIBOutletCollectionAttrInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - + ffi.Pointer arg0); typedef Native_clang_index_getCXXClassDeclInfo = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getCXXClassDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef Native_clang_index_getClientContainer = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getClientContainer = ffi.Pointer Function( - ffi.Pointer arg0, -); + ffi.Pointer arg0); +typedef Native_clang_index_getClientContainer = CXIdxClientContainer Function( + ffi.Pointer arg0); +/// The client's data object that is associated with a semantic container +/// of entities. +typedef CXIdxClientContainer = ffi.Pointer; typedef Native_clang_index_setClientContainer = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); + ffi.Pointer arg0, CXIdxClientContainer arg1); +typedef Native_clang_index_getClientEntity = CXIdxClientEntity Function( + ffi.Pointer arg0); + +/// The client's data object that is associated with a semantic entity. +typedef CXIdxClientEntity = ffi.Pointer; +typedef Native_clang_index_setClientEntity = ffi.Void Function( + ffi.Pointer arg0, CXIdxClientEntity arg1); +typedef Native_clang_IndexAction_create = CXIndexAction Function(CXIndex CIdx); -typedef _dart_clang_index_setClientContainer = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); +/// An indexing action/session, to be applied to one or multiple +/// translation units. +typedef CXIndexAction = ffi.Pointer; +typedef Native_clang_IndexAction_dispose = ffi.Void Function( + CXIndexAction arg0); +typedef Native_clang_indexSourceFile = ffi.Int32 Function( + CXIndexAction arg0, + CXClientData client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int32 num_command_line_args, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Pointer out_TU, + ffi.Uint32 TU_options); -typedef Native_clang_index_getClientEntity = ffi.Pointer Function( - ffi.Pointer arg0, -); +/// A group of callbacks used by #clang_indexSourceFile and +/// #clang_indexTranslationUnit. +class IndexerCallbacks extends ffi.Struct { + /// Called periodically to check whether indexing should be aborted. + /// Should return 0 to continue, and non-zero to abort. + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(CXClientData, ffi.Pointer)>> abortQuery; -typedef _dart_clang_index_getClientEntity = ffi.Pointer Function( - ffi.Pointer arg0, -); + /// Called at the end of indexing; passes the complete diagnostic set. + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + CXClientData, CXDiagnosticSet, ffi.Pointer)>> + diagnostic; -typedef Native_clang_index_setClientEntity = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientFile Function( + CXClientData, CXFile, ffi.Pointer)>> enteredMainFile; -typedef _dart_clang_index_setClientEntity = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); + /// Called when a file gets \#included/\#imported. + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientFile Function( + CXClientData, ffi.Pointer)>> + ppIncludedFile; -typedef Native_clang_IndexAction_create = ffi.Pointer Function( - ffi.Pointer CIdx, -); + /// Called when a AST file (PCH or module) gets imported. + /// + /// AST files will not get indexed (there will not be callbacks to index all + /// the entities in an AST file). The recommended action is that, if the AST + /// file is not already indexed, to initiate a new indexing job specific to + /// the AST file. + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientASTFile Function( + CXClientData, ffi.Pointer)>> + importedASTFile; -typedef _dart_clang_IndexAction_create = ffi.Pointer Function( - ffi.Pointer CIdx, -); + /// Called at the beginning of indexing a translation unit. + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientContainer Function( + CXClientData, ffi.Pointer)>> startedTranslationUnit; -typedef Native_clang_IndexAction_dispose = ffi.Void Function( - ffi.Pointer arg0, -); + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(CXClientData, ffi.Pointer)>> + indexDeclaration; -typedef _dart_clang_IndexAction_dispose = void Function( - ffi.Pointer arg0, -); + /// Called to index a reference of an entity. + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(CXClientData, ffi.Pointer)>> + indexEntityReference; +} -typedef Native_clang_indexSourceFile = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Pointer> out_TU, - ffi.Uint32 TU_options, -); - -typedef _dart_clang_indexSourceFile = int Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - ffi.Pointer> out_TU, - int TU_options, -); +/// The client's data object that is associated with a CXFile. +typedef CXIdxClientFile = ffi.Pointer; +/// The client's data object that is associated with an AST file (PCH +/// or module). +typedef CXIdxClientASTFile = ffi.Pointer; typedef Native_clang_indexSourceFileFullArgv = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Pointer> out_TU, - ffi.Uint32 TU_options, -); - -typedef _dart_clang_indexSourceFileFullArgv = int Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - ffi.Pointer> out_TU, - int TU_options, -); - + CXIndexAction arg0, + CXClientData client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + ffi.Pointer source_filename, + ffi.Pointer> command_line_args, + ffi.Int32 num_command_line_args, + ffi.Pointer unsaved_files, + ffi.Uint32 num_unsaved_files, + ffi.Pointer out_TU, + ffi.Uint32 TU_options); typedef Native_clang_indexTranslationUnit = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - ffi.Pointer arg5, -); - -typedef _dart_clang_indexTranslationUnit = int Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - ffi.Pointer arg5, -); - + CXIndexAction arg0, + CXClientData client_data, + ffi.Pointer index_callbacks, + ffi.Uint32 index_callbacks_size, + ffi.Uint32 index_options, + CXTranslationUnit arg5); typedef Native_clang_indexLoc_getFileLocation = ffi.Void Function( - CXIdxLoc loc, - ffi.Pointer> indexFile, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _dart_clang_indexLoc_getFileLocation = void Function( - CXIdxLoc loc, - ffi.Pointer> indexFile, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - + CXIdxLoc loc, + ffi.Pointer indexFile, + ffi.Pointer file, + ffi.Pointer line, + ffi.Pointer column, + ffi.Pointer offset); typedef Native_clang_indexLoc_getCXSourceLocation = CXSourceLocation Function( - CXIdxLoc loc, -); + CXIdxLoc loc); +typedef Native_clang_Type_visitFields = ffi.Uint32 Function( + CXType T, CXFieldVisitor visitor, CXClientData client_data); + +/// Visitor invoked for each field found by a traversal. +/// +/// This visitor function will be invoked for each field found by +/// \c clang_Type_visitFields. Its first argument is the cursor being +/// visited, its second argument is the client data provided to +/// \c clang_Type_visitFields. +/// +/// The visitor should return one of the \c CXVisitorResult values +/// to direct \c clang_Type_visitFields. +typedef CXFieldVisitor = ffi + .Pointer>; + +const int CINDEX_VERSION_MAJOR = 0; -typedef _dart_clang_indexLoc_getCXSourceLocation = CXSourceLocation Function( - CXIdxLoc loc, -); +const int CINDEX_VERSION_MINOR = 59; -typedef CXFieldVisitor = ffi.Int32 Function( - CXCursor, - ffi.Pointer, -); +const int CINDEX_VERSION = 59; -typedef Native_clang_Type_visitFields = ffi.Uint32 Function( - CXType T, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _dart_clang_Type_visitFields = int Function( - CXType T, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _typedefC_2 = ffi.Int32 Function( - ffi.Pointer, - CXCursor, - CXSourceRange, -); - -typedef _typedefC_3 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_4 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_5 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_6 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_7 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_8 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_9 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_10 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); +const String CINDEX_VERSION_STRING = '0.59'; diff --git a/example/libclang-example/pubspec.yaml b/example/libclang-example/pubspec.yaml index bf0695e9..f65a6233 100644 --- a/example/libclang-example/pubspec.yaml +++ b/example/libclang-example/pubspec.yaml @@ -5,7 +5,7 @@ name: libclang_example environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.13.0 <3.0.0' dev_dependencies: ffigen: @@ -62,6 +62,11 @@ ffigen: unsigned long long: 8 enum: 4 + # These can be used to map any typedef to a specific native type. + typedef-map: + 'size_t': 'IntPtr' + 'time_t': 'Int64' + # Default is 'NativeLibrary' name: 'LibClang' diff --git a/example/simple/generated_bindings.dart b/example/simple/generated_bindings.dart index 16748825..a964f507 100644 --- a/example/simple/generated_bindings.dart +++ b/example/simple/generated_bindings.dart @@ -30,8 +30,10 @@ class NativeLibrary { ); } - late final _sum_ptr = _lookup>('sum'); - late final _dart_sum _sum = _sum_ptr.asFunction<_dart_sum>(); + late final _sum_ptr = + _lookup>( + 'sum'); + late final _sum = _sum_ptr.asFunction(); /// Subtracts 2 integers. int subtract( @@ -44,10 +46,11 @@ class NativeLibrary { ); } - late final _subtract_ptr = - _lookup>('subtract'); - late final _dart_subtract _subtract = - _subtract_ptr.asFunction<_dart_subtract>(); + late final _subtract_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>>('subtract'); + late final _subtract = + _subtract_ptr.asFunction, int)>(); /// Multiplies 2 integers, returns pointer to an integer,. ffi.Pointer multiply( @@ -60,10 +63,11 @@ class NativeLibrary { ); } - late final _multiply_ptr = - _lookup>('multiply'); - late final _dart_multiply _multiply = - _multiply_ptr.asFunction<_dart_multiply>(); + late final _multiply_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Int32, ffi.Int32)>>('multiply'); + late final _multiply = + _multiply_ptr.asFunction Function(int, int)>(); /// Divides 2 integers, returns pointer to a float. ffi.Pointer divide( @@ -76,8 +80,11 @@ class NativeLibrary { ); } - late final _divide_ptr = _lookup>('divide'); - late final _dart_divide _divide = _divide_ptr.asFunction<_dart_divide>(); + late final _divide_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Int32, ffi.Int32)>>('divide'); + late final _divide = + _divide_ptr.asFunction Function(int, int)>(); /// Divides 2 floats, returns a pointer to double. ffi.Pointer dividePercision( @@ -90,58 +97,11 @@ class NativeLibrary { ); } - late final _dividePercision_ptr = - _lookup>('dividePercision'); - late final _dart_dividePercision _dividePercision = - _dividePercision_ptr.asFunction<_dart_dividePercision>(); + late final _dividePercision_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('dividePercision'); + late final _dividePercision = _dividePercision_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); } - -typedef _c_sum = ffi.Int32 Function( - ffi.Int32 a, - ffi.Int32 b, -); - -typedef _dart_sum = int Function( - int a, - int b, -); - -typedef _c_subtract = ffi.Int32 Function( - ffi.Pointer a, - ffi.Int32 b, -); - -typedef _dart_subtract = int Function( - ffi.Pointer a, - int b, -); - -typedef _c_multiply = ffi.Pointer Function( - ffi.Int32 a, - ffi.Int32 b, -); - -typedef _dart_multiply = ffi.Pointer Function( - int a, - int b, -); - -typedef _c_divide = ffi.Pointer Function( - ffi.Int32 a, - ffi.Int32 b, -); - -typedef _dart_divide = ffi.Pointer Function( - int a, - int b, -); - -typedef _c_dividePercision = ffi.Pointer Function( - ffi.Pointer a, - ffi.Pointer b, -); - -typedef _dart_dividePercision = ffi.Pointer Function( - ffi.Pointer a, - ffi.Pointer b, -); diff --git a/lib/src/code_generator.dart b/lib/src/code_generator.dart index 0b236745..710b32fa 100644 --- a/lib/src/code_generator.dart +++ b/lib/src/code_generator.dart @@ -14,5 +14,5 @@ export 'code_generator/global.dart'; export 'code_generator/library.dart'; export 'code_generator/struc.dart'; export 'code_generator/type.dart'; -export 'code_generator/typedef.dart'; +export 'code_generator/typealias.dart'; export 'code_generator/union.dart'; diff --git a/lib/src/code_generator/binding.dart b/lib/src/code_generator/binding.dart index 877f243e..105d6f00 100644 --- a/lib/src/code_generator/binding.dart +++ b/lib/src/code_generator/binding.dart @@ -3,7 +3,6 @@ // BSD-style license that can be found in the LICENSE file. import 'binding_string.dart'; -import 'typedef.dart'; import 'writer.dart'; /// Base class for all Bindings. @@ -28,8 +27,8 @@ abstract class Binding { this.dartDoc, }); - /// Return typedef dependencies. - List getTypedefDependencies(Writer w) => const []; + /// Get all dependencies, including itself and save them in [dependencies]. + void addDependencies(Set dependencies); /// Converts a Binding to its actual string representation. /// diff --git a/lib/src/code_generator/compound.dart b/lib/src/code_generator/compound.dart index 77868ebd..b6b97a34 100644 --- a/lib/src/code_generator/compound.dart +++ b/lib/src/code_generator/compound.dart @@ -3,7 +3,6 @@ // BSD-style license that can be found in the LICENSE file. import 'package:ffigen/src/code_generator.dart'; -import 'package:ffigen/src/code_generator/typedef.dart'; import 'binding.dart'; import 'binding_string.dart'; @@ -104,23 +103,6 @@ abstract class Compound extends NoLookUpBinding { return type.getCType(w); } - List? _typedefDependencies; - @override - List getTypedefDependencies(Writer w) { - if (_typedefDependencies == null) { - _typedefDependencies = []; - - // Write typedef's required by members and resolve name conflicts. - for (final m in members) { - final base = m.type.getBaseType(); - if (base.broadType == BroadType.NativeFunction) { - _typedefDependencies!.addAll(base.nativeFunc!.getDependencies()); - } - } - } - return _typedefDependencies ?? []; - } - @override BindingString toBindingString(Writer w) { final s = StringBuffer(); @@ -155,7 +137,7 @@ abstract class Compound extends NoLookUpBinding { s.writeAll(m.dartDoc!.split('\n'), '\n' + depth + '/// '); s.write('\n'); } - if (m.type.isPrimitive) { + if (!m.type.sameDartAndCType(w)) { s.write('$depth@${m.type.getCType(w)}()\n'); } s.write('${depth}external ${m.type.getDartType(w)} $memberName;\n\n'); @@ -167,6 +149,14 @@ abstract class Compound extends NoLookUpBinding { type: isStruct ? BindingStringType.struc : BindingStringType.union, string: s.toString()); } + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + + dependencies.add(this); + members.forEach((m) => m.type.addDependencies(dependencies)); + } } class Member { diff --git a/lib/src/code_generator/constant.dart b/lib/src/code_generator/constant.dart index cf6d8e81..8fd71916 100644 --- a/lib/src/code_generator/constant.dart +++ b/lib/src/code_generator/constant.dart @@ -50,9 +50,16 @@ class Constant extends NoLookUpBinding { s.write(makeDartDoc(dartDoc!)); } - s.write('const $rawType $constantName = $rawValue;\n\n'); + s.write('\nconst $rawType $constantName = $rawValue;\n\n'); return BindingString( type: BindingStringType.constant, string: s.toString()); } + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + + dependencies.add(this); + } } diff --git a/lib/src/code_generator/enum_class.dart b/lib/src/code_generator/enum_class.dart index ec9d5e16..e1ed5c4d 100644 --- a/lib/src/code_generator/enum_class.dart +++ b/lib/src/code_generator/enum_class.dart @@ -68,6 +68,13 @@ class EnumClass extends NoLookUpBinding { return BindingString( type: BindingStringType.enumClass, string: s.toString()); } + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + + dependencies.add(this); + } } /// Represents a single value in an enum. diff --git a/lib/src/code_generator/func.dart b/lib/src/code_generator/func.dart index 5236c50a..21aad75b 100644 --- a/lib/src/code_generator/func.dart +++ b/lib/src/code_generator/func.dart @@ -29,10 +29,12 @@ import 'writer.dart'; /// typedef _dart_sum = int Function(int a, int b); /// ``` class Func extends LookUpBinding { - final Type returnType; - final List parameters; + final FunctionType functionType; final bool exposeSymbolAddress; + /// Contains typealias for function type if [exposeSymbolAddress] is true. + Type? _exposedFunctionType; + /// [originalName] is looked up in dynamic library, if not /// provided, takes the value of [name]. Func({ @@ -40,65 +42,29 @@ class Func extends LookUpBinding { required String name, String? originalName, String? dartDoc, - required this.returnType, + required Type returnType, List? parameters, this.exposeSymbolAddress = false, - }) : parameters = parameters ?? [], + }) : functionType = FunctionType( + returnType: returnType, + parameters: parameters ?? const [], + ), super( usr: usr, originalName: originalName, name: name, dartDoc: dartDoc, ) { - for (var i = 0; i < this.parameters.length; i++) { - if (this.parameters[i].name.trim() == '') { - this.parameters[i].name = 'arg$i'; + for (var i = 0; i < functionType.parameters.length; i++) { + if (functionType.parameters[i].name.trim() == '') { + functionType.parameters[i].name = 'arg$i'; } } - } - - List? _typedefDependencies; - @override - List getTypedefDependencies(Writer w) { - if (_typedefDependencies == null) { - _typedefDependencies = []; - - // Add typedef's required by return type. - final returnTypeBase = returnType.getBaseType(); - if (returnTypeBase.broadType == BroadType.NativeFunction) { - _typedefDependencies! - .addAll(returnTypeBase.nativeFunc!.getDependencies()); - } - // Add typedef's required by parameters. - for (final p in parameters) { - final base = p.type.getBaseType(); - if (base.broadType == BroadType.NativeFunction) { - _typedefDependencies!.addAll(base.nativeFunc!.getDependencies()); - } - } - // Add C function typedef. - _typedefDependencies!.add(cType); - // Add Dart function typedef. - _typedefDependencies!.add(dartType); - } - return _typedefDependencies!; + _exposedFunctionType = Type.typealias( + Typealias(name: 'Native_$name', type: Type.functionType(functionType))); } - Typedef? _cType, _dartType; - Typedef get cType => _cType ??= Typedef( - name: exposeSymbolAddress ? 'Native_$name' : '_c_$name', - returnType: returnType, - parameters: parameters, - typedefType: TypedefType.C, - ); - Typedef get dartType => _dartType ??= Typedef( - name: '_dart_$name', - returnType: returnType, - parameters: parameters, - typedefType: TypedefType.Dart, - ); - @override BindingString toBindingString(Writer w) { final s = StringBuffer(); @@ -112,18 +78,22 @@ class Func extends LookUpBinding { } // Resolve name conflicts in function parameter names. final paramNamer = UniqueNamer({}); - for (final p in parameters) { + for (final p in functionType.parameters) { p.name = paramNamer.makeUnique(p.name); } // Write enclosing function. - if (w.dartBool && returnType.broadType == BroadType.Boolean) { + if (w.dartBool && + functionType.returnType.getBaseTypealiasType().broadType == + BroadType.Boolean) { // Use bool return type in enclosing function. s.write('bool $enclosingFuncName(\n'); } else { - s.write('${returnType.getDartType(w)} $enclosingFuncName(\n'); + s.write( + '${functionType.returnType.getDartType(w)} $enclosingFuncName(\n'); } - for (final p in parameters) { - if (w.dartBool && p.type.broadType == BroadType.Boolean) { + for (final p in functionType.parameters) { + if (w.dartBool && + p.type.getBaseTypealiasType().broadType == BroadType.Boolean) { // Use bool parameter type in enclosing function. s.write(' bool ${p.name},\n'); } else { @@ -134,15 +104,16 @@ class Func extends LookUpBinding { s.write('return $funcVarName'); s.write('(\n'); - for (final p in parameters) { - if (w.dartBool && p.type.broadType == BroadType.Boolean) { + for (final p in functionType.parameters) { + if (w.dartBool && + p.type.getBaseTypealiasType().broadType == BroadType.Boolean) { // Convert bool parameter to int before calling. s.write(' ${p.name}?1:0,\n'); } else { s.write(' ${p.name},\n'); } } - if (w.dartBool && returnType.broadType == BroadType.Boolean) { + if (w.dartBool && functionType.returnType.broadType == BroadType.Boolean) { // Convert int return type to bool. s.write(' )!=0;\n'); } else { @@ -150,27 +121,42 @@ class Func extends LookUpBinding { } s.write('}\n'); - // Write function pointer. - s.write( - "late final $funcPointerName = ${w.lookupFuncIdentifier}<${w.ffiLibraryPrefix}.NativeFunction<${cType.name}>>('$originalName');\n"); - // Write function variable. - s.write( - 'late final ${dartType.name} $funcVarName = $funcPointerName.asFunction<${dartType.name}>();\n\n'); + final cType = exposeSymbolAddress + ? _exposedFunctionType!.getCType(w) + : functionType.getCType(w, writeArgumentNames: false); + final dartType = functionType.getDartType(w, writeArgumentNames: false); if (exposeSymbolAddress) { // Add to SymbolAddress in writer. w.symbolAddressWriter.addSymbol( type: - '${w.ffiLibraryPrefix}.Pointer<${w.ffiLibraryPrefix}.NativeFunction<${cType.name}>>', + '${w.ffiLibraryPrefix}.Pointer<${w.ffiLibraryPrefix}.NativeFunction<$cType>>', name: name, ptrName: funcPointerName, ); } + // Write function pointer. + s.write( + "late final $funcPointerName = ${w.lookupFuncIdentifier}<${w.ffiLibraryPrefix}.NativeFunction<$cType>>('$originalName');\n"); + s.write( + 'late final $funcVarName = $funcPointerName.asFunction<$dartType>();\n\n'); + return BindingString(type: BindingStringType.func, string: s.toString()); } + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + + dependencies.add(this); + if (exposeSymbolAddress) { + _exposedFunctionType!.addDependencies(dependencies); + } + functionType.addDependencies(dependencies); + } } -/// Represents a Parameter, used in [Func] and [Typedef]. +/// Represents a Parameter, used in [Func] and [Typealias]. class Parameter { final String? originalName; String name; @@ -180,7 +166,7 @@ class Parameter { : originalName = originalName ?? name, // A type with broadtype [BroadType.NativeFunction] is wrapped with a // pointer because this is a shorthand used in C for Pointer to function. - type = type.broadType == BroadType.NativeFunction + type = type.getBaseTypealiasType().broadType == BroadType.NativeFunction ? Type.pointer(type) : type; } diff --git a/lib/src/code_generator/global.dart b/lib/src/code_generator/global.dart index cf864cd9..df4c7f05 100644 --- a/lib/src/code_generator/global.dart +++ b/lib/src/code_generator/global.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:ffigen/src/code_generator/typedef.dart'; - import 'binding.dart'; import 'binding_string.dart'; import 'type.dart'; @@ -38,21 +36,6 @@ class Global extends LookUpBinding { dartDoc: dartDoc, ); - List? _typedefDependencies; - @override - List getTypedefDependencies(Writer w) { - if (_typedefDependencies == null) { - _typedefDependencies = []; - - // Add typedef's required by the variable's type. - final valueType = type.getBaseType(); - if (valueType.broadType == BroadType.NativeFunction) { - _typedefDependencies!.addAll(valueType.nativeFunc!.getDependencies()); - } - } - return _typedefDependencies!; - } - @override BindingString toBindingString(Writer w) { final s = StringBuffer(); @@ -66,8 +49,9 @@ class Global extends LookUpBinding { s.write( "late final ${w.ffiLibraryPrefix}.Pointer<$cType> $pointerName = ${w.lookupFuncIdentifier}<$cType>('$originalName');\n\n"); - if (type.broadType == BroadType.Compound) { - if (type.compound!.isOpaque) { + final baseTypealiasType = type.getBaseTypealiasType(); + if (baseTypealiasType.broadType == BroadType.Compound) { + if (baseTypealiasType.compound!.isOpaque) { s.write( '${w.ffiLibraryPrefix}.Pointer<$cType> get $globalVarName => $pointerName;\n\n'); } else { @@ -90,4 +74,12 @@ class Global extends LookUpBinding { return BindingString(type: BindingStringType.global, string: s.toString()); } + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + + dependencies.add(this); + type.addDependencies(dependencies); + } } diff --git a/lib/src/code_generator/library.dart b/lib/src/code_generator/library.dart index c29313f6..57776bb4 100644 --- a/lib/src/code_generator/library.dart +++ b/lib/src/code_generator/library.dart @@ -18,7 +18,7 @@ final _logger = Logger('ffigen.code_generator.library'); /// Container for all Bindings. class Library { /// List of bindings in this library. - final List bindings; + late List bindings; late Writer _writer; Writer get writer => _writer; @@ -26,17 +26,26 @@ class Library { Library({ required String name, String? description, - required this.bindings, + required List bindings, String? header, bool dartBool = true, bool sort = false, StructPackingOverride? packingOverride, }) { - if (sort) _sort(); + /// Get all dependencies (includes itself). + final dependencies = {}; + bindings.forEach((b) => b.addDependencies(dependencies)); + + /// Save bindings. + this.bindings = dependencies.toList(); + + if (sort) { + _sort(); + } /// Handle any declaration-declaration name conflicts. final declConflictHandler = UniqueNamer({}); - for (final b in bindings) { + for (final b in this.bindings) { _warnIfPrivateDeclaration(b); _resolveIfNameConflicts(declConflictHandler, b); } @@ -44,7 +53,7 @@ class Library { // Override pack values according to config. We do this after declaration // conflicts have been handled so that users can target the generated names. if (packingOverride != null) { - for (final b in bindings) { + for (final b in this.bindings) { if (b is Struc && packingOverride.isOverriden(b.name)) { b.pack = packingOverride.getOverridenPackValue(b.name); } @@ -52,8 +61,9 @@ class Library { } // Seperate bindings which require lookup. - final lookUpBindings = bindings.whereType().toList(); - final noLookUpBindings = bindings.whereType().toList(); + final lookUpBindings = this.bindings.whereType().toList(); + final noLookUpBindings = + this.bindings.whereType().toList(); _writer = Writer( lookUpBindings: lookUpBindings, diff --git a/lib/src/code_generator/type.dart b/lib/src/code_generator/type.dart index c306395c..0a7e9418 100644 --- a/lib/src/code_generator/type.dart +++ b/lib/src/code_generator/type.dart @@ -5,7 +5,7 @@ import 'package:ffigen/src/code_generator.dart'; import 'compound.dart'; -import 'typedef.dart'; +import 'typealias.dart'; import 'writer.dart'; class _SubType { @@ -39,10 +39,18 @@ enum BroadType { Compound, NativeFunction, + /// Represents a function type. + FunctionType, + + /// Represents a typealias. + Typealias, + /// Represents a Dart_Handle. Handle, - /// Stores its element type in NativeType as only those are supported. + Enum, + + /// Represents an Array type. ConstantArray, IncompleteArray, @@ -68,11 +76,23 @@ class Type { SupportedNativeType.IntPtr: _SubType(c: 'IntPtr', dart: 'int'), }; + /// Enum type is mapped to [SupportedNativeType.Int32]. + static const enumNativeType = SupportedNativeType.Int32; + /// Reference to the [Compound] binding this type refers to. Compound? compound; - /// Reference to the [Typedef] this type refers to. - Typedef? nativeFunc; + /// Reference to the [NativeFunc] this type refers to. + NativeFunc? nativeFunc; + + /// Reference to the [Typealias] this type refers to. + Typealias? typealias; + + /// Reference to the [FunctionType] this type refers to. + FunctionType? functionType; + + /// Reference to the [EnumClass] this type refers to. + EnumClass? enumClass; /// For providing [SupportedNativeType] only. final SupportedNativeType? nativeType; @@ -93,8 +113,11 @@ class Type { required this.broadType, this.child, this.compound, + this.enumClass, this.nativeType, this.nativeFunc, + this.typealias, + this.functionType, this.length, this.unimplementedReason, }); @@ -111,9 +134,19 @@ class Type { factory Type.union(Union union) { return Type._(broadType: BroadType.Compound, compound: union); } - factory Type.nativeFunc(Typedef nativeFunc) { + factory Type.enumClass(EnumClass enumClass) { + return Type._(broadType: BroadType.Enum, enumClass: enumClass); + } + factory Type.functionType(FunctionType functionType) { + return Type._( + broadType: BroadType.FunctionType, functionType: functionType); + } + factory Type.nativeFunc(NativeFunc nativeFunc) { return Type._(broadType: BroadType.NativeFunction, nativeFunc: nativeFunc); } + factory Type.typealias(Typealias typealias) { + return Type._(broadType: BroadType.Typealias, typealias: typealias); + } factory Type.nativeType(SupportedNativeType nativeType) { return Type._(broadType: BroadType.NativeType, nativeType: nativeType); } @@ -143,6 +176,26 @@ class Type { return Type._(broadType: BroadType.Handle); } + /// Get all dependencies of this type and save them in [dependencies]. + void addDependencies(Set dependencies) { + switch (broadType) { + case BroadType.Compound: + return compound!.addDependencies(dependencies); + case BroadType.NativeFunction: + return nativeFunc!.addDependencies(dependencies); + case BroadType.FunctionType: + return functionType!.addDependencies(dependencies); + case BroadType.Typealias: + return typealias!.addDependencies(dependencies); + case BroadType.Enum: + return enumClass!.addDependencies(dependencies); + default: + if (child != null) { + return child!.addDependencies(dependencies); + } + } + } + /// Get base type for any type. /// /// E.g int** has base [Type] of int. @@ -167,16 +220,33 @@ class Type { } } - bool get isPrimitive => - (broadType == BroadType.NativeType || broadType == BroadType.Boolean); + /// Get base typealias type. + /// + /// Returns itself if it's not a Typealias. + Type getBaseTypealiasType() { + if (broadType == BroadType.Typealias) { + return typealias!.type.getBaseTypealiasType(); + } else { + return this; + } + } + + /// Function to check if the dart and C type string are same. + bool sameDartAndCType(Writer w) => getCType(w) == getDartType(w); /// Returns true if the type is a [Compound] and is incomplete. - bool get isIncompleteCompound => - (broadType == BroadType.Compound && - compound != null && - compound!.isInComplete) || - (broadType == BroadType.ConstantArray && - getBaseArrayType().isIncompleteCompound); + bool get isIncompleteCompound { + final baseTypealiasType = getBaseTypealiasType(); + if (baseTypealiasType == this) { + return (broadType == BroadType.Compound && + compound != null && + compound!.isInComplete) || + (broadType == BroadType.ConstantArray && + getBaseArrayType().isIncompleteCompound); + } else { + return baseTypealiasType.isIncompleteCompound; + } + } String getCType(Writer w) { switch (broadType) { @@ -186,8 +256,10 @@ class Type { return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; case BroadType.Compound: return '${compound!.name}'; + case BroadType.Enum: + return '${w.ffiLibraryPrefix}.${_primitives[enumNativeType]!.c}'; case BroadType.NativeFunction: - return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.name}>'; + return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.type.getCType(w)}>'; case BroadType .IncompleteArray: // Array parameters are treated as Pointers in C. return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; @@ -198,8 +270,12 @@ class Type { return '${w.ffiLibraryPrefix}.${_primitives[SupportedNativeType.Uint8]!.c}'; case BroadType.Handle: return '${w.ffiLibraryPrefix}.Handle'; - default: - throw Exception('cType unknown'); + case BroadType.FunctionType: + return functionType!.getCType(w); + case BroadType.Typealias: + return typealias!.name; + case BroadType.Unimplemented: + throw UnimplementedError('C type unknown for ${broadType.toString()}'); } } @@ -211,8 +287,10 @@ class Type { return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; case BroadType.Compound: return '${compound!.name}'; + case BroadType.Enum: + return _primitives[enumNativeType]!.dart; case BroadType.NativeFunction: - return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.name}>'; + return '${w.ffiLibraryPrefix}.NativeFunction<${nativeFunc!.type.getDartType(w)}>'; case BroadType .IncompleteArray: // Array parameters are treated as Pointers in C. return '${w.ffiLibraryPrefix}.Pointer<${child!.getCType(w)}>'; @@ -223,8 +301,19 @@ class Type { return _primitives[SupportedNativeType.Uint8]!.dart; case BroadType.Handle: return 'Object'; - default: - throw Exception('dart type unknown for ${broadType.toString()}'); + case BroadType.FunctionType: + return functionType!.getDartType(w); + case BroadType.Typealias: + // Typealias cannot be used by name in Dart types unless both the C and + // Dart type of the underlying types are same. + if (typealias!.type.sameDartAndCType(w)) { + return typealias!.name; + } else { + return typealias!.type.getDartType(w); + } + case BroadType.Unimplemented: + throw UnimplementedError( + 'dart type unknown for ${broadType.toString()}'); } } @@ -233,3 +322,66 @@ class Type { return 'Type: $broadType'; } } + +/// Represents a function type. +class FunctionType { + final Type returnType; + final List parameters; + + FunctionType({ + required this.returnType, + required this.parameters, + }); + + String getCType(Writer w, {bool writeArgumentNames = true}) { + final sb = StringBuffer(); + + // Write return Type. + sb.write(returnType.getCType(w)); + + // Write Function. + sb.write(' Function('); + sb.write(parameters.map((p) { + return '${p.type.getCType(w)} ${writeArgumentNames ? p.name : ""}'; + }).join(', ')); + sb.write(')'); + + return sb.toString(); + } + + String getDartType(Writer w, {bool writeArgumentNames = true}) { + final sb = StringBuffer(); + + // Write return Type. + sb.write(returnType.getDartType(w)); + + // Write Function. + sb.write(' Function('); + sb.write(parameters.map((p) { + return '${p.type.getDartType(w)} ${writeArgumentNames ? p.name : ""}'; + }).join(', ')); + sb.write(')'); + + return sb.toString(); + } + + void addDependencies(Set dependencies) { + returnType.addDependencies(dependencies); + parameters.forEach((p) => p.type.addDependencies(dependencies)); + } +} + +/// Represents a NativeFunction. +class NativeFunc { + final Type type; + + NativeFunc.fromFunctionType(FunctionType functionType) + : type = Type.functionType(functionType); + + NativeFunc.fromFunctionTypealias(Typealias typealias) + : type = Type.typealias(typealias); + + void addDependencies(Set dependencies) { + type.addDependencies(dependencies); + } +} diff --git a/lib/src/code_generator/typealias.dart b/lib/src/code_generator/typealias.dart new file mode 100644 index 00000000..ada848ef --- /dev/null +++ b/lib/src/code_generator/typealias.dart @@ -0,0 +1,52 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:ffigen/src/code_generator.dart'; + +import 'binding_string.dart'; +import 'type.dart'; +import 'utils.dart'; +import 'writer.dart'; + +/// A simple Typealias, Expands to - +/// +/// ```dart +/// typedef $name = $type; +/// ); +/// ``` +class Typealias extends NoLookUpBinding { + final Type type; + + Typealias({ + String? usr, + String? originalName, + String? dartDoc, + required String name, + required this.type, + }) : super( + usr: usr, + name: name, + dartDoc: dartDoc, + originalName: originalName, + ); + + @override + void addDependencies(Set dependencies) { + if (dependencies.contains(this)) return; + + dependencies.add(this); + type.addDependencies(dependencies); + } + + @override + BindingString toBindingString(Writer w) { + final sb = StringBuffer(); + if (dartDoc != null) { + sb.write(makeDartDoc(dartDoc!)); + } + sb.write('typedef $name = ${type.getCType(w)};\n'); + return BindingString( + type: BindingStringType.typeDef, string: sb.toString()); + } +} diff --git a/lib/src/code_generator/typedef.dart b/lib/src/code_generator/typedef.dart deleted file mode 100644 index 53bc46eb..00000000 --- a/lib/src/code_generator/typedef.dart +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:ffigen/src/code_generator.dart'; - -import 'func.dart' show Parameter; -import 'type.dart'; -import 'utils.dart'; -import 'writer.dart'; - -/// A simple typedef, Expands to - -/// -/// ```dart -/// typedef $name = $returnType Function( -/// $parameter1..., -/// $parameter2..., -/// . -/// . -/// ); -/// ``` -/// Return/Parameter types can be of for C/Dart signarture depending on [typedefType]. -/// -/// Note: re-set [name] after resolving name conflicts. -class Typedef { - String name; - String? dartDoc; - final Type returnType; - final TypedefType typedefType; - final List parameters; - - Typedef({ - required this.name, - this.dartDoc, - required this.returnType, - required this.typedefType, - List? parameters, - }) : parameters = parameters ?? []; - - /// Returns the [Typedef] dependencies required by this typedef including itself. - List getDependencies() { - final dep = []; - for (final p in parameters) { - final base = p.type.getBaseType(); - if (base.broadType == BroadType.NativeFunction) { - dep.addAll(base.nativeFunc!.getDependencies()); - } - } - final returnTypeBase = returnType.getBaseType(); - if (returnTypeBase.broadType == BroadType.NativeFunction) { - dep.addAll(returnTypeBase.nativeFunc!.getDependencies()); - } - dep.add(this); - return dep; - } - - String toTypedefString(Writer w) { - final s = StringBuffer(); - if (dartDoc != null) { - s.write(makeDartDoc(dartDoc!)); - } - final typedefName = name; - final paramNamer = UniqueNamer({}); - if (typedefType == TypedefType.C) { - s.write('typedef $typedefName = ${returnType.getCType(w)} Function(\n'); - for (final p in parameters) { - final name = p.name.isNotEmpty ? paramNamer.makeUnique(p.name) : p.name; - s.write(' ${p.type.getCType(w)} $name,\n'); - } - s.write(');\n\n'); - } else { - s.write( - 'typedef $typedefName = ${returnType.getDartType(w)} Function(\n'); - for (final p in parameters) { - final name = p.name.isNotEmpty ? paramNamer.makeUnique(p.name) : p.name; - - s.write(' ${p.type.getDartType(w)} $name,\n'); - } - s.write(');\n\n'); - } - - return s.toString(); - } -} - -enum TypedefType { C, Dart } diff --git a/lib/src/code_generator/writer.dart b/lib/src/code_generator/writer.dart index 10d1d573..2b9a0c96 100644 --- a/lib/src/code_generator/writer.dart +++ b/lib/src/code_generator/writer.dart @@ -5,7 +5,6 @@ import 'package:ffigen/src/code_generator/utils.dart'; import 'binding.dart'; -import 'typedef.dart'; /// To store generated String bindings. class Writer { @@ -165,20 +164,6 @@ class Writer { s.write("import 'dart:ffi' as $ffiLibraryPrefix;\n"); s.write('\n'); - // Will contain duplicates, must be processed. - final rawDependencies = []; - - /// Get typedef dependencies, these will be written at the end. - for (final b in lookUpBindings) { - rawDependencies.addAll(b.getTypedefDependencies(this)); - } - for (final b in noLookUpBindings) { - rawDependencies.addAll(b.getTypedefDependencies(this)); - } - - // Dependencies, processed to remove duplicates and resolve name conflicts. - final dependencies = processDependencies(rawDependencies); - /// Write [lookUpBindings]. if (lookUpBindings.isNotEmpty) { // Write doc comment for wrapper class. @@ -221,38 +206,8 @@ class Writer { s.write(b.toBindingString(this).string); } - // Write typedef dependencies. - for (final d in dependencies) { - s.write(d.toTypedefString(this)); - } - return s.toString(); } - - /// Removes duplicates and resolves all name conflicts. - Set processDependencies(List dependencies) { - final processedDependencies = dependencies.toSet(); - - for (final d in processedDependencies) { - d.name = _makeUniqueTypedefName(d.name); - } - return processedDependencies; - } - - /// Returns a typedef name that is unique in both top level and wrapper level, - /// ans only marks it as used at top-level. - String _makeUniqueTypedefName(String name) { - final base = name; - var uniqueName = name; - var suffix = 0; - while (topLevelUniqueNamer.isUsed(uniqueName) || - wrapperLevelUniqueNamer.isUsed(uniqueName)) { - suffix++; - uniqueName = base + suffix.toString(); - } - topLevelUniqueNamer.markUsed(uniqueName); - return uniqueName; - } } /// Manages the generated `_SymbolAddress` class. diff --git a/lib/src/config_provider/config.dart b/lib/src/config_provider/config.dart index 92194dc1..57c0019e 100644 --- a/lib/src/config_provider/config.dart +++ b/lib/src/config_provider/config.dart @@ -63,6 +63,10 @@ class Config { Declaration get macroDecl => _macroDecl; late Declaration _macroDecl; + /// Declaration config for Typedefs. + Declaration get typedefs => _typedefs; + late Declaration _typedefs; + /// If generated bindings should be sorted alphabetically. bool get sort => _sort; late bool _sort; @@ -286,6 +290,15 @@ class Config { _macroDecl = result as Declaration; }, ), + [strings.typedefs]: Specification( + requirement: Requirement.no, + validator: declarationConfigValidator, + extractor: declarationConfigExtractor, + defaultValue: () => Declaration(), + extractedResult: (dynamic result) { + _typedefs = result as Declaration; + }, + ), [strings.sizemap]: Specification>( validator: sizemapValidator, extractor: sizemapExtractor, diff --git a/lib/src/header_parser/clang_bindings/clang_bindings.dart b/lib/src/header_parser/clang_bindings/clang_bindings.dart index 05255655..6f021006 100644 --- a/lib/src/header_parser/clang_bindings/clang_bindings.dart +++ b/lib/src/header_parser/clang_bindings/clang_bindings.dart @@ -33,9 +33,10 @@ class Clang { } late final _clang_getCString_ptr = - _lookup>('clang_getCString'); - late final _dart_clang_getCString _clang_getCString = - _clang_getCString_ptr.asFunction<_dart_clang_getCString>(); + _lookup Function(CXString)>>( + 'clang_getCString'); + late final _clang_getCString = _clang_getCString_ptr + .asFunction Function(CXString)>(); /// Free the given string. void clang_disposeString( @@ -47,10 +48,10 @@ class Clang { } late final _clang_disposeString_ptr = - _lookup>( + _lookup>( 'clang_disposeString'); - late final _dart_clang_disposeString _clang_disposeString = - _clang_disposeString_ptr.asFunction<_dart_clang_disposeString>(); + late final _clang_disposeString = + _clang_disposeString_ptr.asFunction(); /// Provides a shared context for creating translation units. /// @@ -90,7 +91,7 @@ class Clang { /// This process of creating the 'pch', loading it separately, and using it (via /// -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks /// (which gives the indexer the same performance benefit as the compiler). - ffi.Pointer clang_createIndex( + CXIndex clang_createIndex( int excludeDeclarationsFromPCH, int displayDiagnostics, ) { @@ -101,16 +102,17 @@ class Clang { } late final _clang_createIndex_ptr = - _lookup>('clang_createIndex'); - late final _dart_clang_createIndex _clang_createIndex = - _clang_createIndex_ptr.asFunction<_dart_clang_createIndex>(); + _lookup>( + 'clang_createIndex'); + late final _clang_createIndex = + _clang_createIndex_ptr.asFunction(); /// Destroy the given index. /// /// The index must not be destroyed until all of the translation units created /// within that index have been destroyed. void clang_disposeIndex( - ffi.Pointer index, + CXIndex index, ) { return _clang_disposeIndex( index, @@ -118,13 +120,14 @@ class Clang { } late final _clang_disposeIndex_ptr = - _lookup>('clang_disposeIndex'); - late final _dart_clang_disposeIndex _clang_disposeIndex = - _clang_disposeIndex_ptr.asFunction<_dart_clang_disposeIndex>(); + _lookup>( + 'clang_disposeIndex'); + late final _clang_disposeIndex = + _clang_disposeIndex_ptr.asFunction(); /// Retrieve the complete file and path name of the given file. CXString clang_getFileName( - ffi.Pointer SFile, + CXFile SFile, ) { return _clang_getFileName( SFile, @@ -132,9 +135,10 @@ class Clang { } late final _clang_getFileName_ptr = - _lookup>('clang_getFileName'); - late final _dart_clang_getFileName _clang_getFileName = - _clang_getFileName_ptr.asFunction<_dart_clang_getFileName>(); + _lookup>( + 'clang_getFileName'); + late final _clang_getFileName = + _clang_getFileName_ptr.asFunction(); /// Determine whether two ranges are equivalent. /// @@ -149,10 +153,12 @@ class Clang { ); } - late final _clang_equalRanges_ptr = - _lookup>('clang_equalRanges'); - late final _dart_clang_equalRanges _clang_equalRanges = - _clang_equalRanges_ptr.asFunction<_dart_clang_equalRanges>(); + late final _clang_equalRanges_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function( + CXSourceRange, CXSourceRange)>>('clang_equalRanges'); + late final _clang_equalRanges = _clang_equalRanges_ptr + .asFunction(); /// Retrieve the file, line, column, and offset represented by /// the given source location. @@ -177,7 +183,7 @@ class Clang { /// buffer to which the given source location points. void clang_getFileLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -191,16 +197,26 @@ class Clang { ); } - late final _clang_getFileLocation_ptr = - _lookup>( - 'clang_getFileLocation'); - late final _dart_clang_getFileLocation _clang_getFileLocation = - _clang_getFileLocation_ptr.asFunction<_dart_clang_getFileLocation>(); + late final _clang_getFileLocation_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getFileLocation'); + late final _clang_getFileLocation = _clang_getFileLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Determine the number of diagnostics produced for the given /// translation unit. int clang_getNumDiagnostics( - ffi.Pointer Unit, + CXTranslationUnit Unit, ) { return _clang_getNumDiagnostics( Unit, @@ -208,10 +224,10 @@ class Clang { } late final _clang_getNumDiagnostics_ptr = - _lookup>( + _lookup>( 'clang_getNumDiagnostics'); - late final _dart_clang_getNumDiagnostics _clang_getNumDiagnostics = - _clang_getNumDiagnostics_ptr.asFunction<_dart_clang_getNumDiagnostics>(); + late final _clang_getNumDiagnostics = _clang_getNumDiagnostics_ptr + .asFunction(); /// Retrieve a diagnostic associated with the given translation unit. /// @@ -220,8 +236,8 @@ class Clang { /// /// \returns the requested diagnostic. This diagnostic must be freed /// via a call to \c clang_disposeDiagnostic(). - ffi.Pointer clang_getDiagnostic( - ffi.Pointer Unit, + CXDiagnostic clang_getDiagnostic( + CXTranslationUnit Unit, int Index, ) { return _clang_getDiagnostic( @@ -230,15 +246,16 @@ class Clang { ); } - late final _clang_getDiagnostic_ptr = - _lookup>( - 'clang_getDiagnostic'); - late final _dart_clang_getDiagnostic _clang_getDiagnostic = - _clang_getDiagnostic_ptr.asFunction<_dart_clang_getDiagnostic>(); + late final _clang_getDiagnostic_ptr = _lookup< + ffi.NativeFunction< + CXDiagnostic Function( + CXTranslationUnit, ffi.Uint32)>>('clang_getDiagnostic'); + late final _clang_getDiagnostic = _clang_getDiagnostic_ptr + .asFunction(); /// Destroy a diagnostic. void clang_disposeDiagnostic( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, ) { return _clang_disposeDiagnostic( Diagnostic, @@ -246,10 +263,10 @@ class Clang { } late final _clang_disposeDiagnostic_ptr = - _lookup>( + _lookup>( 'clang_disposeDiagnostic'); - late final _dart_clang_disposeDiagnostic _clang_disposeDiagnostic = - _clang_disposeDiagnostic_ptr.asFunction<_dart_clang_disposeDiagnostic>(); + late final _clang_disposeDiagnostic = + _clang_disposeDiagnostic_ptr.asFunction(); /// Format the given diagnostic in a manner that is suitable for display. /// @@ -265,7 +282,7 @@ class Clang { /// /// \returns A new string containing for formatted diagnostic. CXString clang_formatDiagnostic( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, int Options, ) { return _clang_formatDiagnostic( @@ -275,17 +292,17 @@ class Clang { } late final _clang_formatDiagnostic_ptr = - _lookup>( + _lookup>( 'clang_formatDiagnostic'); - late final _dart_clang_formatDiagnostic _clang_formatDiagnostic = - _clang_formatDiagnostic_ptr.asFunction<_dart_clang_formatDiagnostic>(); + late final _clang_formatDiagnostic = _clang_formatDiagnostic_ptr + .asFunction(); /// Same as \c clang_parseTranslationUnit2, but returns /// the \c CXTranslationUnit instead of an error code. In case of an error this /// routine returns a \c NULL \c CXTranslationUnit, without further detailed /// error codes. - ffi.Pointer clang_parseTranslationUnit( - ffi.Pointer CIdx, + CXTranslationUnit clang_parseTranslationUnit( + CXIndex CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, int num_command_line_args, @@ -304,16 +321,30 @@ class Clang { ); } - late final _clang_parseTranslationUnit_ptr = - _lookup>( - 'clang_parseTranslationUnit'); - late final _dart_clang_parseTranslationUnit _clang_parseTranslationUnit = - _clang_parseTranslationUnit_ptr - .asFunction<_dart_clang_parseTranslationUnit>(); + late final _clang_parseTranslationUnit_ptr = _lookup< + ffi.NativeFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32)>>('clang_parseTranslationUnit'); + late final _clang_parseTranslationUnit = + _clang_parseTranslationUnit_ptr.asFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + int)>(); /// Destroy the specified CXTranslationUnit object. void clang_disposeTranslationUnit( - ffi.Pointer arg0, + CXTranslationUnit arg0, ) { return _clang_disposeTranslationUnit( arg0, @@ -321,18 +352,17 @@ class Clang { } late final _clang_disposeTranslationUnit_ptr = - _lookup>( + _lookup>( 'clang_disposeTranslationUnit'); - late final _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit = - _clang_disposeTranslationUnit_ptr - .asFunction<_dart_clang_disposeTranslationUnit>(); + late final _clang_disposeTranslationUnit = _clang_disposeTranslationUnit_ptr + .asFunction(); /// Retrieve the cursor that represents the given translation unit. /// /// The translation unit cursor can be used to start traversing the /// various declarations within the given translation unit. CXCursor clang_getTranslationUnitCursor( - ffi.Pointer arg0, + CXTranslationUnit arg0, ) { return _clang_getTranslationUnitCursor( arg0, @@ -340,11 +370,11 @@ class Clang { } late final _clang_getTranslationUnitCursor_ptr = - _lookup>( + _lookup>( 'clang_getTranslationUnitCursor'); - late final _dart_clang_getTranslationUnitCursor - _clang_getTranslationUnitCursor = _clang_getTranslationUnitCursor_ptr - .asFunction<_dart_clang_getTranslationUnitCursor>(); + late final _clang_getTranslationUnitCursor = + _clang_getTranslationUnitCursor_ptr + .asFunction(); /// Returns non-zero if \p cursor is null. int clang_Cursor_isNull( @@ -356,10 +386,10 @@ class Clang { } late final _clang_Cursor_isNull_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isNull'); - late final _dart_clang_Cursor_isNull _clang_Cursor_isNull = - _clang_Cursor_isNull_ptr.asFunction<_dart_clang_Cursor_isNull>(); + late final _clang_Cursor_isNull = + _clang_Cursor_isNull_ptr.asFunction(); /// Retrieve the kind of the given cursor. int clang_getCursorKind( @@ -371,10 +401,10 @@ class Clang { } late final _clang_getCursorKind_ptr = - _lookup>( + _lookup>( 'clang_getCursorKind'); - late final _dart_clang_getCursorKind _clang_getCursorKind = - _clang_getCursorKind_ptr.asFunction<_dart_clang_getCursorKind>(); + late final _clang_getCursorKind = + _clang_getCursorKind_ptr.asFunction(); /// Determine whether the given cursor has any attributes. int clang_Cursor_hasAttrs( @@ -386,10 +416,10 @@ class Clang { } late final _clang_Cursor_hasAttrs_ptr = - _lookup>( + _lookup>( 'clang_Cursor_hasAttrs'); - late final _dart_clang_Cursor_hasAttrs _clang_Cursor_hasAttrs = - _clang_Cursor_hasAttrs_ptr.asFunction<_dart_clang_Cursor_hasAttrs>(); + late final _clang_Cursor_hasAttrs = + _clang_Cursor_hasAttrs_ptr.asFunction(); /// Retrieve the physical location of the source constructor referenced /// by the given cursor. @@ -408,10 +438,10 @@ class Clang { } late final _clang_getCursorLocation_ptr = - _lookup>( + _lookup>( 'clang_getCursorLocation'); - late final _dart_clang_getCursorLocation _clang_getCursorLocation = - _clang_getCursorLocation_ptr.asFunction<_dart_clang_getCursorLocation>(); + late final _clang_getCursorLocation = _clang_getCursorLocation_ptr + .asFunction(); /// Retrieve the type of a CXCursor (if any). CXType clang_getCursorType( @@ -423,10 +453,10 @@ class Clang { } late final _clang_getCursorType_ptr = - _lookup>( + _lookup>( 'clang_getCursorType'); - late final _dart_clang_getCursorType _clang_getCursorType = - _clang_getCursorType_ptr.asFunction<_dart_clang_getCursorType>(); + late final _clang_getCursorType = + _clang_getCursorType_ptr.asFunction(); /// Pretty-print the underlying type using the rules of the /// language of the translation unit from which it came. @@ -441,10 +471,10 @@ class Clang { } late final _clang_getTypeSpelling_ptr = - _lookup>( + _lookup>( 'clang_getTypeSpelling'); - late final _dart_clang_getTypeSpelling _clang_getTypeSpelling = - _clang_getTypeSpelling_ptr.asFunction<_dart_clang_getTypeSpelling>(); + late final _clang_getTypeSpelling = + _clang_getTypeSpelling_ptr.asFunction(); /// Retrieve the underlying type of a typedef declaration. /// @@ -459,12 +489,11 @@ class Clang { } late final _clang_getTypedefDeclUnderlyingType_ptr = - _lookup>( + _lookup>( 'clang_getTypedefDeclUnderlyingType'); - late final _dart_clang_getTypedefDeclUnderlyingType - _clang_getTypedefDeclUnderlyingType = + late final _clang_getTypedefDeclUnderlyingType = _clang_getTypedefDeclUnderlyingType_ptr - .asFunction<_dart_clang_getTypedefDeclUnderlyingType>(); + .asFunction(); /// Retrieve the integer value of an enum constant declaration as a signed /// long long. @@ -481,11 +510,10 @@ class Clang { } late final _clang_getEnumConstantDeclValue_ptr = - _lookup>( + _lookup>( 'clang_getEnumConstantDeclValue'); - late final _dart_clang_getEnumConstantDeclValue - _clang_getEnumConstantDeclValue = _clang_getEnumConstantDeclValue_ptr - .asFunction<_dart_clang_getEnumConstantDeclValue>(); + late final _clang_getEnumConstantDeclValue = + _clang_getEnumConstantDeclValue_ptr.asFunction(); /// Retrieve the bit width of a bit field declaration as an integer. /// @@ -499,11 +527,10 @@ class Clang { } late final _clang_getFieldDeclBitWidth_ptr = - _lookup>( + _lookup>( 'clang_getFieldDeclBitWidth'); - late final _dart_clang_getFieldDeclBitWidth _clang_getFieldDeclBitWidth = - _clang_getFieldDeclBitWidth_ptr - .asFunction<_dart_clang_getFieldDeclBitWidth>(); + late final _clang_getFieldDeclBitWidth = + _clang_getFieldDeclBitWidth_ptr.asFunction(); /// Retrieve the number of non-variadic arguments associated with a given /// cursor. @@ -519,11 +546,10 @@ class Clang { } late final _clang_Cursor_getNumArguments_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getNumArguments'); - late final _dart_clang_Cursor_getNumArguments _clang_Cursor_getNumArguments = - _clang_Cursor_getNumArguments_ptr - .asFunction<_dart_clang_Cursor_getNumArguments>(); + late final _clang_Cursor_getNumArguments = + _clang_Cursor_getNumArguments_ptr.asFunction(); /// Retrieve the argument cursor of a function or method. /// @@ -541,11 +567,10 @@ class Clang { } late final _clang_Cursor_getArgument_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getArgument'); - late final _dart_clang_Cursor_getArgument _clang_Cursor_getArgument = - _clang_Cursor_getArgument_ptr - .asFunction<_dart_clang_Cursor_getArgument>(); + late final _clang_Cursor_getArgument = _clang_Cursor_getArgument_ptr + .asFunction(); /// Return the canonical type for a CXType. /// @@ -562,10 +587,10 @@ class Clang { } late final _clang_getCanonicalType_ptr = - _lookup>( + _lookup>( 'clang_getCanonicalType'); - late final _dart_clang_getCanonicalType _clang_getCanonicalType = - _clang_getCanonicalType_ptr.asFunction<_dart_clang_getCanonicalType>(); + late final _clang_getCanonicalType = + _clang_getCanonicalType_ptr.asFunction(); /// Determine whether a CXCursor that is a macro, is /// function like. @@ -578,11 +603,11 @@ class Clang { } late final _clang_Cursor_isMacroFunctionLike_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroFunctionLike'); - late final _dart_clang_Cursor_isMacroFunctionLike - _clang_Cursor_isMacroFunctionLike = _clang_Cursor_isMacroFunctionLike_ptr - .asFunction<_dart_clang_Cursor_isMacroFunctionLike>(); + late final _clang_Cursor_isMacroFunctionLike = + _clang_Cursor_isMacroFunctionLike_ptr + .asFunction(); /// Determine whether a CXCursor that is a macro, is a /// builtin one. @@ -595,11 +620,10 @@ class Clang { } late final _clang_Cursor_isMacroBuiltin_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroBuiltin'); - late final _dart_clang_Cursor_isMacroBuiltin _clang_Cursor_isMacroBuiltin = - _clang_Cursor_isMacroBuiltin_ptr - .asFunction<_dart_clang_Cursor_isMacroBuiltin>(); + late final _clang_Cursor_isMacroBuiltin = + _clang_Cursor_isMacroBuiltin_ptr.asFunction(); /// Determine whether a CXCursor that is a function declaration, is an /// inline declaration. @@ -612,11 +636,10 @@ class Clang { } late final _clang_Cursor_isFunctionInlined_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isFunctionInlined'); - late final _dart_clang_Cursor_isFunctionInlined - _clang_Cursor_isFunctionInlined = _clang_Cursor_isFunctionInlined_ptr - .asFunction<_dart_clang_Cursor_isFunctionInlined>(); + late final _clang_Cursor_isFunctionInlined = + _clang_Cursor_isFunctionInlined_ptr.asFunction(); /// Returns the typedef name of the given type. CXString clang_getTypedefName( @@ -628,10 +651,10 @@ class Clang { } late final _clang_getTypedefName_ptr = - _lookup>( + _lookup>( 'clang_getTypedefName'); - late final _dart_clang_getTypedefName _clang_getTypedefName = - _clang_getTypedefName_ptr.asFunction<_dart_clang_getTypedefName>(); + late final _clang_getTypedefName = + _clang_getTypedefName_ptr.asFunction(); /// For pointer types, returns the type of the pointee. CXType clang_getPointeeType( @@ -643,10 +666,10 @@ class Clang { } late final _clang_getPointeeType_ptr = - _lookup>( + _lookup>( 'clang_getPointeeType'); - late final _dart_clang_getPointeeType _clang_getPointeeType = - _clang_getPointeeType_ptr.asFunction<_dart_clang_getPointeeType>(); + late final _clang_getPointeeType = + _clang_getPointeeType_ptr.asFunction(); /// Return the cursor for the declaration of the given type. CXCursor clang_getTypeDeclaration( @@ -658,11 +681,10 @@ class Clang { } late final _clang_getTypeDeclaration_ptr = - _lookup>( + _lookup>( 'clang_getTypeDeclaration'); - late final _dart_clang_getTypeDeclaration _clang_getTypeDeclaration = - _clang_getTypeDeclaration_ptr - .asFunction<_dart_clang_getTypeDeclaration>(); + late final _clang_getTypeDeclaration = + _clang_getTypeDeclaration_ptr.asFunction(); /// Retrieve the spelling of a given CXTypeKind. CXString clang_getTypeKindSpelling( @@ -674,11 +696,10 @@ class Clang { } late final _clang_getTypeKindSpelling_ptr = - _lookup>( + _lookup>( 'clang_getTypeKindSpelling'); - late final _dart_clang_getTypeKindSpelling _clang_getTypeKindSpelling = - _clang_getTypeKindSpelling_ptr - .asFunction<_dart_clang_getTypeKindSpelling>(); + late final _clang_getTypeKindSpelling = + _clang_getTypeKindSpelling_ptr.asFunction(); /// Retrieve the return type associated with a function type. /// @@ -692,10 +713,10 @@ class Clang { } late final _clang_getResultType_ptr = - _lookup>( + _lookup>( 'clang_getResultType'); - late final _dart_clang_getResultType _clang_getResultType = - _clang_getResultType_ptr.asFunction<_dart_clang_getResultType>(); + late final _clang_getResultType = + _clang_getResultType_ptr.asFunction(); /// Retrieve the number of non-variadic parameters associated with a /// function type. @@ -710,10 +731,10 @@ class Clang { } late final _clang_getNumArgTypes_ptr = - _lookup>( + _lookup>( 'clang_getNumArgTypes'); - late final _dart_clang_getNumArgTypes _clang_getNumArgTypes = - _clang_getNumArgTypes_ptr.asFunction<_dart_clang_getNumArgTypes>(); + late final _clang_getNumArgTypes = + _clang_getNumArgTypes_ptr.asFunction(); /// Retrieve the type of a parameter of a function type. /// @@ -730,9 +751,10 @@ class Clang { } late final _clang_getArgType_ptr = - _lookup>('clang_getArgType'); - late final _dart_clang_getArgType _clang_getArgType = - _clang_getArgType_ptr.asFunction<_dart_clang_getArgType>(); + _lookup>( + 'clang_getArgType'); + late final _clang_getArgType = + _clang_getArgType_ptr.asFunction(); /// Return the number of elements of an array or vector type. /// @@ -747,10 +769,10 @@ class Clang { } late final _clang_getNumElements_ptr = - _lookup>( + _lookup>( 'clang_getNumElements'); - late final _dart_clang_getNumElements _clang_getNumElements = - _clang_getNumElements_ptr.asFunction<_dart_clang_getNumElements>(); + late final _clang_getNumElements = + _clang_getNumElements_ptr.asFunction(); /// Return the element type of an array type. /// @@ -764,11 +786,10 @@ class Clang { } late final _clang_getArrayElementType_ptr = - _lookup>( + _lookup>( 'clang_getArrayElementType'); - late final _dart_clang_getArrayElementType _clang_getArrayElementType = - _clang_getArrayElementType_ptr - .asFunction<_dart_clang_getArrayElementType>(); + late final _clang_getArrayElementType = + _clang_getArrayElementType_ptr.asFunction(); /// Retrieve the type named by the qualified-id. /// @@ -782,10 +803,10 @@ class Clang { } late final _clang_Type_getNamedType_ptr = - _lookup>( + _lookup>( 'clang_Type_getNamedType'); - late final _dart_clang_Type_getNamedType _clang_Type_getNamedType = - _clang_Type_getNamedType_ptr.asFunction<_dart_clang_Type_getNamedType>(); + late final _clang_Type_getNamedType = + _clang_Type_getNamedType_ptr.asFunction(); /// Return the alignment of a type in bytes as per C++[expr.alignof] /// standard. @@ -806,10 +827,10 @@ class Clang { } late final _clang_Type_getAlignOf_ptr = - _lookup>( + _lookup>( 'clang_Type_getAlignOf'); - late final _dart_clang_Type_getAlignOf _clang_Type_getAlignOf = - _clang_Type_getAlignOf_ptr.asFunction<_dart_clang_Type_getAlignOf>(); + late final _clang_Type_getAlignOf = + _clang_Type_getAlignOf_ptr.asFunction(); /// Determine whether the given cursor represents an anonymous /// tag or namespace @@ -822,11 +843,10 @@ class Clang { } late final _clang_Cursor_isAnonymous_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymous'); - late final _dart_clang_Cursor_isAnonymous _clang_Cursor_isAnonymous = - _clang_Cursor_isAnonymous_ptr - .asFunction<_dart_clang_Cursor_isAnonymous>(); + late final _clang_Cursor_isAnonymous = + _clang_Cursor_isAnonymous_ptr.asFunction(); /// Determine whether the given cursor represents an anonymous record /// declaration. @@ -839,12 +859,11 @@ class Clang { } late final _clang_Cursor_isAnonymousRecordDecl_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymousRecordDecl'); - late final _dart_clang_Cursor_isAnonymousRecordDecl - _clang_Cursor_isAnonymousRecordDecl = + late final _clang_Cursor_isAnonymousRecordDecl = _clang_Cursor_isAnonymousRecordDecl_ptr - .asFunction<_dart_clang_Cursor_isAnonymousRecordDecl>(); + .asFunction(); /// Visit the children of a particular cursor. /// @@ -868,8 +887,8 @@ class Clang { /// prematurely by the visitor returning \c CXChildVisit_Break. int clang_visitChildren( CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, + CXCursorVisitor visitor, + CXClientData client_data, ) { return _clang_visitChildren( parent, @@ -878,11 +897,12 @@ class Clang { ); } - late final _clang_visitChildren_ptr = - _lookup>( - 'clang_visitChildren'); - late final _dart_clang_visitChildren _clang_visitChildren = - _clang_visitChildren_ptr.asFunction<_dart_clang_visitChildren>(); + late final _clang_visitChildren_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function( + CXCursor, CXCursorVisitor, CXClientData)>>('clang_visitChildren'); + late final _clang_visitChildren = _clang_visitChildren_ptr + .asFunction(); /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced /// by the given cursor. @@ -900,9 +920,10 @@ class Clang { } late final _clang_getCursorUSR_ptr = - _lookup>('clang_getCursorUSR'); - late final _dart_clang_getCursorUSR _clang_getCursorUSR = - _clang_getCursorUSR_ptr.asFunction<_dart_clang_getCursorUSR>(); + _lookup>( + 'clang_getCursorUSR'); + late final _clang_getCursorUSR = + _clang_getCursorUSR_ptr.asFunction(); /// Retrieve a name for the entity referenced by this cursor. CXString clang_getCursorSpelling( @@ -914,10 +935,10 @@ class Clang { } late final _clang_getCursorSpelling_ptr = - _lookup>( + _lookup>( 'clang_getCursorSpelling'); - late final _dart_clang_getCursorSpelling _clang_getCursorSpelling = - _clang_getCursorSpelling_ptr.asFunction<_dart_clang_getCursorSpelling>(); + late final _clang_getCursorSpelling = + _clang_getCursorSpelling_ptr.asFunction(); /// For a cursor that is either a reference to or a declaration /// of some entity, retrieve a cursor that describes the definition of @@ -954,11 +975,10 @@ class Clang { } late final _clang_getCursorDefinition_ptr = - _lookup>( + _lookup>( 'clang_getCursorDefinition'); - late final _dart_clang_getCursorDefinition _clang_getCursorDefinition = - _clang_getCursorDefinition_ptr - .asFunction<_dart_clang_getCursorDefinition>(); + late final _clang_getCursorDefinition = + _clang_getCursorDefinition_ptr.asFunction(); /// Given a cursor that represents a declaration, return the associated /// comment's source range. The range may include multiple consecutive comments @@ -972,11 +992,10 @@ class Clang { } late final _clang_Cursor_getCommentRange_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getCommentRange'); - late final _dart_clang_Cursor_getCommentRange _clang_Cursor_getCommentRange = - _clang_Cursor_getCommentRange_ptr - .asFunction<_dart_clang_Cursor_getCommentRange>(); + late final _clang_Cursor_getCommentRange = _clang_Cursor_getCommentRange_ptr + .asFunction(); /// Given a cursor that represents a declaration, return the associated /// comment text, including comment markers. @@ -989,11 +1008,11 @@ class Clang { } late final _clang_Cursor_getRawCommentText_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getRawCommentText'); - late final _dart_clang_Cursor_getRawCommentText - _clang_Cursor_getRawCommentText = _clang_Cursor_getRawCommentText_ptr - .asFunction<_dart_clang_Cursor_getRawCommentText>(); + late final _clang_Cursor_getRawCommentText = + _clang_Cursor_getRawCommentText_ptr + .asFunction(); /// Given a cursor that represents a documentable entity (e.g., /// declaration), return the associated \paragraph; otherwise return the @@ -1007,11 +1026,11 @@ class Clang { } late final _clang_Cursor_getBriefCommentText_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getBriefCommentText'); - late final _dart_clang_Cursor_getBriefCommentText - _clang_Cursor_getBriefCommentText = _clang_Cursor_getBriefCommentText_ptr - .asFunction<_dart_clang_Cursor_getBriefCommentText>(); + late final _clang_Cursor_getBriefCommentText = + _clang_Cursor_getBriefCommentText_ptr + .asFunction(); /// \defgroup CINDEX_DEBUG Debugging facilities /// @@ -1028,16 +1047,15 @@ class Clang { } late final _clang_getCursorKindSpelling_ptr = - _lookup>( + _lookup>( 'clang_getCursorKindSpelling'); - late final _dart_clang_getCursorKindSpelling _clang_getCursorKindSpelling = - _clang_getCursorKindSpelling_ptr - .asFunction<_dart_clang_getCursorKindSpelling>(); + late final _clang_getCursorKindSpelling = + _clang_getCursorKindSpelling_ptr.asFunction(); /// If cursor is a statement declaration tries to evaluate the /// statement and if its variable, tries to evaluate its initializer, /// into its corresponding type. - ffi.Pointer clang_Cursor_Evaluate( + CXEvalResult clang_Cursor_Evaluate( CXCursor C, ) { return _clang_Cursor_Evaluate( @@ -1046,14 +1064,14 @@ class Clang { } late final _clang_Cursor_Evaluate_ptr = - _lookup>( + _lookup>( 'clang_Cursor_Evaluate'); - late final _dart_clang_Cursor_Evaluate _clang_Cursor_Evaluate = - _clang_Cursor_Evaluate_ptr.asFunction<_dart_clang_Cursor_Evaluate>(); + late final _clang_Cursor_Evaluate = + _clang_Cursor_Evaluate_ptr.asFunction(); /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getKind( E, @@ -1061,16 +1079,15 @@ class Clang { } late final _clang_EvalResult_getKind_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getKind'); - late final _dart_clang_EvalResult_getKind _clang_EvalResult_getKind = - _clang_EvalResult_getKind_ptr - .asFunction<_dart_clang_EvalResult_getKind>(); + late final _clang_EvalResult_getKind = + _clang_EvalResult_getKind_ptr.asFunction(); /// Returns the evaluation result as integer if the /// kind is Int. int clang_EvalResult_getAsInt( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsInt( E, @@ -1078,17 +1095,16 @@ class Clang { } late final _clang_EvalResult_getAsInt_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsInt'); - late final _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt = - _clang_EvalResult_getAsInt_ptr - .asFunction<_dart_clang_EvalResult_getAsInt>(); + late final _clang_EvalResult_getAsInt = + _clang_EvalResult_getAsInt_ptr.asFunction(); /// Returns the evaluation result as a long long integer if the /// kind is Int. This prevents overflows that may happen if the result is /// returned with clang_EvalResult_getAsInt. int clang_EvalResult_getAsLongLong( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsLongLong( E, @@ -1096,16 +1112,16 @@ class Clang { } late final _clang_EvalResult_getAsLongLong_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsLongLong'); - late final _dart_clang_EvalResult_getAsLongLong - _clang_EvalResult_getAsLongLong = _clang_EvalResult_getAsLongLong_ptr - .asFunction<_dart_clang_EvalResult_getAsLongLong>(); + late final _clang_EvalResult_getAsLongLong = + _clang_EvalResult_getAsLongLong_ptr + .asFunction(); /// Returns the evaluation result as double if the /// kind is double. double clang_EvalResult_getAsDouble( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsDouble( E, @@ -1113,18 +1129,17 @@ class Clang { } late final _clang_EvalResult_getAsDouble_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsDouble'); - late final _dart_clang_EvalResult_getAsDouble _clang_EvalResult_getAsDouble = - _clang_EvalResult_getAsDouble_ptr - .asFunction<_dart_clang_EvalResult_getAsDouble>(); + late final _clang_EvalResult_getAsDouble = _clang_EvalResult_getAsDouble_ptr + .asFunction(); /// Returns the evaluation result as a constant string if the /// kind is other than Int or float. User must not free this pointer, /// instead call clang_EvalResult_dispose on the CXEvalResult returned /// by clang_Cursor_Evaluate. ffi.Pointer clang_EvalResult_getAsStr( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsStr( E, @@ -1132,15 +1147,14 @@ class Clang { } late final _clang_EvalResult_getAsStr_ptr = - _lookup>( + _lookup Function(CXEvalResult)>>( 'clang_EvalResult_getAsStr'); - late final _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr = - _clang_EvalResult_getAsStr_ptr - .asFunction<_dart_clang_EvalResult_getAsStr>(); + late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStr_ptr + .asFunction Function(CXEvalResult)>(); /// Disposes the created Eval memory. void clang_EvalResult_dispose( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_dispose( E, @@ -1148,11 +1162,10 @@ class Clang { } late final _clang_EvalResult_dispose_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_dispose'); - late final _dart_clang_EvalResult_dispose _clang_EvalResult_dispose = - _clang_EvalResult_dispose_ptr - .asFunction<_dart_clang_EvalResult_dispose>(); + late final _clang_EvalResult_dispose = + _clang_EvalResult_dispose_ptr.asFunction(); } /// A character string. @@ -1189,6 +1202,13 @@ class CXUnsavedFile extends ffi.Struct { external int Length; } +/// An "index" that consists of a set of translation units that would +/// typically be linked together into an executable or library. +typedef CXIndex = ffi.Pointer; + +/// A particular source file that is part of a translation unit. +typedef CXFile = ffi.Pointer; + /// Identifies a specific source location within a translation /// unit. /// @@ -1217,6 +1237,13 @@ class CXSourceRange extends ffi.Struct { external int end_int_data; } +/// A single translation unit, which resides in an index. +typedef CXTranslationUnit = ffi.Pointer; + +/// A single diagnostic, containing the diagnostic's severity, +/// location, text, source ranges, and fix-it hints. +typedef CXDiagnostic = ffi.Pointer; + /// Options to control the display of diagnostics. /// /// The values in this enum are meant to be combined to customize the @@ -2361,6 +2388,23 @@ abstract class CXChildVisitResult { static const int CXChildVisit_Recurse = 2; } +/// Visitor invoked for each cursor found by a traversal. +/// +/// This visitor function will be invoked for each cursor found by +/// clang_visitCursorChildren(). Its first argument is the cursor being +/// visited, its second argument is the parent visitor for that cursor, +/// and its third argument is the client data provided to +/// clang_visitCursorChildren(). +/// +/// The visitor should return one of the \c CXChildVisitResult values +/// to direct clang_visitCursorChildren(). +typedef CXCursorVisitor = ffi.Pointer< + ffi.NativeFunction>; + +/// Opaque pointer representing client data that will be passed through +/// to various callbacks and visitors. +typedef CXClientData = ffi.Pointer; + abstract class CXEvalResultKind { static const int CXEval_Int = 1; static const int CXEval_Float = 2; @@ -2371,6 +2415,9 @@ abstract class CXEvalResultKind { static const int CXEval_UnExposed = 0; } +/// Evaluation result of a cursor +typedef CXEvalResult = ffi.Pointer; + const int CINDEX_VERSION_MAJOR = 0; const int CINDEX_VERSION_MINOR = 59; @@ -2378,503 +2425,3 @@ const int CINDEX_VERSION_MINOR = 59; const int CINDEX_VERSION = 59; const String CINDEX_VERSION_STRING = '0.59'; - -typedef _c_clang_getCString = ffi.Pointer Function( - CXString string, -); - -typedef _dart_clang_getCString = ffi.Pointer Function( - CXString string, -); - -typedef _c_clang_disposeString = ffi.Void Function( - CXString string, -); - -typedef _dart_clang_disposeString = void Function( - CXString string, -); - -typedef _c_clang_createIndex = ffi.Pointer Function( - ffi.Int32 excludeDeclarationsFromPCH, - ffi.Int32 displayDiagnostics, -); - -typedef _dart_clang_createIndex = ffi.Pointer Function( - int excludeDeclarationsFromPCH, - int displayDiagnostics, -); - -typedef _c_clang_disposeIndex = ffi.Void Function( - ffi.Pointer index, -); - -typedef _dart_clang_disposeIndex = void Function( - ffi.Pointer index, -); - -typedef _c_clang_getFileName = CXString Function( - ffi.Pointer SFile, -); - -typedef _dart_clang_getFileName = CXString Function( - ffi.Pointer SFile, -); - -typedef _c_clang_equalRanges = ffi.Uint32 Function( - CXSourceRange range1, - CXSourceRange range2, -); - -typedef _dart_clang_equalRanges = int Function( - CXSourceRange range1, - CXSourceRange range2, -); - -typedef _c_clang_getFileLocation = ffi.Void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _dart_clang_getFileLocation = void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _c_clang_getNumDiagnostics = ffi.Uint32 Function( - ffi.Pointer Unit, -); - -typedef _dart_clang_getNumDiagnostics = int Function( - ffi.Pointer Unit, -); - -typedef _c_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - ffi.Uint32 Index, -); - -typedef _dart_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - int Index, -); - -typedef _c_clang_disposeDiagnostic = ffi.Void Function( - ffi.Pointer Diagnostic, -); - -typedef _dart_clang_disposeDiagnostic = void Function( - ffi.Pointer Diagnostic, -); - -typedef _c_clang_formatDiagnostic = CXString Function( - ffi.Pointer Diagnostic, - ffi.Uint32 Options, -); - -typedef _dart_clang_formatDiagnostic = CXString Function( - ffi.Pointer Diagnostic, - int Options, -); - -typedef _c_clang_parseTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, -); - -typedef _dart_clang_parseTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, -); - -typedef _c_clang_disposeTranslationUnit = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_disposeTranslationUnit = void Function( - ffi.Pointer arg0, -); - -typedef _c_clang_getTranslationUnitCursor = CXCursor Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getTranslationUnitCursor = CXCursor Function( - ffi.Pointer arg0, -); - -typedef _c_clang_Cursor_isNull = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_Cursor_isNull = int Function( - CXCursor cursor, -); - -typedef _c_clang_getCursorKind = ffi.Int32 Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorKind = int Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_hasAttrs = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_hasAttrs = int Function( - CXCursor C, -); - -typedef _c_clang_getCursorLocation = CXSourceLocation Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorLocation = CXSourceLocation Function( - CXCursor arg0, -); - -typedef _c_clang_getCursorType = CXType Function( - CXCursor C, -); - -typedef _dart_clang_getCursorType = CXType Function( - CXCursor C, -); - -typedef _c_clang_getTypeSpelling = CXString Function( - CXType CT, -); - -typedef _dart_clang_getTypeSpelling = CXString Function( - CXType CT, -); - -typedef _c_clang_getTypedefDeclUnderlyingType = CXType Function( - CXCursor C, -); - -typedef _dart_clang_getTypedefDeclUnderlyingType = CXType Function( - CXCursor C, -); - -typedef _c_clang_getEnumConstantDeclValue = ffi.Int64 Function( - CXCursor C, -); - -typedef _dart_clang_getEnumConstantDeclValue = int Function( - CXCursor C, -); - -typedef _c_clang_getFieldDeclBitWidth = ffi.Int32 Function( - CXCursor C, -); - -typedef _dart_clang_getFieldDeclBitWidth = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getNumArguments = ffi.Int32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getNumArguments = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getArgument = CXCursor Function( - CXCursor C, - ffi.Uint32 i, -); - -typedef _dart_clang_Cursor_getArgument = CXCursor Function( - CXCursor C, - int i, -); - -typedef _c_clang_getCanonicalType = CXType Function( - CXType T, -); - -typedef _dart_clang_getCanonicalType = CXType Function( - CXType T, -); - -typedef _c_clang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isMacroFunctionLike = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isMacroBuiltin = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isMacroBuiltin = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isFunctionInlined = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isFunctionInlined = int Function( - CXCursor C, -); - -typedef _c_clang_getTypedefName = CXString Function( - CXType CT, -); - -typedef _dart_clang_getTypedefName = CXString Function( - CXType CT, -); - -typedef _c_clang_getPointeeType = CXType Function( - CXType T, -); - -typedef _dart_clang_getPointeeType = CXType Function( - CXType T, -); - -typedef _c_clang_getTypeDeclaration = CXCursor Function( - CXType T, -); - -typedef _dart_clang_getTypeDeclaration = CXCursor Function( - CXType T, -); - -typedef _c_clang_getTypeKindSpelling = CXString Function( - ffi.Int32 K, -); - -typedef _dart_clang_getTypeKindSpelling = CXString Function( - int K, -); - -typedef _c_clang_getResultType = CXType Function( - CXType T, -); - -typedef _dart_clang_getResultType = CXType Function( - CXType T, -); - -typedef _c_clang_getNumArgTypes = ffi.Int32 Function( - CXType T, -); - -typedef _dart_clang_getNumArgTypes = int Function( - CXType T, -); - -typedef _c_clang_getArgType = CXType Function( - CXType T, - ffi.Uint32 i, -); - -typedef _dart_clang_getArgType = CXType Function( - CXType T, - int i, -); - -typedef _c_clang_getNumElements = ffi.Int64 Function( - CXType T, -); - -typedef _dart_clang_getNumElements = int Function( - CXType T, -); - -typedef _c_clang_getArrayElementType = CXType Function( - CXType T, -); - -typedef _dart_clang_getArrayElementType = CXType Function( - CXType T, -); - -typedef _c_clang_Type_getNamedType = CXType Function( - CXType T, -); - -typedef _dart_clang_Type_getNamedType = CXType Function( - CXType T, -); - -typedef _c_clang_Type_getAlignOf = ffi.Int64 Function( - CXType T, -); - -typedef _dart_clang_Type_getAlignOf = int Function( - CXType T, -); - -typedef _c_clang_Cursor_isAnonymous = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isAnonymous = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isAnonymousRecordDecl = int Function( - CXCursor C, -); - -typedef CXCursorVisitor = ffi.Int32 Function( - CXCursor, - CXCursor, - ffi.Pointer, -); - -typedef _c_clang_visitChildren = ffi.Uint32 Function( - CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _dart_clang_visitChildren = int Function( - CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _c_clang_getCursorUSR = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorUSR = CXString Function( - CXCursor arg0, -); - -typedef _c_clang_getCursorSpelling = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorSpelling = CXString Function( - CXCursor arg0, -); - -typedef _c_clang_getCursorDefinition = CXCursor Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorDefinition = CXCursor Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_getCommentRange = CXSourceRange Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getCommentRange = CXSourceRange Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getRawCommentText = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getRawCommentText = CXString Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getBriefCommentText = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getBriefCommentText = CXString Function( - CXCursor C, -); - -typedef _c_clang_getCursorKindSpelling = CXString Function( - ffi.Int32 Kind, -); - -typedef _dart_clang_getCursorKindSpelling = CXString Function( - int Kind, -); - -typedef _c_clang_Cursor_Evaluate = ffi.Pointer Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_Evaluate = ffi.Pointer Function( - CXCursor C, -); - -typedef _c_clang_EvalResult_getKind = ffi.Int32 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getKind = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsInt = ffi.Int32 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsInt = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsLongLong = ffi.Int64 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsLongLong = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsDouble = ffi.Double Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsDouble = double Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_dispose = ffi.Void Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_dispose = void Function( - ffi.Pointer E, -); diff --git a/lib/src/header_parser/includer.dart b/lib/src/header_parser/includer.dart index 1cd4ff16..9211d5fa 100644 --- a/lib/src/header_parser/includer.dart +++ b/lib/src/header_parser/includer.dart @@ -2,83 +2,61 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'data.dart'; - /// Utility functions to check whether a binding should be parsed or not /// based on filters. -bool shouldIncludeStruct(String usr, String name) { - if (bindingsIndex.isSeenStruct(usr) || name == '') { +import 'data.dart'; + +bool _shouldIncludeDecl(String usr, String name, + bool Function(String) isSeenDecl, bool Function(String) configIncludes) { + if (isSeenDecl(usr) || name == '') { return false; - } else if (config.structDecl.shouldInclude(name)) { + } else if (configIncludes(name)) { return true; } else { return false; } } +bool shouldIncludeStruct(String usr, String name) { + return _shouldIncludeDecl( + usr, name, bindingsIndex.isSeenStruct, config.structDecl.shouldInclude); +} + bool shouldIncludeUnion(String usr, String name) { - if (bindingsIndex.isSeenStruct(usr) || name == '') { - return false; - } else if (config.unionDecl.shouldInclude(name)) { - return true; - } else { - return false; - } + return _shouldIncludeDecl( + usr, name, bindingsIndex.isSeenUnion, config.unionDecl.shouldInclude); } bool shouldIncludeFunc(String usr, String name) { - if (bindingsIndex.isSeenFunc(usr) || name == '') { - return false; - } else if (config.functionDecl.shouldInclude(name)) { - return true; - } else { - return false; - } + return _shouldIncludeDecl( + usr, name, bindingsIndex.isSeenFunc, config.functionDecl.shouldInclude); } bool shouldIncludeEnumClass(String usr, String name) { - if (bindingsIndex.isSeenEnumClass(usr) || name == '') { - return false; - } else if (config.enumClassDecl.shouldInclude(name)) { - return true; - } else { - return false; - } + return _shouldIncludeDecl(usr, name, bindingsIndex.isSeenEnumClass, + config.enumClassDecl.shouldInclude); } bool shouldIncludeUnnamedEnumConstant(String usr, String name) { - if (bindingsIndex.isSeenUnnamedEnumConstant(usr) || name == '') { - return false; - } else if (config.unnamedEnumConstants.shouldInclude(name)) { - return true; - } else { - return false; - } + return _shouldIncludeDecl(usr, name, bindingsIndex.isSeenUnnamedEnumConstant, + config.unnamedEnumConstants.shouldInclude); } bool shouldIncludeGlobalVar(String usr, String name) { - if (bindingsIndex.isSeenGlobalVar(usr) || name == '') { - return false; - } else if (config.globals.shouldInclude(name)) { - return true; - } else { - return false; - } + return _shouldIncludeDecl( + usr, name, bindingsIndex.isSeenGlobalVar, config.globals.shouldInclude); } bool shouldIncludeMacro(String usr, String name) { - if (bindingsIndex.isSeenMacro(usr) || name == '') { - return false; - } else if (config.macroDecl.shouldInclude(name)) { - return true; - } else { - return false; - } + return _shouldIncludeDecl( + usr, name, bindingsIndex.isSeenMacro, config.macroDecl.shouldInclude); } -/// Cache for headers. -final _headerCache = {}; +bool shouldIncludeTypealias(String usr, String name) { + return _shouldIncludeDecl( + usr, name, bindingsIndex.isSeenTypealias, config.typedefs.shouldInclude); +} /// True if a cursor should be included based on headers config, used on root /// declarations. @@ -88,11 +66,11 @@ bool shouldIncludeRootCursor(String sourceFile) { return false; } - // Add header to cache if its not. - if (!_headerCache.containsKey(sourceFile)) { - _headerCache[sourceFile] = - config.headers.includeFilter.shouldInclude(sourceFile); + // Add header to seen if it's not. + if (!bindingsIndex.isSeenHeader(sourceFile)) { + bindingsIndex.addHeaderToSeen( + sourceFile, config.headers.includeFilter.shouldInclude(sourceFile)); } - return _headerCache[sourceFile]!; + return bindingsIndex.getSeenHeaderStatus(sourceFile)!; } diff --git a/lib/src/header_parser/sub_parsers/compounddecl_parser.dart b/lib/src/header_parser/sub_parsers/compounddecl_parser.dart index 82bac38b..0bee37d9 100644 --- a/lib/src/header_parser/sub_parsers/compounddecl_parser.dart +++ b/lib/src/header_parser/sub_parsers/compounddecl_parser.dart @@ -75,9 +75,6 @@ Compound? parseCompoundDeclaration( clang_types.CXCursor cursor, CompoundType compoundType, { - /// Optionally provide name (useful in case declaration is inside a typedef). - String? name, - /// Option to ignore declaration filter (Useful in case of extracting /// declarations when they are passed/returned by an included function.) bool ignoreFilter = false, @@ -85,19 +82,9 @@ Compound? parseCompoundDeclaration( /// To track if the declaration was used by reference(i.e T*). (Used to only /// generate these as opaque if `dependency-only` was set to opaque). bool pointerReference = false, - - /// If the compound name should be updated, if it was already seen. - bool updateName = true, }) { _stack.push(_ParsedCompound()); - // Parse the cursor definition instead, if this is a forward declaration. - if (isForwardDeclaration(cursor)) { - cursor = clang.clang_getCursorDefinition(cursor); - } - final declUsr = cursor.usr(); - final declName = name ?? cursor.spelling(); - // Set includer functions according to compoundType. final bool Function(String, String) shouldIncludeDecl; final bool Function(String) isSeenDecl; @@ -124,6 +111,25 @@ Compound? parseCompoundDeclaration( break; } + // Parse the cursor definition instead, if this is a forward declaration. + if (isForwardDeclaration(cursor)) { + cursor = clang.clang_getCursorDefinition(cursor); + } + final declUsr = cursor.usr(); + final String declName; + + // Only set name using USR if the type is not Anonymous (A struct is anonymous + // if it has no name, is not inside any typedef and declared inline inside + // another declaration). + if (clang.clang_Cursor_isAnonymous(cursor) == 0) { + // This gives the significant name, i.e name of the struct if defined or + // name of the first typedef declaration that refers to it. + declName = declUsr.split('@').last; + } else { + // Empty names are treated as inline declarations. + declName = ''; + } + if (declName.isEmpty) { if (ignoreFilter) { // This declaration is defined inside some other declaration and hence @@ -136,24 +142,22 @@ Compound? parseCompoundDeclaration( ); _setMembers(cursor, className); } else { - _logger.finest('unnamed $className or typedef $className declaration'); - } - } else { - if ((ignoreFilter || shouldIncludeDecl(declUsr, declName)) && - (!isSeenDecl(declUsr))) { - _logger.fine( - '++++ Adding $className: Name: $declName, ${cursor.completeStringRepr()}'); - _stack.top.compound = Compound.fromType( - type: compoundType, - usr: declUsr, - originalName: declName, - name: configDecl.renameUsingConfig(declName), - dartDoc: getCursorDocComment(cursor), - ); - // Adding to seen here to stop recursion if a declaration has itself as a - // member, members are updated later. - addDeclToSeen(declUsr, _stack.top.compound!); + _logger.finest('unnamed $className declaration'); } + } else if ((ignoreFilter || shouldIncludeDecl(declUsr, declName)) && + (!isSeenDecl(declUsr))) { + _logger.fine( + '++++ Adding $className: Name: $declName, ${cursor.completeStringRepr()}'); + _stack.top.compound = Compound.fromType( + type: compoundType, + usr: declUsr, + originalName: declName, + name: configDecl.renameUsingConfig(declName), + dartDoc: getCursorDocComment(cursor), + ); + // Adding to seen here to stop recursion if a declaration has itself as a + // member, members are updated later. + addDeclToSeen(declUsr, _stack.top.compound!); } if (isSeenDecl(declUsr)) { @@ -177,11 +181,6 @@ Compound? parseCompoundDeclaration( } else if (!_stack.top.compound!.parsedDependencies) { _logger.fine('Skipped dependencies.'); } - - if (updateName) { - // If struct is seen, update it's name. - _stack.top.compound!.name = configDecl.renameUsingConfig(declName); - } } return _stack.pop().compound; diff --git a/lib/src/header_parser/sub_parsers/enumdecl_parser.dart b/lib/src/header_parser/sub_parsers/enumdecl_parser.dart index 7e095980..52cb4ba0 100644 --- a/lib/src/header_parser/sub_parsers/enumdecl_parser.dart +++ b/lib/src/header_parser/sub_parsers/enumdecl_parser.dart @@ -24,12 +24,13 @@ class _ParsedEnum { final _stack = Stack<_ParsedEnum>(); -/// Parses a function declaration. +/// Parses an enum declaration. EnumClass? parseEnumDeclaration( clang_types.CXCursor cursor, { - /// Optionally provide name to use (useful in case enum is inside a typedef). - String? name, + /// Option to ignore declaration filter (Useful in case of extracting + /// declarations when they are passed/returned by an included function.) + bool ignoreFilter = false, }) { _stack.push(_ParsedEnum()); @@ -39,16 +40,22 @@ EnumClass? parseEnumDeclaration( } final enumUsr = cursor.usr(); - final enumName = name ?? cursor.spelling(); - if (enumName == '') { - // Save this unnamed enum if it is anonymous (therefore not in a typedef). - if (clang.clang_Cursor_isAnonymous(cursor) != 0) { - _logger.fine('Saving anonymous enum.'); - saveUnNamedEnum(cursor); - } else { - _logger.fine('Unnamed enum inside a typedef.'); - } - } else if (shouldIncludeEnumClass(enumUsr, enumName)) { + final String enumName; + // Only set name using USR if the type is not Anonymous (i.e not inside + // any typedef and declared inplace inside another type). + if (clang.clang_Cursor_isAnonymous(cursor) == 0) { + // This gives the significant name, i.e name of the enum if defined or + // name of the first typedef declaration that refers to it. + enumName = enumUsr.split('@').last; + } else { + enumName = ''; + } + + if (enumName.isEmpty) { + _logger.fine('Saving anonymous enum.'); + saveUnNamedEnum(cursor); + } else if ((ignoreFilter || shouldIncludeEnumClass(enumUsr, enumName)) && + (!bindingsIndex.isSeenEnumClass(enumUsr))) { _logger.fine('++++ Adding Enum: ${cursor.completeStringRepr()}'); _stack.top.enumClass = EnumClass( usr: enumUsr, @@ -61,10 +68,6 @@ EnumClass? parseEnumDeclaration( } if (bindingsIndex.isSeenEnumClass(enumUsr)) { _stack.top.enumClass = bindingsIndex.getSeenEnumClass(enumUsr); - - // If enum is seen, update it's name. - _stack.top.enumClass!.name = - config.enumClassDecl.renameUsingConfig(enumName); } return _stack.pop().enumClass; diff --git a/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart b/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart index 192c0389..90d5664d 100644 --- a/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart +++ b/lib/src/header_parser/sub_parsers/typedefdecl_parser.dart @@ -2,16 +2,14 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:ffi'; - import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser/includer.dart'; +import 'package:ffigen/src/header_parser/type_extractor/extractor.dart'; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; -import '../sub_parsers/enumdecl_parser.dart'; import '../utils.dart'; -import 'compounddecl_parser.dart'; final _logger = Logger('ffigen.header_parser.typedefdecl_parser'); @@ -32,88 +30,75 @@ final _logger = Logger('ffigen.header_parser.typedefdecl_parser'); /// /// typedef A D; // Typeref. /// ``` -class _ParsedTypedef { - Binding? binding; +class _ParsedTypealias { + Typealias? typealias; String? typedefName; bool typedefToPointer = false; - _ParsedTypedef(); + _ParsedTypealias(); } -final _stack = Stack<_ParsedTypedef>(); +final _stack = Stack<_ParsedTypealias>(); /// Parses a typedef declaration. -Binding? parseTypedefDeclaration(clang_types.CXCursor cursor) { - _stack.push(_ParsedTypedef()); - - /// Check if typedef declaration is to a pointer. - _stack.top.typedefToPointer = - (clang.clang_getTypedefDeclUnderlyingType(cursor).kind == - clang_types.CXTypeKind.CXType_Pointer); - - // Name of typedef. - _stack.top.typedefName = cursor.spelling(); - final resultCode = clang.clang_visitChildren( - cursor, - Pointer.fromFunction(_typedefdeclarationCursorVisitor, - clang_types.CXChildVisitResult.CXChildVisit_Break), - nullptr, - ); - - visitChildrenResultChecker(resultCode); - return _stack.pop().binding; -} - -/// Visitor for extracting binding for a TypedefDeclarations of a -/// [clang.CXCursorKind.CXCursor_TypedefDecl]. /// -/// Visitor invoked on cursor of type declaration returned by -/// [clang.clang_getTypeDeclaration_wrap]. -int _typedefdeclarationCursorVisitor(clang_types.CXCursor cursor, - clang_types.CXCursor parent, Pointer clientData) { - try { - _logger.finest( - 'typedefdeclarationCursorVisitor: ${cursor.completeStringRepr()}'); +/// Returns `null` if the typedef could not be generated or has been excluded +/// by the config. +Typealias? parseTypedefDeclaration( + clang_types.CXCursor cursor, { + bool pointerReference = false, +}) { + _stack.push(_ParsedTypealias()); + final typedefName = cursor.spelling(); + final typedefUsr = cursor.usr(); + if (shouldIncludeTypealias(typedefUsr, typedefName)) { + final ct = clang.clang_getTypedefDeclUnderlyingType(cursor); + final s = getCodeGenType(ct, pointerReference: pointerReference); - switch (clang.clang_getCursorKind(cursor)) { - case clang_types.CXCursorKind.CXCursor_StructDecl: - if (_stack.top.typedefToPointer && - bindingsIndex.isSeenStruct(cursor.usr())) { - // Skip a typedef pointer if struct is seen. - _stack.top.binding = bindingsIndex.getSeenStruct(cursor.usr()); - } else { - // This will update the name of struct if already seen. - _stack.top.binding = parseCompoundDeclaration( - cursor, - CompoundType.struct, - name: _stack.top.typedefName, - ); - } - break; - case clang_types.CXCursorKind.CXCursor_UnionDecl: - if (_stack.top.typedefToPointer && - bindingsIndex.isSeenUnion(cursor.usr())) { - // Skip a typedef pointer if struct is seen. - _stack.top.binding = bindingsIndex.getSeenUnion(cursor.usr()); - } else { - // This will update the name of struct if already seen. - _stack.top.binding = parseCompoundDeclaration( - cursor, - CompoundType.union, - name: _stack.top.typedefName, - ); - } - break; - case clang_types.CXCursorKind.CXCursor_EnumDecl: - _stack.top.binding = - parseEnumDeclaration(cursor, name: _stack.top.typedefName); - break; - default: - _logger.finest('typedefdeclarationCursorVisitor: Ignored'); + if (bindingsIndex.isSeenUnsupportedTypealias(typedefUsr)) { + // Do not process unsupported typealiases again. + } else if (s.broadType == BroadType.Unimplemented) { + _logger + .fine("Skipped Typedef '$typedefName': Unimplemented type referred."); + bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); + } else if (s.broadType == BroadType.Compound && + s.compound!.originalName == typedefName) { + // Ignore typedef if it refers to a compound with the same original name. + bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); + _logger.fine( + "Skipped Typedef '$typedefName': Name matches with referred struct/union."); + } else if (s.broadType == BroadType.Enum) { + // Ignore typedefs to Enum. + bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); + _logger.fine("Skipped Typedef '$typedefName': typedef to enum."); + } else if (s.broadType == BroadType.Handle) { + // Ignore typedefs to Handle. + _logger.fine("Skipped Typedef '$typedefName': typedef to Dart Handle."); + bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); + } else if (s.broadType == BroadType.ConstantArray || + s.broadType == BroadType.IncompleteArray) { + // Ignore typedefs to Constant Array. + _logger.fine("Skipped Typedef '$typedefName': typedef to array."); + bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); + } else if (s.broadType == BroadType.Boolean) { + // Ignore typedefs to Boolean. + _logger.fine("Skipped Typedef '$typedefName': typedef to bool."); + bindingsIndex.addUnsupportedTypealiasToSeen(typedefUsr); + } else { + // Create typealias. + _stack.top.typealias = Typealias( + usr: typedefUsr, + originalName: typedefName, + name: config.typedefs.renameUsingConfig(typedefName), + type: s, + dartDoc: getCursorDocComment(cursor), + ); + bindingsIndex.addTypealiasToSeen(typedefUsr, _stack.top.typealias!); } - } catch (e, s) { - _logger.severe(e); - _logger.severe(s); - rethrow; } - return clang_types.CXChildVisitResult.CXChildVisit_Continue; + + if (bindingsIndex.isSeenTypealias(typedefUsr)) { + _stack.top.typealias = bindingsIndex.getSeenTypealias(typedefUsr); + } + + return _stack.pop().typealias; } diff --git a/lib/src/header_parser/translation_unit_parser.dart b/lib/src/header_parser/translation_unit_parser.dart index 5f597077..3e5a677c 100644 --- a/lib/src/header_parser/translation_unit_parser.dart +++ b/lib/src/header_parser/translation_unit_parser.dart @@ -15,7 +15,6 @@ import 'includer.dart'; import 'sub_parsers/compounddecl_parser.dart'; import 'sub_parsers/enumdecl_parser.dart'; import 'sub_parsers/functiondecl_parser.dart'; -import 'sub_parsers/typedefdecl_parser.dart'; import 'utils.dart'; final _logger = Logger('ffigen.header_parser.translation_unit_parser'); @@ -47,9 +46,6 @@ int _rootCursorVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent, case clang_types.CXCursorKind.CXCursor_FunctionDecl: addToBindings(parseFunctionDeclaration(cursor)); break; - case clang_types.CXCursorKind.CXCursor_TypedefDecl: - addToBindings(parseTypedefDeclaration(cursor)); - break; case clang_types.CXCursorKind.CXCursor_StructDecl: addToBindings(parseCompoundDeclaration(cursor, CompoundType.struct)); break; diff --git a/lib/src/header_parser/type_extractor/cxtypekindmap.dart b/lib/src/header_parser/type_extractor/cxtypekindmap.dart index 48c915af..eae99bc4 100644 --- a/lib/src/header_parser/type_extractor/cxtypekindmap.dart +++ b/lib/src/header_parser/type_extractor/cxtypekindmap.dart @@ -25,12 +25,8 @@ var cxTypeKindToSupportedNativeTypes = { clang.CXTypeKind.CXType_Double: SupportedNativeType.Double, clang.CXTypeKind.CXType_Char_S: SupportedNativeType.Int8, clang.CXTypeKind.CXType_Char_U: SupportedNativeType.Uint8, - clang.CXTypeKind.CXType_Enum: SupportedNativeType.Int32, }; -SupportedNativeType get enumNativeType => - cxTypeKindToSupportedNativeTypes[clang.CXTypeKind.CXType_Enum]!; - var suportedTypedefToSuportedNativeType = { 'uint8_t': SupportedNativeType.Uint8, 'uint16_t': SupportedNativeType.Uint16, diff --git a/lib/src/header_parser/type_extractor/extractor.dart b/lib/src/header_parser/type_extractor/extractor.dart index 521e71e8..43d964cd 100644 --- a/lib/src/header_parser/type_extractor/extractor.dart +++ b/lib/src/header_parser/type_extractor/extractor.dart @@ -4,13 +4,14 @@ /// Extracts code_gen Type from type. import 'package:ffigen/src/code_generator.dart'; +import 'package:ffigen/src/header_parser/sub_parsers/typedefdecl_parser.dart'; import 'package:ffigen/src/strings.dart' as strings; import 'package:logging/logging.dart'; import '../clang_bindings/clang_bindings.dart' as clang_types; import '../data.dart'; import '../sub_parsers/compounddecl_parser.dart'; -import '../translation_unit_parser.dart'; +import '../sub_parsers/enumdecl_parser.dart'; import '../type_extractor/cxtypekindmap.dart'; import '../utils.dart'; @@ -20,7 +21,6 @@ const _padding = ' '; /// Converts cxtype to a typestring code_generator can accept. Type getCodeGenType( clang_types.CXType cxtype, { - String? parentName, /// Passed on if a value was marked as a pointer before this one. bool pointerReference = false, @@ -31,8 +31,7 @@ Type getCodeGenType( switch (kind) { case clang_types.CXTypeKind.CXType_Pointer: final pt = clang.clang_getPointeeType(cxtype); - final s = - getCodeGenType(pt, parentName: parentName, pointerReference: true); + final s = getCodeGenType(pt, pointerReference: true); // Replace Pointer<_Dart_Handle> with Handle. if (config.useDartHandle && @@ -58,30 +57,54 @@ Type getCodeGenType( } // This is important or we get stuck in infinite recursion. - final ct = clang.clang_getTypedefDeclUnderlyingType( - clang.clang_getTypeDeclaration(cxtype)); + final cursor = clang.clang_getTypeDeclaration(cxtype); + final typedefUsr = cursor.usr(); - final s = getCodeGenType(ct, - parentName: parentName ?? spelling, - pointerReference: pointerReference); - return s; + if (bindingsIndex.isSeenTypealias(typedefUsr)) { + return Type.typealias(bindingsIndex.getSeenTypealias(typedefUsr)!); + } else { + final typealias = + parseTypedefDeclaration(cursor, pointerReference: pointerReference); + + if (typealias != null) { + return Type.typealias(typealias); + } else { + // Use underlying type if typealias couldn't be created or if + // the user excluded this typedef. + final ct = clang.clang_getTypedefDeclUnderlyingType(cursor); + return getCodeGenType(ct, pointerReference: pointerReference); + } + } case clang_types.CXTypeKind.CXType_Elaborated: final et = clang.clang_Type_getNamedType(cxtype); - final s = getCodeGenType(et, - parentName: parentName, pointerReference: pointerReference); + final s = getCodeGenType(et, pointerReference: pointerReference); return s; case clang_types.CXTypeKind.CXType_Record: - return _extractfromRecord(cxtype, parentName, pointerReference); + return _extractfromRecord(cxtype, pointerReference); case clang_types.CXTypeKind.CXType_Enum: - return Type.nativeType( - enumNativeType, - ); + final cursor = clang.clang_getTypeDeclaration(cxtype); + final usr = cursor.usr(); + + if (bindingsIndex.isSeenEnumClass(usr)) { + return Type.enumClass(bindingsIndex.getSeenEnumClass(usr)!); + } else { + final enumClass = parseEnumDeclaration( + cursor, + ignoreFilter: true, + ); + if (enumClass == null) { + // Handle anonymous enum declarations within another declaration. + return Type.nativeType(Type.enumNativeType); + } else { + return Type.enumClass(enumClass); + } + } case clang_types.CXTypeKind.CXType_FunctionProto: // Primarily used for function pointers. - return _extractFromFunctionProto(cxtype, parentName); + return _extractFromFunctionProto(cxtype); case clang_types.CXTypeKind.CXType_FunctionNoProto: // Primarily used for function types with zero arguments. - return _extractFromFunctionProto(cxtype, parentName); + return _extractFromFunctionProto(cxtype); case clang_types.CXTypeKind .CXType_ConstantArray: // Primarily used for constant array in struct members. return Type.constantArray( @@ -109,8 +132,7 @@ Type getCodeGenType( } } -Type _extractfromRecord( - clang_types.CXType cxtype, String? parentName, bool pointerReference) { +Type _extractfromRecord(clang_types.CXType cxtype, bool pointerReference) { Type type; final cursor = clang.clang_getTypeDeclaration(cxtype); @@ -121,9 +143,6 @@ Type _extractfromRecord( cursorKind == clang_types.CXCursorKind.CXCursor_UnionDecl) { final declUsr = cursor.usr(); - // Name of typedef (parentName) is used if available. - final declName = parentName ?? cursor.spelling(); - // Set includer functions according to compoundType. final bool Function(String) isSeenDecl; final Compound? Function(String) getSeenDecl; @@ -153,25 +172,17 @@ Type _extractfromRecord( parseCompoundDeclaration( cursor, compoundType, - name: declName, ignoreFilter: true, pointerReference: pointerReference, - updateName: false, ); } else { final struc = parseCompoundDeclaration( cursor, compoundType, - name: declName, ignoreFilter: true, pointerReference: pointerReference, ); type = Type.compound(struc!); - - // Add to bindings if it's not Dart_Handle and is unseen. - if (!(config.useDartHandle && declUsr == strings.dartHandleUsr)) { - addToBindings(struc); - } } } else { _logger.fine( @@ -183,12 +194,7 @@ Type _extractfromRecord( } // Used for function pointer arguments. -Type _extractFromFunctionProto(clang_types.CXType cxtype, String? parentName) { - var name = parentName; - - // An empty name means the function prototype was declared in-place, instead - // of using a typedef. - name = name ?? ''; +Type _extractFromFunctionProto(clang_types.CXType cxtype) { final _parameters = []; final totalArgs = clang.clang_getNumArgTypes(cxtype); for (var i = 0; i < totalArgs; i++) { @@ -207,21 +213,8 @@ Type _extractFromFunctionProto(clang_types.CXType cxtype, String? parentName) { ); } - Typedef? typedefC; - if (bindingsIndex.isSeenFunctionTypedef(name)) { - typedefC = bindingsIndex.getSeenFunctionTypedef(name); - } else { - typedefC = Typedef( - name: name.isNotEmpty ? name : incrementalNamer.name('_typedefC'), - typedefType: TypedefType.C, - parameters: _parameters, - returnType: clang.clang_getResultType(cxtype).toCodeGenType(), - ); - // Add to seen, if name isn't empty. - if (name.isNotEmpty) { - bindingsIndex.addFunctionTypedefToSeen(name, typedefC); - } - } - - return Type.nativeFunc(typedefC!); + return Type.nativeFunc(NativeFunc.fromFunctionType(FunctionType( + parameters: _parameters, + returnType: clang.clang_getResultType(cxtype).toCodeGenType(), + ))); } diff --git a/lib/src/header_parser/utils.dart b/lib/src/header_parser/utils.dart index 272f21d8..9ff09fe3 100644 --- a/lib/src/header_parser/utils.dart +++ b/lib/src/header_parser/utils.dart @@ -333,8 +333,13 @@ class BindingsIndex { final Map _unnamedEnumConstants = {}; final Map _macros = {}; final Map _globals = {}; - // Stores only named typedefC used in NativeFunc. - final Map _functionTypedefs = {}; + + /// Contains usr for typedefs which cannot be generated. + final Set _unsupportedTypealiases = {}; + final Map _typealiases = {}; + + /// Index for headers. + final Map _headerCache = {}; bool isSeenStruct(String usr) { return _structs.containsKey(usr); @@ -420,15 +425,35 @@ class BindingsIndex { return _macros[usr]; } - bool isSeenFunctionTypedef(String originalName) { - return _functionTypedefs.containsKey(originalName); + bool isSeenTypealias(String usr) { + return _typealiases.containsKey(usr); + } + + void addTypealiasToSeen(String usr, Typealias t) { + _typealiases[usr] = t; + } + + bool isSeenUnsupportedTypealias(String usr) { + return _unsupportedTypealiases.contains(usr); + } + + void addUnsupportedTypealiasToSeen(String usr) { + _unsupportedTypealiases.add(usr); + } + + Typealias? getSeenTypealias(String usr) { + return _typealiases[usr]; + } + + bool isSeenHeader(String source) { + return _headerCache.containsKey(source); } - void addFunctionTypedefToSeen(String originalName, Typedef t) { - _functionTypedefs[originalName] = t; + void addHeaderToSeen(String source, bool includeStatus) { + _headerCache[source] = includeStatus; } - Typedef? getSeenFunctionTypedef(String originalName) { - return _functionTypedefs[originalName]; + bool? getSeenHeaderStatus(String source) { + return _headerCache[source]; } } diff --git a/lib/src/strings.dart b/lib/src/strings.dart index b551ead6..46bdb099 100644 --- a/lib/src/strings.dart +++ b/lib/src/strings.dart @@ -51,6 +51,7 @@ const enums = 'enums'; const unnamedEnums = 'unnamed-enums'; const globals = 'globals'; const macros = 'macros'; +const typedefs = 'typedefs'; // Sub-fields of Declarations. const include = 'include'; @@ -155,7 +156,8 @@ const linuxDylibLocations = [ '/usr/lib/llvm-9/lib/', '/usr/lib/llvm-10/lib/', '/usr/lib/llvm-11/lib/', - '/usr/lib/' + '/usr/lib/', + '/usr/lib64/', ]; const windowsDylibLocations = [ r'C:\Program Files\LLVM\bin\', diff --git a/pubspec.yaml b/pubspec.yaml index ef3ff765..9c305e26 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 3.1.0-dev.1 +version: 4.0.0-dev.0 homepage: https://github.com/dart-lang/ffigen description: Generator for FFI bindings, using LibClang to parse C header files. diff --git a/test/code_generator_tests/code_generator_test.dart b/test/code_generator_tests/code_generator_test.dart index 79ac3520..b30f6347 100644 --- a/test/code_generator_tests/code_generator_test.dart +++ b/test/code_generator_tests/code_generator_test.dart @@ -447,6 +447,40 @@ void main() { ); _matchLib(library, 'unions'); }); + test('Typealias Bindings', () { + final library = Library( + name: 'Bindings', + bindings: [ + Typealias( + name: 'RawUnused', type: Type.compound(Struc(name: 'Struct1'))), + Struc(name: 'WithTypealiasStruc', members: [ + Member( + name: 't', + type: Type.typealias(Typealias( + name: 'Struct2Typealias', + type: Type.struct(Struc(name: 'Struct2', members: [ + Member( + name: 'a', + type: Type.nativeType(SupportedNativeType.Double)) + ]))))) + ]), + Func( + name: 'WithTypealiasStruc', + returnType: Type.pointer(Type.nativeFunc( + NativeFunc.fromFunctionType(FunctionType( + returnType: Type.nativeType(SupportedNativeType.Void), + parameters: [])))), + parameters: [ + Parameter( + name: 't', + type: Type.typealias(Typealias( + name: 'Struct3Typealias', + type: Type.struct(Struc(name: 'Struct3'))))) + ]), + ], + ); + _matchLib(library, 'typealias'); + }); } /// Utility to match expected bindings to the generated bindings. diff --git a/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart b/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart index 77645246..a35b620d 100644 --- a/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart +++ b/test/code_generator_tests/expected_bindings/_expected_boolean_dartbool_bindings.dart @@ -28,21 +28,14 @@ class Bindings { 0; } - late final _test1_ptr = _lookup>('test1'); - late final _dart_test1 _test1 = _test1_ptr.asFunction<_dart_test1>(); + late final _test1_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Uint8, ffi.Pointer)>>('test1'); + late final _test1 = + _test1_ptr.asFunction)>(); } class test2 extends ffi.Struct { @ffi.Uint8() external int a; } - -typedef _c_test1 = ffi.Uint8 Function( - ffi.Uint8 a, - ffi.Pointer b, -); - -typedef _dart_test1 = int Function( - int a, - ffi.Pointer b, -); diff --git a/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart b/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart index 5757ff03..30653c8d 100644 --- a/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart +++ b/test/code_generator_tests/expected_bindings/_expected_boolean_no_dartbool_bindings.dart @@ -27,21 +27,14 @@ class Bindings { ); } - late final _test1_ptr = _lookup>('test1'); - late final _dart_test1 _test1 = _test1_ptr.asFunction<_dart_test1>(); + late final _test1_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint8 Function(ffi.Uint8, ffi.Pointer)>>('test1'); + late final _test1 = + _test1_ptr.asFunction)>(); } class test2 extends ffi.Struct { @ffi.Uint8() external int a; } - -typedef _c_test1 = ffi.Uint8 Function( - ffi.Uint8 a, - ffi.Pointer b, -); - -typedef _dart_test1 = int Function( - int a, - ffi.Pointer b, -); diff --git a/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart b/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart index 30de175b..8b94f2b3 100644 --- a/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart +++ b/test/code_generator_tests/expected_bindings/_expected_function_bindings.dart @@ -23,8 +23,9 @@ class Bindings { return _noParam(); } - late final _noParam_ptr = _lookup>('noParam'); - late final _dart_noParam _noParam = _noParam_ptr.asFunction<_dart_noParam>(); + late final _noParam_ptr = + _lookup>('noParam'); + late final _noParam = _noParam_ptr.asFunction(); int withPrimitiveParam( int a, @@ -37,9 +38,10 @@ class Bindings { } late final _withPrimitiveParam_ptr = - _lookup>('withPrimitiveParam'); - late final _dart_withPrimitiveParam _withPrimitiveParam = - _withPrimitiveParam_ptr.asFunction<_dart_withPrimitiveParam>(); + _lookup>( + 'withPrimitiveParam'); + late final _withPrimitiveParam = + _withPrimitiveParam_ptr.asFunction(); ffi.Pointer withPointerParam( ffi.Pointer a, @@ -51,32 +53,11 @@ class Bindings { ); } - late final _withPointerParam_ptr = - _lookup>('withPointerParam'); - late final _dart_withPointerParam _withPointerParam = - _withPointerParam_ptr.asFunction<_dart_withPointerParam>(); + late final _withPointerParam_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer>)>>('withPointerParam'); + late final _withPointerParam = _withPointerParam_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer>)>(); } - -typedef _c_noParam = ffi.Int32 Function(); - -typedef _dart_noParam = int Function(); - -typedef _c_withPrimitiveParam = ffi.Uint8 Function( - ffi.Int32 a, - ffi.Uint8 b, -); - -typedef _dart_withPrimitiveParam = int Function( - int a, - int b, -); - -typedef _c_withPointerParam = ffi.Pointer Function( - ffi.Pointer a, - ffi.Pointer> b, -); - -typedef _dart_withPointerParam = ffi.Pointer Function( - ffi.Pointer a, - ffi.Pointer> b, -); diff --git a/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart b/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart index c4bfa273..d658e31d 100644 --- a/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart +++ b/test/code_generator_tests/expected_bindings/_expected_function_n_struct_bindings.dart @@ -25,10 +25,12 @@ class Bindings { ); } - late final _someFunc_ptr = - _lookup>('someFunc'); - late final _dart_someFunc _someFunc = - _someFunc_ptr.asFunction<_dart_someFunc>(); + late final _someFunc_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer>)>>('someFunc'); + late final _someFunc = _someFunc_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer>)>(); } class SomeStruc extends ffi.Struct { @@ -41,11 +43,3 @@ class SomeStruc extends ffi.Struct { @ffi.Uint8() external int c; } - -typedef _c_someFunc = ffi.Pointer Function( - ffi.Pointer> some, -); - -typedef _dart_someFunc = ffi.Pointer Function( - ffi.Pointer> some, -); diff --git a/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart b/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart index 4556dfae..7a0cff24 100644 --- a/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart +++ b/test/code_generator_tests/expected_bindings/_expected_internal_conflict_resolution_bindings.dart @@ -24,38 +24,41 @@ class init_dylib_1 { return _test_1(); } - late final _test_ptr = _lookup>('test'); - late final _dart_test1 _test_1 = _test_ptr.asFunction<_dart_test1>(); + late final _test_ptr = + _lookup>('test'); + late final _test_1 = _test_ptr.asFunction(); void _test() { return __test(); } - late final __test_ptr = _lookup>('_test'); - late final _dart__test __test = __test_ptr.asFunction<_dart__test>(); + late final __test_ptr = + _lookup>('_test'); + late final __test = __test_ptr.asFunction(); void _c_test() { return __c_test(); } - late final __c_test_ptr = _lookup>('_c_test'); - late final _dart__c_test __c_test = __c_test_ptr.asFunction<_dart__c_test>(); + late final __c_test_ptr = + _lookup>('_c_test'); + late final __c_test = __c_test_ptr.asFunction(); void _dart_test() { return __dart_test(); } late final __dart_test_ptr = - _lookup>('_dart_test'); - late final _dart__dart_test __dart_test = - __dart_test_ptr.asFunction<_dart__dart_test>(); + _lookup>('_dart_test'); + late final __dart_test = __dart_test_ptr.asFunction(); void Test() { return _Test(); } - late final _Test_ptr = _lookup>('Test'); - late final _dart_Test _Test = _Test_ptr.asFunction<_dart_Test>(); + late final _Test_ptr = + _lookup>('Test'); + late final _Test = _Test_ptr.asFunction(); } class _Test extends ffi.Struct { @@ -68,23 +71,3 @@ class ArrayHelperPrefixCollisionTest extends ffi.Opaque {} abstract class _c_Test {} abstract class init_dylib {} - -typedef _c_test1 = ffi.Void Function(); - -typedef _dart_test1 = void Function(); - -typedef _c__test = ffi.Void Function(); - -typedef _dart__test = void Function(); - -typedef _c__c_test = ffi.Void Function(); - -typedef _dart__c_test = void Function(); - -typedef _c__dart_test = ffi.Void Function(); - -typedef _dart__dart_test = void Function(); - -typedef _c_Test1 = ffi.Void Function(); - -typedef _dart_Test = void Function(); diff --git a/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart b/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart index aaa8f2d2..fd1b0beb 100644 --- a/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart +++ b/test/code_generator_tests/expected_bindings/_expected_sort_bindings_bindings.dart @@ -21,25 +21,17 @@ class Bindings { return _a(); } - late final _a_ptr = _lookup>('a'); - late final _dart_a _a = _a_ptr.asFunction<_dart_a>(); + late final _a_ptr = _lookup>('a'); + late final _a = _a_ptr.asFunction(); void b() { return _b(); } - late final _b_ptr = _lookup>('b'); - late final _dart_b _b = _b_ptr.asFunction<_dart_b>(); + late final _b_ptr = _lookup>('b'); + late final _b = _b_ptr.asFunction(); } class c extends ffi.Opaque {} class d extends ffi.Opaque {} - -typedef _c_a = ffi.Void Function(); - -typedef _dart_a = void Function(); - -typedef _c_b = ffi.Void Function(); - -typedef _dart_b = void Function(); diff --git a/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart b/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart new file mode 100644 index 00000000..4b633769 --- /dev/null +++ b/test/code_generator_tests/expected_bindings/_expected_typealias_bindings.dart @@ -0,0 +1,54 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class Bindings { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + Bindings(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + Bindings.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + ffi.Pointer> WithTypealiasStruc_1( + Struct3Typealias t, + ) { + return _WithTypealiasStruc_1( + t, + ); + } + + late final _WithTypealiasStruc_1_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer> Function( + Struct3Typealias)>>('WithTypealiasStruc'); + late final _WithTypealiasStruc_1 = _WithTypealiasStruc_1_ptr.asFunction< + ffi.Pointer> Function( + Struct3Typealias)>(); +} + +typedef RawUnused = Struct1; + +class Struct1 extends ffi.Opaque {} + +class WithTypealiasStruc extends ffi.Struct { + external Struct2Typealias t; +} + +typedef Struct2Typealias = Struct2; + +class Struct2 extends ffi.Struct { + @ffi.Double() + external double a; +} + +typedef Struct3Typealias = Struct3; + +class Struct3 extends ffi.Opaque {} diff --git a/test/collision_tests/decl_decl_collision_test.dart b/test/collision_tests/decl_decl_collision_test.dart index fb6645fe..ac22f402 100644 --- a/test/collision_tests/decl_decl_collision_test.dart +++ b/test/collision_tests/decl_decl_collision_test.dart @@ -36,6 +36,10 @@ void main() { rawType: 'int', rawValue: '0', ), + Typealias( + name: 'testAlias', type: Type.nativeType(SupportedNativeType.Void)), + Typealias( + name: 'testAlias', type: Type.nativeType(SupportedNativeType.Void)), /// Conflicts across declarations. Struc(name: 'testCrossDecl'), @@ -44,6 +48,9 @@ void main() { returnType: Type.nativeType(SupportedNativeType.Void)), Constant(name: 'testCrossDecl', rawValue: '0', rawType: 'int'), EnumClass(name: 'testCrossDecl'), + Typealias( + name: 'testCrossDecl', + type: Type.nativeType(SupportedNativeType.Void)), /// Conflicts with ffi library prefix, name of prefix is changed. Struc(name: 'ffi'), @@ -76,6 +83,11 @@ void main() { rawType: 'int', rawValue: '0', ), + Typealias( + name: 'testAlias', type: Type.nativeType(SupportedNativeType.Void)), + Typealias( + name: 'testAlias_1', + type: Type.nativeType(SupportedNativeType.Void)), Struc(name: 'testCrossDecl', originalName: 'testCrossDecl'), Func( name: 'testCrossDecl_1', @@ -83,6 +95,9 @@ void main() { returnType: Type.nativeType(SupportedNativeType.Void)), Constant(name: 'testCrossDecl_2', rawValue: '0', rawType: 'int'), EnumClass(name: 'testCrossDecl_3'), + Typealias( + name: 'testCrossDecl_4', + type: Type.nativeType(SupportedNativeType.Void)), Struc(name: 'ffi'), Func( name: 'ffi_1', diff --git a/test/collision_tests/decl_symbol_address_collision_test.dart b/test/collision_tests/decl_symbol_address_collision_test.dart index cc534e89..b11252f8 100644 --- a/test/collision_tests/decl_symbol_address_collision_test.dart +++ b/test/collision_tests/decl_symbol_address_collision_test.dart @@ -36,7 +36,7 @@ void main() { matchLibraryWithExpected(actual, [ 'test', 'debug_generated', - 'decl_symbol_address_collision_output.dart' + 'collision_test_decl_symbol_address_collision_output.dart' ], [ 'test', 'collision_tests', diff --git a/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart b/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart index b983034b..a8d8a7b2 100644 --- a/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart +++ b/test/collision_tests/expected_bindings/_expected_decl_symbol_address_collision_bindings.dart @@ -25,8 +25,7 @@ class Bindings_1 { late final __library_ptr = _lookup>('_library'); - late final _dart__library __library = - __library_ptr.asFunction<_dart__library>(); + late final __library = __library_ptr.asFunction(); void _SymbolAddresses_1() { return __SymbolAddresses_1(); @@ -35,8 +34,8 @@ class Bindings_1 { late final __SymbolAddresses_1_ptr = _lookup>( '_SymbolAddresses_1'); - late final _dart__SymbolAddresses_1 __SymbolAddresses_1 = - __SymbolAddresses_1_ptr.asFunction<_dart__SymbolAddresses_1>(); + late final __SymbolAddresses_1 = + __SymbolAddresses_1_ptr.asFunction(); late final addresses = _SymbolAddresses_2(this); } @@ -57,9 +56,4 @@ class _SymbolAddresses extends ffi.Opaque {} abstract class Bindings {} typedef Native__library = ffi.Void Function(); - -typedef _dart__library = void Function(); - typedef Native__SymbolAddresses_1 = ffi.Void Function(); - -typedef _dart__SymbolAddresses_1 = void Function(); diff --git a/test/collision_tests/reserved_keyword_collision_test.dart b/test/collision_tests/reserved_keyword_collision_test.dart index b5b69317..7764ee15 100644 --- a/test/collision_tests/reserved_keyword_collision_test.dart +++ b/test/collision_tests/reserved_keyword_collision_test.dart @@ -45,6 +45,7 @@ void main() { rawType: 'int', rawValue: '0', ), + Typealias(name: 'var', type: Type.nativeType(SupportedNativeType.Void)), ]); final l2 = Library(name: 'Bindings', bindings: [ Struc(name: 'abstract_1'), @@ -79,6 +80,8 @@ void main() { rawType: 'int', rawValue: '0', ), + Typealias( + name: 'var_1', type: Type.nativeType(SupportedNativeType.Void)), ]); expect(l1.generate(), l2.generate()); }); diff --git a/test/example_tests/cjson_example_test.dart b/test/example_tests/cjson_example_test.dart index f6504a81..7d094330 100644 --- a/test/example_tests/cjson_example_test.dart +++ b/test/example_tests/cjson_example_test.dart @@ -27,6 +27,8 @@ ${strings.headers}: ${strings.includeDirectives}: - '**cJSON.h' ${strings.comments}: false +${strings.typedefmap}: + 'size_t': 'IntPtr' ${strings.preamble}: | // Copyright (c) 2009-2017 Dave Gamble and cJSON contributors // @@ -52,7 +54,7 @@ ${strings.preamble}: | matchLibraryWithExpected( library, - ['test', 'debug_generated', 'c_json.dart'], + ['test', 'debug_generated', 'example_c_json.dart'], ['example', 'c_json', config.output], ); }); diff --git a/test/example_tests/libclang_example_test.dart b/test/example_tests/libclang_example_test.dart index 43407fc4..1c3b2b75 100644 --- a/test/example_tests/libclang_example_test.dart +++ b/test/example_tests/libclang_example_test.dart @@ -40,7 +40,9 @@ ${strings.enums}: ${strings.include}: - 'CXTypeKind' - 'CXGlobalOptFlags' - +${strings.typedefmap}: + 'size_t': 'IntPtr' + 'time_t': 'Int64' ${strings.name}: 'LibClang' ${strings.description}: 'Holds bindings to LibClang.' ${strings.comments}: @@ -57,7 +59,7 @@ ${strings.preamble}: | matchLibraryWithExpected( library, - ['test', 'debug_generated', 'libclang-example.dart'], + ['test', 'debug_generated', 'example_libclang.dart'], ['example', 'libclang-example', config.output], ); }); diff --git a/test/example_tests/simple_example_test.dart b/test/example_tests/simple_example_test.dart index 8f4c1815..190e65e7 100644 --- a/test/example_tests/simple_example_test.dart +++ b/test/example_tests/simple_example_test.dart @@ -30,7 +30,7 @@ ${strings.headers}: matchLibraryWithExpected( library, - ['test', 'debug_generated', 'simple.dart'], + ['test', 'debug_generated', 'example_simple.dart'], ['example', 'simple', config.output], ); }); diff --git a/test/header_parser_tests/comment_markup_test.dart b/test/header_parser_tests/comment_markup_test.dart index 9771f632..3fadaea6 100644 --- a/test/header_parser_tests/comment_markup_test.dart +++ b/test/header_parser_tests/comment_markup_test.dart @@ -36,7 +36,7 @@ ${strings.comments}: matchLibraryWithExpected(actual, [ 'test', 'debug_generated', - 'comment_markup_test_output.dart' + 'header_parser_comment_markup_test_output.dart' ], [ 'test', 'header_parser_tests', diff --git a/test/header_parser_tests/dart_handle_test.dart b/test/header_parser_tests/dart_handle_test.dart index ed9d1aa7..90893026 100644 --- a/test/header_parser_tests/dart_handle_test.dart +++ b/test/header_parser_tests/dart_handle_test.dart @@ -19,7 +19,6 @@ void main() { group('dart_handle_test', () { setUpAll(() { logWarnings(); - expected = expectedLibrary(); actual = parser.parse( Config.fromYaml(yaml.loadYaml(''' ${strings.name}: 'NativeLibrary' @@ -35,86 +34,17 @@ ${strings.headers}: ''') as yaml.YamlMap), ); }); - test('Total bindings count', () { - expect(actual.bindings.length, expected.bindings.length); - }); - - test('func1', () { - expect(actual.getBindingAsString('func1'), - expected.getBindingAsString('func1')); - }); - test('func2', () { - expect(actual.getBindingAsString('func2'), - expected.getBindingAsString('func2')); - }); - test('func3', () { - expect(actual.getBindingAsString('func3'), - expected.getBindingAsString('func3')); - }); - test('func4', () { - expect(actual.getBindingAsString('func4'), - expected.getBindingAsString('func4')); - }); - test('struc1', () { - expect(actual.getBindingAsString('struc1'), - expected.getBindingAsString('struc1')); - }); - test('struc2', () { - expect(actual.getBindingAsString('struc2'), - expected.getBindingAsString('struc2')); + test('Expected Bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'header_parser_dart_handle_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_dart_handle_bindings.dart' + ]); }); }); } - -Library expectedLibrary() { - final namedTypedef = Typedef( - name: 'typedef1', - typedefType: TypedefType.C, - returnType: Type.nativeType(SupportedNativeType.Void), - parameters: [Parameter(type: Type.handle())], - ); - return Library( - name: 'NativeLibrary', - bindings: [ - Func( - name: 'func1', - returnType: Type.nativeType( - SupportedNativeType.Void, - ), - parameters: [ - Parameter(type: Type.handle()), - ], - ), - Func( - name: 'func2', - returnType: Type.handle(), - ), - Func( - name: 'func3', - returnType: Type.pointer(Type.pointer(Type.handle())), - parameters: [ - Parameter( - type: Type.pointer(Type.handle()), - ), - ], - ), - Func( - name: 'func4', - returnType: Type.nativeType(SupportedNativeType.Void), - parameters: [ - Parameter( - type: Type.pointer(Type.nativeFunc(namedTypedef)), - ), - ], - ), - // struc1 should have no members. - Struc(name: 'struc1'), - Struc( - name: 'struc2', - members: [ - Member(name: 'h', type: Type.pointer(Type.handle())), - ], - ), - ], - ); -} diff --git a/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart b/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart index 75bc7c7c..378bec02 100644 --- a/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart +++ b/test/header_parser_tests/expected_bindings/_expected_comment_markup_bindings.dart @@ -24,8 +24,9 @@ class NativeLibrary { return _com1(); } - late final _com1_ptr = _lookup>('com1'); - late final _dart_com1 _com1 = _com1_ptr.asFunction<_dart_com1>(); + late final _com1_ptr = + _lookup>('com1'); + late final _com1 = _com1_ptr.asFunction(); /// This is a multi-line /// test comment. @@ -33,8 +34,9 @@ class NativeLibrary { return _com2(); } - late final _com2_ptr = _lookup>('com2'); - late final _dart_com2 _com2 = _com2_ptr.asFunction<_dart_com2>(); + late final _com2_ptr = + _lookup>('com2'); + late final _com2 = _com2_ptr.asFunction(); /// This is a multi-line /// doxygen style @@ -43,8 +45,9 @@ class NativeLibrary { return _com3(); } - late final _com3_ptr = _lookup>('com3'); - late final _dart_com3 _com3 = _com3_ptr.asFunction<_dart_com3>(); + late final _com3_ptr = + _lookup>('com3'); + late final _com3 = _com3_ptr.asFunction(); } /// Test comment for struct. @@ -58,15 +61,3 @@ class com4 extends ffi.Struct { @ffi.Float() external double b; } - -typedef _c_com1 = ffi.Void Function(); - -typedef _dart_com1 = void Function(); - -typedef _c_com2 = ffi.Void Function(); - -typedef _dart_com2 = void Function(); - -typedef _c_com3 = ffi.Void Function(); - -typedef _dart_com3 = void Function(); diff --git a/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart b/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart new file mode 100644 index 00000000..7d87f989 --- /dev/null +++ b/test/header_parser_tests/expected_bindings/_expected_dart_handle_bindings.dart @@ -0,0 +1,77 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Dart_Handle Test +class NativeLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void func1( + Object arg0, + ) { + return _func1( + arg0, + ); + } + + late final _func1_ptr = + _lookup>('func1'); + late final _func1 = _func1_ptr.asFunction(); + + Object func2() { + return _func2(); + } + + late final _func2_ptr = + _lookup>('func2'); + late final _func2 = _func2_ptr.asFunction(); + + ffi.Pointer> func3( + ffi.Pointer arg0, + ) { + return _func3( + arg0, + ); + } + + late final _func3_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer> Function( + ffi.Pointer)>>('func3'); + late final _func3 = _func3_ptr.asFunction< + ffi.Pointer> Function(ffi.Pointer)>(); + + void func4( + typedef1 arg0, + ) { + return _func4( + arg0, + ); + } + + late final _func4_ptr = + _lookup>('func4'); + late final _func4 = _func4_ptr.asFunction(); +} + +typedef typedef1 + = ffi.Pointer>; + +class struc1 extends ffi.Opaque {} + +class struc2 extends ffi.Struct { + external ffi.Pointer h; +} diff --git a/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart b/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart index 5fc47cde..355255bf 100644 --- a/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart +++ b/test/header_parser_tests/expected_bindings/_expected_forward_decl_bindings.dart @@ -29,8 +29,10 @@ class NativeLibrary { ); } - late final _func_ptr = _lookup>('func'); - late final _dart_func _func = _func_ptr.asFunction<_dart_func>(); + late final _func_ptr = + _lookup, ffi.Int32)>>( + 'func'); + late final _func = _func_ptr.asFunction, int)>(); } class A extends ffi.Struct { @@ -45,13 +47,3 @@ abstract class B { static const int a = 0; static const int b = 1; } - -typedef _c_func = ffi.Void Function( - ffi.Pointer a, - ffi.Int32 b, -); - -typedef _dart_func = void Function( - ffi.Pointer a, - int b, -); diff --git a/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart b/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart new file mode 100644 index 00000000..769371ae --- /dev/null +++ b/test/header_parser_tests/expected_bindings/_expected_functions_bindings.dart @@ -0,0 +1,114 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +/// Functions Test +class NativeLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + NativeLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + NativeLibrary.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void func1() { + return _func1(); + } + + late final _func1_ptr = + _lookup>('func1'); + late final _func1 = _func1_ptr.asFunction(); + + int func2( + int arg0, + ) { + return _func2( + arg0, + ); + } + + late final _func2_ptr = + _lookup>('func2'); + late final _func2 = _func2_ptr.asFunction(); + + double func3( + double arg0, + int a, + int arg2, + int b, + ) { + return _func3( + arg0, + a, + arg2, + b, + ); + } + + late final _func3_ptr = _lookup>('func3'); + late final _func3 = + _func3_ptr.asFunction(); + + ffi.Pointer func4( + ffi.Pointer> arg0, + double arg1, + ffi.Pointer>> arg2, + ) { + return _func4( + arg0, + arg1, + arg2, + ); + } + + late final _func4_ptr = _lookup>('func4'); + late final _func4 = _func4_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer>, double, + ffi.Pointer>>)>(); + + void func5( + ffi.Pointer a, + ffi.Pointer> b, + ) { + return _func5( + a, + b, + ); + } + + late final _func5_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer>)>>('func5'); + late final _func5 = _func5_ptr.asFunction< + void Function(ffi.Pointer, + ffi.Pointer>)>(); + + late final addresses = _SymbolAddresses(this); +} + +class _SymbolAddresses { + final NativeLibrary _library; + _SymbolAddresses(this._library); + ffi.Pointer> get func3 => + _library._func3_ptr; + ffi.Pointer> get func4 => + _library._func4_ptr; +} + +typedef Native_func3 = ffi.Double Function( + ffi.Float arg0, ffi.Int8 a, ffi.Int64 arg2, ffi.Int32 b); +typedef Native_func4 = ffi.Pointer Function( + ffi.Pointer> arg0, + ffi.Double arg1, + ffi.Pointer>> arg2); +typedef shortHand = ffi.NativeFunction< + ffi.Void Function(ffi.Pointer>)>; diff --git a/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart b/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart index ac068d2a..5cf12c3c 100644 --- a/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart +++ b/test/header_parser_tests/expected_bindings/_expected_native_func_typedef_bindings.dart @@ -20,18 +20,36 @@ class NativeLibrary { : _lookup = lookup; void func( - ffi.Pointer> unnamed1, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer>)>> + unnamed1, ) { return _func( unnamed1, ); } - late final _func_ptr = _lookup>('func'); - late final _dart_func _func = _func_ptr.asFunction<_dart_func>(); + late final _func_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function()>>)>>)>>('func'); + late final _func = _func_ptr.asFunction< + void Function( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer< + ffi.NativeFunction>)>>)>(); void funcWithNativeFunc( - ffi.Pointer> named, + withTypedefReturnType named, ) { return _funcWithNativeFunc( named, @@ -39,50 +57,25 @@ class NativeLibrary { } late final _funcWithNativeFunc_ptr = - _lookup>('funcWithNativeFunc'); - late final _dart_funcWithNativeFunc _funcWithNativeFunc = - _funcWithNativeFunc_ptr.asFunction<_dart_funcWithNativeFunc>(); + _lookup>( + 'funcWithNativeFunc'); + late final _funcWithNativeFunc = _funcWithNativeFunc_ptr + .asFunction(); } class struc extends ffi.Struct { - external ffi.Pointer> unnamed1; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer>)>> unnamed1; } -class Struc2 extends ffi.Struct { - external ffi.Pointer> constFuncPointer; -} - -typedef _typedefC_3 = ffi.Void Function(); - -typedef _typedefC_4 = ffi.Void Function( - ffi.Pointer>, -); - -typedef _c_func = ffi.Void Function( - ffi.Pointer> unnamed1, -); - -typedef _dart_func = void Function( - ffi.Pointer> unnamed1, -); - -typedef insideReturnType = ffi.Void Function(); - typedef withTypedefReturnType - = ffi.Pointer> Function(); - -typedef _c_funcWithNativeFunc = ffi.Void Function( - ffi.Pointer> named, -); - -typedef _dart_funcWithNativeFunc = void Function( - ffi.Pointer> named, -); + = ffi.Pointer>; +typedef insideReturnType = ffi.Pointer>; -typedef _typedefC_1 = ffi.Void Function(); - -typedef _typedefC_2 = ffi.Void Function( - ffi.Pointer>, -); +class Struc2 extends ffi.Struct { + external VoidFuncPointer constFuncPointer; +} -typedef VoidFuncPointer = ffi.Void Function(); +typedef VoidFuncPointer = ffi.Pointer>; diff --git a/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart b/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart index c37dbafc..c8cb2e05 100644 --- a/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart +++ b/test/header_parser_tests/expected_bindings/_expected_opaque_dependencies_bindings.dart @@ -19,7 +19,7 @@ class NativeLibrary { lookup) : _lookup = lookup; - ffi.Pointer func( + ffi.Pointer func( ffi.Pointer a, ) { return _func( @@ -27,8 +27,11 @@ class NativeLibrary { ); } - late final _func_ptr = _lookup>('func'); - late final _dart_func _func = _func_ptr.asFunction<_dart_func>(); + late final _func_ptr = _lookup< + ffi.NativeFunction Function(ffi.Pointer)>>( + 'func'); + late final _func = + _func_ptr.asFunction Function(ffi.Pointer)>(); ffi.Pointer func2( ffi.Pointer a, @@ -38,56 +41,45 @@ class NativeLibrary { ); } - late final _func2_ptr = _lookup>('func2'); - late final _dart_func2 _func2 = _func2_ptr.asFunction<_dart_func2>(); + late final _func2_ptr = + _lookup Function(ffi.Pointer)>>( + 'func2'); + late final _func2 = + _func2_ptr.asFunction Function(ffi.Pointer)>(); } +typedef B_alias = B; + class B extends ffi.Opaque {} class A extends ffi.Opaque {} -class C extends ffi.Opaque {} - -class D extends ffi.Struct { - @ffi.Int32() - external int a; -} - class E extends ffi.Struct { external ffi.Pointer c; external D d; } -class UB extends ffi.Opaque {} - -class UA extends ffi.Opaque {} - -class UC extends ffi.Opaque {} +class C extends ffi.Opaque {} -class UD extends ffi.Union { +class D extends ffi.Struct { @ffi.Int32() external int a; } +class UB extends ffi.Opaque {} + +class UA extends ffi.Opaque {} + class UE extends ffi.Union { external ffi.Pointer c; external UD d; } -typedef _c_func = ffi.Pointer Function( - ffi.Pointer a, -); - -typedef _dart_func = ffi.Pointer Function( - ffi.Pointer a, -); - -typedef _c_func2 = ffi.Pointer Function( - ffi.Pointer a, -); +class UC extends ffi.Opaque {} -typedef _dart_func2 = ffi.Pointer Function( - ffi.Pointer a, -); +class UD extends ffi.Union { + @ffi.Int32() + external int a; +} diff --git a/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart b/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart new file mode 100644 index 00000000..fc0d39ba --- /dev/null +++ b/test/header_parser_tests/expected_bindings/_expected_typedef_bindings.dart @@ -0,0 +1,121 @@ +// ignore_for_file: unused_element +// ignore_for_file: unused_field + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. +import 'dart:ffi' as ffi; + +class Bindings { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + Bindings(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + Bindings.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + NamedFunctionProto func1( + NamedFunctionProto named, + ffi.Pointer> unnamed, + ) { + return _func1( + named, + unnamed, + ); + } + + late final _func1_ptr = _lookup< + ffi.NativeFunction< + NamedFunctionProto Function( + NamedFunctionProto, + ffi.Pointer< + ffi.NativeFunction>)>>('func1'); + late final _func1 = _func1_ptr.asFunction< + NamedFunctionProto Function(NamedFunctionProto, + ffi.Pointer>)>(); + + void func2( + ffi.Pointer arg0, + ) { + return _func2( + arg0, + ); + } + + late final _func2_ptr = + _lookup)>>( + 'func2'); + late final _func2 = + _func2_ptr.asFunction)>(); + + void func3( + int arg0, + int b, + ) { + return _func3( + arg0, + b, + ); + } + + late final _func3_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.IntPtr, nesting_a_specified_type)>>('func3'); + late final _func3 = _func3_ptr.asFunction(); + + bool func4( + ffi.Pointer a, + ) { + return _func4( + a, + ) != + 0; + } + + late final _func4_ptr = + _lookup)>>( + 'func4'); + late final _func4 = + _func4_ptr.asFunction)>(); +} + +class Struct1 extends ffi.Struct { + external NamedFunctionProto named; + + external ffi.Pointer> unnamed; +} + +typedef NamedFunctionProto + = ffi.Pointer>; + +class AnonymousStructInTypedef extends ffi.Opaque {} + +class _NamedStructInTypedef extends ffi.Opaque {} + +typedef NTyperef1 = ExcludedStruct; +typedef ExcludedStruct = _ExcludedStruct; + +class _ExcludedStruct extends ffi.Opaque {} + +abstract class AnonymousEnumInTypedef { + static const int a = 0; +} + +abstract class _NamedEnumInTypedef { + static const int b = 0; +} + +typedef nesting_a_specified_type = ffi.IntPtr; + +class Struct2 extends ffi.Opaque {} + +class withBoolAlias extends ffi.Struct { + @ffi.Uint8() + external int b; +} diff --git a/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart b/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart index a06659ee..d1024151 100644 --- a/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart +++ b/test/header_parser_tests/expected_bindings/_expected_unions_bindings.dart @@ -27,8 +27,11 @@ class NativeLibrary { ); } - late final _func1_ptr = _lookup>('func1'); - late final _dart_func1 _func1 = _func1_ptr.asFunction<_dart_func1>(); + late final _func1_ptr = + _lookup)>>( + 'func1'); + late final _func1 = + _func1_ptr.asFunction)>(); void func2( ffi.Pointer s, @@ -38,8 +41,11 @@ class NativeLibrary { ); } - late final _func2_ptr = _lookup>('func2'); - late final _dart_func2 _func2 = _func2_ptr.asFunction<_dart_func2>(); + late final _func2_ptr = + _lookup)>>( + 'func2'); + late final _func2 = + _func2_ptr.asFunction)>(); } class Union1 extends ffi.Union { @@ -56,19 +62,3 @@ class Union3 extends ffi.Opaque {} class Union4 extends ffi.Opaque {} class Union5 extends ffi.Opaque {} - -typedef _c_func1 = ffi.Void Function( - ffi.Pointer s, -); - -typedef _dart_func1 = void Function( - ffi.Pointer s, -); - -typedef _c_func2 = ffi.Void Function( - ffi.Pointer s, -); - -typedef _dart_func2 = void Function( - ffi.Pointer s, -); diff --git a/test/header_parser_tests/forward_decl_test.dart b/test/header_parser_tests/forward_decl_test.dart index 0d4488e3..ca16de4f 100644 --- a/test/header_parser_tests/forward_decl_test.dart +++ b/test/header_parser_tests/forward_decl_test.dart @@ -33,7 +33,7 @@ ${strings.headers}: matchLibraryWithExpected(actual, [ 'test', 'debug_generated', - 'forward_decl_test_output.dart' + 'header_parser_forward_decl_test_output.dart' ], [ 'test', 'header_parser_tests', diff --git a/test/header_parser_tests/function_n_struct.h b/test/header_parser_tests/function_n_struct.h index bae5f401..e428cf38 100644 --- a/test/header_parser_tests/function_n_struct.h +++ b/test/header_parser_tests/function_n_struct.h @@ -33,7 +33,16 @@ struct Struct5 struct Struct3 s; // Incomplete nested struct. }; +typedef int arr10[10]; + +struct Struct6 +{ + arr10 a[2]; +}; + void func1(struct Struct2 *s); // Incomplete array parameter will be treated as a pointer. void func2(struct Struct3 s[]); + +void func3(arr10 a); diff --git a/test/header_parser_tests/function_n_struct_test.dart b/test/header_parser_tests/function_n_struct_test.dart index 861a6bfe..3b34013e 100644 --- a/test/header_parser_tests/function_n_struct_test.dart +++ b/test/header_parser_tests/function_n_struct_test.dart @@ -56,29 +56,37 @@ ${strings.headers}: test('Struct5 incompleted struct member', () { expect((actual.getBinding('Struct5') as Struc).members.isEmpty, true); }); + test('Struct6 typedef constant array', () { + expect(actual.getBindingAsString('Struct6'), + expected.getBindingAsString('Struct6')); + }); + test('func3 constant typedef array parameter', () { + expect(actual.getBindingAsString('func3'), + expected.getBindingAsString('func3')); + }); }); } Library expectedLibrary() { - final struc1 = Struc(name: 'Struct1', members: []); + final struc1 = Struc(name: 'Struct1', members: [ + Member( + name: 'a', + type: Type.nativeType(SupportedNativeType.Int32), + ), + ]); final struc2 = Struc(name: 'Struct2', members: [ Member( name: 'a', type: Type.struct(struc1), ), ]); - final struc3 = Struc(name: 'Struct3', members: []); + final struc3 = Struc(name: 'Struct3'); return Library( name: 'Bindings', bindings: [ + struc1, struc2, struc3, - Struc(name: 'Struct1', members: [ - Member( - name: 'a', - type: Type.nativeType(SupportedNativeType.Int32), - ), - ]), Func( name: 'func1', parameters: [ @@ -97,13 +105,27 @@ Library expectedLibrary() { SupportedNativeType.Void, ), ), - Struc(name: 'Struct4', members: [ - Member( - name: 'a', - type: Type.struct(struc1), + Func( + name: 'func3', + parameters: [ + Parameter( + name: 'a', + type: Type.pointer(Type.nativeType(SupportedNativeType.Int32))), + ], + returnType: Type.nativeType( + SupportedNativeType.Void, ), - ]), + ), + Struc(name: 'Struct4'), Struc(name: 'Struct5'), + Struc(name: 'Struct6', members: [ + Member( + name: 'a', + type: Type.constantArray( + 2, + Type.constantArray( + 10, Type.nativeType(SupportedNativeType.Int32)))) + ]), ], ); } diff --git a/test/header_parser_tests/functions_test.dart b/test/header_parser_tests/functions_test.dart index 6e526b15..1bfb733b 100644 --- a/test/header_parser_tests/functions_test.dart +++ b/test/header_parser_tests/functions_test.dart @@ -17,7 +17,6 @@ void main() { group('functions_test', () { setUpAll(() { logWarnings(); - expected = expectedLibrary(); actual = parser.parse( Config.fromYaml(yaml.loadYaml(''' ${strings.name}: 'NativeLibrary' @@ -38,138 +37,17 @@ ${strings.functions}: ''') as yaml.YamlMap), ); }); - test('Total bindings count', () { - expect(actual.bindings.length, expected.bindings.length); - }); - - test('func1', () { - expect(actual.getBindingAsString('func1'), - expected.getBindingAsString('func1')); - }); - test('func2', () { - expect(actual.getBindingAsString('func2'), - expected.getBindingAsString('func2')); - }); - test('func3', () { - expect(actual.getBindingAsString('func3'), - expected.getBindingAsString('func3')); - }); - - test('func4', () { - expect(actual.getBindingAsString('func4'), - expected.getBindingAsString('func4')); - }); - - test('func5', () { - expect(actual.getBindingAsString('func5'), - expected.getBindingAsString('func5')); - }); - - test('Skip inline functions', () { - expect(() => actual.getBindingAsString('inlineFunc'), - throwsA(TypeMatcher())); + test('Expected Bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'header_parser_functions_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_functions_bindings.dart' + ]); }); }); } - -Library expectedLibrary() { - return Library( - name: 'Bindings', - bindings: [ - Func( - name: 'func1', - returnType: Type.nativeType( - SupportedNativeType.Void, - ), - ), - Func( - name: 'func2', - returnType: Type.nativeType( - SupportedNativeType.Int32, - ), - parameters: [ - Parameter( - name: '', - type: Type.nativeType( - SupportedNativeType.Int16, - ), - ), - ], - ), - Func( - name: 'func3', - exposeSymbolAddress: true, - returnType: Type.nativeType( - SupportedNativeType.Double, - ), - parameters: [ - Parameter( - type: Type.nativeType( - SupportedNativeType.Float, - ), - ), - Parameter( - name: 'a', - type: Type.nativeType( - SupportedNativeType.Int8, - ), - ), - Parameter( - name: '', - type: Type.nativeType( - SupportedNativeType.Int64, - ), - ), - Parameter( - name: 'b', - type: Type.nativeType( - SupportedNativeType.Int32, - ), - ), - ], - ), - Func( - name: 'func4', - exposeSymbolAddress: true, - returnType: Type.pointer(Type.nativeType(SupportedNativeType.Void)), - parameters: [ - Parameter( - type: Type.pointer( - Type.pointer(Type.nativeType(SupportedNativeType.Int8)))), - Parameter(type: Type.nativeType(SupportedNativeType.Double)), - Parameter( - type: Type.pointer(Type.pointer( - Type.pointer(Type.nativeType(SupportedNativeType.Int32)))), - ), - ]), - Func( - name: 'func5', - returnType: Type.nativeType(SupportedNativeType.Void), - parameters: [ - Parameter( - name: 'a', - type: Type.pointer(Type.nativeFunc(Typedef( - name: 'shortHand', - returnType: Type.nativeType(SupportedNativeType.Void), - typedefType: TypedefType.C, - parameters: [ - Parameter( - type: Type.pointer(Type.nativeFunc(Typedef( - name: 'b', - returnType: Type.nativeType(SupportedNativeType.Void), - typedefType: TypedefType.C, - )))), - ], - )))), - Parameter( - name: 'b', - type: Type.pointer(Type.nativeFunc(Typedef( - name: '_typedefC_2', - returnType: Type.nativeType(SupportedNativeType.Void), - typedefType: TypedefType.C, - )))), - ], - ), - ], - ); -} diff --git a/test/header_parser_tests/globals.h b/test/header_parser_tests/globals.h index 80da2b0a..5ce3fc52 100644 --- a/test/header_parser_tests/globals.h +++ b/test/header_parser_tests/globals.h @@ -19,3 +19,6 @@ struct EmptyStruct }; struct EmptyStruct globalStruct; + +typedef struct EmptyStruct EmptyStruct_Alias; +EmptyStruct_Alias globalStruct_from_alias; diff --git a/test/header_parser_tests/globals_test.dart b/test/header_parser_tests/globals_test.dart index 467be8a0..be10f3c2 100644 --- a/test/header_parser_tests/globals_test.dart +++ b/test/header_parser_tests/globals_test.dart @@ -87,6 +87,16 @@ Library expectedLibrary() { type: Type.struct(globalStruc), exposeSymbolAddress: true, ), + Global( + name: 'globalStruct_from_alias', + type: Type.typealias( + Typealias( + name: 'EmptyStruct_Alias', + type: Type.struct(globalStruc), + ), + ), + exposeSymbolAddress: true, + ) ], ); } diff --git a/test/header_parser_tests/native_func_typedef_test.dart b/test/header_parser_tests/native_func_typedef_test.dart index cc348cbc..4f9187c5 100644 --- a/test/header_parser_tests/native_func_typedef_test.dart +++ b/test/header_parser_tests/native_func_typedef_test.dart @@ -38,7 +38,7 @@ ${strings.headers}: matchLibraryWithExpected(actual, [ 'test', 'debug_generated', - 'native_func_typedef_test_output.dart' + 'header_parser_native_func_typedef_test_output.dart' ], [ 'test', 'header_parser_tests', diff --git a/test/header_parser_tests/opaque_dependencies.h b/test/header_parser_tests/opaque_dependencies.h index e30b260e..2825911a 100644 --- a/test/header_parser_tests/opaque_dependencies.h +++ b/test/header_parser_tests/opaque_dependencies.h @@ -9,12 +9,12 @@ struct A }; // Opaque. -struct B +typedef struct B { int a; -}; +} B_alias; -struct B *func(struct A *a); +B_alias *func(struct A *a); // Opaque. struct C diff --git a/test/header_parser_tests/opaque_dependencies_test.dart b/test/header_parser_tests/opaque_dependencies_test.dart index 101e8db8..782f761f 100644 --- a/test/header_parser_tests/opaque_dependencies_test.dart +++ b/test/header_parser_tests/opaque_dependencies_test.dart @@ -36,12 +36,11 @@ ${strings.unions}: ''') as yaml.YamlMap), ); }); - test('Expected bindings', () { matchLibraryWithExpected(actual, [ 'test', 'debug_generated', - 'opaque_dependencies_test_output.dart' + 'header_parser_opaque_dependencies_test_output.dart' ], [ 'test', 'header_parser_tests', diff --git a/test/header_parser_tests/packed_structs_test.dart b/test/header_parser_tests/packed_structs_test.dart index 4e99c037..357412e4 100644 --- a/test/header_parser_tests/packed_structs_test.dart +++ b/test/header_parser_tests/packed_structs_test.dart @@ -33,7 +33,7 @@ ${strings.headers}: matchLibraryWithExpected(actual, [ 'test', 'debug_generated', - 'packed_structs_test_output.dart' + 'header_parser_packed_structs_test_output.dart' ], [ 'test', 'header_parser_tests', diff --git a/test/header_parser_tests/typedef.h b/test/header_parser_tests/typedef.h index a8e9cd6d..73e7e2e5 100644 --- a/test/header_parser_tests/typedef.h +++ b/test/header_parser_tests/typedef.h @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +#include + typedef void (*NamedFunctionProto)(); struct Struct1 @@ -59,3 +61,11 @@ void func3(specified_type_as_IntPtr, nesting_a_specified_type b); typedef struct { } Struct2, Struct3, *pStruct2, *pStruct3; + +typedef bool bool_alias; + +bool_alias func4(bool_alias *a); + +struct withBoolAlias{ + bool_alias b; +}; diff --git a/test/header_parser_tests/typedef_test.dart b/test/header_parser_tests/typedef_test.dart index 4e3daa52..53417c29 100644 --- a/test/header_parser_tests/typedef_test.dart +++ b/test/header_parser_tests/typedef_test.dart @@ -18,7 +18,6 @@ void main() { group('typedef_test', () { setUpAll(() { logWarnings(Level.SEVERE); - expected = expectedLibrary(); actual = parser.parse( Config.fromYaml(yaml.loadYaml(''' ${strings.name}: 'Bindings' @@ -27,102 +26,33 @@ ${strings.output}: 'unused' ${strings.headers}: ${strings.entryPoints}: - 'test/header_parser_tests/typedef.h' + ${strings.includeDirectives}: + - '**typedef.h' ${strings.structs}: ${strings.exclude}: - ExcludedStruct - _ExcludedStruct ${strings.typedefmap}: 'specified_type_as_IntPtr': 'IntPtr' + +${strings.preamble}: | + // ignore_for_file: unused_element + // ignore_for_file: unused_field ''') as yaml.YamlMap), ); }); - test('Library output', () { - expect(actual.generate(), expected.generate()); + test('Expected Bindings', () { + matchLibraryWithExpected(actual, [ + 'test', + 'debug_generated', + 'header_parser_typedef_test_output.dart' + ], [ + 'test', + 'header_parser_tests', + 'expected_bindings', + '_expected_typedef_bindings.dart' + ]); }); }); } - -Library expectedLibrary() { - final namedTypedef = Typedef( - name: 'NamedFunctionProto', - typedefType: TypedefType.C, - returnType: Type.nativeType(SupportedNativeType.Void), - ); - - final excludedNtyperef = Struc(name: 'NTyperef1'); - return Library( - name: 'Bindings', - bindings: [ - Struc(name: 'Struct1', members: [ - Member( - name: 'named', - type: Type.pointer(Type.nativeFunc(namedTypedef)), - ), - Member( - name: 'unnamed', - type: Type.pointer(Type.nativeFunc(Typedef( - name: '_typedefC_1', - typedefType: TypedefType.C, - returnType: Type.nativeType(SupportedNativeType.Void), - ))), - ), - ]), - Func( - name: 'func1', - parameters: [ - Parameter( - name: 'named', - type: Type.pointer(Type.nativeFunc(namedTypedef)), - ), - Parameter( - name: 'unnamed', - type: Type.pointer(Type.nativeFunc(Typedef( - name: '_typedefC_2', - typedefType: TypedefType.C, - parameters: [ - Parameter(type: Type.nativeType(SupportedNativeType.Int32)), - ], - returnType: Type.nativeType(SupportedNativeType.Void), - ))), - ), - ], - returnType: Type.pointer(Type.nativeFunc(namedTypedef)), - ), - Struc(name: 'AnonymousStructInTypedef'), - Struc(name: 'NamedStructInTypedef'), - excludedNtyperef, - Func( - name: 'func2', - returnType: Type.nativeType(SupportedNativeType.Void), - parameters: [ - Parameter(type: Type.pointer(Type.struct(excludedNtyperef))) - ], - ), - EnumClass( - name: 'AnonymousEnumInTypedef', - enumConstants: [ - EnumConstant(name: 'a', value: 0), - ], - ), - EnumClass( - name: 'NamedEnumInTypedef', - enumConstants: [ - EnumConstant(name: 'b', value: 0), - ], - ), - Func( - name: 'func3', - returnType: Type.nativeType(SupportedNativeType.Void), - parameters: [ - Parameter(type: Type.nativeType(SupportedNativeType.IntPtr)), - Parameter( - type: Type.nativeType(SupportedNativeType.IntPtr), - name: 'b', - ), - ], - ), - Struc(name: 'Struct3'), - ], - ); -} diff --git a/test/header_parser_tests/unions_test.dart b/test/header_parser_tests/unions_test.dart index 699f93d0..5146d627 100644 --- a/test/header_parser_tests/unions_test.dart +++ b/test/header_parser_tests/unions_test.dart @@ -33,7 +33,7 @@ ${strings.headers}: matchLibraryWithExpected(actual, [ 'test', 'debug_generated', - 'unions_test_output.dart' + 'header_parser_unions_test_output.dart' ], [ 'test', 'header_parser_tests', diff --git a/test/large_integration_tests/_expected_cjson_bindings.dart b/test/large_integration_tests/_expected_cjson_bindings.dart index 818416a8..73257d0c 100644 --- a/test/large_integration_tests/_expected_cjson_bindings.dart +++ b/test/large_integration_tests/_expected_cjson_bindings.dart @@ -23,9 +23,10 @@ class CJson { } late final _cJSON_Version_ptr = - _lookup>('cJSON_Version'); - late final _dart_cJSON_Version _cJSON_Version = - _cJSON_Version_ptr.asFunction<_dart_cJSON_Version>(); + _lookup Function()>>( + 'cJSON_Version'); + late final _cJSON_Version = + _cJSON_Version_ptr.asFunction Function()>(); void cJSON_InitHooks( ffi.Pointer hooks, @@ -36,9 +37,10 @@ class CJson { } late final _cJSON_InitHooks_ptr = - _lookup>('cJSON_InitHooks'); - late final _dart_cJSON_InitHooks _cJSON_InitHooks = - _cJSON_InitHooks_ptr.asFunction<_dart_cJSON_InitHooks>(); + _lookup)>>( + 'cJSON_InitHooks'); + late final _cJSON_InitHooks = _cJSON_InitHooks_ptr + .asFunction)>(); ffi.Pointer cJSON_Parse( ffi.Pointer value, @@ -48,10 +50,11 @@ class CJson { ); } - late final _cJSON_Parse_ptr = - _lookup>('cJSON_Parse'); - late final _dart_cJSON_Parse _cJSON_Parse = - _cJSON_Parse_ptr.asFunction<_dart_cJSON_Parse>(); + late final _cJSON_Parse_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Parse'); + late final _cJSON_Parse = _cJSON_Parse_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_ParseWithOpts( ffi.Pointer value, @@ -65,11 +68,15 @@ class CJson { ); } - late final _cJSON_ParseWithOpts_ptr = - _lookup>( - 'cJSON_ParseWithOpts'); - late final _dart_cJSON_ParseWithOpts _cJSON_ParseWithOpts = - _cJSON_ParseWithOpts_ptr.asFunction<_dart_cJSON_ParseWithOpts>(); + late final _cJSON_ParseWithOpts_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer>, + cJSON_bool)>>('cJSON_ParseWithOpts'); + late final _cJSON_ParseWithOpts = _cJSON_ParseWithOpts_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer>, int)>(); ffi.Pointer cJSON_Print( ffi.Pointer item, @@ -79,10 +86,11 @@ class CJson { ); } - late final _cJSON_Print_ptr = - _lookup>('cJSON_Print'); - late final _dart_cJSON_Print _cJSON_Print = - _cJSON_Print_ptr.asFunction<_dart_cJSON_Print>(); + late final _cJSON_Print_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('cJSON_Print'); + late final _cJSON_Print = _cJSON_Print_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_PrintUnformatted( ffi.Pointer item, @@ -92,11 +100,12 @@ class CJson { ); } - late final _cJSON_PrintUnformatted_ptr = - _lookup>( - 'cJSON_PrintUnformatted'); - late final _dart_cJSON_PrintUnformatted _cJSON_PrintUnformatted = - _cJSON_PrintUnformatted_ptr.asFunction<_dart_cJSON_PrintUnformatted>(); + late final _cJSON_PrintUnformatted_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_PrintUnformatted'); + late final _cJSON_PrintUnformatted = _cJSON_PrintUnformatted_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_PrintBuffered( ffi.Pointer item, @@ -110,11 +119,12 @@ class CJson { ); } - late final _cJSON_PrintBuffered_ptr = - _lookup>( - 'cJSON_PrintBuffered'); - late final _dart_cJSON_PrintBuffered _cJSON_PrintBuffered = - _cJSON_PrintBuffered_ptr.asFunction<_dart_cJSON_PrintBuffered>(); + late final _cJSON_PrintBuffered_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Int32, + cJSON_bool)>>('cJSON_PrintBuffered'); + late final _cJSON_PrintBuffered = _cJSON_PrintBuffered_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int, int)>(); int cJSON_PrintPreallocated( ffi.Pointer item, @@ -130,11 +140,12 @@ class CJson { ); } - late final _cJSON_PrintPreallocated_ptr = - _lookup>( - 'cJSON_PrintPreallocated'); - late final _dart_cJSON_PrintPreallocated _cJSON_PrintPreallocated = - _cJSON_PrintPreallocated_ptr.asFunction<_dart_cJSON_PrintPreallocated>(); + late final _cJSON_PrintPreallocated_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, cJSON_bool)>>('cJSON_PrintPreallocated'); + late final _cJSON_PrintPreallocated = _cJSON_PrintPreallocated_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, int)>(); void cJSON_Delete( ffi.Pointer item, @@ -145,9 +156,10 @@ class CJson { } late final _cJSON_Delete_ptr = - _lookup>('cJSON_Delete'); - late final _dart_cJSON_Delete _cJSON_Delete = - _cJSON_Delete_ptr.asFunction<_dart_cJSON_Delete>(); + _lookup)>>( + 'cJSON_Delete'); + late final _cJSON_Delete = + _cJSON_Delete_ptr.asFunction)>(); int cJSON_GetArraySize( ffi.Pointer array, @@ -158,9 +170,10 @@ class CJson { } late final _cJSON_GetArraySize_ptr = - _lookup>('cJSON_GetArraySize'); - late final _dart_cJSON_GetArraySize _cJSON_GetArraySize = - _cJSON_GetArraySize_ptr.asFunction<_dart_cJSON_GetArraySize>(); + _lookup)>>( + 'cJSON_GetArraySize'); + late final _cJSON_GetArraySize = + _cJSON_GetArraySize_ptr.asFunction)>(); ffi.Pointer cJSON_GetArrayItem( ffi.Pointer array, @@ -172,10 +185,12 @@ class CJson { ); } - late final _cJSON_GetArrayItem_ptr = - _lookup>('cJSON_GetArrayItem'); - late final _dart_cJSON_GetArrayItem _cJSON_GetArrayItem = - _cJSON_GetArrayItem_ptr.asFunction<_dart_cJSON_GetArrayItem>(); + late final _cJSON_GetArrayItem_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_GetArrayItem'); + late final _cJSON_GetArrayItem = _cJSON_GetArrayItem_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_GetObjectItem( ffi.Pointer object, @@ -187,11 +202,12 @@ class CJson { ); } - late final _cJSON_GetObjectItem_ptr = - _lookup>( - 'cJSON_GetObjectItem'); - late final _dart_cJSON_GetObjectItem _cJSON_GetObjectItem = - _cJSON_GetObjectItem_ptr.asFunction<_dart_cJSON_GetObjectItem>(); + late final _cJSON_GetObjectItem_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_GetObjectItem'); + late final _cJSON_GetObjectItem = _cJSON_GetObjectItem_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_GetObjectItemCaseSensitive( ffi.Pointer object, @@ -203,12 +219,14 @@ class CJson { ); } - late final _cJSON_GetObjectItemCaseSensitive_ptr = - _lookup>( - 'cJSON_GetObjectItemCaseSensitive'); - late final _dart_cJSON_GetObjectItemCaseSensitive - _cJSON_GetObjectItemCaseSensitive = _cJSON_GetObjectItemCaseSensitive_ptr - .asFunction<_dart_cJSON_GetObjectItemCaseSensitive>(); + late final _cJSON_GetObjectItemCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_GetObjectItemCaseSensitive'); + late final _cJSON_GetObjectItemCaseSensitive = + _cJSON_GetObjectItemCaseSensitive_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); int cJSON_HasObjectItem( ffi.Pointer object, @@ -220,20 +238,22 @@ class CJson { ); } - late final _cJSON_HasObjectItem_ptr = - _lookup>( - 'cJSON_HasObjectItem'); - late final _dart_cJSON_HasObjectItem _cJSON_HasObjectItem = - _cJSON_HasObjectItem_ptr.asFunction<_dart_cJSON_HasObjectItem>(); + late final _cJSON_HasObjectItem_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_HasObjectItem'); + late final _cJSON_HasObjectItem = _cJSON_HasObjectItem_ptr + .asFunction, ffi.Pointer)>(); ffi.Pointer cJSON_GetErrorPtr() { return _cJSON_GetErrorPtr(); } late final _cJSON_GetErrorPtr_ptr = - _lookup>('cJSON_GetErrorPtr'); - late final _dart_cJSON_GetErrorPtr _cJSON_GetErrorPtr = - _cJSON_GetErrorPtr_ptr.asFunction<_dart_cJSON_GetErrorPtr>(); + _lookup Function()>>( + 'cJSON_GetErrorPtr'); + late final _cJSON_GetErrorPtr = + _cJSON_GetErrorPtr_ptr.asFunction Function()>(); ffi.Pointer cJSON_GetStringValue( ffi.Pointer item, @@ -243,11 +263,12 @@ class CJson { ); } - late final _cJSON_GetStringValue_ptr = - _lookup>( - 'cJSON_GetStringValue'); - late final _dart_cJSON_GetStringValue _cJSON_GetStringValue = - _cJSON_GetStringValue_ptr.asFunction<_dart_cJSON_GetStringValue>(); + late final _cJSON_GetStringValue_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_GetStringValue'); + late final _cJSON_GetStringValue = _cJSON_GetStringValue_ptr + .asFunction Function(ffi.Pointer)>(); int cJSON_IsInvalid( ffi.Pointer item, @@ -258,9 +279,10 @@ class CJson { } late final _cJSON_IsInvalid_ptr = - _lookup>('cJSON_IsInvalid'); - late final _dart_cJSON_IsInvalid _cJSON_IsInvalid = - _cJSON_IsInvalid_ptr.asFunction<_dart_cJSON_IsInvalid>(); + _lookup)>>( + 'cJSON_IsInvalid'); + late final _cJSON_IsInvalid = + _cJSON_IsInvalid_ptr.asFunction)>(); int cJSON_IsFalse( ffi.Pointer item, @@ -271,9 +293,10 @@ class CJson { } late final _cJSON_IsFalse_ptr = - _lookup>('cJSON_IsFalse'); - late final _dart_cJSON_IsFalse _cJSON_IsFalse = - _cJSON_IsFalse_ptr.asFunction<_dart_cJSON_IsFalse>(); + _lookup)>>( + 'cJSON_IsFalse'); + late final _cJSON_IsFalse = + _cJSON_IsFalse_ptr.asFunction)>(); int cJSON_IsTrue( ffi.Pointer item, @@ -284,9 +307,10 @@ class CJson { } late final _cJSON_IsTrue_ptr = - _lookup>('cJSON_IsTrue'); - late final _dart_cJSON_IsTrue _cJSON_IsTrue = - _cJSON_IsTrue_ptr.asFunction<_dart_cJSON_IsTrue>(); + _lookup)>>( + 'cJSON_IsTrue'); + late final _cJSON_IsTrue = + _cJSON_IsTrue_ptr.asFunction)>(); int cJSON_IsBool( ffi.Pointer item, @@ -297,9 +321,10 @@ class CJson { } late final _cJSON_IsBool_ptr = - _lookup>('cJSON_IsBool'); - late final _dart_cJSON_IsBool _cJSON_IsBool = - _cJSON_IsBool_ptr.asFunction<_dart_cJSON_IsBool>(); + _lookup)>>( + 'cJSON_IsBool'); + late final _cJSON_IsBool = + _cJSON_IsBool_ptr.asFunction)>(); int cJSON_IsNull( ffi.Pointer item, @@ -310,9 +335,10 @@ class CJson { } late final _cJSON_IsNull_ptr = - _lookup>('cJSON_IsNull'); - late final _dart_cJSON_IsNull _cJSON_IsNull = - _cJSON_IsNull_ptr.asFunction<_dart_cJSON_IsNull>(); + _lookup)>>( + 'cJSON_IsNull'); + late final _cJSON_IsNull = + _cJSON_IsNull_ptr.asFunction)>(); int cJSON_IsNumber( ffi.Pointer item, @@ -323,9 +349,10 @@ class CJson { } late final _cJSON_IsNumber_ptr = - _lookup>('cJSON_IsNumber'); - late final _dart_cJSON_IsNumber _cJSON_IsNumber = - _cJSON_IsNumber_ptr.asFunction<_dart_cJSON_IsNumber>(); + _lookup)>>( + 'cJSON_IsNumber'); + late final _cJSON_IsNumber = + _cJSON_IsNumber_ptr.asFunction)>(); int cJSON_IsString( ffi.Pointer item, @@ -336,9 +363,10 @@ class CJson { } late final _cJSON_IsString_ptr = - _lookup>('cJSON_IsString'); - late final _dart_cJSON_IsString _cJSON_IsString = - _cJSON_IsString_ptr.asFunction<_dart_cJSON_IsString>(); + _lookup)>>( + 'cJSON_IsString'); + late final _cJSON_IsString = + _cJSON_IsString_ptr.asFunction)>(); int cJSON_IsArray( ffi.Pointer item, @@ -349,9 +377,10 @@ class CJson { } late final _cJSON_IsArray_ptr = - _lookup>('cJSON_IsArray'); - late final _dart_cJSON_IsArray _cJSON_IsArray = - _cJSON_IsArray_ptr.asFunction<_dart_cJSON_IsArray>(); + _lookup)>>( + 'cJSON_IsArray'); + late final _cJSON_IsArray = + _cJSON_IsArray_ptr.asFunction)>(); int cJSON_IsObject( ffi.Pointer item, @@ -362,9 +391,10 @@ class CJson { } late final _cJSON_IsObject_ptr = - _lookup>('cJSON_IsObject'); - late final _dart_cJSON_IsObject _cJSON_IsObject = - _cJSON_IsObject_ptr.asFunction<_dart_cJSON_IsObject>(); + _lookup)>>( + 'cJSON_IsObject'); + late final _cJSON_IsObject = + _cJSON_IsObject_ptr.asFunction)>(); int cJSON_IsRaw( ffi.Pointer item, @@ -375,36 +405,40 @@ class CJson { } late final _cJSON_IsRaw_ptr = - _lookup>('cJSON_IsRaw'); - late final _dart_cJSON_IsRaw _cJSON_IsRaw = - _cJSON_IsRaw_ptr.asFunction<_dart_cJSON_IsRaw>(); + _lookup)>>( + 'cJSON_IsRaw'); + late final _cJSON_IsRaw = + _cJSON_IsRaw_ptr.asFunction)>(); ffi.Pointer cJSON_CreateNull() { return _cJSON_CreateNull(); } late final _cJSON_CreateNull_ptr = - _lookup>('cJSON_CreateNull'); - late final _dart_cJSON_CreateNull _cJSON_CreateNull = - _cJSON_CreateNull_ptr.asFunction<_dart_cJSON_CreateNull>(); + _lookup Function()>>( + 'cJSON_CreateNull'); + late final _cJSON_CreateNull = + _cJSON_CreateNull_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateTrue() { return _cJSON_CreateTrue(); } late final _cJSON_CreateTrue_ptr = - _lookup>('cJSON_CreateTrue'); - late final _dart_cJSON_CreateTrue _cJSON_CreateTrue = - _cJSON_CreateTrue_ptr.asFunction<_dart_cJSON_CreateTrue>(); + _lookup Function()>>( + 'cJSON_CreateTrue'); + late final _cJSON_CreateTrue = + _cJSON_CreateTrue_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateFalse() { return _cJSON_CreateFalse(); } late final _cJSON_CreateFalse_ptr = - _lookup>('cJSON_CreateFalse'); - late final _dart_cJSON_CreateFalse _cJSON_CreateFalse = - _cJSON_CreateFalse_ptr.asFunction<_dart_cJSON_CreateFalse>(); + _lookup Function()>>( + 'cJSON_CreateFalse'); + late final _cJSON_CreateFalse = + _cJSON_CreateFalse_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateBool( int boolean, @@ -415,9 +449,10 @@ class CJson { } late final _cJSON_CreateBool_ptr = - _lookup>('cJSON_CreateBool'); - late final _dart_cJSON_CreateBool _cJSON_CreateBool = - _cJSON_CreateBool_ptr.asFunction<_dart_cJSON_CreateBool>(); + _lookup Function(cJSON_bool)>>( + 'cJSON_CreateBool'); + late final _cJSON_CreateBool = + _cJSON_CreateBool_ptr.asFunction Function(int)>(); ffi.Pointer cJSON_CreateNumber( double num, @@ -428,9 +463,10 @@ class CJson { } late final _cJSON_CreateNumber_ptr = - _lookup>('cJSON_CreateNumber'); - late final _dart_cJSON_CreateNumber _cJSON_CreateNumber = - _cJSON_CreateNumber_ptr.asFunction<_dart_cJSON_CreateNumber>(); + _lookup Function(ffi.Double)>>( + 'cJSON_CreateNumber'); + late final _cJSON_CreateNumber = + _cJSON_CreateNumber_ptr.asFunction Function(double)>(); ffi.Pointer cJSON_CreateString( ffi.Pointer string, @@ -440,10 +476,12 @@ class CJson { ); } - late final _cJSON_CreateString_ptr = - _lookup>('cJSON_CreateString'); - late final _dart_cJSON_CreateString _cJSON_CreateString = - _cJSON_CreateString_ptr.asFunction<_dart_cJSON_CreateString>(); + late final _cJSON_CreateString_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_CreateString'); + late final _cJSON_CreateString = _cJSON_CreateString_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateRaw( ffi.Pointer raw, @@ -453,28 +491,32 @@ class CJson { ); } - late final _cJSON_CreateRaw_ptr = - _lookup>('cJSON_CreateRaw'); - late final _dart_cJSON_CreateRaw _cJSON_CreateRaw = - _cJSON_CreateRaw_ptr.asFunction<_dart_cJSON_CreateRaw>(); + late final _cJSON_CreateRaw_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_CreateRaw'); + late final _cJSON_CreateRaw = _cJSON_CreateRaw_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArray() { return _cJSON_CreateArray(); } late final _cJSON_CreateArray_ptr = - _lookup>('cJSON_CreateArray'); - late final _dart_cJSON_CreateArray _cJSON_CreateArray = - _cJSON_CreateArray_ptr.asFunction<_dart_cJSON_CreateArray>(); + _lookup Function()>>( + 'cJSON_CreateArray'); + late final _cJSON_CreateArray = + _cJSON_CreateArray_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateObject() { return _cJSON_CreateObject(); } late final _cJSON_CreateObject_ptr = - _lookup>('cJSON_CreateObject'); - late final _dart_cJSON_CreateObject _cJSON_CreateObject = - _cJSON_CreateObject_ptr.asFunction<_dart_cJSON_CreateObject>(); + _lookup Function()>>( + 'cJSON_CreateObject'); + late final _cJSON_CreateObject = + _cJSON_CreateObject_ptr.asFunction Function()>(); ffi.Pointer cJSON_CreateStringReference( ffi.Pointer string, @@ -484,12 +526,12 @@ class CJson { ); } - late final _cJSON_CreateStringReference_ptr = - _lookup>( - 'cJSON_CreateStringReference'); - late final _dart_cJSON_CreateStringReference _cJSON_CreateStringReference = - _cJSON_CreateStringReference_ptr - .asFunction<_dart_cJSON_CreateStringReference>(); + late final _cJSON_CreateStringReference_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('cJSON_CreateStringReference'); + late final _cJSON_CreateStringReference = _cJSON_CreateStringReference_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateObjectReference( ffi.Pointer child, @@ -499,12 +541,11 @@ class CJson { ); } - late final _cJSON_CreateObjectReference_ptr = - _lookup>( - 'cJSON_CreateObjectReference'); - late final _dart_cJSON_CreateObjectReference _cJSON_CreateObjectReference = - _cJSON_CreateObjectReference_ptr - .asFunction<_dart_cJSON_CreateObjectReference>(); + late final _cJSON_CreateObjectReference_ptr = _lookup< + ffi.NativeFunction Function(ffi.Pointer)>>( + 'cJSON_CreateObjectReference'); + late final _cJSON_CreateObjectReference = _cJSON_CreateObjectReference_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateArrayReference( ffi.Pointer child, @@ -514,12 +555,11 @@ class CJson { ); } - late final _cJSON_CreateArrayReference_ptr = - _lookup>( - 'cJSON_CreateArrayReference'); - late final _dart_cJSON_CreateArrayReference _cJSON_CreateArrayReference = - _cJSON_CreateArrayReference_ptr - .asFunction<_dart_cJSON_CreateArrayReference>(); + late final _cJSON_CreateArrayReference_ptr = _lookup< + ffi.NativeFunction Function(ffi.Pointer)>>( + 'cJSON_CreateArrayReference'); + late final _cJSON_CreateArrayReference = _cJSON_CreateArrayReference_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer cJSON_CreateIntArray( ffi.Pointer numbers, @@ -531,11 +571,12 @@ class CJson { ); } - late final _cJSON_CreateIntArray_ptr = - _lookup>( - 'cJSON_CreateIntArray'); - late final _dart_cJSON_CreateIntArray _cJSON_CreateIntArray = - _cJSON_CreateIntArray_ptr.asFunction<_dart_cJSON_CreateIntArray>(); + late final _cJSON_CreateIntArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_CreateIntArray'); + late final _cJSON_CreateIntArray = _cJSON_CreateIntArray_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateFloatArray( ffi.Pointer numbers, @@ -547,11 +588,12 @@ class CJson { ); } - late final _cJSON_CreateFloatArray_ptr = - _lookup>( - 'cJSON_CreateFloatArray'); - late final _dart_cJSON_CreateFloatArray _cJSON_CreateFloatArray = - _cJSON_CreateFloatArray_ptr.asFunction<_dart_cJSON_CreateFloatArray>(); + late final _cJSON_CreateFloatArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_CreateFloatArray'); + late final _cJSON_CreateFloatArray = _cJSON_CreateFloatArray_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateDoubleArray( ffi.Pointer numbers, @@ -563,11 +605,12 @@ class CJson { ); } - late final _cJSON_CreateDoubleArray_ptr = - _lookup>( - 'cJSON_CreateDoubleArray'); - late final _dart_cJSON_CreateDoubleArray _cJSON_CreateDoubleArray = - _cJSON_CreateDoubleArray_ptr.asFunction<_dart_cJSON_CreateDoubleArray>(); + late final _cJSON_CreateDoubleArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_CreateDoubleArray'); + late final _cJSON_CreateDoubleArray = _cJSON_CreateDoubleArray_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer cJSON_CreateStringArray( ffi.Pointer> strings, @@ -579,11 +622,12 @@ class CJson { ); } - late final _cJSON_CreateStringArray_ptr = - _lookup>( - 'cJSON_CreateStringArray'); - late final _dart_cJSON_CreateStringArray _cJSON_CreateStringArray = - _cJSON_CreateStringArray_ptr.asFunction<_dart_cJSON_CreateStringArray>(); + late final _cJSON_CreateStringArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer>, + ffi.Int32)>>('cJSON_CreateStringArray'); + late final _cJSON_CreateStringArray = _cJSON_CreateStringArray_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer>, int)>(); void cJSON_AddItemToArray( ffi.Pointer array, @@ -595,11 +639,12 @@ class CJson { ); } - late final _cJSON_AddItemToArray_ptr = - _lookup>( - 'cJSON_AddItemToArray'); - late final _dart_cJSON_AddItemToArray _cJSON_AddItemToArray = - _cJSON_AddItemToArray_ptr.asFunction<_dart_cJSON_AddItemToArray>(); + late final _cJSON_AddItemToArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('cJSON_AddItemToArray'); + late final _cJSON_AddItemToArray = _cJSON_AddItemToArray_ptr + .asFunction, ffi.Pointer)>(); void cJSON_AddItemToObject( ffi.Pointer object, @@ -613,11 +658,13 @@ class CJson { ); } - late final _cJSON_AddItemToObject_ptr = - _lookup>( - 'cJSON_AddItemToObject'); - late final _dart_cJSON_AddItemToObject _cJSON_AddItemToObject = - _cJSON_AddItemToObject_ptr.asFunction<_dart_cJSON_AddItemToObject>(); + late final _cJSON_AddItemToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemToObject'); + late final _cJSON_AddItemToObject = _cJSON_AddItemToObject_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemToObjectCS( ffi.Pointer object, @@ -631,11 +678,13 @@ class CJson { ); } - late final _cJSON_AddItemToObjectCS_ptr = - _lookup>( - 'cJSON_AddItemToObjectCS'); - late final _dart_cJSON_AddItemToObjectCS _cJSON_AddItemToObjectCS = - _cJSON_AddItemToObjectCS_ptr.asFunction<_dart_cJSON_AddItemToObjectCS>(); + late final _cJSON_AddItemToObjectCS_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemToObjectCS'); + late final _cJSON_AddItemToObjectCS = _cJSON_AddItemToObjectCS_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_AddItemReferenceToArray( ffi.Pointer array, @@ -647,12 +696,12 @@ class CJson { ); } - late final _cJSON_AddItemReferenceToArray_ptr = - _lookup>( - 'cJSON_AddItemReferenceToArray'); - late final _dart_cJSON_AddItemReferenceToArray - _cJSON_AddItemReferenceToArray = _cJSON_AddItemReferenceToArray_ptr - .asFunction<_dart_cJSON_AddItemReferenceToArray>(); + late final _cJSON_AddItemReferenceToArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemReferenceToArray'); + late final _cJSON_AddItemReferenceToArray = _cJSON_AddItemReferenceToArray_ptr + .asFunction, ffi.Pointer)>(); void cJSON_AddItemReferenceToObject( ffi.Pointer object, @@ -666,12 +715,14 @@ class CJson { ); } - late final _cJSON_AddItemReferenceToObject_ptr = - _lookup>( - 'cJSON_AddItemReferenceToObject'); - late final _dart_cJSON_AddItemReferenceToObject - _cJSON_AddItemReferenceToObject = _cJSON_AddItemReferenceToObject_ptr - .asFunction<_dart_cJSON_AddItemReferenceToObject>(); + late final _cJSON_AddItemReferenceToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddItemReferenceToObject'); + late final _cJSON_AddItemReferenceToObject = + _cJSON_AddItemReferenceToObject_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemViaPointer( ffi.Pointer parent, @@ -683,12 +734,14 @@ class CJson { ); } - late final _cJSON_DetachItemViaPointer_ptr = - _lookup>( - 'cJSON_DetachItemViaPointer'); - late final _dart_cJSON_DetachItemViaPointer _cJSON_DetachItemViaPointer = - _cJSON_DetachItemViaPointer_ptr - .asFunction<_dart_cJSON_DetachItemViaPointer>(); + late final _cJSON_DetachItemViaPointer_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_DetachItemViaPointer'); + late final _cJSON_DetachItemViaPointer = + _cJSON_DetachItemViaPointer_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemFromArray( ffi.Pointer array, @@ -700,12 +753,12 @@ class CJson { ); } - late final _cJSON_DetachItemFromArray_ptr = - _lookup>( - 'cJSON_DetachItemFromArray'); - late final _dart_cJSON_DetachItemFromArray _cJSON_DetachItemFromArray = - _cJSON_DetachItemFromArray_ptr - .asFunction<_dart_cJSON_DetachItemFromArray>(); + late final _cJSON_DetachItemFromArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('cJSON_DetachItemFromArray'); + late final _cJSON_DetachItemFromArray = _cJSON_DetachItemFromArray_ptr + .asFunction Function(ffi.Pointer, int)>(); void cJSON_DeleteItemFromArray( ffi.Pointer array, @@ -717,12 +770,11 @@ class CJson { ); } - late final _cJSON_DeleteItemFromArray_ptr = - _lookup>( - 'cJSON_DeleteItemFromArray'); - late final _dart_cJSON_DeleteItemFromArray _cJSON_DeleteItemFromArray = - _cJSON_DeleteItemFromArray_ptr - .asFunction<_dart_cJSON_DeleteItemFromArray>(); + late final _cJSON_DeleteItemFromArray_ptr = _lookup< + ffi.NativeFunction, ffi.Int32)>>( + 'cJSON_DeleteItemFromArray'); + late final _cJSON_DeleteItemFromArray = _cJSON_DeleteItemFromArray_ptr + .asFunction, int)>(); ffi.Pointer cJSON_DetachItemFromObject( ffi.Pointer object, @@ -734,12 +786,14 @@ class CJson { ); } - late final _cJSON_DetachItemFromObject_ptr = - _lookup>( - 'cJSON_DetachItemFromObject'); - late final _dart_cJSON_DetachItemFromObject _cJSON_DetachItemFromObject = - _cJSON_DetachItemFromObject_ptr - .asFunction<_dart_cJSON_DetachItemFromObject>(); + late final _cJSON_DetachItemFromObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_DetachItemFromObject'); + late final _cJSON_DetachItemFromObject = + _cJSON_DetachItemFromObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_DetachItemFromObjectCaseSensitive( ffi.Pointer object, @@ -751,13 +805,15 @@ class CJson { ); } - late final _cJSON_DetachItemFromObjectCaseSensitive_ptr = - _lookup>( - 'cJSON_DetachItemFromObjectCaseSensitive'); - late final _dart_cJSON_DetachItemFromObjectCaseSensitive - _cJSON_DetachItemFromObjectCaseSensitive = - _cJSON_DetachItemFromObjectCaseSensitive_ptr - .asFunction<_dart_cJSON_DetachItemFromObjectCaseSensitive>(); + late final _cJSON_DetachItemFromObjectCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>( + 'cJSON_DetachItemFromObjectCaseSensitive'); + late final _cJSON_DetachItemFromObjectCaseSensitive = + _cJSON_DetachItemFromObjectCaseSensitive_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); void cJSON_DeleteItemFromObject( ffi.Pointer object, @@ -769,12 +825,12 @@ class CJson { ); } - late final _cJSON_DeleteItemFromObject_ptr = - _lookup>( - 'cJSON_DeleteItemFromObject'); - late final _dart_cJSON_DeleteItemFromObject _cJSON_DeleteItemFromObject = - _cJSON_DeleteItemFromObject_ptr - .asFunction<_dart_cJSON_DeleteItemFromObject>(); + late final _cJSON_DeleteItemFromObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_DeleteItemFromObject'); + late final _cJSON_DeleteItemFromObject = _cJSON_DeleteItemFromObject_ptr + .asFunction, ffi.Pointer)>(); void cJSON_DeleteItemFromObjectCaseSensitive( ffi.Pointer object, @@ -786,13 +842,13 @@ class CJson { ); } - late final _cJSON_DeleteItemFromObjectCaseSensitive_ptr = - _lookup>( - 'cJSON_DeleteItemFromObjectCaseSensitive'); - late final _dart_cJSON_DeleteItemFromObjectCaseSensitive - _cJSON_DeleteItemFromObjectCaseSensitive = - _cJSON_DeleteItemFromObjectCaseSensitive_ptr - .asFunction<_dart_cJSON_DeleteItemFromObjectCaseSensitive>(); + late final _cJSON_DeleteItemFromObjectCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer)>>( + 'cJSON_DeleteItemFromObjectCaseSensitive'); + late final _cJSON_DeleteItemFromObjectCaseSensitive = + _cJSON_DeleteItemFromObjectCaseSensitive_ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); void cJSON_InsertItemInArray( ffi.Pointer array, @@ -806,11 +862,12 @@ class CJson { ); } - late final _cJSON_InsertItemInArray_ptr = - _lookup>( - 'cJSON_InsertItemInArray'); - late final _dart_cJSON_InsertItemInArray _cJSON_InsertItemInArray = - _cJSON_InsertItemInArray_ptr.asFunction<_dart_cJSON_InsertItemInArray>(); + late final _cJSON_InsertItemInArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer)>>('cJSON_InsertItemInArray'); + late final _cJSON_InsertItemInArray = _cJSON_InsertItemInArray_ptr + .asFunction, int, ffi.Pointer)>(); int cJSON_ReplaceItemViaPointer( ffi.Pointer parent, @@ -824,12 +881,14 @@ class CJson { ); } - late final _cJSON_ReplaceItemViaPointer_ptr = - _lookup>( - 'cJSON_ReplaceItemViaPointer'); - late final _dart_cJSON_ReplaceItemViaPointer _cJSON_ReplaceItemViaPointer = - _cJSON_ReplaceItemViaPointer_ptr - .asFunction<_dart_cJSON_ReplaceItemViaPointer>(); + late final _cJSON_ReplaceItemViaPointer_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_ReplaceItemViaPointer'); + late final _cJSON_ReplaceItemViaPointer = + _cJSON_ReplaceItemViaPointer_ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_ReplaceItemInArray( ffi.Pointer array, @@ -843,12 +902,12 @@ class CJson { ); } - late final _cJSON_ReplaceItemInArray_ptr = - _lookup>( - 'cJSON_ReplaceItemInArray'); - late final _dart_cJSON_ReplaceItemInArray _cJSON_ReplaceItemInArray = - _cJSON_ReplaceItemInArray_ptr - .asFunction<_dart_cJSON_ReplaceItemInArray>(); + late final _cJSON_ReplaceItemInArray_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer)>>('cJSON_ReplaceItemInArray'); + late final _cJSON_ReplaceItemInArray = _cJSON_ReplaceItemInArray_ptr + .asFunction, int, ffi.Pointer)>(); void cJSON_ReplaceItemInObject( ffi.Pointer object, @@ -862,12 +921,14 @@ class CJson { ); } - late final _cJSON_ReplaceItemInObject_ptr = - _lookup>( - 'cJSON_ReplaceItemInObject'); - late final _dart_cJSON_ReplaceItemInObject _cJSON_ReplaceItemInObject = - _cJSON_ReplaceItemInObject_ptr - .asFunction<_dart_cJSON_ReplaceItemInObject>(); + late final _cJSON_ReplaceItemInObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_ReplaceItemInObject'); + late final _cJSON_ReplaceItemInObject = + _cJSON_ReplaceItemInObject_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); void cJSON_ReplaceItemInObjectCaseSensitive( ffi.Pointer object, @@ -881,13 +942,14 @@ class CJson { ); } - late final _cJSON_ReplaceItemInObjectCaseSensitive_ptr = - _lookup>( - 'cJSON_ReplaceItemInObjectCaseSensitive'); - late final _dart_cJSON_ReplaceItemInObjectCaseSensitive - _cJSON_ReplaceItemInObjectCaseSensitive = - _cJSON_ReplaceItemInObjectCaseSensitive_ptr - .asFunction<_dart_cJSON_ReplaceItemInObjectCaseSensitive>(); + late final _cJSON_ReplaceItemInObjectCaseSensitive_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_ReplaceItemInObjectCaseSensitive'); + late final _cJSON_ReplaceItemInObjectCaseSensitive = + _cJSON_ReplaceItemInObjectCaseSensitive_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_Duplicate( ffi.Pointer item, @@ -899,10 +961,12 @@ class CJson { ); } - late final _cJSON_Duplicate_ptr = - _lookup>('cJSON_Duplicate'); - late final _dart_cJSON_Duplicate _cJSON_Duplicate = - _cJSON_Duplicate_ptr.asFunction<_dart_cJSON_Duplicate>(); + late final _cJSON_Duplicate_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, cJSON_bool)>>('cJSON_Duplicate'); + late final _cJSON_Duplicate = _cJSON_Duplicate_ptr + .asFunction Function(ffi.Pointer, int)>(); int cJSON_Compare( ffi.Pointer a, @@ -916,10 +980,12 @@ class CJson { ); } - late final _cJSON_Compare_ptr = - _lookup>('cJSON_Compare'); - late final _dart_cJSON_Compare _cJSON_Compare = - _cJSON_Compare_ptr.asFunction<_dart_cJSON_Compare>(); + late final _cJSON_Compare_ptr = _lookup< + ffi.NativeFunction< + cJSON_bool Function(ffi.Pointer, ffi.Pointer, + cJSON_bool)>>('cJSON_Compare'); + late final _cJSON_Compare = _cJSON_Compare_ptr + .asFunction, ffi.Pointer, int)>(); void cJSON_Minify( ffi.Pointer json, @@ -930,9 +996,10 @@ class CJson { } late final _cJSON_Minify_ptr = - _lookup>('cJSON_Minify'); - late final _dart_cJSON_Minify _cJSON_Minify = - _cJSON_Minify_ptr.asFunction<_dart_cJSON_Minify>(); + _lookup)>>( + 'cJSON_Minify'); + late final _cJSON_Minify = + _cJSON_Minify_ptr.asFunction)>(); ffi.Pointer cJSON_AddNullToObject( ffi.Pointer object, @@ -944,11 +1011,12 @@ class CJson { ); } - late final _cJSON_AddNullToObject_ptr = - _lookup>( - 'cJSON_AddNullToObject'); - late final _dart_cJSON_AddNullToObject _cJSON_AddNullToObject = - _cJSON_AddNullToObject_ptr.asFunction<_dart_cJSON_AddNullToObject>(); + late final _cJSON_AddNullToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddNullToObject'); + late final _cJSON_AddNullToObject = _cJSON_AddNullToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddTrueToObject( ffi.Pointer object, @@ -960,11 +1028,12 @@ class CJson { ); } - late final _cJSON_AddTrueToObject_ptr = - _lookup>( - 'cJSON_AddTrueToObject'); - late final _dart_cJSON_AddTrueToObject _cJSON_AddTrueToObject = - _cJSON_AddTrueToObject_ptr.asFunction<_dart_cJSON_AddTrueToObject>(); + late final _cJSON_AddTrueToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddTrueToObject'); + late final _cJSON_AddTrueToObject = _cJSON_AddTrueToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddFalseToObject( ffi.Pointer object, @@ -976,11 +1045,12 @@ class CJson { ); } - late final _cJSON_AddFalseToObject_ptr = - _lookup>( - 'cJSON_AddFalseToObject'); - late final _dart_cJSON_AddFalseToObject _cJSON_AddFalseToObject = - _cJSON_AddFalseToObject_ptr.asFunction<_dart_cJSON_AddFalseToObject>(); + late final _cJSON_AddFalseToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddFalseToObject'); + late final _cJSON_AddFalseToObject = _cJSON_AddFalseToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddBoolToObject( ffi.Pointer object, @@ -994,11 +1064,13 @@ class CJson { ); } - late final _cJSON_AddBoolToObject_ptr = - _lookup>( - 'cJSON_AddBoolToObject'); - late final _dart_cJSON_AddBoolToObject _cJSON_AddBoolToObject = - _cJSON_AddBoolToObject_ptr.asFunction<_dart_cJSON_AddBoolToObject>(); + late final _cJSON_AddBoolToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + cJSON_bool)>>('cJSON_AddBoolToObject'); + late final _cJSON_AddBoolToObject = _cJSON_AddBoolToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer cJSON_AddNumberToObject( ffi.Pointer object, @@ -1012,11 +1084,13 @@ class CJson { ); } - late final _cJSON_AddNumberToObject_ptr = - _lookup>( - 'cJSON_AddNumberToObject'); - late final _dart_cJSON_AddNumberToObject _cJSON_AddNumberToObject = - _cJSON_AddNumberToObject_ptr.asFunction<_dart_cJSON_AddNumberToObject>(); + late final _cJSON_AddNumberToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Double)>>('cJSON_AddNumberToObject'); + late final _cJSON_AddNumberToObject = _cJSON_AddNumberToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, double)>(); ffi.Pointer cJSON_AddStringToObject( ffi.Pointer object, @@ -1030,11 +1104,13 @@ class CJson { ); } - late final _cJSON_AddStringToObject_ptr = - _lookup>( - 'cJSON_AddStringToObject'); - late final _dart_cJSON_AddStringToObject _cJSON_AddStringToObject = - _cJSON_AddStringToObject_ptr.asFunction<_dart_cJSON_AddStringToObject>(); + late final _cJSON_AddStringToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddStringToObject'); + late final _cJSON_AddStringToObject = _cJSON_AddStringToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddRawToObject( ffi.Pointer object, @@ -1048,11 +1124,13 @@ class CJson { ); } - late final _cJSON_AddRawToObject_ptr = - _lookup>( - 'cJSON_AddRawToObject'); - late final _dart_cJSON_AddRawToObject _cJSON_AddRawToObject = - _cJSON_AddRawToObject_ptr.asFunction<_dart_cJSON_AddRawToObject>(); + late final _cJSON_AddRawToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cJSON_AddRawToObject'); + late final _cJSON_AddRawToObject = _cJSON_AddRawToObject_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddObjectToObject( ffi.Pointer object, @@ -1064,11 +1142,12 @@ class CJson { ); } - late final _cJSON_AddObjectToObject_ptr = - _lookup>( - 'cJSON_AddObjectToObject'); - late final _dart_cJSON_AddObjectToObject _cJSON_AddObjectToObject = - _cJSON_AddObjectToObject_ptr.asFunction<_dart_cJSON_AddObjectToObject>(); + late final _cJSON_AddObjectToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddObjectToObject'); + late final _cJSON_AddObjectToObject = _cJSON_AddObjectToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer cJSON_AddArrayToObject( ffi.Pointer object, @@ -1080,11 +1159,12 @@ class CJson { ); } - late final _cJSON_AddArrayToObject_ptr = - _lookup>( - 'cJSON_AddArrayToObject'); - late final _dart_cJSON_AddArrayToObject _cJSON_AddArrayToObject = - _cJSON_AddArrayToObject_ptr.asFunction<_dart_cJSON_AddArrayToObject>(); + late final _cJSON_AddArrayToObject_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('cJSON_AddArrayToObject'); + late final _cJSON_AddArrayToObject = _cJSON_AddArrayToObject_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); double cJSON_SetNumberHelper( ffi.Pointer object, @@ -1096,11 +1176,12 @@ class CJson { ); } - late final _cJSON_SetNumberHelper_ptr = - _lookup>( - 'cJSON_SetNumberHelper'); - late final _dart_cJSON_SetNumberHelper _cJSON_SetNumberHelper = - _cJSON_SetNumberHelper_ptr.asFunction<_dart_cJSON_SetNumberHelper>(); + late final _cJSON_SetNumberHelper_ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, ffi.Double)>>('cJSON_SetNumberHelper'); + late final _cJSON_SetNumberHelper = _cJSON_SetNumberHelper_ptr + .asFunction, double)>(); ffi.Pointer cJSON_malloc( int size, @@ -1111,9 +1192,10 @@ class CJson { } late final _cJSON_malloc_ptr = - _lookup>('cJSON_malloc'); - late final _dart_cJSON_malloc _cJSON_malloc = - _cJSON_malloc_ptr.asFunction<_dart_cJSON_malloc>(); + _lookup Function(ffi.IntPtr)>>( + 'cJSON_malloc'); + late final _cJSON_malloc = + _cJSON_malloc_ptr.asFunction Function(int)>(); void cJSON_free( ffi.Pointer object, @@ -1124,9 +1206,10 @@ class CJson { } late final _cJSON_free_ptr = - _lookup>('cJSON_free'); - late final _dart_cJSON_free _cJSON_free = - _cJSON_free_ptr.asFunction<_dart_cJSON_free>(); + _lookup)>>( + 'cJSON_free'); + late final _cJSON_free = + _cJSON_free_ptr.asFunction)>(); } class cJSON extends ffi.Struct { @@ -1151,11 +1234,16 @@ class cJSON extends ffi.Struct { } class cJSON_Hooks extends ffi.Struct { - external ffi.Pointer> malloc_fn; + external ffi.Pointer< + ffi.NativeFunction Function(ffi.IntPtr)>> malloc_fn; - external ffi.Pointer> free_fn; + external ffi + .Pointer)>> + free_fn; } +typedef cJSON_bool = ffi.Int32; + const int CJSON_VERSION_MAJOR = 1; const int CJSON_VERSION_MINOR = 7; @@ -1187,691 +1275,3 @@ const int cJSON_StringIsConst = 512; const int CJSON_NESTING_LIMIT = 1000; const double CJSON_DOUBLE_PRECISION = 1e-16; - -typedef _c_cJSON_Version = ffi.Pointer Function(); - -typedef _dart_cJSON_Version = ffi.Pointer Function(); - -typedef _c_cJSON_InitHooks = ffi.Void Function( - ffi.Pointer hooks, -); - -typedef _dart_cJSON_InitHooks = void Function( - ffi.Pointer hooks, -); - -typedef _c_cJSON_Parse = ffi.Pointer Function( - ffi.Pointer value, -); - -typedef _dart_cJSON_Parse = ffi.Pointer Function( - ffi.Pointer value, -); - -typedef _c_cJSON_ParseWithOpts = ffi.Pointer Function( - ffi.Pointer value, - ffi.Pointer> return_parse_end, - ffi.Int32 require_null_terminated, -); - -typedef _dart_cJSON_ParseWithOpts = ffi.Pointer Function( - ffi.Pointer value, - ffi.Pointer> return_parse_end, - int require_null_terminated, -); - -typedef _c_cJSON_Print = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_Print = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _c_cJSON_PrintUnformatted = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_PrintUnformatted = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _c_cJSON_PrintBuffered = ffi.Pointer Function( - ffi.Pointer item, - ffi.Int32 prebuffer, - ffi.Int32 fmt, -); - -typedef _dart_cJSON_PrintBuffered = ffi.Pointer Function( - ffi.Pointer item, - int prebuffer, - int fmt, -); - -typedef _c_cJSON_PrintPreallocated = ffi.Int32 Function( - ffi.Pointer item, - ffi.Pointer buffer, - ffi.Int32 length, - ffi.Int32 format, -); - -typedef _dart_cJSON_PrintPreallocated = int Function( - ffi.Pointer item, - ffi.Pointer buffer, - int length, - int format, -); - -typedef _c_cJSON_Delete = ffi.Void Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_Delete = void Function( - ffi.Pointer item, -); - -typedef _c_cJSON_GetArraySize = ffi.Int32 Function( - ffi.Pointer array, -); - -typedef _dart_cJSON_GetArraySize = int Function( - ffi.Pointer array, -); - -typedef _c_cJSON_GetArrayItem = ffi.Pointer Function( - ffi.Pointer array, - ffi.Int32 index, -); - -typedef _dart_cJSON_GetArrayItem = ffi.Pointer Function( - ffi.Pointer array, - int index, -); - -typedef _c_cJSON_GetObjectItem = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_GetObjectItem = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_GetObjectItemCaseSensitive = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_GetObjectItemCaseSensitive = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_HasObjectItem = ffi.Int32 Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_HasObjectItem = int Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_GetErrorPtr = ffi.Pointer Function(); - -typedef _dart_cJSON_GetErrorPtr = ffi.Pointer Function(); - -typedef _c_cJSON_GetStringValue = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_GetStringValue = ffi.Pointer Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsInvalid = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsInvalid = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsFalse = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsFalse = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsTrue = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsTrue = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsBool = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsBool = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsNull = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsNull = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsNumber = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsNumber = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsString = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsString = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsArray = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsArray = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsObject = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsObject = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_IsRaw = ffi.Int32 Function( - ffi.Pointer item, -); - -typedef _dart_cJSON_IsRaw = int Function( - ffi.Pointer item, -); - -typedef _c_cJSON_CreateNull = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateNull = ffi.Pointer Function(); - -typedef _c_cJSON_CreateTrue = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateTrue = ffi.Pointer Function(); - -typedef _c_cJSON_CreateFalse = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateFalse = ffi.Pointer Function(); - -typedef _c_cJSON_CreateBool = ffi.Pointer Function( - ffi.Int32 boolean, -); - -typedef _dart_cJSON_CreateBool = ffi.Pointer Function( - int boolean, -); - -typedef _c_cJSON_CreateNumber = ffi.Pointer Function( - ffi.Double num, -); - -typedef _dart_cJSON_CreateNumber = ffi.Pointer Function( - double num, -); - -typedef _c_cJSON_CreateString = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _dart_cJSON_CreateString = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _c_cJSON_CreateRaw = ffi.Pointer Function( - ffi.Pointer raw, -); - -typedef _dart_cJSON_CreateRaw = ffi.Pointer Function( - ffi.Pointer raw, -); - -typedef _c_cJSON_CreateArray = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateArray = ffi.Pointer Function(); - -typedef _c_cJSON_CreateObject = ffi.Pointer Function(); - -typedef _dart_cJSON_CreateObject = ffi.Pointer Function(); - -typedef _c_cJSON_CreateStringReference = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _dart_cJSON_CreateStringReference = ffi.Pointer Function( - ffi.Pointer string, -); - -typedef _c_cJSON_CreateObjectReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _dart_cJSON_CreateObjectReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _c_cJSON_CreateArrayReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _dart_cJSON_CreateArrayReference = ffi.Pointer Function( - ffi.Pointer child, -); - -typedef _c_cJSON_CreateIntArray = ffi.Pointer Function( - ffi.Pointer numbers, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateIntArray = ffi.Pointer Function( - ffi.Pointer numbers, - int count, -); - -typedef _c_cJSON_CreateFloatArray = ffi.Pointer Function( - ffi.Pointer numbers, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateFloatArray = ffi.Pointer Function( - ffi.Pointer numbers, - int count, -); - -typedef _c_cJSON_CreateDoubleArray = ffi.Pointer Function( - ffi.Pointer numbers, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateDoubleArray = ffi.Pointer Function( - ffi.Pointer numbers, - int count, -); - -typedef _c_cJSON_CreateStringArray = ffi.Pointer Function( - ffi.Pointer> strings, - ffi.Int32 count, -); - -typedef _dart_cJSON_CreateStringArray = ffi.Pointer Function( - ffi.Pointer> strings, - int count, -); - -typedef _c_cJSON_AddItemToArray = ffi.Void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemToArray = void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemToObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemToObject = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemToObjectCS = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemToObjectCS = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemReferenceToArray = ffi.Void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemReferenceToArray = void Function( - ffi.Pointer array, - ffi.Pointer item, -); - -typedef _c_cJSON_AddItemReferenceToObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _dart_cJSON_AddItemReferenceToObject = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer item, -); - -typedef _c_cJSON_DetachItemViaPointer = ffi.Pointer Function( - ffi.Pointer parent, - ffi.Pointer item, -); - -typedef _dart_cJSON_DetachItemViaPointer = ffi.Pointer Function( - ffi.Pointer parent, - ffi.Pointer item, -); - -typedef _c_cJSON_DetachItemFromArray = ffi.Pointer Function( - ffi.Pointer array, - ffi.Int32 which, -); - -typedef _dart_cJSON_DetachItemFromArray = ffi.Pointer Function( - ffi.Pointer array, - int which, -); - -typedef _c_cJSON_DeleteItemFromArray = ffi.Void Function( - ffi.Pointer array, - ffi.Int32 which, -); - -typedef _dart_cJSON_DeleteItemFromArray = void Function( - ffi.Pointer array, - int which, -); - -typedef _c_cJSON_DetachItemFromObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DetachItemFromObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_DetachItemFromObjectCaseSensitive = ffi.Pointer - Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DetachItemFromObjectCaseSensitive = ffi.Pointer - Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_DeleteItemFromObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DeleteItemFromObject = void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_DeleteItemFromObjectCaseSensitive = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _dart_cJSON_DeleteItemFromObjectCaseSensitive = void Function( - ffi.Pointer object, - ffi.Pointer string, -); - -typedef _c_cJSON_InsertItemInArray = ffi.Void Function( - ffi.Pointer array, - ffi.Int32 which, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_InsertItemInArray = void Function( - ffi.Pointer array, - int which, - ffi.Pointer newitem, -); - -typedef _c_cJSON_ReplaceItemViaPointer = ffi.Int32 Function( - ffi.Pointer parent, - ffi.Pointer item, - ffi.Pointer replacement, -); - -typedef _dart_cJSON_ReplaceItemViaPointer = int Function( - ffi.Pointer parent, - ffi.Pointer item, - ffi.Pointer replacement, -); - -typedef _c_cJSON_ReplaceItemInArray = ffi.Void Function( - ffi.Pointer array, - ffi.Int32 which, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_ReplaceItemInArray = void Function( - ffi.Pointer array, - int which, - ffi.Pointer newitem, -); - -typedef _c_cJSON_ReplaceItemInObject = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_ReplaceItemInObject = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _c_cJSON_ReplaceItemInObjectCaseSensitive = ffi.Void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _dart_cJSON_ReplaceItemInObjectCaseSensitive = void Function( - ffi.Pointer object, - ffi.Pointer string, - ffi.Pointer newitem, -); - -typedef _c_cJSON_Duplicate = ffi.Pointer Function( - ffi.Pointer item, - ffi.Int32 recurse, -); - -typedef _dart_cJSON_Duplicate = ffi.Pointer Function( - ffi.Pointer item, - int recurse, -); - -typedef _c_cJSON_Compare = ffi.Int32 Function( - ffi.Pointer a, - ffi.Pointer b, - ffi.Int32 case_sensitive, -); - -typedef _dart_cJSON_Compare = int Function( - ffi.Pointer a, - ffi.Pointer b, - int case_sensitive, -); - -typedef _c_cJSON_Minify = ffi.Void Function( - ffi.Pointer json, -); - -typedef _dart_cJSON_Minify = void Function( - ffi.Pointer json, -); - -typedef _c_cJSON_AddNullToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddNullToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddTrueToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddTrueToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddFalseToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddFalseToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddBoolToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Int32 boolean, -); - -typedef _dart_cJSON_AddBoolToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - int boolean, -); - -typedef _c_cJSON_AddNumberToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Double number, -); - -typedef _dart_cJSON_AddNumberToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - double number, -); - -typedef _c_cJSON_AddStringToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer string, -); - -typedef _dart_cJSON_AddStringToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer string, -); - -typedef _c_cJSON_AddRawToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer raw, -); - -typedef _dart_cJSON_AddRawToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, - ffi.Pointer raw, -); - -typedef _c_cJSON_AddObjectToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddObjectToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_AddArrayToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _dart_cJSON_AddArrayToObject = ffi.Pointer Function( - ffi.Pointer object, - ffi.Pointer name, -); - -typedef _c_cJSON_SetNumberHelper = ffi.Double Function( - ffi.Pointer object, - ffi.Double number, -); - -typedef _dart_cJSON_SetNumberHelper = double Function( - ffi.Pointer object, - double number, -); - -typedef _c_cJSON_malloc = ffi.Pointer Function( - ffi.Uint64 size, -); - -typedef _dart_cJSON_malloc = ffi.Pointer Function( - int size, -); - -typedef _c_cJSON_free = ffi.Void Function( - ffi.Pointer object, -); - -typedef _dart_cJSON_free = void Function( - ffi.Pointer object, -); - -typedef _typedefC_1 = ffi.Pointer Function( - ffi.Uint64, -); - -typedef _typedefC_2 = ffi.Void Function( - ffi.Pointer, -); diff --git a/test/large_integration_tests/_expected_libclang_bindings.dart b/test/large_integration_tests/_expected_libclang_bindings.dart index be68fb58..caf2392c 100644 --- a/test/large_integration_tests/_expected_libclang_bindings.dart +++ b/test/large_integration_tests/_expected_libclang_bindings.dart @@ -28,9 +28,10 @@ class LibClang { } late final _clang_getCString_ptr = - _lookup>('clang_getCString'); - late final _dart_clang_getCString _clang_getCString = - _clang_getCString_ptr.asFunction<_dart_clang_getCString>(); + _lookup Function(CXString)>>( + 'clang_getCString'); + late final _clang_getCString = _clang_getCString_ptr + .asFunction Function(CXString)>(); /// Free the given string. void clang_disposeString( @@ -42,10 +43,10 @@ class LibClang { } late final _clang_disposeString_ptr = - _lookup>( + _lookup>( 'clang_disposeString'); - late final _dart_clang_disposeString _clang_disposeString = - _clang_disposeString_ptr.asFunction<_dart_clang_disposeString>(); + late final _clang_disposeString = + _clang_disposeString_ptr.asFunction(); /// Free the given string set. void clang_disposeStringSet( @@ -57,10 +58,10 @@ class LibClang { } late final _clang_disposeStringSet_ptr = - _lookup>( + _lookup)>>( 'clang_disposeStringSet'); - late final _dart_clang_disposeStringSet _clang_disposeStringSet = - _clang_disposeStringSet_ptr.asFunction<_dart_clang_disposeStringSet>(); + late final _clang_disposeStringSet = _clang_disposeStringSet_ptr + .asFunction)>(); /// Return the timestamp for use with Clang's -fbuild-session-timestamp= /// option. @@ -69,15 +70,14 @@ class LibClang { } late final _clang_getBuildSessionTimestamp_ptr = - _lookup>( + _lookup>( 'clang_getBuildSessionTimestamp'); - late final _dart_clang_getBuildSessionTimestamp - _clang_getBuildSessionTimestamp = _clang_getBuildSessionTimestamp_ptr - .asFunction<_dart_clang_getBuildSessionTimestamp>(); + late final _clang_getBuildSessionTimestamp = + _clang_getBuildSessionTimestamp_ptr.asFunction(); /// Create a CXVirtualFileOverlay object. Must be disposed with /// clang_VirtualFileOverlay_dispose(). - ffi.Pointer clang_VirtualFileOverlay_create( + CXVirtualFileOverlay clang_VirtualFileOverlay_create( int options, ) { return _clang_VirtualFileOverlay_create( @@ -86,16 +86,16 @@ class LibClang { } late final _clang_VirtualFileOverlay_create_ptr = - _lookup>( + _lookup>( 'clang_VirtualFileOverlay_create'); - late final _dart_clang_VirtualFileOverlay_create - _clang_VirtualFileOverlay_create = _clang_VirtualFileOverlay_create_ptr - .asFunction<_dart_clang_VirtualFileOverlay_create>(); + late final _clang_VirtualFileOverlay_create = + _clang_VirtualFileOverlay_create_ptr + .asFunction(); /// Map an absolute virtual file path to an absolute real one. The virtual /// path must be canonicalized (not contain "."/".."). int clang_VirtualFileOverlay_addFileMapping( - ffi.Pointer arg0, + CXVirtualFileOverlay arg0, ffi.Pointer virtualPath, ffi.Pointer realPath, ) { @@ -106,19 +106,21 @@ class LibClang { ); } - late final _clang_VirtualFileOverlay_addFileMapping_ptr = - _lookup>( - 'clang_VirtualFileOverlay_addFileMapping'); - late final _dart_clang_VirtualFileOverlay_addFileMapping - _clang_VirtualFileOverlay_addFileMapping = - _clang_VirtualFileOverlay_addFileMapping_ptr - .asFunction<_dart_clang_VirtualFileOverlay_addFileMapping>(); + late final _clang_VirtualFileOverlay_addFileMapping_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(CXVirtualFileOverlay, ffi.Pointer, + ffi.Pointer)>>( + 'clang_VirtualFileOverlay_addFileMapping'); + late final _clang_VirtualFileOverlay_addFileMapping = + _clang_VirtualFileOverlay_addFileMapping_ptr.asFunction< + int Function(CXVirtualFileOverlay, ffi.Pointer, + ffi.Pointer)>(); /// Set the case sensitivity for the CXVirtualFileOverlay object. The /// CXVirtualFileOverlay object is case-sensitive by default, this option can /// be used to override the default. int clang_VirtualFileOverlay_setCaseSensitivity( - ffi.Pointer arg0, + CXVirtualFileOverlay arg0, int caseSensitive, ) { return _clang_VirtualFileOverlay_setCaseSensitivity( @@ -128,16 +130,16 @@ class LibClang { } late final _clang_VirtualFileOverlay_setCaseSensitivity_ptr = _lookup< - ffi.NativeFunction<_c_clang_VirtualFileOverlay_setCaseSensitivity>>( - 'clang_VirtualFileOverlay_setCaseSensitivity'); - late final _dart_clang_VirtualFileOverlay_setCaseSensitivity - _clang_VirtualFileOverlay_setCaseSensitivity = + ffi.NativeFunction< + ffi.Int32 Function(CXVirtualFileOverlay, + ffi.Int32)>>('clang_VirtualFileOverlay_setCaseSensitivity'); + late final _clang_VirtualFileOverlay_setCaseSensitivity = _clang_VirtualFileOverlay_setCaseSensitivity_ptr - .asFunction<_dart_clang_VirtualFileOverlay_setCaseSensitivity>(); + .asFunction(); /// Write out the CXVirtualFileOverlay object to a char buffer. int clang_VirtualFileOverlay_writeToBuffer( - ffi.Pointer arg0, + CXVirtualFileOverlay arg0, int options, ffi.Pointer> out_buffer_ptr, ffi.Pointer out_buffer_size, @@ -150,13 +152,18 @@ class LibClang { ); } - late final _clang_VirtualFileOverlay_writeToBuffer_ptr = - _lookup>( - 'clang_VirtualFileOverlay_writeToBuffer'); - late final _dart_clang_VirtualFileOverlay_writeToBuffer - _clang_VirtualFileOverlay_writeToBuffer = - _clang_VirtualFileOverlay_writeToBuffer_ptr - .asFunction<_dart_clang_VirtualFileOverlay_writeToBuffer>(); + late final _clang_VirtualFileOverlay_writeToBuffer_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXVirtualFileOverlay, + ffi.Uint32, + ffi.Pointer>, + ffi.Pointer)>>( + 'clang_VirtualFileOverlay_writeToBuffer'); + late final _clang_VirtualFileOverlay_writeToBuffer = + _clang_VirtualFileOverlay_writeToBuffer_ptr.asFunction< + int Function(CXVirtualFileOverlay, int, + ffi.Pointer>, ffi.Pointer)>(); /// free memory allocated by libclang, such as the buffer returned by /// CXVirtualFileOverlay() or clang_ModuleMapDescriptor_writeToBuffer(). @@ -169,13 +176,14 @@ class LibClang { } late final _clang_free_ptr = - _lookup>('clang_free'); - late final _dart_clang_free _clang_free = - _clang_free_ptr.asFunction<_dart_clang_free>(); + _lookup)>>( + 'clang_free'); + late final _clang_free = + _clang_free_ptr.asFunction)>(); /// Dispose a CXVirtualFileOverlay object. void clang_VirtualFileOverlay_dispose( - ffi.Pointer arg0, + CXVirtualFileOverlay arg0, ) { return _clang_VirtualFileOverlay_dispose( arg0, @@ -183,15 +191,15 @@ class LibClang { } late final _clang_VirtualFileOverlay_dispose_ptr = - _lookup>( + _lookup>( 'clang_VirtualFileOverlay_dispose'); - late final _dart_clang_VirtualFileOverlay_dispose - _clang_VirtualFileOverlay_dispose = _clang_VirtualFileOverlay_dispose_ptr - .asFunction<_dart_clang_VirtualFileOverlay_dispose>(); + late final _clang_VirtualFileOverlay_dispose = + _clang_VirtualFileOverlay_dispose_ptr + .asFunction(); /// Create a CXModuleMapDescriptor object. Must be disposed with /// clang_ModuleMapDescriptor_dispose(). - ffi.Pointer clang_ModuleMapDescriptor_create( + CXModuleMapDescriptor clang_ModuleMapDescriptor_create( int options, ) { return _clang_ModuleMapDescriptor_create( @@ -200,15 +208,15 @@ class LibClang { } late final _clang_ModuleMapDescriptor_create_ptr = - _lookup>( + _lookup>( 'clang_ModuleMapDescriptor_create'); - late final _dart_clang_ModuleMapDescriptor_create - _clang_ModuleMapDescriptor_create = _clang_ModuleMapDescriptor_create_ptr - .asFunction<_dart_clang_ModuleMapDescriptor_create>(); + late final _clang_ModuleMapDescriptor_create = + _clang_ModuleMapDescriptor_create_ptr + .asFunction(); /// Sets the framework module name that the module.map describes. int clang_ModuleMapDescriptor_setFrameworkModuleName( - ffi.Pointer arg0, + CXModuleMapDescriptor arg0, ffi.Pointer name, ) { return _clang_ModuleMapDescriptor_setFrameworkModuleName( @@ -219,16 +227,16 @@ class LibClang { late final _clang_ModuleMapDescriptor_setFrameworkModuleName_ptr = _lookup< ffi.NativeFunction< - _c_clang_ModuleMapDescriptor_setFrameworkModuleName>>( + ffi.Int32 Function( + CXModuleMapDescriptor, ffi.Pointer)>>( 'clang_ModuleMapDescriptor_setFrameworkModuleName'); - late final _dart_clang_ModuleMapDescriptor_setFrameworkModuleName - _clang_ModuleMapDescriptor_setFrameworkModuleName = - _clang_ModuleMapDescriptor_setFrameworkModuleName_ptr - .asFunction<_dart_clang_ModuleMapDescriptor_setFrameworkModuleName>(); + late final _clang_ModuleMapDescriptor_setFrameworkModuleName = + _clang_ModuleMapDescriptor_setFrameworkModuleName_ptr.asFunction< + int Function(CXModuleMapDescriptor, ffi.Pointer)>(); /// Sets the umbrealla header name that the module.map describes. int clang_ModuleMapDescriptor_setUmbrellaHeader( - ffi.Pointer arg0, + CXModuleMapDescriptor arg0, ffi.Pointer name, ) { return _clang_ModuleMapDescriptor_setUmbrellaHeader( @@ -238,16 +246,17 @@ class LibClang { } late final _clang_ModuleMapDescriptor_setUmbrellaHeader_ptr = _lookup< - ffi.NativeFunction<_c_clang_ModuleMapDescriptor_setUmbrellaHeader>>( + ffi.NativeFunction< + ffi.Int32 Function( + CXModuleMapDescriptor, ffi.Pointer)>>( 'clang_ModuleMapDescriptor_setUmbrellaHeader'); - late final _dart_clang_ModuleMapDescriptor_setUmbrellaHeader - _clang_ModuleMapDescriptor_setUmbrellaHeader = - _clang_ModuleMapDescriptor_setUmbrellaHeader_ptr - .asFunction<_dart_clang_ModuleMapDescriptor_setUmbrellaHeader>(); + late final _clang_ModuleMapDescriptor_setUmbrellaHeader = + _clang_ModuleMapDescriptor_setUmbrellaHeader_ptr.asFunction< + int Function(CXModuleMapDescriptor, ffi.Pointer)>(); /// Write out the CXModuleMapDescriptor object to a char buffer. int clang_ModuleMapDescriptor_writeToBuffer( - ffi.Pointer arg0, + CXModuleMapDescriptor arg0, int options, ffi.Pointer> out_buffer_ptr, ffi.Pointer out_buffer_size, @@ -260,17 +269,22 @@ class LibClang { ); } - late final _clang_ModuleMapDescriptor_writeToBuffer_ptr = - _lookup>( - 'clang_ModuleMapDescriptor_writeToBuffer'); - late final _dart_clang_ModuleMapDescriptor_writeToBuffer - _clang_ModuleMapDescriptor_writeToBuffer = - _clang_ModuleMapDescriptor_writeToBuffer_ptr - .asFunction<_dart_clang_ModuleMapDescriptor_writeToBuffer>(); + late final _clang_ModuleMapDescriptor_writeToBuffer_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXModuleMapDescriptor, + ffi.Uint32, + ffi.Pointer>, + ffi.Pointer)>>( + 'clang_ModuleMapDescriptor_writeToBuffer'); + late final _clang_ModuleMapDescriptor_writeToBuffer = + _clang_ModuleMapDescriptor_writeToBuffer_ptr.asFunction< + int Function(CXModuleMapDescriptor, int, + ffi.Pointer>, ffi.Pointer)>(); /// Dispose a CXModuleMapDescriptor object. void clang_ModuleMapDescriptor_dispose( - ffi.Pointer arg0, + CXModuleMapDescriptor arg0, ) { return _clang_ModuleMapDescriptor_dispose( arg0, @@ -278,15 +292,14 @@ class LibClang { } late final _clang_ModuleMapDescriptor_dispose_ptr = - _lookup>( + _lookup>( 'clang_ModuleMapDescriptor_dispose'); - late final _dart_clang_ModuleMapDescriptor_dispose - _clang_ModuleMapDescriptor_dispose = + late final _clang_ModuleMapDescriptor_dispose = _clang_ModuleMapDescriptor_dispose_ptr - .asFunction<_dart_clang_ModuleMapDescriptor_dispose>(); + .asFunction(); /// Provides a shared context for creating translation units. - ffi.Pointer clang_createIndex( + CXIndex clang_createIndex( int excludeDeclarationsFromPCH, int displayDiagnostics, ) { @@ -297,13 +310,14 @@ class LibClang { } late final _clang_createIndex_ptr = - _lookup>('clang_createIndex'); - late final _dart_clang_createIndex _clang_createIndex = - _clang_createIndex_ptr.asFunction<_dart_clang_createIndex>(); + _lookup>( + 'clang_createIndex'); + late final _clang_createIndex = + _clang_createIndex_ptr.asFunction(); /// Destroy the given index. void clang_disposeIndex( - ffi.Pointer index, + CXIndex index, ) { return _clang_disposeIndex( index, @@ -311,13 +325,14 @@ class LibClang { } late final _clang_disposeIndex_ptr = - _lookup>('clang_disposeIndex'); - late final _dart_clang_disposeIndex _clang_disposeIndex = - _clang_disposeIndex_ptr.asFunction<_dart_clang_disposeIndex>(); + _lookup>( + 'clang_disposeIndex'); + late final _clang_disposeIndex = + _clang_disposeIndex_ptr.asFunction(); /// Sets general options associated with a CXIndex. void clang_CXIndex_setGlobalOptions( - ffi.Pointer arg0, + CXIndex arg0, int options, ) { return _clang_CXIndex_setGlobalOptions( @@ -327,15 +342,15 @@ class LibClang { } late final _clang_CXIndex_setGlobalOptions_ptr = - _lookup>( + _lookup>( 'clang_CXIndex_setGlobalOptions'); - late final _dart_clang_CXIndex_setGlobalOptions - _clang_CXIndex_setGlobalOptions = _clang_CXIndex_setGlobalOptions_ptr - .asFunction<_dart_clang_CXIndex_setGlobalOptions>(); + late final _clang_CXIndex_setGlobalOptions = + _clang_CXIndex_setGlobalOptions_ptr + .asFunction(); /// Gets the general options associated with a CXIndex. int clang_CXIndex_getGlobalOptions( - ffi.Pointer arg0, + CXIndex arg0, ) { return _clang_CXIndex_getGlobalOptions( arg0, @@ -343,15 +358,14 @@ class LibClang { } late final _clang_CXIndex_getGlobalOptions_ptr = - _lookup>( + _lookup>( 'clang_CXIndex_getGlobalOptions'); - late final _dart_clang_CXIndex_getGlobalOptions - _clang_CXIndex_getGlobalOptions = _clang_CXIndex_getGlobalOptions_ptr - .asFunction<_dart_clang_CXIndex_getGlobalOptions>(); + late final _clang_CXIndex_getGlobalOptions = + _clang_CXIndex_getGlobalOptions_ptr.asFunction(); /// Sets the invocation emission path option in a CXIndex. void clang_CXIndex_setInvocationEmissionPathOption( - ffi.Pointer arg0, + CXIndex arg0, ffi.Pointer Path, ) { return _clang_CXIndex_setInvocationEmissionPathOption( @@ -361,16 +375,16 @@ class LibClang { } late final _clang_CXIndex_setInvocationEmissionPathOption_ptr = _lookup< - ffi.NativeFunction<_c_clang_CXIndex_setInvocationEmissionPathOption>>( + ffi.NativeFunction< + ffi.Void Function(CXIndex, ffi.Pointer)>>( 'clang_CXIndex_setInvocationEmissionPathOption'); - late final _dart_clang_CXIndex_setInvocationEmissionPathOption - _clang_CXIndex_setInvocationEmissionPathOption = + late final _clang_CXIndex_setInvocationEmissionPathOption = _clang_CXIndex_setInvocationEmissionPathOption_ptr - .asFunction<_dart_clang_CXIndex_setInvocationEmissionPathOption>(); + .asFunction)>(); /// Retrieve the complete file and path name of the given file. CXString clang_getFileName( - ffi.Pointer SFile, + CXFile SFile, ) { return _clang_getFileName( SFile, @@ -378,13 +392,14 @@ class LibClang { } late final _clang_getFileName_ptr = - _lookup>('clang_getFileName'); - late final _dart_clang_getFileName _clang_getFileName = - _clang_getFileName_ptr.asFunction<_dart_clang_getFileName>(); + _lookup>( + 'clang_getFileName'); + late final _clang_getFileName = + _clang_getFileName_ptr.asFunction(); /// Retrieve the last modification time of the given file. int clang_getFileTime( - ffi.Pointer SFile, + CXFile SFile, ) { return _clang_getFileTime( SFile, @@ -392,13 +407,14 @@ class LibClang { } late final _clang_getFileTime_ptr = - _lookup>('clang_getFileTime'); - late final _dart_clang_getFileTime _clang_getFileTime = - _clang_getFileTime_ptr.asFunction<_dart_clang_getFileTime>(); + _lookup>( + 'clang_getFileTime'); + late final _clang_getFileTime = + _clang_getFileTime_ptr.asFunction(); /// Retrieve the unique ID for the given file. int clang_getFileUniqueID( - ffi.Pointer file, + CXFile file, ffi.Pointer outID, ) { return _clang_getFileUniqueID( @@ -407,18 +423,19 @@ class LibClang { ); } - late final _clang_getFileUniqueID_ptr = - _lookup>( - 'clang_getFileUniqueID'); - late final _dart_clang_getFileUniqueID _clang_getFileUniqueID = - _clang_getFileUniqueID_ptr.asFunction<_dart_clang_getFileUniqueID>(); + late final _clang_getFileUniqueID_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXFile, ffi.Pointer)>>('clang_getFileUniqueID'); + late final _clang_getFileUniqueID = _clang_getFileUniqueID_ptr + .asFunction)>(); /// Determine whether the given header is guarded against multiple inclusions, /// either with the conventional #ifndef/#define/#endif macro guards or with /// #pragma once. int clang_isFileMultipleIncludeGuarded( - ffi.Pointer tu, - ffi.Pointer file, + CXTranslationUnit tu, + CXFile file, ) { return _clang_isFileMultipleIncludeGuarded( tu, @@ -426,17 +443,16 @@ class LibClang { ); } - late final _clang_isFileMultipleIncludeGuarded_ptr = - _lookup>( - 'clang_isFileMultipleIncludeGuarded'); - late final _dart_clang_isFileMultipleIncludeGuarded - _clang_isFileMultipleIncludeGuarded = + late final _clang_isFileMultipleIncludeGuarded_ptr = _lookup< + ffi.NativeFunction>( + 'clang_isFileMultipleIncludeGuarded'); + late final _clang_isFileMultipleIncludeGuarded = _clang_isFileMultipleIncludeGuarded_ptr - .asFunction<_dart_clang_isFileMultipleIncludeGuarded>(); + .asFunction(); /// Retrieve a file handle within the given translation unit. - ffi.Pointer clang_getFile( - ffi.Pointer tu, + CXFile clang_getFile( + CXTranslationUnit tu, ffi.Pointer file_name, ) { return _clang_getFile( @@ -445,16 +461,18 @@ class LibClang { ); } - late final _clang_getFile_ptr = - _lookup>('clang_getFile'); - late final _dart_clang_getFile _clang_getFile = - _clang_getFile_ptr.asFunction<_dart_clang_getFile>(); + late final _clang_getFile_ptr = _lookup< + ffi.NativeFunction< + CXFile Function( + CXTranslationUnit, ffi.Pointer)>>('clang_getFile'); + late final _clang_getFile = _clang_getFile_ptr + .asFunction)>(); /// Retrieve the buffer associated with the given file. ffi.Pointer clang_getFileContents( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, + CXTranslationUnit tu, + CXFile file, + ffi.Pointer size, ) { return _clang_getFileContents( tu, @@ -463,17 +481,19 @@ class LibClang { ); } - late final _clang_getFileContents_ptr = - _lookup>( - 'clang_getFileContents'); - late final _dart_clang_getFileContents _clang_getFileContents = - _clang_getFileContents_ptr.asFunction<_dart_clang_getFileContents>(); + late final _clang_getFileContents_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(CXTranslationUnit, CXFile, + ffi.Pointer)>>('clang_getFileContents'); + late final _clang_getFileContents = _clang_getFileContents_ptr.asFunction< + ffi.Pointer Function( + CXTranslationUnit, CXFile, ffi.Pointer)>(); /// Returns non-zero if the file1 and file2 point to the same file, or they /// are both NULL. int clang_File_isEqual( - ffi.Pointer file1, - ffi.Pointer file2, + CXFile file1, + CXFile file2, ) { return _clang_File_isEqual( file1, @@ -482,13 +502,14 @@ class LibClang { } late final _clang_File_isEqual_ptr = - _lookup>('clang_File_isEqual'); - late final _dart_clang_File_isEqual _clang_File_isEqual = - _clang_File_isEqual_ptr.asFunction<_dart_clang_File_isEqual>(); + _lookup>( + 'clang_File_isEqual'); + late final _clang_File_isEqual = + _clang_File_isEqual_ptr.asFunction(); /// Returns the real path name of file. CXString clang_File_tryGetRealPathName( - ffi.Pointer file, + CXFile file, ) { return _clang_File_tryGetRealPathName( file, @@ -496,11 +517,10 @@ class LibClang { } late final _clang_File_tryGetRealPathName_ptr = - _lookup>( + _lookup>( 'clang_File_tryGetRealPathName'); - late final _dart_clang_File_tryGetRealPathName - _clang_File_tryGetRealPathName = _clang_File_tryGetRealPathName_ptr - .asFunction<_dart_clang_File_tryGetRealPathName>(); + late final _clang_File_tryGetRealPathName = _clang_File_tryGetRealPathName_ptr + .asFunction(); /// Retrieve a NULL (invalid) source location. CXSourceLocation clang_getNullLocation() { @@ -508,10 +528,10 @@ class LibClang { } late final _clang_getNullLocation_ptr = - _lookup>( + _lookup>( 'clang_getNullLocation'); - late final _dart_clang_getNullLocation _clang_getNullLocation = - _clang_getNullLocation_ptr.asFunction<_dart_clang_getNullLocation>(); + late final _clang_getNullLocation = + _clang_getNullLocation_ptr.asFunction(); /// Determine whether two source locations, which must refer into the same /// translation unit, refer to exactly the same point in the source code. @@ -525,17 +545,18 @@ class LibClang { ); } - late final _clang_equalLocations_ptr = - _lookup>( - 'clang_equalLocations'); - late final _dart_clang_equalLocations _clang_equalLocations = - _clang_equalLocations_ptr.asFunction<_dart_clang_equalLocations>(); + late final _clang_equalLocations_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function( + CXSourceLocation, CXSourceLocation)>>('clang_equalLocations'); + late final _clang_equalLocations = _clang_equalLocations_ptr + .asFunction(); /// Retrieves the source location associated with a given file/line/column in /// a particular translation unit. CXSourceLocation clang_getLocation( - ffi.Pointer tu, - ffi.Pointer file, + CXTranslationUnit tu, + CXFile file, int line, int column, ) { @@ -547,16 +568,18 @@ class LibClang { ); } - late final _clang_getLocation_ptr = - _lookup>('clang_getLocation'); - late final _dart_clang_getLocation _clang_getLocation = - _clang_getLocation_ptr.asFunction<_dart_clang_getLocation>(); + late final _clang_getLocation_ptr = _lookup< + ffi.NativeFunction< + CXSourceLocation Function(CXTranslationUnit, CXFile, ffi.Uint32, + ffi.Uint32)>>('clang_getLocation'); + late final _clang_getLocation = _clang_getLocation_ptr.asFunction< + CXSourceLocation Function(CXTranslationUnit, CXFile, int, int)>(); /// Retrieves the source location associated with a given character offset in /// a particular translation unit. CXSourceLocation clang_getLocationForOffset( - ffi.Pointer tu, - ffi.Pointer file, + CXTranslationUnit tu, + CXFile file, int offset, ) { return _clang_getLocationForOffset( @@ -566,12 +589,12 @@ class LibClang { ); } - late final _clang_getLocationForOffset_ptr = - _lookup>( - 'clang_getLocationForOffset'); - late final _dart_clang_getLocationForOffset _clang_getLocationForOffset = - _clang_getLocationForOffset_ptr - .asFunction<_dart_clang_getLocationForOffset>(); + late final _clang_getLocationForOffset_ptr = _lookup< + ffi.NativeFunction< + CXSourceLocation Function(CXTranslationUnit, CXFile, + ffi.Uint32)>>('clang_getLocationForOffset'); + late final _clang_getLocationForOffset = _clang_getLocationForOffset_ptr + .asFunction(); /// Returns non-zero if the given source location is in a system header. int clang_Location_isInSystemHeader( @@ -583,11 +606,11 @@ class LibClang { } late final _clang_Location_isInSystemHeader_ptr = - _lookup>( + _lookup>( 'clang_Location_isInSystemHeader'); - late final _dart_clang_Location_isInSystemHeader - _clang_Location_isInSystemHeader = _clang_Location_isInSystemHeader_ptr - .asFunction<_dart_clang_Location_isInSystemHeader>(); + late final _clang_Location_isInSystemHeader = + _clang_Location_isInSystemHeader_ptr + .asFunction(); /// Returns non-zero if the given source location is in the main file of the /// corresponding translation unit. @@ -600,11 +623,10 @@ class LibClang { } late final _clang_Location_isFromMainFile_ptr = - _lookup>( + _lookup>( 'clang_Location_isFromMainFile'); - late final _dart_clang_Location_isFromMainFile - _clang_Location_isFromMainFile = _clang_Location_isFromMainFile_ptr - .asFunction<_dart_clang_Location_isFromMainFile>(); + late final _clang_Location_isFromMainFile = _clang_Location_isFromMainFile_ptr + .asFunction(); /// Retrieve a NULL (invalid) source range. CXSourceRange clang_getNullRange() { @@ -612,9 +634,10 @@ class LibClang { } late final _clang_getNullRange_ptr = - _lookup>('clang_getNullRange'); - late final _dart_clang_getNullRange _clang_getNullRange = - _clang_getNullRange_ptr.asFunction<_dart_clang_getNullRange>(); + _lookup>( + 'clang_getNullRange'); + late final _clang_getNullRange = + _clang_getNullRange_ptr.asFunction(); /// Retrieve a source range given the beginning and ending source locations. CXSourceRange clang_getRange( @@ -627,10 +650,12 @@ class LibClang { ); } - late final _clang_getRange_ptr = - _lookup>('clang_getRange'); - late final _dart_clang_getRange _clang_getRange = - _clang_getRange_ptr.asFunction<_dart_clang_getRange>(); + late final _clang_getRange_ptr = _lookup< + ffi.NativeFunction< + CXSourceRange Function( + CXSourceLocation, CXSourceLocation)>>('clang_getRange'); + late final _clang_getRange = _clang_getRange_ptr + .asFunction(); /// Determine whether two ranges are equivalent. int clang_equalRanges( @@ -643,10 +668,12 @@ class LibClang { ); } - late final _clang_equalRanges_ptr = - _lookup>('clang_equalRanges'); - late final _dart_clang_equalRanges _clang_equalRanges = - _clang_equalRanges_ptr.asFunction<_dart_clang_equalRanges>(); + late final _clang_equalRanges_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function( + CXSourceRange, CXSourceRange)>>('clang_equalRanges'); + late final _clang_equalRanges = _clang_equalRanges_ptr + .asFunction(); /// Returns non-zero if range is null. int clang_Range_isNull( @@ -658,15 +685,16 @@ class LibClang { } late final _clang_Range_isNull_ptr = - _lookup>('clang_Range_isNull'); - late final _dart_clang_Range_isNull _clang_Range_isNull = - _clang_Range_isNull_ptr.asFunction<_dart_clang_Range_isNull>(); + _lookup>( + 'clang_Range_isNull'); + late final _clang_Range_isNull = + _clang_Range_isNull_ptr.asFunction(); /// Retrieve the file, line, column, and offset represented by the given /// source location. void clang_getExpansionLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -680,12 +708,22 @@ class LibClang { ); } - late final _clang_getExpansionLocation_ptr = - _lookup>( - 'clang_getExpansionLocation'); - late final _dart_clang_getExpansionLocation _clang_getExpansionLocation = - _clang_getExpansionLocation_ptr - .asFunction<_dart_clang_getExpansionLocation>(); + late final _clang_getExpansionLocation_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getExpansionLocation'); + late final _clang_getExpansionLocation = + _clang_getExpansionLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the file, line and column represented by the given source /// location, as specified in a # line directive. @@ -703,18 +741,23 @@ class LibClang { ); } - late final _clang_getPresumedLocation_ptr = - _lookup>( - 'clang_getPresumedLocation'); - late final _dart_clang_getPresumedLocation _clang_getPresumedLocation = - _clang_getPresumedLocation_ptr - .asFunction<_dart_clang_getPresumedLocation>(); + late final _clang_getPresumedLocation_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getPresumedLocation'); + late final _clang_getPresumedLocation = + _clang_getPresumedLocation_ptr.asFunction< + void Function(CXSourceLocation, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Legacy API to retrieve the file, line, column, and offset represented by /// the given source location. void clang_getInstantiationLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -728,18 +771,28 @@ class LibClang { ); } - late final _clang_getInstantiationLocation_ptr = - _lookup>( - 'clang_getInstantiationLocation'); - late final _dart_clang_getInstantiationLocation - _clang_getInstantiationLocation = _clang_getInstantiationLocation_ptr - .asFunction<_dart_clang_getInstantiationLocation>(); + late final _clang_getInstantiationLocation_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getInstantiationLocation'); + late final _clang_getInstantiationLocation = + _clang_getInstantiationLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the file, line, column, and offset represented by the given /// source location. void clang_getSpellingLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -753,18 +806,28 @@ class LibClang { ); } - late final _clang_getSpellingLocation_ptr = - _lookup>( - 'clang_getSpellingLocation'); - late final _dart_clang_getSpellingLocation _clang_getSpellingLocation = - _clang_getSpellingLocation_ptr - .asFunction<_dart_clang_getSpellingLocation>(); + late final _clang_getSpellingLocation_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getSpellingLocation'); + late final _clang_getSpellingLocation = + _clang_getSpellingLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the file, line, column, and offset represented by the given /// source location. void clang_getFileLocation( CXSourceLocation location, - ffi.Pointer> file, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -778,11 +841,21 @@ class LibClang { ); } - late final _clang_getFileLocation_ptr = - _lookup>( - 'clang_getFileLocation'); - late final _dart_clang_getFileLocation _clang_getFileLocation = - _clang_getFileLocation_ptr.asFunction<_dart_clang_getFileLocation>(); + late final _clang_getFileLocation_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_getFileLocation'); + late final _clang_getFileLocation = _clang_getFileLocation_ptr.asFunction< + void Function( + CXSourceLocation, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve a source location representing the first character within a /// source range. @@ -795,10 +868,10 @@ class LibClang { } late final _clang_getRangeStart_ptr = - _lookup>( + _lookup>( 'clang_getRangeStart'); - late final _dart_clang_getRangeStart _clang_getRangeStart = - _clang_getRangeStart_ptr.asFunction<_dart_clang_getRangeStart>(); + late final _clang_getRangeStart = _clang_getRangeStart_ptr + .asFunction(); /// Retrieve a source location representing the last character within a source /// range. @@ -811,14 +884,15 @@ class LibClang { } late final _clang_getRangeEnd_ptr = - _lookup>('clang_getRangeEnd'); - late final _dart_clang_getRangeEnd _clang_getRangeEnd = - _clang_getRangeEnd_ptr.asFunction<_dart_clang_getRangeEnd>(); + _lookup>( + 'clang_getRangeEnd'); + late final _clang_getRangeEnd = _clang_getRangeEnd_ptr + .asFunction(); /// Retrieve all ranges that were skipped by the preprocessor. ffi.Pointer clang_getSkippedRanges( - ffi.Pointer tu, - ffi.Pointer file, + CXTranslationUnit tu, + CXFile file, ) { return _clang_getSkippedRanges( tu, @@ -826,27 +900,28 @@ class LibClang { ); } - late final _clang_getSkippedRanges_ptr = - _lookup>( - 'clang_getSkippedRanges'); - late final _dart_clang_getSkippedRanges _clang_getSkippedRanges = - _clang_getSkippedRanges_ptr.asFunction<_dart_clang_getSkippedRanges>(); + late final _clang_getSkippedRanges_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + CXTranslationUnit, CXFile)>>('clang_getSkippedRanges'); + late final _clang_getSkippedRanges = _clang_getSkippedRanges_ptr.asFunction< + ffi.Pointer Function(CXTranslationUnit, CXFile)>(); /// Retrieve all ranges from all files that were skipped by the preprocessor. ffi.Pointer clang_getAllSkippedRanges( - ffi.Pointer tu, + CXTranslationUnit tu, ) { return _clang_getAllSkippedRanges( tu, ); } - late final _clang_getAllSkippedRanges_ptr = - _lookup>( - 'clang_getAllSkippedRanges'); - late final _dart_clang_getAllSkippedRanges _clang_getAllSkippedRanges = - _clang_getAllSkippedRanges_ptr - .asFunction<_dart_clang_getAllSkippedRanges>(); + late final _clang_getAllSkippedRanges_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + CXTranslationUnit)>>('clang_getAllSkippedRanges'); + late final _clang_getAllSkippedRanges = _clang_getAllSkippedRanges_ptr + .asFunction Function(CXTranslationUnit)>(); /// Destroy the given CXSourceRangeList. void clang_disposeSourceRangeList( @@ -857,16 +932,16 @@ class LibClang { ); } - late final _clang_disposeSourceRangeList_ptr = - _lookup>( - 'clang_disposeSourceRangeList'); - late final _dart_clang_disposeSourceRangeList _clang_disposeSourceRangeList = - _clang_disposeSourceRangeList_ptr - .asFunction<_dart_clang_disposeSourceRangeList>(); + late final _clang_disposeSourceRangeList_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>('clang_disposeSourceRangeList'); + late final _clang_disposeSourceRangeList = _clang_disposeSourceRangeList_ptr + .asFunction)>(); /// Determine the number of diagnostics in a CXDiagnosticSet. int clang_getNumDiagnosticsInSet( - ffi.Pointer Diags, + CXDiagnosticSet Diags, ) { return _clang_getNumDiagnosticsInSet( Diags, @@ -874,15 +949,14 @@ class LibClang { } late final _clang_getNumDiagnosticsInSet_ptr = - _lookup>( + _lookup>( 'clang_getNumDiagnosticsInSet'); - late final _dart_clang_getNumDiagnosticsInSet _clang_getNumDiagnosticsInSet = - _clang_getNumDiagnosticsInSet_ptr - .asFunction<_dart_clang_getNumDiagnosticsInSet>(); + late final _clang_getNumDiagnosticsInSet = _clang_getNumDiagnosticsInSet_ptr + .asFunction(); /// Retrieve a diagnostic associated with the given CXDiagnosticSet. - ffi.Pointer clang_getDiagnosticInSet( - ffi.Pointer Diags, + CXDiagnostic clang_getDiagnosticInSet( + CXDiagnosticSet Diags, int Index, ) { return _clang_getDiagnosticInSet( @@ -891,15 +965,15 @@ class LibClang { ); } - late final _clang_getDiagnosticInSet_ptr = - _lookup>( - 'clang_getDiagnosticInSet'); - late final _dart_clang_getDiagnosticInSet _clang_getDiagnosticInSet = - _clang_getDiagnosticInSet_ptr - .asFunction<_dart_clang_getDiagnosticInSet>(); + late final _clang_getDiagnosticInSet_ptr = _lookup< + ffi.NativeFunction< + CXDiagnostic Function( + CXDiagnosticSet, ffi.Uint32)>>('clang_getDiagnosticInSet'); + late final _clang_getDiagnosticInSet = _clang_getDiagnosticInSet_ptr + .asFunction(); /// Deserialize a set of diagnostics from a Clang diagnostics bitcode file. - ffi.Pointer clang_loadDiagnostics( + CXDiagnosticSet clang_loadDiagnostics( ffi.Pointer file, ffi.Pointer error, ffi.Pointer errorString, @@ -911,15 +985,19 @@ class LibClang { ); } - late final _clang_loadDiagnostics_ptr = - _lookup>( - 'clang_loadDiagnostics'); - late final _dart_clang_loadDiagnostics _clang_loadDiagnostics = - _clang_loadDiagnostics_ptr.asFunction<_dart_clang_loadDiagnostics>(); + late final _clang_loadDiagnostics_ptr = _lookup< + ffi.NativeFunction< + CXDiagnosticSet Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_loadDiagnostics'); + late final _clang_loadDiagnostics = _clang_loadDiagnostics_ptr.asFunction< + CXDiagnosticSet Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Release a CXDiagnosticSet and all of its contained diagnostics. void clang_disposeDiagnosticSet( - ffi.Pointer Diags, + CXDiagnosticSet Diags, ) { return _clang_disposeDiagnosticSet( Diags, @@ -927,15 +1005,14 @@ class LibClang { } late final _clang_disposeDiagnosticSet_ptr = - _lookup>( + _lookup>( 'clang_disposeDiagnosticSet'); - late final _dart_clang_disposeDiagnosticSet _clang_disposeDiagnosticSet = - _clang_disposeDiagnosticSet_ptr - .asFunction<_dart_clang_disposeDiagnosticSet>(); + late final _clang_disposeDiagnosticSet = _clang_disposeDiagnosticSet_ptr + .asFunction(); /// Retrieve the child diagnostics of a CXDiagnostic. - ffi.Pointer clang_getChildDiagnostics( - ffi.Pointer D, + CXDiagnosticSet clang_getChildDiagnostics( + CXDiagnostic D, ) { return _clang_getChildDiagnostics( D, @@ -943,16 +1020,15 @@ class LibClang { } late final _clang_getChildDiagnostics_ptr = - _lookup>( + _lookup>( 'clang_getChildDiagnostics'); - late final _dart_clang_getChildDiagnostics _clang_getChildDiagnostics = - _clang_getChildDiagnostics_ptr - .asFunction<_dart_clang_getChildDiagnostics>(); + late final _clang_getChildDiagnostics = _clang_getChildDiagnostics_ptr + .asFunction(); /// Determine the number of diagnostics produced for the given translation /// unit. int clang_getNumDiagnostics( - ffi.Pointer Unit, + CXTranslationUnit Unit, ) { return _clang_getNumDiagnostics( Unit, @@ -960,14 +1036,14 @@ class LibClang { } late final _clang_getNumDiagnostics_ptr = - _lookup>( + _lookup>( 'clang_getNumDiagnostics'); - late final _dart_clang_getNumDiagnostics _clang_getNumDiagnostics = - _clang_getNumDiagnostics_ptr.asFunction<_dart_clang_getNumDiagnostics>(); + late final _clang_getNumDiagnostics = _clang_getNumDiagnostics_ptr + .asFunction(); /// Retrieve a diagnostic associated with the given translation unit. - ffi.Pointer clang_getDiagnostic( - ffi.Pointer Unit, + CXDiagnostic clang_getDiagnostic( + CXTranslationUnit Unit, int Index, ) { return _clang_getDiagnostic( @@ -976,16 +1052,17 @@ class LibClang { ); } - late final _clang_getDiagnostic_ptr = - _lookup>( - 'clang_getDiagnostic'); - late final _dart_clang_getDiagnostic _clang_getDiagnostic = - _clang_getDiagnostic_ptr.asFunction<_dart_clang_getDiagnostic>(); + late final _clang_getDiagnostic_ptr = _lookup< + ffi.NativeFunction< + CXDiagnostic Function( + CXTranslationUnit, ffi.Uint32)>>('clang_getDiagnostic'); + late final _clang_getDiagnostic = _clang_getDiagnostic_ptr + .asFunction(); /// Retrieve the complete set of diagnostics associated with a translation /// unit. - ffi.Pointer clang_getDiagnosticSetFromTU( - ffi.Pointer Unit, + CXDiagnosticSet clang_getDiagnosticSetFromTU( + CXTranslationUnit Unit, ) { return _clang_getDiagnosticSetFromTU( Unit, @@ -993,15 +1070,14 @@ class LibClang { } late final _clang_getDiagnosticSetFromTU_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticSetFromTU'); - late final _dart_clang_getDiagnosticSetFromTU _clang_getDiagnosticSetFromTU = - _clang_getDiagnosticSetFromTU_ptr - .asFunction<_dart_clang_getDiagnosticSetFromTU>(); + late final _clang_getDiagnosticSetFromTU = _clang_getDiagnosticSetFromTU_ptr + .asFunction(); /// Destroy a diagnostic. void clang_disposeDiagnostic( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, ) { return _clang_disposeDiagnostic( Diagnostic, @@ -1009,14 +1085,14 @@ class LibClang { } late final _clang_disposeDiagnostic_ptr = - _lookup>( + _lookup>( 'clang_disposeDiagnostic'); - late final _dart_clang_disposeDiagnostic _clang_disposeDiagnostic = - _clang_disposeDiagnostic_ptr.asFunction<_dart_clang_disposeDiagnostic>(); + late final _clang_disposeDiagnostic = + _clang_disposeDiagnostic_ptr.asFunction(); /// Format the given diagnostic in a manner that is suitable for display. CXString clang_formatDiagnostic( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, int Options, ) { return _clang_formatDiagnostic( @@ -1026,10 +1102,10 @@ class LibClang { } late final _clang_formatDiagnostic_ptr = - _lookup>( + _lookup>( 'clang_formatDiagnostic'); - late final _dart_clang_formatDiagnostic _clang_formatDiagnostic = - _clang_formatDiagnostic_ptr.asFunction<_dart_clang_formatDiagnostic>(); + late final _clang_formatDiagnostic = _clang_formatDiagnostic_ptr + .asFunction(); /// Retrieve the set of display options most similar to the default behavior /// of the clang compiler. @@ -1038,16 +1114,14 @@ class LibClang { } late final _clang_defaultDiagnosticDisplayOptions_ptr = - _lookup>( + _lookup>( 'clang_defaultDiagnosticDisplayOptions'); - late final _dart_clang_defaultDiagnosticDisplayOptions - _clang_defaultDiagnosticDisplayOptions = - _clang_defaultDiagnosticDisplayOptions_ptr - .asFunction<_dart_clang_defaultDiagnosticDisplayOptions>(); + late final _clang_defaultDiagnosticDisplayOptions = + _clang_defaultDiagnosticDisplayOptions_ptr.asFunction(); /// Determine the severity of the given diagnostic. int clang_getDiagnosticSeverity( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticSeverity( arg0, @@ -1055,15 +1129,14 @@ class LibClang { } late final _clang_getDiagnosticSeverity_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticSeverity'); - late final _dart_clang_getDiagnosticSeverity _clang_getDiagnosticSeverity = - _clang_getDiagnosticSeverity_ptr - .asFunction<_dart_clang_getDiagnosticSeverity>(); + late final _clang_getDiagnosticSeverity = + _clang_getDiagnosticSeverity_ptr.asFunction(); /// Retrieve the source location of the given diagnostic. CXSourceLocation clang_getDiagnosticLocation( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticLocation( arg0, @@ -1071,15 +1144,14 @@ class LibClang { } late final _clang_getDiagnosticLocation_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticLocation'); - late final _dart_clang_getDiagnosticLocation _clang_getDiagnosticLocation = - _clang_getDiagnosticLocation_ptr - .asFunction<_dart_clang_getDiagnosticLocation>(); + late final _clang_getDiagnosticLocation = _clang_getDiagnosticLocation_ptr + .asFunction(); /// Retrieve the text of the given diagnostic. CXString clang_getDiagnosticSpelling( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticSpelling( arg0, @@ -1087,15 +1159,14 @@ class LibClang { } late final _clang_getDiagnosticSpelling_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticSpelling'); - late final _dart_clang_getDiagnosticSpelling _clang_getDiagnosticSpelling = - _clang_getDiagnosticSpelling_ptr - .asFunction<_dart_clang_getDiagnosticSpelling>(); + late final _clang_getDiagnosticSpelling = _clang_getDiagnosticSpelling_ptr + .asFunction(); /// Retrieve the name of the command-line option that enabled this diagnostic. CXString clang_getDiagnosticOption( - ffi.Pointer Diag, + CXDiagnostic Diag, ffi.Pointer Disable, ) { return _clang_getDiagnosticOption( @@ -1104,16 +1175,16 @@ class LibClang { ); } - late final _clang_getDiagnosticOption_ptr = - _lookup>( - 'clang_getDiagnosticOption'); - late final _dart_clang_getDiagnosticOption _clang_getDiagnosticOption = - _clang_getDiagnosticOption_ptr - .asFunction<_dart_clang_getDiagnosticOption>(); + late final _clang_getDiagnosticOption_ptr = _lookup< + ffi.NativeFunction< + CXString Function(CXDiagnostic, + ffi.Pointer)>>('clang_getDiagnosticOption'); + late final _clang_getDiagnosticOption = _clang_getDiagnosticOption_ptr + .asFunction)>(); /// Retrieve the category number for this diagnostic. int clang_getDiagnosticCategory( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticCategory( arg0, @@ -1121,11 +1192,10 @@ class LibClang { } late final _clang_getDiagnosticCategory_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticCategory'); - late final _dart_clang_getDiagnosticCategory _clang_getDiagnosticCategory = - _clang_getDiagnosticCategory_ptr - .asFunction<_dart_clang_getDiagnosticCategory>(); + late final _clang_getDiagnosticCategory = + _clang_getDiagnosticCategory_ptr.asFunction(); /// Retrieve the name of a particular diagnostic category. This is now /// deprecated. Use clang_getDiagnosticCategoryText() instead. @@ -1138,15 +1208,14 @@ class LibClang { } late final _clang_getDiagnosticCategoryName_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticCategoryName'); - late final _dart_clang_getDiagnosticCategoryName - _clang_getDiagnosticCategoryName = _clang_getDiagnosticCategoryName_ptr - .asFunction<_dart_clang_getDiagnosticCategoryName>(); + late final _clang_getDiagnosticCategoryName = + _clang_getDiagnosticCategoryName_ptr.asFunction(); /// Retrieve the diagnostic category text for a given diagnostic. CXString clang_getDiagnosticCategoryText( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticCategoryText( arg0, @@ -1154,16 +1223,16 @@ class LibClang { } late final _clang_getDiagnosticCategoryText_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticCategoryText'); - late final _dart_clang_getDiagnosticCategoryText - _clang_getDiagnosticCategoryText = _clang_getDiagnosticCategoryText_ptr - .asFunction<_dart_clang_getDiagnosticCategoryText>(); + late final _clang_getDiagnosticCategoryText = + _clang_getDiagnosticCategoryText_ptr + .asFunction(); /// Determine the number of source ranges associated with the given /// diagnostic. int clang_getDiagnosticNumRanges( - ffi.Pointer arg0, + CXDiagnostic arg0, ) { return _clang_getDiagnosticNumRanges( arg0, @@ -1171,15 +1240,14 @@ class LibClang { } late final _clang_getDiagnosticNumRanges_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticNumRanges'); - late final _dart_clang_getDiagnosticNumRanges _clang_getDiagnosticNumRanges = - _clang_getDiagnosticNumRanges_ptr - .asFunction<_dart_clang_getDiagnosticNumRanges>(); + late final _clang_getDiagnosticNumRanges = _clang_getDiagnosticNumRanges_ptr + .asFunction(); /// Retrieve a source range associated with the diagnostic. CXSourceRange clang_getDiagnosticRange( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, int Range, ) { return _clang_getDiagnosticRange( @@ -1188,16 +1256,15 @@ class LibClang { ); } - late final _clang_getDiagnosticRange_ptr = - _lookup>( - 'clang_getDiagnosticRange'); - late final _dart_clang_getDiagnosticRange _clang_getDiagnosticRange = - _clang_getDiagnosticRange_ptr - .asFunction<_dart_clang_getDiagnosticRange>(); + late final _clang_getDiagnosticRange_ptr = _lookup< + ffi.NativeFunction>( + 'clang_getDiagnosticRange'); + late final _clang_getDiagnosticRange = _clang_getDiagnosticRange_ptr + .asFunction(); /// Determine the number of fix-it hints associated with the given diagnostic. int clang_getDiagnosticNumFixIts( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, ) { return _clang_getDiagnosticNumFixIts( Diagnostic, @@ -1205,15 +1272,14 @@ class LibClang { } late final _clang_getDiagnosticNumFixIts_ptr = - _lookup>( + _lookup>( 'clang_getDiagnosticNumFixIts'); - late final _dart_clang_getDiagnosticNumFixIts _clang_getDiagnosticNumFixIts = - _clang_getDiagnosticNumFixIts_ptr - .asFunction<_dart_clang_getDiagnosticNumFixIts>(); + late final _clang_getDiagnosticNumFixIts = _clang_getDiagnosticNumFixIts_ptr + .asFunction(); /// Retrieve the replacement information for a given fix-it. CXString clang_getDiagnosticFixIt( - ffi.Pointer Diagnostic, + CXDiagnostic Diagnostic, int FixIt, ffi.Pointer ReplacementRange, ) { @@ -1224,16 +1290,17 @@ class LibClang { ); } - late final _clang_getDiagnosticFixIt_ptr = - _lookup>( - 'clang_getDiagnosticFixIt'); - late final _dart_clang_getDiagnosticFixIt _clang_getDiagnosticFixIt = - _clang_getDiagnosticFixIt_ptr - .asFunction<_dart_clang_getDiagnosticFixIt>(); + late final _clang_getDiagnosticFixIt_ptr = _lookup< + ffi.NativeFunction< + CXString Function(CXDiagnostic, ffi.Uint32, + ffi.Pointer)>>('clang_getDiagnosticFixIt'); + late final _clang_getDiagnosticFixIt = + _clang_getDiagnosticFixIt_ptr.asFunction< + CXString Function(CXDiagnostic, int, ffi.Pointer)>(); /// Get the original translation unit source file name. CXString clang_getTranslationUnitSpelling( - ffi.Pointer CTUnit, + CXTranslationUnit CTUnit, ) { return _clang_getTranslationUnitSpelling( CTUnit, @@ -1241,16 +1308,16 @@ class LibClang { } late final _clang_getTranslationUnitSpelling_ptr = - _lookup>( + _lookup>( 'clang_getTranslationUnitSpelling'); - late final _dart_clang_getTranslationUnitSpelling - _clang_getTranslationUnitSpelling = _clang_getTranslationUnitSpelling_ptr - .asFunction<_dart_clang_getTranslationUnitSpelling>(); + late final _clang_getTranslationUnitSpelling = + _clang_getTranslationUnitSpelling_ptr + .asFunction(); /// Return the CXTranslationUnit for a given source file and the provided /// command line arguments one would pass to the compiler. - ffi.Pointer clang_createTranslationUnitFromSourceFile( - ffi.Pointer CIdx, + CXTranslationUnit clang_createTranslationUnitFromSourceFile( + CXIndex CIdx, ffi.Pointer source_filename, int num_clang_command_line_args, ffi.Pointer> clang_command_line_args, @@ -1267,19 +1334,31 @@ class LibClang { ); } - late final _clang_createTranslationUnitFromSourceFile_ptr = - _lookup>( - 'clang_createTranslationUnitFromSourceFile'); - late final _dart_clang_createTranslationUnitFromSourceFile - _clang_createTranslationUnitFromSourceFile = - _clang_createTranslationUnitFromSourceFile_ptr - .asFunction<_dart_clang_createTranslationUnitFromSourceFile>(); + late final _clang_createTranslationUnitFromSourceFile_ptr = _lookup< + ffi.NativeFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Uint32, + ffi.Pointer)>>( + 'clang_createTranslationUnitFromSourceFile'); + late final _clang_createTranslationUnitFromSourceFile = + _clang_createTranslationUnitFromSourceFile_ptr.asFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + int, + ffi.Pointer>, + int, + ffi.Pointer)>(); /// Same as clang_createTranslationUnit2, but returns the CXTranslationUnit /// instead of an error code. In case of an error this routine returns a NULL /// CXTranslationUnit, without further detailed error codes. - ffi.Pointer clang_createTranslationUnit( - ffi.Pointer CIdx, + CXTranslationUnit clang_createTranslationUnit( + CXIndex CIdx, ffi.Pointer ast_filename, ) { return _clang_createTranslationUnit( @@ -1288,18 +1367,18 @@ class LibClang { ); } - late final _clang_createTranslationUnit_ptr = - _lookup>( - 'clang_createTranslationUnit'); - late final _dart_clang_createTranslationUnit _clang_createTranslationUnit = - _clang_createTranslationUnit_ptr - .asFunction<_dart_clang_createTranslationUnit>(); + late final _clang_createTranslationUnit_ptr = _lookup< + ffi.NativeFunction< + CXTranslationUnit Function( + CXIndex, ffi.Pointer)>>('clang_createTranslationUnit'); + late final _clang_createTranslationUnit = _clang_createTranslationUnit_ptr + .asFunction)>(); /// Create a translation unit from an AST file ( -emit-ast). int clang_createTranslationUnit2( - ffi.Pointer CIdx, + CXIndex CIdx, ffi.Pointer ast_filename, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, ) { return _clang_createTranslationUnit2( CIdx, @@ -1308,12 +1387,14 @@ class LibClang { ); } - late final _clang_createTranslationUnit2_ptr = - _lookup>( - 'clang_createTranslationUnit2'); - late final _dart_clang_createTranslationUnit2 _clang_createTranslationUnit2 = - _clang_createTranslationUnit2_ptr - .asFunction<_dart_clang_createTranslationUnit2>(); + late final _clang_createTranslationUnit2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(CXIndex, ffi.Pointer, + ffi.Pointer)>>('clang_createTranslationUnit2'); + late final _clang_createTranslationUnit2 = + _clang_createTranslationUnit2_ptr.asFunction< + int Function(CXIndex, ffi.Pointer, + ffi.Pointer)>(); /// Returns the set of flags that is suitable for parsing a translation unit /// that is being edited. @@ -1321,19 +1402,18 @@ class LibClang { return _clang_defaultEditingTranslationUnitOptions(); } - late final _clang_defaultEditingTranslationUnitOptions_ptr = _lookup< - ffi.NativeFunction<_c_clang_defaultEditingTranslationUnitOptions>>( - 'clang_defaultEditingTranslationUnitOptions'); - late final _dart_clang_defaultEditingTranslationUnitOptions - _clang_defaultEditingTranslationUnitOptions = + late final _clang_defaultEditingTranslationUnitOptions_ptr = + _lookup>( + 'clang_defaultEditingTranslationUnitOptions'); + late final _clang_defaultEditingTranslationUnitOptions = _clang_defaultEditingTranslationUnitOptions_ptr - .asFunction<_dart_clang_defaultEditingTranslationUnitOptions>(); + .asFunction(); /// Same as clang_parseTranslationUnit2, but returns the CXTranslationUnit /// instead of an error code. In case of an error this routine returns a NULL /// CXTranslationUnit, without further detailed error codes. - ffi.Pointer clang_parseTranslationUnit( - ffi.Pointer CIdx, + CXTranslationUnit clang_parseTranslationUnit( + CXIndex CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, int num_command_line_args, @@ -1352,24 +1432,38 @@ class LibClang { ); } - late final _clang_parseTranslationUnit_ptr = - _lookup>( - 'clang_parseTranslationUnit'); - late final _dart_clang_parseTranslationUnit _clang_parseTranslationUnit = - _clang_parseTranslationUnit_ptr - .asFunction<_dart_clang_parseTranslationUnit>(); + late final _clang_parseTranslationUnit_ptr = _lookup< + ffi.NativeFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32)>>('clang_parseTranslationUnit'); + late final _clang_parseTranslationUnit = + _clang_parseTranslationUnit_ptr.asFunction< + CXTranslationUnit Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + int)>(); /// Parse the given source file and the translation unit corresponding to that /// file. int clang_parseTranslationUnit2( - ffi.Pointer CIdx, + CXIndex CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, int options, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, ) { return _clang_parseTranslationUnit2( CIdx, @@ -1383,25 +1477,41 @@ class LibClang { ); } - late final _clang_parseTranslationUnit2_ptr = - _lookup>( - 'clang_parseTranslationUnit2'); - late final _dart_clang_parseTranslationUnit2 _clang_parseTranslationUnit2 = - _clang_parseTranslationUnit2_ptr - .asFunction<_dart_clang_parseTranslationUnit2>(); + late final _clang_parseTranslationUnit2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer)>>('clang_parseTranslationUnit2'); + late final _clang_parseTranslationUnit2 = + _clang_parseTranslationUnit2_ptr.asFunction< + int Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + int, + ffi.Pointer)>(); /// Same as clang_parseTranslationUnit2 but requires a full command line for /// command_line_args including argv[0]. This is useful if the standard /// library paths are relative to the binary. int clang_parseTranslationUnit2FullArgv( - ffi.Pointer CIdx, + CXIndex CIdx, ffi.Pointer source_filename, ffi.Pointer> command_line_args, int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, int options, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, ) { return _clang_parseTranslationUnit2FullArgv( CIdx, @@ -1415,17 +1525,33 @@ class LibClang { ); } - late final _clang_parseTranslationUnit2FullArgv_ptr = - _lookup>( - 'clang_parseTranslationUnit2FullArgv'); - late final _dart_clang_parseTranslationUnit2FullArgv - _clang_parseTranslationUnit2FullArgv = - _clang_parseTranslationUnit2FullArgv_ptr - .asFunction<_dart_clang_parseTranslationUnit2FullArgv>(); + late final _clang_parseTranslationUnit2FullArgv_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer)>>( + 'clang_parseTranslationUnit2FullArgv'); + late final _clang_parseTranslationUnit2FullArgv = + _clang_parseTranslationUnit2FullArgv_ptr.asFunction< + int Function( + CXIndex, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + int, + ffi.Pointer)>(); /// Returns the set of flags that is suitable for saving a translation unit. int clang_defaultSaveOptions( - ffi.Pointer TU, + CXTranslationUnit TU, ) { return _clang_defaultSaveOptions( TU, @@ -1433,16 +1559,15 @@ class LibClang { } late final _clang_defaultSaveOptions_ptr = - _lookup>( + _lookup>( 'clang_defaultSaveOptions'); - late final _dart_clang_defaultSaveOptions _clang_defaultSaveOptions = - _clang_defaultSaveOptions_ptr - .asFunction<_dart_clang_defaultSaveOptions>(); + late final _clang_defaultSaveOptions = _clang_defaultSaveOptions_ptr + .asFunction(); /// Saves a translation unit into a serialized representation of that /// translation unit on disk. int clang_saveTranslationUnit( - ffi.Pointer TU, + CXTranslationUnit TU, ffi.Pointer FileName, int options, ) { @@ -1453,16 +1578,17 @@ class LibClang { ); } - late final _clang_saveTranslationUnit_ptr = - _lookup>( - 'clang_saveTranslationUnit'); - late final _dart_clang_saveTranslationUnit _clang_saveTranslationUnit = - _clang_saveTranslationUnit_ptr - .asFunction<_dart_clang_saveTranslationUnit>(); + late final _clang_saveTranslationUnit_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(CXTranslationUnit, ffi.Pointer, + ffi.Uint32)>>('clang_saveTranslationUnit'); + late final _clang_saveTranslationUnit = + _clang_saveTranslationUnit_ptr.asFunction< + int Function(CXTranslationUnit, ffi.Pointer, int)>(); /// Suspend a translation unit in order to free memory associated with it. int clang_suspendTranslationUnit( - ffi.Pointer arg0, + CXTranslationUnit arg0, ) { return _clang_suspendTranslationUnit( arg0, @@ -1470,15 +1596,14 @@ class LibClang { } late final _clang_suspendTranslationUnit_ptr = - _lookup>( + _lookup>( 'clang_suspendTranslationUnit'); - late final _dart_clang_suspendTranslationUnit _clang_suspendTranslationUnit = - _clang_suspendTranslationUnit_ptr - .asFunction<_dart_clang_suspendTranslationUnit>(); + late final _clang_suspendTranslationUnit = _clang_suspendTranslationUnit_ptr + .asFunction(); /// Destroy the specified CXTranslationUnit object. void clang_disposeTranslationUnit( - ffi.Pointer arg0, + CXTranslationUnit arg0, ) { return _clang_disposeTranslationUnit( arg0, @@ -1486,16 +1611,15 @@ class LibClang { } late final _clang_disposeTranslationUnit_ptr = - _lookup>( + _lookup>( 'clang_disposeTranslationUnit'); - late final _dart_clang_disposeTranslationUnit _clang_disposeTranslationUnit = - _clang_disposeTranslationUnit_ptr - .asFunction<_dart_clang_disposeTranslationUnit>(); + late final _clang_disposeTranslationUnit = _clang_disposeTranslationUnit_ptr + .asFunction(); /// Returns the set of flags that is suitable for reparsing a translation /// unit. int clang_defaultReparseOptions( - ffi.Pointer TU, + CXTranslationUnit TU, ) { return _clang_defaultReparseOptions( TU, @@ -1503,15 +1627,14 @@ class LibClang { } late final _clang_defaultReparseOptions_ptr = - _lookup>( + _lookup>( 'clang_defaultReparseOptions'); - late final _dart_clang_defaultReparseOptions _clang_defaultReparseOptions = - _clang_defaultReparseOptions_ptr - .asFunction<_dart_clang_defaultReparseOptions>(); + late final _clang_defaultReparseOptions = _clang_defaultReparseOptions_ptr + .asFunction(); /// Reparse the source files that produced this translation unit. int clang_reparseTranslationUnit( - ffi.Pointer TU, + CXTranslationUnit TU, int num_unsaved_files, ffi.Pointer unsaved_files, int options, @@ -1524,12 +1647,17 @@ class LibClang { ); } - late final _clang_reparseTranslationUnit_ptr = - _lookup>( - 'clang_reparseTranslationUnit'); - late final _dart_clang_reparseTranslationUnit _clang_reparseTranslationUnit = - _clang_reparseTranslationUnit_ptr - .asFunction<_dart_clang_reparseTranslationUnit>(); + late final _clang_reparseTranslationUnit_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXTranslationUnit, + ffi.Uint32, + ffi.Pointer, + ffi.Uint32)>>('clang_reparseTranslationUnit'); + late final _clang_reparseTranslationUnit = + _clang_reparseTranslationUnit_ptr.asFunction< + int Function( + CXTranslationUnit, int, ffi.Pointer, int)>(); /// Returns the human-readable null-terminated C string that represents the /// name of the memory category. This string should never be freed. @@ -1542,28 +1670,26 @@ class LibClang { } late final _clang_getTUResourceUsageName_ptr = - _lookup>( + _lookup Function(ffi.Int32)>>( 'clang_getTUResourceUsageName'); - late final _dart_clang_getTUResourceUsageName _clang_getTUResourceUsageName = - _clang_getTUResourceUsageName_ptr - .asFunction<_dart_clang_getTUResourceUsageName>(); + late final _clang_getTUResourceUsageName = _clang_getTUResourceUsageName_ptr + .asFunction Function(int)>(); /// Return the memory usage of a translation unit. This object should be /// released with clang_disposeCXTUResourceUsage(). CXTUResourceUsage clang_getCXTUResourceUsage( - ffi.Pointer TU, + CXTranslationUnit TU, ) { return _clang_getCXTUResourceUsage( TU, ); } - late final _clang_getCXTUResourceUsage_ptr = - _lookup>( - 'clang_getCXTUResourceUsage'); - late final _dart_clang_getCXTUResourceUsage _clang_getCXTUResourceUsage = - _clang_getCXTUResourceUsage_ptr - .asFunction<_dart_clang_getCXTUResourceUsage>(); + late final _clang_getCXTUResourceUsage_ptr = _lookup< + ffi.NativeFunction>( + 'clang_getCXTUResourceUsage'); + late final _clang_getCXTUResourceUsage = _clang_getCXTUResourceUsage_ptr + .asFunction(); void clang_disposeCXTUResourceUsage( CXTUResourceUsage usage, @@ -1574,15 +1700,15 @@ class LibClang { } late final _clang_disposeCXTUResourceUsage_ptr = - _lookup>( + _lookup>( 'clang_disposeCXTUResourceUsage'); - late final _dart_clang_disposeCXTUResourceUsage - _clang_disposeCXTUResourceUsage = _clang_disposeCXTUResourceUsage_ptr - .asFunction<_dart_clang_disposeCXTUResourceUsage>(); + late final _clang_disposeCXTUResourceUsage = + _clang_disposeCXTUResourceUsage_ptr + .asFunction(); /// Get target information for this translation unit. - ffi.Pointer clang_getTranslationUnitTargetInfo( - ffi.Pointer CTUnit, + CXTargetInfo clang_getTranslationUnitTargetInfo( + CXTranslationUnit CTUnit, ) { return _clang_getTranslationUnitTargetInfo( CTUnit, @@ -1590,16 +1716,15 @@ class LibClang { } late final _clang_getTranslationUnitTargetInfo_ptr = - _lookup>( + _lookup>( 'clang_getTranslationUnitTargetInfo'); - late final _dart_clang_getTranslationUnitTargetInfo - _clang_getTranslationUnitTargetInfo = + late final _clang_getTranslationUnitTargetInfo = _clang_getTranslationUnitTargetInfo_ptr - .asFunction<_dart_clang_getTranslationUnitTargetInfo>(); + .asFunction(); /// Destroy the CXTargetInfo object. void clang_TargetInfo_dispose( - ffi.Pointer Info, + CXTargetInfo Info, ) { return _clang_TargetInfo_dispose( Info, @@ -1607,15 +1732,14 @@ class LibClang { } late final _clang_TargetInfo_dispose_ptr = - _lookup>( + _lookup>( 'clang_TargetInfo_dispose'); - late final _dart_clang_TargetInfo_dispose _clang_TargetInfo_dispose = - _clang_TargetInfo_dispose_ptr - .asFunction<_dart_clang_TargetInfo_dispose>(); + late final _clang_TargetInfo_dispose = + _clang_TargetInfo_dispose_ptr.asFunction(); /// Get the normalized target triple as a string. CXString clang_TargetInfo_getTriple( - ffi.Pointer Info, + CXTargetInfo Info, ) { return _clang_TargetInfo_getTriple( Info, @@ -1623,15 +1747,14 @@ class LibClang { } late final _clang_TargetInfo_getTriple_ptr = - _lookup>( + _lookup>( 'clang_TargetInfo_getTriple'); - late final _dart_clang_TargetInfo_getTriple _clang_TargetInfo_getTriple = - _clang_TargetInfo_getTriple_ptr - .asFunction<_dart_clang_TargetInfo_getTriple>(); + late final _clang_TargetInfo_getTriple = _clang_TargetInfo_getTriple_ptr + .asFunction(); /// Get the pointer width of the target in bits. int clang_TargetInfo_getPointerWidth( - ffi.Pointer Info, + CXTargetInfo Info, ) { return _clang_TargetInfo_getPointerWidth( Info, @@ -1639,11 +1762,11 @@ class LibClang { } late final _clang_TargetInfo_getPointerWidth_ptr = - _lookup>( + _lookup>( 'clang_TargetInfo_getPointerWidth'); - late final _dart_clang_TargetInfo_getPointerWidth - _clang_TargetInfo_getPointerWidth = _clang_TargetInfo_getPointerWidth_ptr - .asFunction<_dart_clang_TargetInfo_getPointerWidth>(); + late final _clang_TargetInfo_getPointerWidth = + _clang_TargetInfo_getPointerWidth_ptr + .asFunction(); /// Retrieve the NULL cursor, which represents no entity. CXCursor clang_getNullCursor() { @@ -1651,14 +1774,13 @@ class LibClang { } late final _clang_getNullCursor_ptr = - _lookup>( - 'clang_getNullCursor'); - late final _dart_clang_getNullCursor _clang_getNullCursor = - _clang_getNullCursor_ptr.asFunction<_dart_clang_getNullCursor>(); + _lookup>('clang_getNullCursor'); + late final _clang_getNullCursor = + _clang_getNullCursor_ptr.asFunction(); /// Retrieve the cursor that represents the given translation unit. CXCursor clang_getTranslationUnitCursor( - ffi.Pointer arg0, + CXTranslationUnit arg0, ) { return _clang_getTranslationUnitCursor( arg0, @@ -1666,11 +1788,11 @@ class LibClang { } late final _clang_getTranslationUnitCursor_ptr = - _lookup>( + _lookup>( 'clang_getTranslationUnitCursor'); - late final _dart_clang_getTranslationUnitCursor - _clang_getTranslationUnitCursor = _clang_getTranslationUnitCursor_ptr - .asFunction<_dart_clang_getTranslationUnitCursor>(); + late final _clang_getTranslationUnitCursor = + _clang_getTranslationUnitCursor_ptr + .asFunction(); /// Determine whether two cursors are equivalent. int clang_equalCursors( @@ -1684,9 +1806,10 @@ class LibClang { } late final _clang_equalCursors_ptr = - _lookup>('clang_equalCursors'); - late final _dart_clang_equalCursors _clang_equalCursors = - _clang_equalCursors_ptr.asFunction<_dart_clang_equalCursors>(); + _lookup>( + 'clang_equalCursors'); + late final _clang_equalCursors = + _clang_equalCursors_ptr.asFunction(); /// Returns non-zero if cursor is null. int clang_Cursor_isNull( @@ -1698,10 +1821,10 @@ class LibClang { } late final _clang_Cursor_isNull_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isNull'); - late final _dart_clang_Cursor_isNull _clang_Cursor_isNull = - _clang_Cursor_isNull_ptr.asFunction<_dart_clang_Cursor_isNull>(); + late final _clang_Cursor_isNull = + _clang_Cursor_isNull_ptr.asFunction(); /// Compute a hash value for the given cursor. int clang_hashCursor( @@ -1713,9 +1836,10 @@ class LibClang { } late final _clang_hashCursor_ptr = - _lookup>('clang_hashCursor'); - late final _dart_clang_hashCursor _clang_hashCursor = - _clang_hashCursor_ptr.asFunction<_dart_clang_hashCursor>(); + _lookup>( + 'clang_hashCursor'); + late final _clang_hashCursor = + _clang_hashCursor_ptr.asFunction(); /// Retrieve the kind of the given cursor. int clang_getCursorKind( @@ -1727,10 +1851,10 @@ class LibClang { } late final _clang_getCursorKind_ptr = - _lookup>( + _lookup>( 'clang_getCursorKind'); - late final _dart_clang_getCursorKind _clang_getCursorKind = - _clang_getCursorKind_ptr.asFunction<_dart_clang_getCursorKind>(); + late final _clang_getCursorKind = + _clang_getCursorKind_ptr.asFunction(); /// Determine whether the given cursor kind represents a declaration. int clang_isDeclaration( @@ -1742,10 +1866,10 @@ class LibClang { } late final _clang_isDeclaration_ptr = - _lookup>( + _lookup>( 'clang_isDeclaration'); - late final _dart_clang_isDeclaration _clang_isDeclaration = - _clang_isDeclaration_ptr.asFunction<_dart_clang_isDeclaration>(); + late final _clang_isDeclaration = + _clang_isDeclaration_ptr.asFunction(); /// Determine whether the given declaration is invalid. int clang_isInvalidDeclaration( @@ -1757,11 +1881,10 @@ class LibClang { } late final _clang_isInvalidDeclaration_ptr = - _lookup>( + _lookup>( 'clang_isInvalidDeclaration'); - late final _dart_clang_isInvalidDeclaration _clang_isInvalidDeclaration = - _clang_isInvalidDeclaration_ptr - .asFunction<_dart_clang_isInvalidDeclaration>(); + late final _clang_isInvalidDeclaration = + _clang_isInvalidDeclaration_ptr.asFunction(); /// Determine whether the given cursor kind represents a simple reference. int clang_isReference( @@ -1773,9 +1896,10 @@ class LibClang { } late final _clang_isReference_ptr = - _lookup>('clang_isReference'); - late final _dart_clang_isReference _clang_isReference = - _clang_isReference_ptr.asFunction<_dart_clang_isReference>(); + _lookup>( + 'clang_isReference'); + late final _clang_isReference = + _clang_isReference_ptr.asFunction(); /// Determine whether the given cursor kind represents an expression. int clang_isExpression( @@ -1787,9 +1911,10 @@ class LibClang { } late final _clang_isExpression_ptr = - _lookup>('clang_isExpression'); - late final _dart_clang_isExpression _clang_isExpression = - _clang_isExpression_ptr.asFunction<_dart_clang_isExpression>(); + _lookup>( + 'clang_isExpression'); + late final _clang_isExpression = + _clang_isExpression_ptr.asFunction(); /// Determine whether the given cursor kind represents a statement. int clang_isStatement( @@ -1801,9 +1926,10 @@ class LibClang { } late final _clang_isStatement_ptr = - _lookup>('clang_isStatement'); - late final _dart_clang_isStatement _clang_isStatement = - _clang_isStatement_ptr.asFunction<_dart_clang_isStatement>(); + _lookup>( + 'clang_isStatement'); + late final _clang_isStatement = + _clang_isStatement_ptr.asFunction(); /// Determine whether the given cursor kind represents an attribute. int clang_isAttribute( @@ -1815,9 +1941,10 @@ class LibClang { } late final _clang_isAttribute_ptr = - _lookup>('clang_isAttribute'); - late final _dart_clang_isAttribute _clang_isAttribute = - _clang_isAttribute_ptr.asFunction<_dart_clang_isAttribute>(); + _lookup>( + 'clang_isAttribute'); + late final _clang_isAttribute = + _clang_isAttribute_ptr.asFunction(); /// Determine whether the given cursor has any attributes. int clang_Cursor_hasAttrs( @@ -1829,10 +1956,10 @@ class LibClang { } late final _clang_Cursor_hasAttrs_ptr = - _lookup>( + _lookup>( 'clang_Cursor_hasAttrs'); - late final _dart_clang_Cursor_hasAttrs _clang_Cursor_hasAttrs = - _clang_Cursor_hasAttrs_ptr.asFunction<_dart_clang_Cursor_hasAttrs>(); + late final _clang_Cursor_hasAttrs = + _clang_Cursor_hasAttrs_ptr.asFunction(); /// Determine whether the given cursor kind represents an invalid cursor. int clang_isInvalid( @@ -1844,9 +1971,10 @@ class LibClang { } late final _clang_isInvalid_ptr = - _lookup>('clang_isInvalid'); - late final _dart_clang_isInvalid _clang_isInvalid = - _clang_isInvalid_ptr.asFunction<_dart_clang_isInvalid>(); + _lookup>( + 'clang_isInvalid'); + late final _clang_isInvalid = + _clang_isInvalid_ptr.asFunction(); /// Determine whether the given cursor kind represents a translation unit. int clang_isTranslationUnit( @@ -1858,10 +1986,10 @@ class LibClang { } late final _clang_isTranslationUnit_ptr = - _lookup>( + _lookup>( 'clang_isTranslationUnit'); - late final _dart_clang_isTranslationUnit _clang_isTranslationUnit = - _clang_isTranslationUnit_ptr.asFunction<_dart_clang_isTranslationUnit>(); + late final _clang_isTranslationUnit = + _clang_isTranslationUnit_ptr.asFunction(); /// * Determine whether the given cursor represents a preprocessing element, /// such as a preprocessor directive or macro instantiation. @@ -1874,10 +2002,10 @@ class LibClang { } late final _clang_isPreprocessing_ptr = - _lookup>( + _lookup>( 'clang_isPreprocessing'); - late final _dart_clang_isPreprocessing _clang_isPreprocessing = - _clang_isPreprocessing_ptr.asFunction<_dart_clang_isPreprocessing>(); + late final _clang_isPreprocessing = + _clang_isPreprocessing_ptr.asFunction(); /// * Determine whether the given cursor represents a currently unexposed /// piece of the AST (e.g., CXCursor_UnexposedStmt). @@ -1890,9 +2018,10 @@ class LibClang { } late final _clang_isUnexposed_ptr = - _lookup>('clang_isUnexposed'); - late final _dart_clang_isUnexposed _clang_isUnexposed = - _clang_isUnexposed_ptr.asFunction<_dart_clang_isUnexposed>(); + _lookup>( + 'clang_isUnexposed'); + late final _clang_isUnexposed = + _clang_isUnexposed_ptr.asFunction(); /// Determine the linkage of the entity referred to by a given cursor. int clang_getCursorLinkage( @@ -1904,10 +2033,10 @@ class LibClang { } late final _clang_getCursorLinkage_ptr = - _lookup>( + _lookup>( 'clang_getCursorLinkage'); - late final _dart_clang_getCursorLinkage _clang_getCursorLinkage = - _clang_getCursorLinkage_ptr.asFunction<_dart_clang_getCursorLinkage>(); + late final _clang_getCursorLinkage = + _clang_getCursorLinkage_ptr.asFunction(); /// Describe the visibility of the entity referred to by a cursor. int clang_getCursorVisibility( @@ -1919,11 +2048,10 @@ class LibClang { } late final _clang_getCursorVisibility_ptr = - _lookup>( + _lookup>( 'clang_getCursorVisibility'); - late final _dart_clang_getCursorVisibility _clang_getCursorVisibility = - _clang_getCursorVisibility_ptr - .asFunction<_dart_clang_getCursorVisibility>(); + late final _clang_getCursorVisibility = + _clang_getCursorVisibility_ptr.asFunction(); /// Determine the availability of the entity that this cursor refers to, /// taking the current target platform into account. @@ -1936,11 +2064,10 @@ class LibClang { } late final _clang_getCursorAvailability_ptr = - _lookup>( + _lookup>( 'clang_getCursorAvailability'); - late final _dart_clang_getCursorAvailability _clang_getCursorAvailability = - _clang_getCursorAvailability_ptr - .asFunction<_dart_clang_getCursorAvailability>(); + late final _clang_getCursorAvailability = + _clang_getCursorAvailability_ptr.asFunction(); /// Determine the availability of the entity that this cursor refers to on any /// platforms for which availability information is known. @@ -1964,13 +2091,26 @@ class LibClang { ); } - late final _clang_getCursorPlatformAvailability_ptr = - _lookup>( - 'clang_getCursorPlatformAvailability'); - late final _dart_clang_getCursorPlatformAvailability - _clang_getCursorPlatformAvailability = - _clang_getCursorPlatformAvailability_ptr - .asFunction<_dart_clang_getCursorPlatformAvailability>(); + late final _clang_getCursorPlatformAvailability_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXCursor, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('clang_getCursorPlatformAvailability'); + late final _clang_getCursorPlatformAvailability = + _clang_getCursorPlatformAvailability_ptr.asFunction< + int Function( + CXCursor, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); /// Free the memory associated with a CXPlatformAvailability structure. void clang_disposeCXPlatformAvailability( @@ -1981,13 +2121,13 @@ class LibClang { ); } - late final _clang_disposeCXPlatformAvailability_ptr = - _lookup>( - 'clang_disposeCXPlatformAvailability'); - late final _dart_clang_disposeCXPlatformAvailability - _clang_disposeCXPlatformAvailability = + late final _clang_disposeCXPlatformAvailability_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>( + 'clang_disposeCXPlatformAvailability'); + late final _clang_disposeCXPlatformAvailability = _clang_disposeCXPlatformAvailability_ptr - .asFunction<_dart_clang_disposeCXPlatformAvailability>(); + .asFunction)>(); /// Determine the "language" of the entity referred to by a given cursor. int clang_getCursorLanguage( @@ -1999,10 +2139,10 @@ class LibClang { } late final _clang_getCursorLanguage_ptr = - _lookup>( + _lookup>( 'clang_getCursorLanguage'); - late final _dart_clang_getCursorLanguage _clang_getCursorLanguage = - _clang_getCursorLanguage_ptr.asFunction<_dart_clang_getCursorLanguage>(); + late final _clang_getCursorLanguage = + _clang_getCursorLanguage_ptr.asFunction(); /// Determine the "thread-local storage (TLS) kind" of the declaration /// referred to by a cursor. @@ -2015,13 +2155,13 @@ class LibClang { } late final _clang_getCursorTLSKind_ptr = - _lookup>( + _lookup>( 'clang_getCursorTLSKind'); - late final _dart_clang_getCursorTLSKind _clang_getCursorTLSKind = - _clang_getCursorTLSKind_ptr.asFunction<_dart_clang_getCursorTLSKind>(); + late final _clang_getCursorTLSKind = + _clang_getCursorTLSKind_ptr.asFunction(); /// Returns the translation unit that a cursor originated from. - ffi.Pointer clang_Cursor_getTranslationUnit( + CXTranslationUnit clang_Cursor_getTranslationUnit( CXCursor arg0, ) { return _clang_Cursor_getTranslationUnit( @@ -2030,26 +2170,26 @@ class LibClang { } late final _clang_Cursor_getTranslationUnit_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getTranslationUnit'); - late final _dart_clang_Cursor_getTranslationUnit - _clang_Cursor_getTranslationUnit = _clang_Cursor_getTranslationUnit_ptr - .asFunction<_dart_clang_Cursor_getTranslationUnit>(); + late final _clang_Cursor_getTranslationUnit = + _clang_Cursor_getTranslationUnit_ptr + .asFunction(); /// Creates an empty CXCursorSet. - ffi.Pointer clang_createCXCursorSet() { + CXCursorSet clang_createCXCursorSet() { return _clang_createCXCursorSet(); } late final _clang_createCXCursorSet_ptr = - _lookup>( + _lookup>( 'clang_createCXCursorSet'); - late final _dart_clang_createCXCursorSet _clang_createCXCursorSet = - _clang_createCXCursorSet_ptr.asFunction<_dart_clang_createCXCursorSet>(); + late final _clang_createCXCursorSet = + _clang_createCXCursorSet_ptr.asFunction(); /// Disposes a CXCursorSet and releases its associated memory. void clang_disposeCXCursorSet( - ffi.Pointer cset, + CXCursorSet cset, ) { return _clang_disposeCXCursorSet( cset, @@ -2057,15 +2197,14 @@ class LibClang { } late final _clang_disposeCXCursorSet_ptr = - _lookup>( + _lookup>( 'clang_disposeCXCursorSet'); - late final _dart_clang_disposeCXCursorSet _clang_disposeCXCursorSet = - _clang_disposeCXCursorSet_ptr - .asFunction<_dart_clang_disposeCXCursorSet>(); + late final _clang_disposeCXCursorSet = + _clang_disposeCXCursorSet_ptr.asFunction(); /// Queries a CXCursorSet to see if it contains a specific CXCursor. int clang_CXCursorSet_contains( - ffi.Pointer cset, + CXCursorSet cset, CXCursor cursor, ) { return _clang_CXCursorSet_contains( @@ -2075,15 +2214,14 @@ class LibClang { } late final _clang_CXCursorSet_contains_ptr = - _lookup>( + _lookup>( 'clang_CXCursorSet_contains'); - late final _dart_clang_CXCursorSet_contains _clang_CXCursorSet_contains = - _clang_CXCursorSet_contains_ptr - .asFunction<_dart_clang_CXCursorSet_contains>(); + late final _clang_CXCursorSet_contains = _clang_CXCursorSet_contains_ptr + .asFunction(); /// Inserts a CXCursor into a CXCursorSet. int clang_CXCursorSet_insert( - ffi.Pointer cset, + CXCursorSet cset, CXCursor cursor, ) { return _clang_CXCursorSet_insert( @@ -2093,11 +2231,10 @@ class LibClang { } late final _clang_CXCursorSet_insert_ptr = - _lookup>( + _lookup>( 'clang_CXCursorSet_insert'); - late final _dart_clang_CXCursorSet_insert _clang_CXCursorSet_insert = - _clang_CXCursorSet_insert_ptr - .asFunction<_dart_clang_CXCursorSet_insert>(); + late final _clang_CXCursorSet_insert = _clang_CXCursorSet_insert_ptr + .asFunction(); /// Determine the semantic parent of the given cursor. CXCursor clang_getCursorSemanticParent( @@ -2109,11 +2246,10 @@ class LibClang { } late final _clang_getCursorSemanticParent_ptr = - _lookup>( + _lookup>( 'clang_getCursorSemanticParent'); - late final _dart_clang_getCursorSemanticParent - _clang_getCursorSemanticParent = _clang_getCursorSemanticParent_ptr - .asFunction<_dart_clang_getCursorSemanticParent>(); + late final _clang_getCursorSemanticParent = _clang_getCursorSemanticParent_ptr + .asFunction(); /// Determine the lexical parent of the given cursor. CXCursor clang_getCursorLexicalParent( @@ -2125,11 +2261,10 @@ class LibClang { } late final _clang_getCursorLexicalParent_ptr = - _lookup>( + _lookup>( 'clang_getCursorLexicalParent'); - late final _dart_clang_getCursorLexicalParent _clang_getCursorLexicalParent = - _clang_getCursorLexicalParent_ptr - .asFunction<_dart_clang_getCursorLexicalParent>(); + late final _clang_getCursorLexicalParent = _clang_getCursorLexicalParent_ptr + .asFunction(); /// Determine the set of methods that are overridden by the given method. void clang_getOverriddenCursors( @@ -2144,12 +2279,14 @@ class LibClang { ); } - late final _clang_getOverriddenCursors_ptr = - _lookup>( - 'clang_getOverriddenCursors'); - late final _dart_clang_getOverriddenCursors _clang_getOverriddenCursors = - _clang_getOverriddenCursors_ptr - .asFunction<_dart_clang_getOverriddenCursors>(); + late final _clang_getOverriddenCursors_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CXCursor, ffi.Pointer>, + ffi.Pointer)>>('clang_getOverriddenCursors'); + late final _clang_getOverriddenCursors = + _clang_getOverriddenCursors_ptr.asFunction< + void Function(CXCursor, ffi.Pointer>, + ffi.Pointer)>(); /// Free the set of overridden cursors returned by /// clang_getOverriddenCursors(). @@ -2162,15 +2299,15 @@ class LibClang { } late final _clang_disposeOverriddenCursors_ptr = - _lookup>( + _lookup)>>( 'clang_disposeOverriddenCursors'); - late final _dart_clang_disposeOverriddenCursors - _clang_disposeOverriddenCursors = _clang_disposeOverriddenCursors_ptr - .asFunction<_dart_clang_disposeOverriddenCursors>(); + late final _clang_disposeOverriddenCursors = + _clang_disposeOverriddenCursors_ptr + .asFunction)>(); /// Retrieve the file that is included by the given inclusion directive /// cursor. - ffi.Pointer clang_getIncludedFile( + CXFile clang_getIncludedFile( CXCursor cursor, ) { return _clang_getIncludedFile( @@ -2179,15 +2316,15 @@ class LibClang { } late final _clang_getIncludedFile_ptr = - _lookup>( + _lookup>( 'clang_getIncludedFile'); - late final _dart_clang_getIncludedFile _clang_getIncludedFile = - _clang_getIncludedFile_ptr.asFunction<_dart_clang_getIncludedFile>(); + late final _clang_getIncludedFile = + _clang_getIncludedFile_ptr.asFunction(); /// Map a source location to the cursor that describes the entity at that /// location in the source code. CXCursor clang_getCursor( - ffi.Pointer arg0, + CXTranslationUnit arg0, CXSourceLocation arg1, ) { return _clang_getCursor( @@ -2196,10 +2333,12 @@ class LibClang { ); } - late final _clang_getCursor_ptr = - _lookup>('clang_getCursor'); - late final _dart_clang_getCursor _clang_getCursor = - _clang_getCursor_ptr.asFunction<_dart_clang_getCursor>(); + late final _clang_getCursor_ptr = _lookup< + ffi.NativeFunction< + CXCursor Function( + CXTranslationUnit, CXSourceLocation)>>('clang_getCursor'); + late final _clang_getCursor = _clang_getCursor_ptr + .asFunction(); /// Retrieve the physical location of the source constructor referenced by the /// given cursor. @@ -2212,10 +2351,10 @@ class LibClang { } late final _clang_getCursorLocation_ptr = - _lookup>( + _lookup>( 'clang_getCursorLocation'); - late final _dart_clang_getCursorLocation _clang_getCursorLocation = - _clang_getCursorLocation_ptr.asFunction<_dart_clang_getCursorLocation>(); + late final _clang_getCursorLocation = _clang_getCursorLocation_ptr + .asFunction(); /// Retrieve the physical extent of the source construct referenced by the /// given cursor. @@ -2228,10 +2367,10 @@ class LibClang { } late final _clang_getCursorExtent_ptr = - _lookup>( + _lookup>( 'clang_getCursorExtent'); - late final _dart_clang_getCursorExtent _clang_getCursorExtent = - _clang_getCursorExtent_ptr.asFunction<_dart_clang_getCursorExtent>(); + late final _clang_getCursorExtent = + _clang_getCursorExtent_ptr.asFunction(); /// Retrieve the type of a CXCursor (if any). CXType clang_getCursorType( @@ -2243,10 +2382,10 @@ class LibClang { } late final _clang_getCursorType_ptr = - _lookup>( + _lookup>( 'clang_getCursorType'); - late final _dart_clang_getCursorType _clang_getCursorType = - _clang_getCursorType_ptr.asFunction<_dart_clang_getCursorType>(); + late final _clang_getCursorType = + _clang_getCursorType_ptr.asFunction(); /// Pretty-print the underlying type using the rules of the language of the /// translation unit from which it came. @@ -2259,10 +2398,10 @@ class LibClang { } late final _clang_getTypeSpelling_ptr = - _lookup>( + _lookup>( 'clang_getTypeSpelling'); - late final _dart_clang_getTypeSpelling _clang_getTypeSpelling = - _clang_getTypeSpelling_ptr.asFunction<_dart_clang_getTypeSpelling>(); + late final _clang_getTypeSpelling = + _clang_getTypeSpelling_ptr.asFunction(); /// Retrieve the underlying type of a typedef declaration. CXType clang_getTypedefDeclUnderlyingType( @@ -2274,12 +2413,11 @@ class LibClang { } late final _clang_getTypedefDeclUnderlyingType_ptr = - _lookup>( + _lookup>( 'clang_getTypedefDeclUnderlyingType'); - late final _dart_clang_getTypedefDeclUnderlyingType - _clang_getTypedefDeclUnderlyingType = + late final _clang_getTypedefDeclUnderlyingType = _clang_getTypedefDeclUnderlyingType_ptr - .asFunction<_dart_clang_getTypedefDeclUnderlyingType>(); + .asFunction(); /// Retrieve the integer type of an enum declaration. CXType clang_getEnumDeclIntegerType( @@ -2291,11 +2429,10 @@ class LibClang { } late final _clang_getEnumDeclIntegerType_ptr = - _lookup>( + _lookup>( 'clang_getEnumDeclIntegerType'); - late final _dart_clang_getEnumDeclIntegerType _clang_getEnumDeclIntegerType = - _clang_getEnumDeclIntegerType_ptr - .asFunction<_dart_clang_getEnumDeclIntegerType>(); + late final _clang_getEnumDeclIntegerType = + _clang_getEnumDeclIntegerType_ptr.asFunction(); /// Retrieve the integer value of an enum constant declaration as a signed /// long long. @@ -2308,11 +2445,10 @@ class LibClang { } late final _clang_getEnumConstantDeclValue_ptr = - _lookup>( + _lookup>( 'clang_getEnumConstantDeclValue'); - late final _dart_clang_getEnumConstantDeclValue - _clang_getEnumConstantDeclValue = _clang_getEnumConstantDeclValue_ptr - .asFunction<_dart_clang_getEnumConstantDeclValue>(); + late final _clang_getEnumConstantDeclValue = + _clang_getEnumConstantDeclValue_ptr.asFunction(); /// Retrieve the integer value of an enum constant declaration as an unsigned /// long long. @@ -2325,12 +2461,11 @@ class LibClang { } late final _clang_getEnumConstantDeclUnsignedValue_ptr = - _lookup>( + _lookup>( 'clang_getEnumConstantDeclUnsignedValue'); - late final _dart_clang_getEnumConstantDeclUnsignedValue - _clang_getEnumConstantDeclUnsignedValue = + late final _clang_getEnumConstantDeclUnsignedValue = _clang_getEnumConstantDeclUnsignedValue_ptr - .asFunction<_dart_clang_getEnumConstantDeclUnsignedValue>(); + .asFunction(); /// Retrieve the bit width of a bit field declaration as an integer. int clang_getFieldDeclBitWidth( @@ -2342,11 +2477,10 @@ class LibClang { } late final _clang_getFieldDeclBitWidth_ptr = - _lookup>( + _lookup>( 'clang_getFieldDeclBitWidth'); - late final _dart_clang_getFieldDeclBitWidth _clang_getFieldDeclBitWidth = - _clang_getFieldDeclBitWidth_ptr - .asFunction<_dart_clang_getFieldDeclBitWidth>(); + late final _clang_getFieldDeclBitWidth = + _clang_getFieldDeclBitWidth_ptr.asFunction(); /// Retrieve the number of non-variadic arguments associated with a given /// cursor. @@ -2359,11 +2493,10 @@ class LibClang { } late final _clang_Cursor_getNumArguments_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getNumArguments'); - late final _dart_clang_Cursor_getNumArguments _clang_Cursor_getNumArguments = - _clang_Cursor_getNumArguments_ptr - .asFunction<_dart_clang_Cursor_getNumArguments>(); + late final _clang_Cursor_getNumArguments = + _clang_Cursor_getNumArguments_ptr.asFunction(); /// Retrieve the argument cursor of a function or method. CXCursor clang_Cursor_getArgument( @@ -2377,11 +2510,10 @@ class LibClang { } late final _clang_Cursor_getArgument_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getArgument'); - late final _dart_clang_Cursor_getArgument _clang_Cursor_getArgument = - _clang_Cursor_getArgument_ptr - .asFunction<_dart_clang_Cursor_getArgument>(); + late final _clang_Cursor_getArgument = _clang_Cursor_getArgument_ptr + .asFunction(); /// Returns the number of template args of a function decl representing a /// template specialization. @@ -2394,12 +2526,11 @@ class LibClang { } late final _clang_Cursor_getNumTemplateArguments_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getNumTemplateArguments'); - late final _dart_clang_Cursor_getNumTemplateArguments - _clang_Cursor_getNumTemplateArguments = + late final _clang_Cursor_getNumTemplateArguments = _clang_Cursor_getNumTemplateArguments_ptr - .asFunction<_dart_clang_Cursor_getNumTemplateArguments>(); + .asFunction(); /// Retrieve the kind of the I'th template argument of the CXCursor C. int clang_Cursor_getTemplateArgumentKind( @@ -2413,12 +2544,11 @@ class LibClang { } late final _clang_Cursor_getTemplateArgumentKind_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getTemplateArgumentKind'); - late final _dart_clang_Cursor_getTemplateArgumentKind - _clang_Cursor_getTemplateArgumentKind = + late final _clang_Cursor_getTemplateArgumentKind = _clang_Cursor_getTemplateArgumentKind_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentKind>(); + .asFunction(); /// Retrieve a CXType representing the type of a TemplateArgument of a /// function decl representing a template specialization. @@ -2433,12 +2563,11 @@ class LibClang { } late final _clang_Cursor_getTemplateArgumentType_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getTemplateArgumentType'); - late final _dart_clang_Cursor_getTemplateArgumentType - _clang_Cursor_getTemplateArgumentType = + late final _clang_Cursor_getTemplateArgumentType = _clang_Cursor_getTemplateArgumentType_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentType>(); + .asFunction(); /// Retrieve the value of an Integral TemplateArgument (of a function decl /// representing a template specialization) as a signed long long. @@ -2453,12 +2582,11 @@ class LibClang { } late final _clang_Cursor_getTemplateArgumentValue_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getTemplateArgumentValue'); - late final _dart_clang_Cursor_getTemplateArgumentValue - _clang_Cursor_getTemplateArgumentValue = + late final _clang_Cursor_getTemplateArgumentValue = _clang_Cursor_getTemplateArgumentValue_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentValue>(); + .asFunction(); /// Retrieve the value of an Integral TemplateArgument (of a function decl /// representing a template specialization) as an unsigned long long. @@ -2472,13 +2600,12 @@ class LibClang { ); } - late final _clang_Cursor_getTemplateArgumentUnsignedValue_ptr = _lookup< - ffi.NativeFunction<_c_clang_Cursor_getTemplateArgumentUnsignedValue>>( - 'clang_Cursor_getTemplateArgumentUnsignedValue'); - late final _dart_clang_Cursor_getTemplateArgumentUnsignedValue - _clang_Cursor_getTemplateArgumentUnsignedValue = + late final _clang_Cursor_getTemplateArgumentUnsignedValue_ptr = + _lookup>( + 'clang_Cursor_getTemplateArgumentUnsignedValue'); + late final _clang_Cursor_getTemplateArgumentUnsignedValue = _clang_Cursor_getTemplateArgumentUnsignedValue_ptr - .asFunction<_dart_clang_Cursor_getTemplateArgumentUnsignedValue>(); + .asFunction(); /// Determine whether two CXTypes represent the same type. int clang_equalTypes( @@ -2492,9 +2619,10 @@ class LibClang { } late final _clang_equalTypes_ptr = - _lookup>('clang_equalTypes'); - late final _dart_clang_equalTypes _clang_equalTypes = - _clang_equalTypes_ptr.asFunction<_dart_clang_equalTypes>(); + _lookup>( + 'clang_equalTypes'); + late final _clang_equalTypes = + _clang_equalTypes_ptr.asFunction(); /// Return the canonical type for a CXType. CXType clang_getCanonicalType( @@ -2506,10 +2634,10 @@ class LibClang { } late final _clang_getCanonicalType_ptr = - _lookup>( + _lookup>( 'clang_getCanonicalType'); - late final _dart_clang_getCanonicalType _clang_getCanonicalType = - _clang_getCanonicalType_ptr.asFunction<_dart_clang_getCanonicalType>(); + late final _clang_getCanonicalType = + _clang_getCanonicalType_ptr.asFunction(); /// Determine whether a CXType has the "const" qualifier set, without looking /// through typedefs that may have added "const" at a different level. @@ -2522,11 +2650,10 @@ class LibClang { } late final _clang_isConstQualifiedType_ptr = - _lookup>( + _lookup>( 'clang_isConstQualifiedType'); - late final _dart_clang_isConstQualifiedType _clang_isConstQualifiedType = - _clang_isConstQualifiedType_ptr - .asFunction<_dart_clang_isConstQualifiedType>(); + late final _clang_isConstQualifiedType = + _clang_isConstQualifiedType_ptr.asFunction(); /// Determine whether a CXCursor that is a macro, is function like. int clang_Cursor_isMacroFunctionLike( @@ -2538,11 +2665,11 @@ class LibClang { } late final _clang_Cursor_isMacroFunctionLike_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroFunctionLike'); - late final _dart_clang_Cursor_isMacroFunctionLike - _clang_Cursor_isMacroFunctionLike = _clang_Cursor_isMacroFunctionLike_ptr - .asFunction<_dart_clang_Cursor_isMacroFunctionLike>(); + late final _clang_Cursor_isMacroFunctionLike = + _clang_Cursor_isMacroFunctionLike_ptr + .asFunction(); /// Determine whether a CXCursor that is a macro, is a builtin one. int clang_Cursor_isMacroBuiltin( @@ -2554,11 +2681,10 @@ class LibClang { } late final _clang_Cursor_isMacroBuiltin_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isMacroBuiltin'); - late final _dart_clang_Cursor_isMacroBuiltin _clang_Cursor_isMacroBuiltin = - _clang_Cursor_isMacroBuiltin_ptr - .asFunction<_dart_clang_Cursor_isMacroBuiltin>(); + late final _clang_Cursor_isMacroBuiltin = + _clang_Cursor_isMacroBuiltin_ptr.asFunction(); /// Determine whether a CXCursor that is a function declaration, is an inline /// declaration. @@ -2571,11 +2697,10 @@ class LibClang { } late final _clang_Cursor_isFunctionInlined_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isFunctionInlined'); - late final _dart_clang_Cursor_isFunctionInlined - _clang_Cursor_isFunctionInlined = _clang_Cursor_isFunctionInlined_ptr - .asFunction<_dart_clang_Cursor_isFunctionInlined>(); + late final _clang_Cursor_isFunctionInlined = + _clang_Cursor_isFunctionInlined_ptr.asFunction(); /// Determine whether a CXType has the "volatile" qualifier set, without /// looking through typedefs that may have added "volatile" at a different @@ -2589,11 +2714,10 @@ class LibClang { } late final _clang_isVolatileQualifiedType_ptr = - _lookup>( + _lookup>( 'clang_isVolatileQualifiedType'); - late final _dart_clang_isVolatileQualifiedType - _clang_isVolatileQualifiedType = _clang_isVolatileQualifiedType_ptr - .asFunction<_dart_clang_isVolatileQualifiedType>(); + late final _clang_isVolatileQualifiedType = + _clang_isVolatileQualifiedType_ptr.asFunction(); /// Determine whether a CXType has the "restrict" qualifier set, without /// looking through typedefs that may have added "restrict" at a different @@ -2607,11 +2731,10 @@ class LibClang { } late final _clang_isRestrictQualifiedType_ptr = - _lookup>( + _lookup>( 'clang_isRestrictQualifiedType'); - late final _dart_clang_isRestrictQualifiedType - _clang_isRestrictQualifiedType = _clang_isRestrictQualifiedType_ptr - .asFunction<_dart_clang_isRestrictQualifiedType>(); + late final _clang_isRestrictQualifiedType = + _clang_isRestrictQualifiedType_ptr.asFunction(); /// Returns the address space of the given type. int clang_getAddressSpace( @@ -2623,10 +2746,10 @@ class LibClang { } late final _clang_getAddressSpace_ptr = - _lookup>( + _lookup>( 'clang_getAddressSpace'); - late final _dart_clang_getAddressSpace _clang_getAddressSpace = - _clang_getAddressSpace_ptr.asFunction<_dart_clang_getAddressSpace>(); + late final _clang_getAddressSpace = + _clang_getAddressSpace_ptr.asFunction(); /// Returns the typedef name of the given type. CXString clang_getTypedefName( @@ -2638,10 +2761,10 @@ class LibClang { } late final _clang_getTypedefName_ptr = - _lookup>( + _lookup>( 'clang_getTypedefName'); - late final _dart_clang_getTypedefName _clang_getTypedefName = - _clang_getTypedefName_ptr.asFunction<_dart_clang_getTypedefName>(); + late final _clang_getTypedefName = + _clang_getTypedefName_ptr.asFunction(); /// For pointer types, returns the type of the pointee. CXType clang_getPointeeType( @@ -2653,10 +2776,10 @@ class LibClang { } late final _clang_getPointeeType_ptr = - _lookup>( + _lookup>( 'clang_getPointeeType'); - late final _dart_clang_getPointeeType _clang_getPointeeType = - _clang_getPointeeType_ptr.asFunction<_dart_clang_getPointeeType>(); + late final _clang_getPointeeType = + _clang_getPointeeType_ptr.asFunction(); /// Return the cursor for the declaration of the given type. CXCursor clang_getTypeDeclaration( @@ -2668,11 +2791,10 @@ class LibClang { } late final _clang_getTypeDeclaration_ptr = - _lookup>( + _lookup>( 'clang_getTypeDeclaration'); - late final _dart_clang_getTypeDeclaration _clang_getTypeDeclaration = - _clang_getTypeDeclaration_ptr - .asFunction<_dart_clang_getTypeDeclaration>(); + late final _clang_getTypeDeclaration = + _clang_getTypeDeclaration_ptr.asFunction(); /// Returns the Objective-C type encoding for the specified declaration. CXString clang_getDeclObjCTypeEncoding( @@ -2684,11 +2806,10 @@ class LibClang { } late final _clang_getDeclObjCTypeEncoding_ptr = - _lookup>( + _lookup>( 'clang_getDeclObjCTypeEncoding'); - late final _dart_clang_getDeclObjCTypeEncoding - _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncoding_ptr - .asFunction<_dart_clang_getDeclObjCTypeEncoding>(); + late final _clang_getDeclObjCTypeEncoding = _clang_getDeclObjCTypeEncoding_ptr + .asFunction(); /// Returns the Objective-C type encoding for the specified CXType. CXString clang_Type_getObjCEncoding( @@ -2700,11 +2821,10 @@ class LibClang { } late final _clang_Type_getObjCEncoding_ptr = - _lookup>( + _lookup>( 'clang_Type_getObjCEncoding'); - late final _dart_clang_Type_getObjCEncoding _clang_Type_getObjCEncoding = - _clang_Type_getObjCEncoding_ptr - .asFunction<_dart_clang_Type_getObjCEncoding>(); + late final _clang_Type_getObjCEncoding = + _clang_Type_getObjCEncoding_ptr.asFunction(); /// Retrieve the spelling of a given CXTypeKind. CXString clang_getTypeKindSpelling( @@ -2716,11 +2836,10 @@ class LibClang { } late final _clang_getTypeKindSpelling_ptr = - _lookup>( + _lookup>( 'clang_getTypeKindSpelling'); - late final _dart_clang_getTypeKindSpelling _clang_getTypeKindSpelling = - _clang_getTypeKindSpelling_ptr - .asFunction<_dart_clang_getTypeKindSpelling>(); + late final _clang_getTypeKindSpelling = + _clang_getTypeKindSpelling_ptr.asFunction(); /// Retrieve the calling convention associated with a function type. int clang_getFunctionTypeCallingConv( @@ -2732,11 +2851,10 @@ class LibClang { } late final _clang_getFunctionTypeCallingConv_ptr = - _lookup>( + _lookup>( 'clang_getFunctionTypeCallingConv'); - late final _dart_clang_getFunctionTypeCallingConv - _clang_getFunctionTypeCallingConv = _clang_getFunctionTypeCallingConv_ptr - .asFunction<_dart_clang_getFunctionTypeCallingConv>(); + late final _clang_getFunctionTypeCallingConv = + _clang_getFunctionTypeCallingConv_ptr.asFunction(); /// Retrieve the return type associated with a function type. CXType clang_getResultType( @@ -2748,10 +2866,10 @@ class LibClang { } late final _clang_getResultType_ptr = - _lookup>( + _lookup>( 'clang_getResultType'); - late final _dart_clang_getResultType _clang_getResultType = - _clang_getResultType_ptr.asFunction<_dart_clang_getResultType>(); + late final _clang_getResultType = + _clang_getResultType_ptr.asFunction(); /// Retrieve the exception specification type associated with a function type. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -2764,12 +2882,11 @@ class LibClang { } late final _clang_getExceptionSpecificationType_ptr = - _lookup>( + _lookup>( 'clang_getExceptionSpecificationType'); - late final _dart_clang_getExceptionSpecificationType - _clang_getExceptionSpecificationType = + late final _clang_getExceptionSpecificationType = _clang_getExceptionSpecificationType_ptr - .asFunction<_dart_clang_getExceptionSpecificationType>(); + .asFunction(); /// Retrieve the number of non-variadic parameters associated with a function /// type. @@ -2782,10 +2899,10 @@ class LibClang { } late final _clang_getNumArgTypes_ptr = - _lookup>( + _lookup>( 'clang_getNumArgTypes'); - late final _dart_clang_getNumArgTypes _clang_getNumArgTypes = - _clang_getNumArgTypes_ptr.asFunction<_dart_clang_getNumArgTypes>(); + late final _clang_getNumArgTypes = + _clang_getNumArgTypes_ptr.asFunction(); /// Retrieve the type of a parameter of a function type. CXType clang_getArgType( @@ -2799,9 +2916,10 @@ class LibClang { } late final _clang_getArgType_ptr = - _lookup>('clang_getArgType'); - late final _dart_clang_getArgType _clang_getArgType = - _clang_getArgType_ptr.asFunction<_dart_clang_getArgType>(); + _lookup>( + 'clang_getArgType'); + late final _clang_getArgType = + _clang_getArgType_ptr.asFunction(); /// Retrieves the base type of the ObjCObjectType. CXType clang_Type_getObjCObjectBaseType( @@ -2813,11 +2931,11 @@ class LibClang { } late final _clang_Type_getObjCObjectBaseType_ptr = - _lookup>( + _lookup>( 'clang_Type_getObjCObjectBaseType'); - late final _dart_clang_Type_getObjCObjectBaseType - _clang_Type_getObjCObjectBaseType = _clang_Type_getObjCObjectBaseType_ptr - .asFunction<_dart_clang_Type_getObjCObjectBaseType>(); + late final _clang_Type_getObjCObjectBaseType = + _clang_Type_getObjCObjectBaseType_ptr + .asFunction(); /// Retrieve the number of protocol references associated with an ObjC /// object/id. @@ -2830,12 +2948,10 @@ class LibClang { } late final _clang_Type_getNumObjCProtocolRefs_ptr = - _lookup>( + _lookup>( 'clang_Type_getNumObjCProtocolRefs'); - late final _dart_clang_Type_getNumObjCProtocolRefs - _clang_Type_getNumObjCProtocolRefs = - _clang_Type_getNumObjCProtocolRefs_ptr - .asFunction<_dart_clang_Type_getNumObjCProtocolRefs>(); + late final _clang_Type_getNumObjCProtocolRefs = + _clang_Type_getNumObjCProtocolRefs_ptr.asFunction(); /// Retrieve the decl for a protocol reference for an ObjC object/id. CXCursor clang_Type_getObjCProtocolDecl( @@ -2849,11 +2965,11 @@ class LibClang { } late final _clang_Type_getObjCProtocolDecl_ptr = - _lookup>( + _lookup>( 'clang_Type_getObjCProtocolDecl'); - late final _dart_clang_Type_getObjCProtocolDecl - _clang_Type_getObjCProtocolDecl = _clang_Type_getObjCProtocolDecl_ptr - .asFunction<_dart_clang_Type_getObjCProtocolDecl>(); + late final _clang_Type_getObjCProtocolDecl = + _clang_Type_getObjCProtocolDecl_ptr + .asFunction(); /// Retreive the number of type arguments associated with an ObjC object. int clang_Type_getNumObjCTypeArgs( @@ -2865,11 +2981,10 @@ class LibClang { } late final _clang_Type_getNumObjCTypeArgs_ptr = - _lookup>( + _lookup>( 'clang_Type_getNumObjCTypeArgs'); - late final _dart_clang_Type_getNumObjCTypeArgs - _clang_Type_getNumObjCTypeArgs = _clang_Type_getNumObjCTypeArgs_ptr - .asFunction<_dart_clang_Type_getNumObjCTypeArgs>(); + late final _clang_Type_getNumObjCTypeArgs = + _clang_Type_getNumObjCTypeArgs_ptr.asFunction(); /// Retrieve a type argument associated with an ObjC object. CXType clang_Type_getObjCTypeArg( @@ -2883,11 +2998,10 @@ class LibClang { } late final _clang_Type_getObjCTypeArg_ptr = - _lookup>( + _lookup>( 'clang_Type_getObjCTypeArg'); - late final _dart_clang_Type_getObjCTypeArg _clang_Type_getObjCTypeArg = - _clang_Type_getObjCTypeArg_ptr - .asFunction<_dart_clang_Type_getObjCTypeArg>(); + late final _clang_Type_getObjCTypeArg = + _clang_Type_getObjCTypeArg_ptr.asFunction(); /// Return 1 if the CXType is a variadic function type, and 0 otherwise. int clang_isFunctionTypeVariadic( @@ -2899,11 +3013,10 @@ class LibClang { } late final _clang_isFunctionTypeVariadic_ptr = - _lookup>( + _lookup>( 'clang_isFunctionTypeVariadic'); - late final _dart_clang_isFunctionTypeVariadic _clang_isFunctionTypeVariadic = - _clang_isFunctionTypeVariadic_ptr - .asFunction<_dart_clang_isFunctionTypeVariadic>(); + late final _clang_isFunctionTypeVariadic = + _clang_isFunctionTypeVariadic_ptr.asFunction(); /// Retrieve the return type associated with a given cursor. CXType clang_getCursorResultType( @@ -2915,11 +3028,10 @@ class LibClang { } late final _clang_getCursorResultType_ptr = - _lookup>( + _lookup>( 'clang_getCursorResultType'); - late final _dart_clang_getCursorResultType _clang_getCursorResultType = - _clang_getCursorResultType_ptr - .asFunction<_dart_clang_getCursorResultType>(); + late final _clang_getCursorResultType = + _clang_getCursorResultType_ptr.asFunction(); /// Retrieve the exception specification type associated with a given cursor. /// This is a value of type CXCursor_ExceptionSpecificationKind. @@ -2932,12 +3044,11 @@ class LibClang { } late final _clang_getCursorExceptionSpecificationType_ptr = - _lookup>( + _lookup>( 'clang_getCursorExceptionSpecificationType'); - late final _dart_clang_getCursorExceptionSpecificationType - _clang_getCursorExceptionSpecificationType = + late final _clang_getCursorExceptionSpecificationType = _clang_getCursorExceptionSpecificationType_ptr - .asFunction<_dart_clang_getCursorExceptionSpecificationType>(); + .asFunction(); /// Return 1 if the CXType is a POD (plain old data) type, and 0 otherwise. int clang_isPODType( @@ -2949,9 +3060,10 @@ class LibClang { } late final _clang_isPODType_ptr = - _lookup>('clang_isPODType'); - late final _dart_clang_isPODType _clang_isPODType = - _clang_isPODType_ptr.asFunction<_dart_clang_isPODType>(); + _lookup>( + 'clang_isPODType'); + late final _clang_isPODType = + _clang_isPODType_ptr.asFunction(); /// Return the element type of an array, complex, or vector type. CXType clang_getElementType( @@ -2963,10 +3075,10 @@ class LibClang { } late final _clang_getElementType_ptr = - _lookup>( + _lookup>( 'clang_getElementType'); - late final _dart_clang_getElementType _clang_getElementType = - _clang_getElementType_ptr.asFunction<_dart_clang_getElementType>(); + late final _clang_getElementType = + _clang_getElementType_ptr.asFunction(); /// Return the number of elements of an array or vector type. int clang_getNumElements( @@ -2978,10 +3090,10 @@ class LibClang { } late final _clang_getNumElements_ptr = - _lookup>( + _lookup>( 'clang_getNumElements'); - late final _dart_clang_getNumElements _clang_getNumElements = - _clang_getNumElements_ptr.asFunction<_dart_clang_getNumElements>(); + late final _clang_getNumElements = + _clang_getNumElements_ptr.asFunction(); /// Return the element type of an array type. CXType clang_getArrayElementType( @@ -2993,11 +3105,10 @@ class LibClang { } late final _clang_getArrayElementType_ptr = - _lookup>( + _lookup>( 'clang_getArrayElementType'); - late final _dart_clang_getArrayElementType _clang_getArrayElementType = - _clang_getArrayElementType_ptr - .asFunction<_dart_clang_getArrayElementType>(); + late final _clang_getArrayElementType = + _clang_getArrayElementType_ptr.asFunction(); /// Return the array size of a constant array. int clang_getArraySize( @@ -3009,9 +3120,10 @@ class LibClang { } late final _clang_getArraySize_ptr = - _lookup>('clang_getArraySize'); - late final _dart_clang_getArraySize _clang_getArraySize = - _clang_getArraySize_ptr.asFunction<_dart_clang_getArraySize>(); + _lookup>( + 'clang_getArraySize'); + late final _clang_getArraySize = + _clang_getArraySize_ptr.asFunction(); /// Retrieve the type named by the qualified-id. CXType clang_Type_getNamedType( @@ -3023,10 +3135,10 @@ class LibClang { } late final _clang_Type_getNamedType_ptr = - _lookup>( + _lookup>( 'clang_Type_getNamedType'); - late final _dart_clang_Type_getNamedType _clang_Type_getNamedType = - _clang_Type_getNamedType_ptr.asFunction<_dart_clang_Type_getNamedType>(); + late final _clang_Type_getNamedType = + _clang_Type_getNamedType_ptr.asFunction(); /// Determine if a typedef is 'transparent' tag. int clang_Type_isTransparentTagTypedef( @@ -3038,12 +3150,11 @@ class LibClang { } late final _clang_Type_isTransparentTagTypedef_ptr = - _lookup>( + _lookup>( 'clang_Type_isTransparentTagTypedef'); - late final _dart_clang_Type_isTransparentTagTypedef - _clang_Type_isTransparentTagTypedef = + late final _clang_Type_isTransparentTagTypedef = _clang_Type_isTransparentTagTypedef_ptr - .asFunction<_dart_clang_Type_isTransparentTagTypedef>(); + .asFunction(); /// Retrieve the nullability kind of a pointer type. int clang_Type_getNullability( @@ -3055,11 +3166,10 @@ class LibClang { } late final _clang_Type_getNullability_ptr = - _lookup>( + _lookup>( 'clang_Type_getNullability'); - late final _dart_clang_Type_getNullability _clang_Type_getNullability = - _clang_Type_getNullability_ptr - .asFunction<_dart_clang_Type_getNullability>(); + late final _clang_Type_getNullability = + _clang_Type_getNullability_ptr.asFunction(); /// Return the alignment of a type in bytes as per C++[expr.alignof] standard. int clang_Type_getAlignOf( @@ -3071,10 +3181,10 @@ class LibClang { } late final _clang_Type_getAlignOf_ptr = - _lookup>( + _lookup>( 'clang_Type_getAlignOf'); - late final _dart_clang_Type_getAlignOf _clang_Type_getAlignOf = - _clang_Type_getAlignOf_ptr.asFunction<_dart_clang_Type_getAlignOf>(); + late final _clang_Type_getAlignOf = + _clang_Type_getAlignOf_ptr.asFunction(); /// Return the class type of an member pointer type. CXType clang_Type_getClassType( @@ -3086,10 +3196,10 @@ class LibClang { } late final _clang_Type_getClassType_ptr = - _lookup>( + _lookup>( 'clang_Type_getClassType'); - late final _dart_clang_Type_getClassType _clang_Type_getClassType = - _clang_Type_getClassType_ptr.asFunction<_dart_clang_Type_getClassType>(); + late final _clang_Type_getClassType = + _clang_Type_getClassType_ptr.asFunction(); /// Return the size of a type in bytes as per C++[expr.sizeof] standard. int clang_Type_getSizeOf( @@ -3101,10 +3211,10 @@ class LibClang { } late final _clang_Type_getSizeOf_ptr = - _lookup>( + _lookup>( 'clang_Type_getSizeOf'); - late final _dart_clang_Type_getSizeOf _clang_Type_getSizeOf = - _clang_Type_getSizeOf_ptr.asFunction<_dart_clang_Type_getSizeOf>(); + late final _clang_Type_getSizeOf = + _clang_Type_getSizeOf_ptr.asFunction(); /// Return the offset of a field named S in a record of type T in bits as it /// would be returned by __offsetof__ as per C++11[18.2p4] @@ -3118,11 +3228,12 @@ class LibClang { ); } - late final _clang_Type_getOffsetOf_ptr = - _lookup>( - 'clang_Type_getOffsetOf'); - late final _dart_clang_Type_getOffsetOf _clang_Type_getOffsetOf = - _clang_Type_getOffsetOf_ptr.asFunction<_dart_clang_Type_getOffsetOf>(); + late final _clang_Type_getOffsetOf_ptr = _lookup< + ffi.NativeFunction< + ffi.Int64 Function( + CXType, ffi.Pointer)>>('clang_Type_getOffsetOf'); + late final _clang_Type_getOffsetOf = _clang_Type_getOffsetOf_ptr + .asFunction)>(); /// Return the type that was modified by this attributed type. CXType clang_Type_getModifiedType( @@ -3134,11 +3245,10 @@ class LibClang { } late final _clang_Type_getModifiedType_ptr = - _lookup>( + _lookup>( 'clang_Type_getModifiedType'); - late final _dart_clang_Type_getModifiedType _clang_Type_getModifiedType = - _clang_Type_getModifiedType_ptr - .asFunction<_dart_clang_Type_getModifiedType>(); + late final _clang_Type_getModifiedType = + _clang_Type_getModifiedType_ptr.asFunction(); /// Return the offset of the field represented by the Cursor. int clang_Cursor_getOffsetOfField( @@ -3150,11 +3260,10 @@ class LibClang { } late final _clang_Cursor_getOffsetOfField_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getOffsetOfField'); - late final _dart_clang_Cursor_getOffsetOfField - _clang_Cursor_getOffsetOfField = _clang_Cursor_getOffsetOfField_ptr - .asFunction<_dart_clang_Cursor_getOffsetOfField>(); + late final _clang_Cursor_getOffsetOfField = + _clang_Cursor_getOffsetOfField_ptr.asFunction(); /// Determine whether the given cursor represents an anonymous tag or /// namespace @@ -3167,11 +3276,10 @@ class LibClang { } late final _clang_Cursor_isAnonymous_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymous'); - late final _dart_clang_Cursor_isAnonymous _clang_Cursor_isAnonymous = - _clang_Cursor_isAnonymous_ptr - .asFunction<_dart_clang_Cursor_isAnonymous>(); + late final _clang_Cursor_isAnonymous = + _clang_Cursor_isAnonymous_ptr.asFunction(); /// Determine whether the given cursor represents an anonymous record /// declaration. @@ -3184,12 +3292,11 @@ class LibClang { } late final _clang_Cursor_isAnonymousRecordDecl_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isAnonymousRecordDecl'); - late final _dart_clang_Cursor_isAnonymousRecordDecl - _clang_Cursor_isAnonymousRecordDecl = + late final _clang_Cursor_isAnonymousRecordDecl = _clang_Cursor_isAnonymousRecordDecl_ptr - .asFunction<_dart_clang_Cursor_isAnonymousRecordDecl>(); + .asFunction(); /// Determine whether the given cursor represents an inline namespace /// declaration. @@ -3202,11 +3309,10 @@ class LibClang { } late final _clang_Cursor_isInlineNamespace_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isInlineNamespace'); - late final _dart_clang_Cursor_isInlineNamespace - _clang_Cursor_isInlineNamespace = _clang_Cursor_isInlineNamespace_ptr - .asFunction<_dart_clang_Cursor_isInlineNamespace>(); + late final _clang_Cursor_isInlineNamespace = + _clang_Cursor_isInlineNamespace_ptr.asFunction(); /// Returns the number of template arguments for given template /// specialization, or -1 if type T is not a template specialization. @@ -3219,12 +3325,11 @@ class LibClang { } late final _clang_Type_getNumTemplateArguments_ptr = - _lookup>( + _lookup>( 'clang_Type_getNumTemplateArguments'); - late final _dart_clang_Type_getNumTemplateArguments - _clang_Type_getNumTemplateArguments = + late final _clang_Type_getNumTemplateArguments = _clang_Type_getNumTemplateArguments_ptr - .asFunction<_dart_clang_Type_getNumTemplateArguments>(); + .asFunction(); /// Returns the type template argument of a template class specialization at /// given index. @@ -3239,12 +3344,11 @@ class LibClang { } late final _clang_Type_getTemplateArgumentAsType_ptr = - _lookup>( + _lookup>( 'clang_Type_getTemplateArgumentAsType'); - late final _dart_clang_Type_getTemplateArgumentAsType - _clang_Type_getTemplateArgumentAsType = + late final _clang_Type_getTemplateArgumentAsType = _clang_Type_getTemplateArgumentAsType_ptr - .asFunction<_dart_clang_Type_getTemplateArgumentAsType>(); + .asFunction(); /// Retrieve the ref-qualifier kind of a function or method. int clang_Type_getCXXRefQualifier( @@ -3256,11 +3360,10 @@ class LibClang { } late final _clang_Type_getCXXRefQualifier_ptr = - _lookup>( + _lookup>( 'clang_Type_getCXXRefQualifier'); - late final _dart_clang_Type_getCXXRefQualifier - _clang_Type_getCXXRefQualifier = _clang_Type_getCXXRefQualifier_ptr - .asFunction<_dart_clang_Type_getCXXRefQualifier>(); + late final _clang_Type_getCXXRefQualifier = + _clang_Type_getCXXRefQualifier_ptr.asFunction(); /// Returns non-zero if the cursor specifies a Record member that is a /// bitfield. @@ -3273,10 +3376,10 @@ class LibClang { } late final _clang_Cursor_isBitField_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isBitField'); - late final _dart_clang_Cursor_isBitField _clang_Cursor_isBitField = - _clang_Cursor_isBitField_ptr.asFunction<_dart_clang_Cursor_isBitField>(); + late final _clang_Cursor_isBitField = + _clang_Cursor_isBitField_ptr.asFunction(); /// Returns 1 if the base class specified by the cursor with kind /// CX_CXXBaseSpecifier is virtual. @@ -3289,10 +3392,10 @@ class LibClang { } late final _clang_isVirtualBase_ptr = - _lookup>( + _lookup>( 'clang_isVirtualBase'); - late final _dart_clang_isVirtualBase _clang_isVirtualBase = - _clang_isVirtualBase_ptr.asFunction<_dart_clang_isVirtualBase>(); + late final _clang_isVirtualBase = + _clang_isVirtualBase_ptr.asFunction(); /// Returns the access control level for the referenced object. int clang_getCXXAccessSpecifier( @@ -3304,11 +3407,10 @@ class LibClang { } late final _clang_getCXXAccessSpecifier_ptr = - _lookup>( + _lookup>( 'clang_getCXXAccessSpecifier'); - late final _dart_clang_getCXXAccessSpecifier _clang_getCXXAccessSpecifier = - _clang_getCXXAccessSpecifier_ptr - .asFunction<_dart_clang_getCXXAccessSpecifier>(); + late final _clang_getCXXAccessSpecifier = + _clang_getCXXAccessSpecifier_ptr.asFunction(); /// Returns the storage class for a function or variable declaration. int clang_Cursor_getStorageClass( @@ -3320,11 +3422,10 @@ class LibClang { } late final _clang_Cursor_getStorageClass_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getStorageClass'); - late final _dart_clang_Cursor_getStorageClass _clang_Cursor_getStorageClass = - _clang_Cursor_getStorageClass_ptr - .asFunction<_dart_clang_Cursor_getStorageClass>(); + late final _clang_Cursor_getStorageClass = + _clang_Cursor_getStorageClass_ptr.asFunction(); /// Determine the number of overloaded declarations referenced by a /// CXCursor_OverloadedDeclRef cursor. @@ -3337,11 +3438,10 @@ class LibClang { } late final _clang_getNumOverloadedDecls_ptr = - _lookup>( + _lookup>( 'clang_getNumOverloadedDecls'); - late final _dart_clang_getNumOverloadedDecls _clang_getNumOverloadedDecls = - _clang_getNumOverloadedDecls_ptr - .asFunction<_dart_clang_getNumOverloadedDecls>(); + late final _clang_getNumOverloadedDecls = + _clang_getNumOverloadedDecls_ptr.asFunction(); /// Retrieve a cursor for one of the overloaded declarations referenced by a /// CXCursor_OverloadedDeclRef cursor. @@ -3356,10 +3456,10 @@ class LibClang { } late final _clang_getOverloadedDecl_ptr = - _lookup>( + _lookup>( 'clang_getOverloadedDecl'); - late final _dart_clang_getOverloadedDecl _clang_getOverloadedDecl = - _clang_getOverloadedDecl_ptr.asFunction<_dart_clang_getOverloadedDecl>(); + late final _clang_getOverloadedDecl = _clang_getOverloadedDecl_ptr + .asFunction(); /// For cursors representing an iboutletcollection attribute, this function /// returns the collection element type. @@ -3372,17 +3472,17 @@ class LibClang { } late final _clang_getIBOutletCollectionType_ptr = - _lookup>( + _lookup>( 'clang_getIBOutletCollectionType'); - late final _dart_clang_getIBOutletCollectionType - _clang_getIBOutletCollectionType = _clang_getIBOutletCollectionType_ptr - .asFunction<_dart_clang_getIBOutletCollectionType>(); + late final _clang_getIBOutletCollectionType = + _clang_getIBOutletCollectionType_ptr + .asFunction(); /// Visit the children of a particular cursor. int clang_visitChildren( CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, + CXCursorVisitor visitor, + CXClientData client_data, ) { return _clang_visitChildren( parent, @@ -3391,11 +3491,12 @@ class LibClang { ); } - late final _clang_visitChildren_ptr = - _lookup>( - 'clang_visitChildren'); - late final _dart_clang_visitChildren _clang_visitChildren = - _clang_visitChildren_ptr.asFunction<_dart_clang_visitChildren>(); + late final _clang_visitChildren_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function( + CXCursor, CXCursorVisitor, CXClientData)>>('clang_visitChildren'); + late final _clang_visitChildren = _clang_visitChildren_ptr + .asFunction(); /// Retrieve a Unified Symbol Resolution (USR) for the entity referenced by /// the given cursor. @@ -3408,9 +3509,10 @@ class LibClang { } late final _clang_getCursorUSR_ptr = - _lookup>('clang_getCursorUSR'); - late final _dart_clang_getCursorUSR _clang_getCursorUSR = - _clang_getCursorUSR_ptr.asFunction<_dart_clang_getCursorUSR>(); + _lookup>( + 'clang_getCursorUSR'); + late final _clang_getCursorUSR = + _clang_getCursorUSR_ptr.asFunction(); /// Construct a USR for a specified Objective-C class. CXString clang_constructUSR_ObjCClass( @@ -3422,11 +3524,10 @@ class LibClang { } late final _clang_constructUSR_ObjCClass_ptr = - _lookup>( + _lookup)>>( 'clang_constructUSR_ObjCClass'); - late final _dart_clang_constructUSR_ObjCClass _clang_constructUSR_ObjCClass = - _clang_constructUSR_ObjCClass_ptr - .asFunction<_dart_clang_constructUSR_ObjCClass>(); + late final _clang_constructUSR_ObjCClass = _clang_constructUSR_ObjCClass_ptr + .asFunction)>(); /// Construct a USR for a specified Objective-C category. CXString clang_constructUSR_ObjCCategory( @@ -3439,12 +3540,13 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCCategory_ptr = - _lookup>( - 'clang_constructUSR_ObjCCategory'); - late final _dart_clang_constructUSR_ObjCCategory - _clang_constructUSR_ObjCCategory = _clang_constructUSR_ObjCCategory_ptr - .asFunction<_dart_clang_constructUSR_ObjCCategory>(); + late final _clang_constructUSR_ObjCCategory_ptr = _lookup< + ffi.NativeFunction< + CXString Function(ffi.Pointer, + ffi.Pointer)>>('clang_constructUSR_ObjCCategory'); + late final _clang_constructUSR_ObjCCategory = + _clang_constructUSR_ObjCCategory_ptr.asFunction< + CXString Function(ffi.Pointer, ffi.Pointer)>(); /// Construct a USR for a specified Objective-C protocol. CXString clang_constructUSR_ObjCProtocol( @@ -3456,11 +3558,11 @@ class LibClang { } late final _clang_constructUSR_ObjCProtocol_ptr = - _lookup>( + _lookup)>>( 'clang_constructUSR_ObjCProtocol'); - late final _dart_clang_constructUSR_ObjCProtocol - _clang_constructUSR_ObjCProtocol = _clang_constructUSR_ObjCProtocol_ptr - .asFunction<_dart_clang_constructUSR_ObjCProtocol>(); + late final _clang_constructUSR_ObjCProtocol = + _clang_constructUSR_ObjCProtocol_ptr + .asFunction)>(); /// Construct a USR for a specified Objective-C instance variable and the USR /// for its containing class. @@ -3474,12 +3576,12 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCIvar_ptr = - _lookup>( - 'clang_constructUSR_ObjCIvar'); - late final _dart_clang_constructUSR_ObjCIvar _clang_constructUSR_ObjCIvar = - _clang_constructUSR_ObjCIvar_ptr - .asFunction<_dart_clang_constructUSR_ObjCIvar>(); + late final _clang_constructUSR_ObjCIvar_ptr = _lookup< + ffi.NativeFunction< + CXString Function( + ffi.Pointer, CXString)>>('clang_constructUSR_ObjCIvar'); + late final _clang_constructUSR_ObjCIvar = _clang_constructUSR_ObjCIvar_ptr + .asFunction, CXString)>(); /// Construct a USR for a specified Objective-C method and the USR for its /// containing class. @@ -3495,12 +3597,12 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCMethod_ptr = - _lookup>( - 'clang_constructUSR_ObjCMethod'); - late final _dart_clang_constructUSR_ObjCMethod - _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethod_ptr - .asFunction<_dart_clang_constructUSR_ObjCMethod>(); + late final _clang_constructUSR_ObjCMethod_ptr = _lookup< + ffi.NativeFunction< + CXString Function(ffi.Pointer, ffi.Uint32, + CXString)>>('clang_constructUSR_ObjCMethod'); + late final _clang_constructUSR_ObjCMethod = _clang_constructUSR_ObjCMethod_ptr + .asFunction, int, CXString)>(); /// Construct a USR for a specified Objective-C property and the USR for its /// containing class. @@ -3514,12 +3616,13 @@ class LibClang { ); } - late final _clang_constructUSR_ObjCProperty_ptr = - _lookup>( - 'clang_constructUSR_ObjCProperty'); - late final _dart_clang_constructUSR_ObjCProperty - _clang_constructUSR_ObjCProperty = _clang_constructUSR_ObjCProperty_ptr - .asFunction<_dart_clang_constructUSR_ObjCProperty>(); + late final _clang_constructUSR_ObjCProperty_ptr = _lookup< + ffi.NativeFunction< + CXString Function(ffi.Pointer, + CXString)>>('clang_constructUSR_ObjCProperty'); + late final _clang_constructUSR_ObjCProperty = + _clang_constructUSR_ObjCProperty_ptr + .asFunction, CXString)>(); /// Retrieve a name for the entity referenced by this cursor. CXString clang_getCursorSpelling( @@ -3531,10 +3634,10 @@ class LibClang { } late final _clang_getCursorSpelling_ptr = - _lookup>( + _lookup>( 'clang_getCursorSpelling'); - late final _dart_clang_getCursorSpelling _clang_getCursorSpelling = - _clang_getCursorSpelling_ptr.asFunction<_dart_clang_getCursorSpelling>(); + late final _clang_getCursorSpelling = + _clang_getCursorSpelling_ptr.asFunction(); /// Retrieve a range for a piece that forms the cursors spelling name. Most of /// the times there is only one range for the complete spelling but for @@ -3552,17 +3655,17 @@ class LibClang { ); } - late final _clang_Cursor_getSpellingNameRange_ptr = - _lookup>( - 'clang_Cursor_getSpellingNameRange'); - late final _dart_clang_Cursor_getSpellingNameRange - _clang_Cursor_getSpellingNameRange = + late final _clang_Cursor_getSpellingNameRange_ptr = _lookup< + ffi.NativeFunction< + CXSourceRange Function(CXCursor, ffi.Uint32, + ffi.Uint32)>>('clang_Cursor_getSpellingNameRange'); + late final _clang_Cursor_getSpellingNameRange = _clang_Cursor_getSpellingNameRange_ptr - .asFunction<_dart_clang_Cursor_getSpellingNameRange>(); + .asFunction(); /// Get a property value for the given printing policy. int clang_PrintingPolicy_getProperty( - ffi.Pointer Policy, + CXPrintingPolicy Policy, int Property, ) { return _clang_PrintingPolicy_getProperty( @@ -3571,16 +3674,16 @@ class LibClang { ); } - late final _clang_PrintingPolicy_getProperty_ptr = - _lookup>( - 'clang_PrintingPolicy_getProperty'); - late final _dart_clang_PrintingPolicy_getProperty - _clang_PrintingPolicy_getProperty = _clang_PrintingPolicy_getProperty_ptr - .asFunction<_dart_clang_PrintingPolicy_getProperty>(); + late final _clang_PrintingPolicy_getProperty_ptr = _lookup< + ffi.NativeFunction>( + 'clang_PrintingPolicy_getProperty'); + late final _clang_PrintingPolicy_getProperty = + _clang_PrintingPolicy_getProperty_ptr + .asFunction(); /// Set a property value for the given printing policy. void clang_PrintingPolicy_setProperty( - ffi.Pointer Policy, + CXPrintingPolicy Policy, int Property, int Value, ) { @@ -3591,15 +3694,16 @@ class LibClang { ); } - late final _clang_PrintingPolicy_setProperty_ptr = - _lookup>( - 'clang_PrintingPolicy_setProperty'); - late final _dart_clang_PrintingPolicy_setProperty - _clang_PrintingPolicy_setProperty = _clang_PrintingPolicy_setProperty_ptr - .asFunction<_dart_clang_PrintingPolicy_setProperty>(); + late final _clang_PrintingPolicy_setProperty_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CXPrintingPolicy, ffi.Int32, + ffi.Uint32)>>('clang_PrintingPolicy_setProperty'); + late final _clang_PrintingPolicy_setProperty = + _clang_PrintingPolicy_setProperty_ptr + .asFunction(); /// Retrieve the default policy for the cursor. - ffi.Pointer clang_getCursorPrintingPolicy( + CXPrintingPolicy clang_getCursorPrintingPolicy( CXCursor arg0, ) { return _clang_getCursorPrintingPolicy( @@ -3608,15 +3712,14 @@ class LibClang { } late final _clang_getCursorPrintingPolicy_ptr = - _lookup>( + _lookup>( 'clang_getCursorPrintingPolicy'); - late final _dart_clang_getCursorPrintingPolicy - _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicy_ptr - .asFunction<_dart_clang_getCursorPrintingPolicy>(); + late final _clang_getCursorPrintingPolicy = _clang_getCursorPrintingPolicy_ptr + .asFunction(); /// Release a printing policy. void clang_PrintingPolicy_dispose( - ffi.Pointer Policy, + CXPrintingPolicy Policy, ) { return _clang_PrintingPolicy_dispose( Policy, @@ -3624,16 +3727,15 @@ class LibClang { } late final _clang_PrintingPolicy_dispose_ptr = - _lookup>( + _lookup>( 'clang_PrintingPolicy_dispose'); - late final _dart_clang_PrintingPolicy_dispose _clang_PrintingPolicy_dispose = - _clang_PrintingPolicy_dispose_ptr - .asFunction<_dart_clang_PrintingPolicy_dispose>(); + late final _clang_PrintingPolicy_dispose = _clang_PrintingPolicy_dispose_ptr + .asFunction(); /// Pretty print declarations. CXString clang_getCursorPrettyPrinted( CXCursor Cursor, - ffi.Pointer Policy, + CXPrintingPolicy Policy, ) { return _clang_getCursorPrettyPrinted( Cursor, @@ -3641,12 +3743,11 @@ class LibClang { ); } - late final _clang_getCursorPrettyPrinted_ptr = - _lookup>( - 'clang_getCursorPrettyPrinted'); - late final _dart_clang_getCursorPrettyPrinted _clang_getCursorPrettyPrinted = - _clang_getCursorPrettyPrinted_ptr - .asFunction<_dart_clang_getCursorPrettyPrinted>(); + late final _clang_getCursorPrettyPrinted_ptr = _lookup< + ffi.NativeFunction>( + 'clang_getCursorPrettyPrinted'); + late final _clang_getCursorPrettyPrinted = _clang_getCursorPrettyPrinted_ptr + .asFunction(); /// Retrieve the display name for the entity referenced by this cursor. CXString clang_getCursorDisplayName( @@ -3658,11 +3759,10 @@ class LibClang { } late final _clang_getCursorDisplayName_ptr = - _lookup>( + _lookup>( 'clang_getCursorDisplayName'); - late final _dart_clang_getCursorDisplayName _clang_getCursorDisplayName = - _clang_getCursorDisplayName_ptr - .asFunction<_dart_clang_getCursorDisplayName>(); + late final _clang_getCursorDisplayName = + _clang_getCursorDisplayName_ptr.asFunction(); /// For a cursor that is a reference, retrieve a cursor representing the /// entity that it references. @@ -3675,11 +3775,10 @@ class LibClang { } late final _clang_getCursorReferenced_ptr = - _lookup>( + _lookup>( 'clang_getCursorReferenced'); - late final _dart_clang_getCursorReferenced _clang_getCursorReferenced = - _clang_getCursorReferenced_ptr - .asFunction<_dart_clang_getCursorReferenced>(); + late final _clang_getCursorReferenced = + _clang_getCursorReferenced_ptr.asFunction(); /// For a cursor that is either a reference to or a declaration of some /// entity, retrieve a cursor that describes the definition of that entity. @@ -3692,11 +3791,10 @@ class LibClang { } late final _clang_getCursorDefinition_ptr = - _lookup>( + _lookup>( 'clang_getCursorDefinition'); - late final _dart_clang_getCursorDefinition _clang_getCursorDefinition = - _clang_getCursorDefinition_ptr - .asFunction<_dart_clang_getCursorDefinition>(); + late final _clang_getCursorDefinition = + _clang_getCursorDefinition_ptr.asFunction(); /// Determine whether the declaration pointed to by this cursor is also a /// definition of that entity. @@ -3709,11 +3807,10 @@ class LibClang { } late final _clang_isCursorDefinition_ptr = - _lookup>( + _lookup>( 'clang_isCursorDefinition'); - late final _dart_clang_isCursorDefinition _clang_isCursorDefinition = - _clang_isCursorDefinition_ptr - .asFunction<_dart_clang_isCursorDefinition>(); + late final _clang_isCursorDefinition = + _clang_isCursorDefinition_ptr.asFunction(); /// Retrieve the canonical cursor corresponding to the given cursor. CXCursor clang_getCanonicalCursor( @@ -3725,11 +3822,10 @@ class LibClang { } late final _clang_getCanonicalCursor_ptr = - _lookup>( + _lookup>( 'clang_getCanonicalCursor'); - late final _dart_clang_getCanonicalCursor _clang_getCanonicalCursor = - _clang_getCanonicalCursor_ptr - .asFunction<_dart_clang_getCanonicalCursor>(); + late final _clang_getCanonicalCursor = + _clang_getCanonicalCursor_ptr.asFunction(); /// If the cursor points to a selector identifier in an Objective-C method or /// message expression, this returns the selector index. @@ -3742,12 +3838,11 @@ class LibClang { } late final _clang_Cursor_getObjCSelectorIndex_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCSelectorIndex'); - late final _dart_clang_Cursor_getObjCSelectorIndex - _clang_Cursor_getObjCSelectorIndex = + late final _clang_Cursor_getObjCSelectorIndex = _clang_Cursor_getObjCSelectorIndex_ptr - .asFunction<_dart_clang_Cursor_getObjCSelectorIndex>(); + .asFunction(); /// Given a cursor pointing to a C++ method call or an Objective-C message, /// returns non-zero if the method/message is "dynamic", meaning: @@ -3760,11 +3855,10 @@ class LibClang { } late final _clang_Cursor_isDynamicCall_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isDynamicCall'); - late final _dart_clang_Cursor_isDynamicCall _clang_Cursor_isDynamicCall = - _clang_Cursor_isDynamicCall_ptr - .asFunction<_dart_clang_Cursor_isDynamicCall>(); + late final _clang_Cursor_isDynamicCall = + _clang_Cursor_isDynamicCall_ptr.asFunction(); /// Given a cursor pointing to an Objective-C message or property reference, /// or C++ method call, returns the CXType of the receiver. @@ -3777,11 +3871,10 @@ class LibClang { } late final _clang_Cursor_getReceiverType_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getReceiverType'); - late final _dart_clang_Cursor_getReceiverType _clang_Cursor_getReceiverType = - _clang_Cursor_getReceiverType_ptr - .asFunction<_dart_clang_Cursor_getReceiverType>(); + late final _clang_Cursor_getReceiverType = + _clang_Cursor_getReceiverType_ptr.asFunction(); /// Given a cursor that represents a property declaration, return the /// associated property attributes. The bits are formed from @@ -3797,12 +3890,11 @@ class LibClang { } late final _clang_Cursor_getObjCPropertyAttributes_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCPropertyAttributes'); - late final _dart_clang_Cursor_getObjCPropertyAttributes - _clang_Cursor_getObjCPropertyAttributes = + late final _clang_Cursor_getObjCPropertyAttributes = _clang_Cursor_getObjCPropertyAttributes_ptr - .asFunction<_dart_clang_Cursor_getObjCPropertyAttributes>(); + .asFunction(); /// Given a cursor that represents a property declaration, return the name of /// the method that implements the getter. @@ -3815,12 +3907,11 @@ class LibClang { } late final _clang_Cursor_getObjCPropertyGetterName_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCPropertyGetterName'); - late final _dart_clang_Cursor_getObjCPropertyGetterName - _clang_Cursor_getObjCPropertyGetterName = + late final _clang_Cursor_getObjCPropertyGetterName = _clang_Cursor_getObjCPropertyGetterName_ptr - .asFunction<_dart_clang_Cursor_getObjCPropertyGetterName>(); + .asFunction(); /// Given a cursor that represents a property declaration, return the name of /// the method that implements the setter, if any. @@ -3833,12 +3924,11 @@ class LibClang { } late final _clang_Cursor_getObjCPropertySetterName_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCPropertySetterName'); - late final _dart_clang_Cursor_getObjCPropertySetterName - _clang_Cursor_getObjCPropertySetterName = + late final _clang_Cursor_getObjCPropertySetterName = _clang_Cursor_getObjCPropertySetterName_ptr - .asFunction<_dart_clang_Cursor_getObjCPropertySetterName>(); + .asFunction(); /// Given a cursor that represents an Objective-C method or parameter /// declaration, return the associated Objective-C qualifiers for the return @@ -3853,12 +3943,11 @@ class LibClang { } late final _clang_Cursor_getObjCDeclQualifiers_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getObjCDeclQualifiers'); - late final _dart_clang_Cursor_getObjCDeclQualifiers - _clang_Cursor_getObjCDeclQualifiers = + late final _clang_Cursor_getObjCDeclQualifiers = _clang_Cursor_getObjCDeclQualifiers_ptr - .asFunction<_dart_clang_Cursor_getObjCDeclQualifiers>(); + .asFunction(); /// Given a cursor that represents an Objective-C method or property /// declaration, return non-zero if the declaration was affected by @@ -3873,11 +3962,10 @@ class LibClang { } late final _clang_Cursor_isObjCOptional_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isObjCOptional'); - late final _dart_clang_Cursor_isObjCOptional _clang_Cursor_isObjCOptional = - _clang_Cursor_isObjCOptional_ptr - .asFunction<_dart_clang_Cursor_isObjCOptional>(); + late final _clang_Cursor_isObjCOptional = + _clang_Cursor_isObjCOptional_ptr.asFunction(); /// Returns non-zero if the given cursor is a variadic function or method. int clang_Cursor_isVariadic( @@ -3889,10 +3977,10 @@ class LibClang { } late final _clang_Cursor_isVariadic_ptr = - _lookup>( + _lookup>( 'clang_Cursor_isVariadic'); - late final _dart_clang_Cursor_isVariadic _clang_Cursor_isVariadic = - _clang_Cursor_isVariadic_ptr.asFunction<_dart_clang_Cursor_isVariadic>(); + late final _clang_Cursor_isVariadic = + _clang_Cursor_isVariadic_ptr.asFunction(); /// Returns non-zero if the given cursor points to a symbol marked with /// external_source_symbol attribute. @@ -3910,12 +3998,17 @@ class LibClang { ); } - late final _clang_Cursor_isExternalSymbol_ptr = - _lookup>( - 'clang_Cursor_isExternalSymbol'); - late final _dart_clang_Cursor_isExternalSymbol - _clang_Cursor_isExternalSymbol = _clang_Cursor_isExternalSymbol_ptr - .asFunction<_dart_clang_Cursor_isExternalSymbol>(); + late final _clang_Cursor_isExternalSymbol_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function( + CXCursor, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_Cursor_isExternalSymbol'); + late final _clang_Cursor_isExternalSymbol = + _clang_Cursor_isExternalSymbol_ptr.asFunction< + int Function(CXCursor, ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Given a cursor that represents a declaration, return the associated /// comment's source range. The range may include multiple consecutive @@ -3929,11 +4022,10 @@ class LibClang { } late final _clang_Cursor_getCommentRange_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getCommentRange'); - late final _dart_clang_Cursor_getCommentRange _clang_Cursor_getCommentRange = - _clang_Cursor_getCommentRange_ptr - .asFunction<_dart_clang_Cursor_getCommentRange>(); + late final _clang_Cursor_getCommentRange = _clang_Cursor_getCommentRange_ptr + .asFunction(); /// Given a cursor that represents a declaration, return the associated /// comment text, including comment markers. @@ -3946,11 +4038,11 @@ class LibClang { } late final _clang_Cursor_getRawCommentText_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getRawCommentText'); - late final _dart_clang_Cursor_getRawCommentText - _clang_Cursor_getRawCommentText = _clang_Cursor_getRawCommentText_ptr - .asFunction<_dart_clang_Cursor_getRawCommentText>(); + late final _clang_Cursor_getRawCommentText = + _clang_Cursor_getRawCommentText_ptr + .asFunction(); /// Given a cursor that represents a documentable entity (e.g., declaration), /// return the associated first paragraph. @@ -3963,11 +4055,11 @@ class LibClang { } late final _clang_Cursor_getBriefCommentText_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getBriefCommentText'); - late final _dart_clang_Cursor_getBriefCommentText - _clang_Cursor_getBriefCommentText = _clang_Cursor_getBriefCommentText_ptr - .asFunction<_dart_clang_Cursor_getBriefCommentText>(); + late final _clang_Cursor_getBriefCommentText = + _clang_Cursor_getBriefCommentText_ptr + .asFunction(); /// Retrieve the CXString representing the mangled name of the cursor. CXString clang_Cursor_getMangling( @@ -3979,11 +4071,10 @@ class LibClang { } late final _clang_Cursor_getMangling_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getMangling'); - late final _dart_clang_Cursor_getMangling _clang_Cursor_getMangling = - _clang_Cursor_getMangling_ptr - .asFunction<_dart_clang_Cursor_getMangling>(); + late final _clang_Cursor_getMangling = + _clang_Cursor_getMangling_ptr.asFunction(); /// Retrieve the CXStrings representing the mangled symbols of the C++ /// constructor or destructor at the cursor. @@ -3996,11 +4087,10 @@ class LibClang { } late final _clang_Cursor_getCXXManglings_ptr = - _lookup>( + _lookup Function(CXCursor)>>( 'clang_Cursor_getCXXManglings'); - late final _dart_clang_Cursor_getCXXManglings _clang_Cursor_getCXXManglings = - _clang_Cursor_getCXXManglings_ptr - .asFunction<_dart_clang_Cursor_getCXXManglings>(); + late final _clang_Cursor_getCXXManglings = _clang_Cursor_getCXXManglings_ptr + .asFunction Function(CXCursor)>(); /// Retrieve the CXStrings representing the mangled symbols of the ObjC class /// interface or implementation at the cursor. @@ -4013,14 +4103,13 @@ class LibClang { } late final _clang_Cursor_getObjCManglings_ptr = - _lookup>( + _lookup Function(CXCursor)>>( 'clang_Cursor_getObjCManglings'); - late final _dart_clang_Cursor_getObjCManglings - _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglings_ptr - .asFunction<_dart_clang_Cursor_getObjCManglings>(); + late final _clang_Cursor_getObjCManglings = _clang_Cursor_getObjCManglings_ptr + .asFunction Function(CXCursor)>(); /// Given a CXCursor_ModuleImportDecl cursor, return the associated module. - ffi.Pointer clang_Cursor_getModule( + CXModule clang_Cursor_getModule( CXCursor C, ) { return _clang_Cursor_getModule( @@ -4029,16 +4118,16 @@ class LibClang { } late final _clang_Cursor_getModule_ptr = - _lookup>( + _lookup>( 'clang_Cursor_getModule'); - late final _dart_clang_Cursor_getModule _clang_Cursor_getModule = - _clang_Cursor_getModule_ptr.asFunction<_dart_clang_Cursor_getModule>(); + late final _clang_Cursor_getModule = + _clang_Cursor_getModule_ptr.asFunction(); /// Given a CXFile header file, return the module that contains it, if one /// exists. - ffi.Pointer clang_getModuleForFile( - ffi.Pointer arg0, - ffi.Pointer arg1, + CXModule clang_getModuleForFile( + CXTranslationUnit arg0, + CXFile arg1, ) { return _clang_getModuleForFile( arg0, @@ -4047,14 +4136,14 @@ class LibClang { } late final _clang_getModuleForFile_ptr = - _lookup>( + _lookup>( 'clang_getModuleForFile'); - late final _dart_clang_getModuleForFile _clang_getModuleForFile = - _clang_getModuleForFile_ptr.asFunction<_dart_clang_getModuleForFile>(); + late final _clang_getModuleForFile = _clang_getModuleForFile_ptr + .asFunction(); /// Returns the module file where the provided module object came from. - ffi.Pointer clang_Module_getASTFile( - ffi.Pointer Module, + CXFile clang_Module_getASTFile( + CXModule Module, ) { return _clang_Module_getASTFile( Module, @@ -4062,15 +4151,15 @@ class LibClang { } late final _clang_Module_getASTFile_ptr = - _lookup>( + _lookup>( 'clang_Module_getASTFile'); - late final _dart_clang_Module_getASTFile _clang_Module_getASTFile = - _clang_Module_getASTFile_ptr.asFunction<_dart_clang_Module_getASTFile>(); + late final _clang_Module_getASTFile = + _clang_Module_getASTFile_ptr.asFunction(); /// Returns the parent of a sub-module or NULL if the given module is /// top-level, e.g. for 'std.vector' it will return the 'std' module. - ffi.Pointer clang_Module_getParent( - ffi.Pointer Module, + CXModule clang_Module_getParent( + CXModule Module, ) { return _clang_Module_getParent( Module, @@ -4078,15 +4167,15 @@ class LibClang { } late final _clang_Module_getParent_ptr = - _lookup>( + _lookup>( 'clang_Module_getParent'); - late final _dart_clang_Module_getParent _clang_Module_getParent = - _clang_Module_getParent_ptr.asFunction<_dart_clang_Module_getParent>(); + late final _clang_Module_getParent = + _clang_Module_getParent_ptr.asFunction(); /// Returns the name of the module, e.g. for the 'std.vector' sub-module it /// will return "vector". CXString clang_Module_getName( - ffi.Pointer Module, + CXModule Module, ) { return _clang_Module_getName( Module, @@ -4094,14 +4183,14 @@ class LibClang { } late final _clang_Module_getName_ptr = - _lookup>( + _lookup>( 'clang_Module_getName'); - late final _dart_clang_Module_getName _clang_Module_getName = - _clang_Module_getName_ptr.asFunction<_dart_clang_Module_getName>(); + late final _clang_Module_getName = + _clang_Module_getName_ptr.asFunction(); /// Returns the full name of the module, e.g. "std.vector". CXString clang_Module_getFullName( - ffi.Pointer Module, + CXModule Module, ) { return _clang_Module_getFullName( Module, @@ -4109,15 +4198,14 @@ class LibClang { } late final _clang_Module_getFullName_ptr = - _lookup>( + _lookup>( 'clang_Module_getFullName'); - late final _dart_clang_Module_getFullName _clang_Module_getFullName = - _clang_Module_getFullName_ptr - .asFunction<_dart_clang_Module_getFullName>(); + late final _clang_Module_getFullName = + _clang_Module_getFullName_ptr.asFunction(); /// Returns non-zero if the module is a system one. int clang_Module_isSystem( - ffi.Pointer Module, + CXModule Module, ) { return _clang_Module_isSystem( Module, @@ -4125,15 +4213,15 @@ class LibClang { } late final _clang_Module_isSystem_ptr = - _lookup>( + _lookup>( 'clang_Module_isSystem'); - late final _dart_clang_Module_isSystem _clang_Module_isSystem = - _clang_Module_isSystem_ptr.asFunction<_dart_clang_Module_isSystem>(); + late final _clang_Module_isSystem = + _clang_Module_isSystem_ptr.asFunction(); /// Returns the number of top level headers associated with this module. int clang_Module_getNumTopLevelHeaders( - ffi.Pointer arg0, - ffi.Pointer Module, + CXTranslationUnit arg0, + CXModule Module, ) { return _clang_Module_getNumTopLevelHeaders( arg0, @@ -4141,18 +4229,17 @@ class LibClang { ); } - late final _clang_Module_getNumTopLevelHeaders_ptr = - _lookup>( - 'clang_Module_getNumTopLevelHeaders'); - late final _dart_clang_Module_getNumTopLevelHeaders - _clang_Module_getNumTopLevelHeaders = + late final _clang_Module_getNumTopLevelHeaders_ptr = _lookup< + ffi.NativeFunction>( + 'clang_Module_getNumTopLevelHeaders'); + late final _clang_Module_getNumTopLevelHeaders = _clang_Module_getNumTopLevelHeaders_ptr - .asFunction<_dart_clang_Module_getNumTopLevelHeaders>(); + .asFunction(); /// Returns the specified top level header associated with the module. - ffi.Pointer clang_Module_getTopLevelHeader( - ffi.Pointer arg0, - ffi.Pointer Module, + CXFile clang_Module_getTopLevelHeader( + CXTranslationUnit arg0, + CXModule Module, int Index, ) { return _clang_Module_getTopLevelHeader( @@ -4162,12 +4249,13 @@ class LibClang { ); } - late final _clang_Module_getTopLevelHeader_ptr = - _lookup>( - 'clang_Module_getTopLevelHeader'); - late final _dart_clang_Module_getTopLevelHeader - _clang_Module_getTopLevelHeader = _clang_Module_getTopLevelHeader_ptr - .asFunction<_dart_clang_Module_getTopLevelHeader>(); + late final _clang_Module_getTopLevelHeader_ptr = _lookup< + ffi.NativeFunction< + CXFile Function(CXTranslationUnit, CXModule, + ffi.Uint32)>>('clang_Module_getTopLevelHeader'); + late final _clang_Module_getTopLevelHeader = + _clang_Module_getTopLevelHeader_ptr + .asFunction(); /// Determine if a C++ constructor is a converting constructor. int clang_CXXConstructor_isConvertingConstructor( @@ -4178,13 +4266,12 @@ class LibClang { ); } - late final _clang_CXXConstructor_isConvertingConstructor_ptr = _lookup< - ffi.NativeFunction<_c_clang_CXXConstructor_isConvertingConstructor>>( - 'clang_CXXConstructor_isConvertingConstructor'); - late final _dart_clang_CXXConstructor_isConvertingConstructor - _clang_CXXConstructor_isConvertingConstructor = + late final _clang_CXXConstructor_isConvertingConstructor_ptr = + _lookup>( + 'clang_CXXConstructor_isConvertingConstructor'); + late final _clang_CXXConstructor_isConvertingConstructor = _clang_CXXConstructor_isConvertingConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isConvertingConstructor>(); + .asFunction(); /// Determine if a C++ constructor is a copy constructor. int clang_CXXConstructor_isCopyConstructor( @@ -4196,12 +4283,11 @@ class LibClang { } late final _clang_CXXConstructor_isCopyConstructor_ptr = - _lookup>( + _lookup>( 'clang_CXXConstructor_isCopyConstructor'); - late final _dart_clang_CXXConstructor_isCopyConstructor - _clang_CXXConstructor_isCopyConstructor = + late final _clang_CXXConstructor_isCopyConstructor = _clang_CXXConstructor_isCopyConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isCopyConstructor>(); + .asFunction(); /// Determine if a C++ constructor is the default constructor. int clang_CXXConstructor_isDefaultConstructor( @@ -4213,12 +4299,11 @@ class LibClang { } late final _clang_CXXConstructor_isDefaultConstructor_ptr = - _lookup>( + _lookup>( 'clang_CXXConstructor_isDefaultConstructor'); - late final _dart_clang_CXXConstructor_isDefaultConstructor - _clang_CXXConstructor_isDefaultConstructor = + late final _clang_CXXConstructor_isDefaultConstructor = _clang_CXXConstructor_isDefaultConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isDefaultConstructor>(); + .asFunction(); /// Determine if a C++ constructor is a move constructor. int clang_CXXConstructor_isMoveConstructor( @@ -4230,12 +4315,11 @@ class LibClang { } late final _clang_CXXConstructor_isMoveConstructor_ptr = - _lookup>( + _lookup>( 'clang_CXXConstructor_isMoveConstructor'); - late final _dart_clang_CXXConstructor_isMoveConstructor - _clang_CXXConstructor_isMoveConstructor = + late final _clang_CXXConstructor_isMoveConstructor = _clang_CXXConstructor_isMoveConstructor_ptr - .asFunction<_dart_clang_CXXConstructor_isMoveConstructor>(); + .asFunction(); /// Determine if a C++ field is declared 'mutable'. int clang_CXXField_isMutable( @@ -4247,11 +4331,10 @@ class LibClang { } late final _clang_CXXField_isMutable_ptr = - _lookup>( + _lookup>( 'clang_CXXField_isMutable'); - late final _dart_clang_CXXField_isMutable _clang_CXXField_isMutable = - _clang_CXXField_isMutable_ptr - .asFunction<_dart_clang_CXXField_isMutable>(); + late final _clang_CXXField_isMutable = + _clang_CXXField_isMutable_ptr.asFunction(); /// Determine if a C++ method is declared '= default'. int clang_CXXMethod_isDefaulted( @@ -4263,11 +4346,10 @@ class LibClang { } late final _clang_CXXMethod_isDefaulted_ptr = - _lookup>( + _lookup>( 'clang_CXXMethod_isDefaulted'); - late final _dart_clang_CXXMethod_isDefaulted _clang_CXXMethod_isDefaulted = - _clang_CXXMethod_isDefaulted_ptr - .asFunction<_dart_clang_CXXMethod_isDefaulted>(); + late final _clang_CXXMethod_isDefaulted = + _clang_CXXMethod_isDefaulted_ptr.asFunction(); /// Determine if a C++ member function or member function template is pure /// virtual. @@ -4280,11 +4362,10 @@ class LibClang { } late final _clang_CXXMethod_isPureVirtual_ptr = - _lookup>( + _lookup>( 'clang_CXXMethod_isPureVirtual'); - late final _dart_clang_CXXMethod_isPureVirtual - _clang_CXXMethod_isPureVirtual = _clang_CXXMethod_isPureVirtual_ptr - .asFunction<_dart_clang_CXXMethod_isPureVirtual>(); + late final _clang_CXXMethod_isPureVirtual = + _clang_CXXMethod_isPureVirtual_ptr.asFunction(); /// Determine if a C++ member function or member function template is declared /// 'static'. @@ -4297,11 +4378,10 @@ class LibClang { } late final _clang_CXXMethod_isStatic_ptr = - _lookup>( + _lookup>( 'clang_CXXMethod_isStatic'); - late final _dart_clang_CXXMethod_isStatic _clang_CXXMethod_isStatic = - _clang_CXXMethod_isStatic_ptr - .asFunction<_dart_clang_CXXMethod_isStatic>(); + late final _clang_CXXMethod_isStatic = + _clang_CXXMethod_isStatic_ptr.asFunction(); /// Determine if a C++ member function or member function template is /// explicitly declared 'virtual' or if it overrides a virtual method from one @@ -4315,11 +4395,10 @@ class LibClang { } late final _clang_CXXMethod_isVirtual_ptr = - _lookup>( + _lookup>( 'clang_CXXMethod_isVirtual'); - late final _dart_clang_CXXMethod_isVirtual _clang_CXXMethod_isVirtual = - _clang_CXXMethod_isVirtual_ptr - .asFunction<_dart_clang_CXXMethod_isVirtual>(); + late final _clang_CXXMethod_isVirtual = + _clang_CXXMethod_isVirtual_ptr.asFunction(); /// Determine if a C++ record is abstract, i.e. whether a class or struct has /// a pure virtual member function. @@ -4332,11 +4411,10 @@ class LibClang { } late final _clang_CXXRecord_isAbstract_ptr = - _lookup>( + _lookup>( 'clang_CXXRecord_isAbstract'); - late final _dart_clang_CXXRecord_isAbstract _clang_CXXRecord_isAbstract = - _clang_CXXRecord_isAbstract_ptr - .asFunction<_dart_clang_CXXRecord_isAbstract>(); + late final _clang_CXXRecord_isAbstract = + _clang_CXXRecord_isAbstract_ptr.asFunction(); /// Determine if an enum declaration refers to a scoped enum. int clang_EnumDecl_isScoped( @@ -4348,10 +4426,10 @@ class LibClang { } late final _clang_EnumDecl_isScoped_ptr = - _lookup>( + _lookup>( 'clang_EnumDecl_isScoped'); - late final _dart_clang_EnumDecl_isScoped _clang_EnumDecl_isScoped = - _clang_EnumDecl_isScoped_ptr.asFunction<_dart_clang_EnumDecl_isScoped>(); + late final _clang_EnumDecl_isScoped = + _clang_EnumDecl_isScoped_ptr.asFunction(); /// Determine if a C++ member function or member function template is declared /// 'const'. @@ -4364,10 +4442,10 @@ class LibClang { } late final _clang_CXXMethod_isConst_ptr = - _lookup>( + _lookup>( 'clang_CXXMethod_isConst'); - late final _dart_clang_CXXMethod_isConst _clang_CXXMethod_isConst = - _clang_CXXMethod_isConst_ptr.asFunction<_dart_clang_CXXMethod_isConst>(); + late final _clang_CXXMethod_isConst = + _clang_CXXMethod_isConst_ptr.asFunction(); /// Given a cursor that represents a template, determine the cursor kind of /// the specializations would be generated by instantiating the template. @@ -4380,11 +4458,10 @@ class LibClang { } late final _clang_getTemplateCursorKind_ptr = - _lookup>( + _lookup>( 'clang_getTemplateCursorKind'); - late final _dart_clang_getTemplateCursorKind _clang_getTemplateCursorKind = - _clang_getTemplateCursorKind_ptr - .asFunction<_dart_clang_getTemplateCursorKind>(); + late final _clang_getTemplateCursorKind = + _clang_getTemplateCursorKind_ptr.asFunction(); /// Given a cursor that may represent a specialization or instantiation of a /// template, retrieve the cursor that represents the template that it @@ -4398,12 +4475,11 @@ class LibClang { } late final _clang_getSpecializedCursorTemplate_ptr = - _lookup>( + _lookup>( 'clang_getSpecializedCursorTemplate'); - late final _dart_clang_getSpecializedCursorTemplate - _clang_getSpecializedCursorTemplate = + late final _clang_getSpecializedCursorTemplate = _clang_getSpecializedCursorTemplate_ptr - .asFunction<_dart_clang_getSpecializedCursorTemplate>(); + .asFunction(); /// Given a cursor that references something else, return the source range /// covering that reference. @@ -4419,17 +4495,17 @@ class LibClang { ); } - late final _clang_getCursorReferenceNameRange_ptr = - _lookup>( - 'clang_getCursorReferenceNameRange'); - late final _dart_clang_getCursorReferenceNameRange - _clang_getCursorReferenceNameRange = + late final _clang_getCursorReferenceNameRange_ptr = _lookup< + ffi.NativeFunction< + CXSourceRange Function(CXCursor, ffi.Uint32, + ffi.Uint32)>>('clang_getCursorReferenceNameRange'); + late final _clang_getCursorReferenceNameRange = _clang_getCursorReferenceNameRange_ptr - .asFunction<_dart_clang_getCursorReferenceNameRange>(); + .asFunction(); /// Get the raw lexical token starting with the given location. ffi.Pointer clang_getToken( - ffi.Pointer TU, + CXTranslationUnit TU, CXSourceLocation Location, ) { return _clang_getToken( @@ -4438,10 +4514,12 @@ class LibClang { ); } - late final _clang_getToken_ptr = - _lookup>('clang_getToken'); - late final _dart_clang_getToken _clang_getToken = - _clang_getToken_ptr.asFunction<_dart_clang_getToken>(); + late final _clang_getToken_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + CXTranslationUnit, CXSourceLocation)>>('clang_getToken'); + late final _clang_getToken = _clang_getToken_ptr.asFunction< + ffi.Pointer Function(CXTranslationUnit, CXSourceLocation)>(); /// Determine the kind of the given token. int clang_getTokenKind( @@ -4453,13 +4531,14 @@ class LibClang { } late final _clang_getTokenKind_ptr = - _lookup>('clang_getTokenKind'); - late final _dart_clang_getTokenKind _clang_getTokenKind = - _clang_getTokenKind_ptr.asFunction<_dart_clang_getTokenKind>(); + _lookup>( + 'clang_getTokenKind'); + late final _clang_getTokenKind = + _clang_getTokenKind_ptr.asFunction(); /// Determine the spelling of the given token. CXString clang_getTokenSpelling( - ffi.Pointer arg0, + CXTranslationUnit arg0, CXToken arg1, ) { return _clang_getTokenSpelling( @@ -4468,15 +4547,15 @@ class LibClang { ); } - late final _clang_getTokenSpelling_ptr = - _lookup>( - 'clang_getTokenSpelling'); - late final _dart_clang_getTokenSpelling _clang_getTokenSpelling = - _clang_getTokenSpelling_ptr.asFunction<_dart_clang_getTokenSpelling>(); + late final _clang_getTokenSpelling_ptr = _lookup< + ffi.NativeFunction>( + 'clang_getTokenSpelling'); + late final _clang_getTokenSpelling = _clang_getTokenSpelling_ptr + .asFunction(); /// Retrieve the source location of the given token. CXSourceLocation clang_getTokenLocation( - ffi.Pointer arg0, + CXTranslationUnit arg0, CXToken arg1, ) { return _clang_getTokenLocation( @@ -4485,15 +4564,16 @@ class LibClang { ); } - late final _clang_getTokenLocation_ptr = - _lookup>( - 'clang_getTokenLocation'); - late final _dart_clang_getTokenLocation _clang_getTokenLocation = - _clang_getTokenLocation_ptr.asFunction<_dart_clang_getTokenLocation>(); + late final _clang_getTokenLocation_ptr = _lookup< + ffi.NativeFunction< + CXSourceLocation Function( + CXTranslationUnit, CXToken)>>('clang_getTokenLocation'); + late final _clang_getTokenLocation = _clang_getTokenLocation_ptr + .asFunction(); /// Retrieve a source range that covers the given token. CXSourceRange clang_getTokenExtent( - ffi.Pointer arg0, + CXTranslationUnit arg0, CXToken arg1, ) { return _clang_getTokenExtent( @@ -4502,16 +4582,17 @@ class LibClang { ); } - late final _clang_getTokenExtent_ptr = - _lookup>( - 'clang_getTokenExtent'); - late final _dart_clang_getTokenExtent _clang_getTokenExtent = - _clang_getTokenExtent_ptr.asFunction<_dart_clang_getTokenExtent>(); + late final _clang_getTokenExtent_ptr = _lookup< + ffi.NativeFunction< + CXSourceRange Function( + CXTranslationUnit, CXToken)>>('clang_getTokenExtent'); + late final _clang_getTokenExtent = _clang_getTokenExtent_ptr + .asFunction(); /// Tokenize the source code described by the given range into raw lexical /// tokens. void clang_tokenize( - ffi.Pointer TU, + CXTranslationUnit TU, CXSourceRange Range, ffi.Pointer> Tokens, ffi.Pointer NumTokens, @@ -4524,15 +4605,21 @@ class LibClang { ); } - late final _clang_tokenize_ptr = - _lookup>('clang_tokenize'); - late final _dart_clang_tokenize _clang_tokenize = - _clang_tokenize_ptr.asFunction<_dart_clang_tokenize>(); + late final _clang_tokenize_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXTranslationUnit, + CXSourceRange, + ffi.Pointer>, + ffi.Pointer)>>('clang_tokenize'); + late final _clang_tokenize = _clang_tokenize_ptr.asFunction< + void Function(CXTranslationUnit, CXSourceRange, + ffi.Pointer>, ffi.Pointer)>(); /// Annotate the given set of tokens by providing cursors for each token that /// can be mapped to a specific entity within the abstract syntax tree. void clang_annotateTokens( - ffi.Pointer TU, + CXTranslationUnit TU, ffi.Pointer Tokens, int NumTokens, ffi.Pointer Cursors, @@ -4545,15 +4632,17 @@ class LibClang { ); } - late final _clang_annotateTokens_ptr = - _lookup>( - 'clang_annotateTokens'); - late final _dart_clang_annotateTokens _clang_annotateTokens = - _clang_annotateTokens_ptr.asFunction<_dart_clang_annotateTokens>(); + late final _clang_annotateTokens_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CXTranslationUnit, ffi.Pointer, ffi.Uint32, + ffi.Pointer)>>('clang_annotateTokens'); + late final _clang_annotateTokens = _clang_annotateTokens_ptr.asFunction< + void Function(CXTranslationUnit, ffi.Pointer, int, + ffi.Pointer)>(); /// Free the given set of tokens. void clang_disposeTokens( - ffi.Pointer TU, + CXTranslationUnit TU, ffi.Pointer Tokens, int NumTokens, ) { @@ -4564,11 +4653,12 @@ class LibClang { ); } - late final _clang_disposeTokens_ptr = - _lookup>( - 'clang_disposeTokens'); - late final _dart_clang_disposeTokens _clang_disposeTokens = - _clang_disposeTokens_ptr.asFunction<_dart_clang_disposeTokens>(); + late final _clang_disposeTokens_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CXTranslationUnit, ffi.Pointer, + ffi.Uint32)>>('clang_disposeTokens'); + late final _clang_disposeTokens = _clang_disposeTokens_ptr.asFunction< + void Function(CXTranslationUnit, ffi.Pointer, int)>(); /// These routines are used for testing and debugging, only, and should not be /// relied upon. @@ -4581,11 +4671,10 @@ class LibClang { } late final _clang_getCursorKindSpelling_ptr = - _lookup>( + _lookup>( 'clang_getCursorKindSpelling'); - late final _dart_clang_getCursorKindSpelling _clang_getCursorKindSpelling = - _clang_getCursorKindSpelling_ptr - .asFunction<_dart_clang_getCursorKindSpelling>(); + late final _clang_getCursorKindSpelling = + _clang_getCursorKindSpelling_ptr.asFunction(); void clang_getDefinitionSpellingAndExtent( CXCursor arg0, @@ -4607,26 +4696,41 @@ class LibClang { ); } - late final _clang_getDefinitionSpellingAndExtent_ptr = - _lookup>( - 'clang_getDefinitionSpellingAndExtent'); - late final _dart_clang_getDefinitionSpellingAndExtent - _clang_getDefinitionSpellingAndExtent = - _clang_getDefinitionSpellingAndExtent_ptr - .asFunction<_dart_clang_getDefinitionSpellingAndExtent>(); + late final _clang_getDefinitionSpellingAndExtent_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXCursor, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'clang_getDefinitionSpellingAndExtent'); + late final _clang_getDefinitionSpellingAndExtent = + _clang_getDefinitionSpellingAndExtent_ptr.asFunction< + void Function( + CXCursor, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); void clang_enableStackTraces() { return _clang_enableStackTraces(); } late final _clang_enableStackTraces_ptr = - _lookup>( + _lookup>( 'clang_enableStackTraces'); - late final _dart_clang_enableStackTraces _clang_enableStackTraces = - _clang_enableStackTraces_ptr.asFunction<_dart_clang_enableStackTraces>(); + late final _clang_enableStackTraces = + _clang_enableStackTraces_ptr.asFunction(); void clang_executeOnThread( - ffi.Pointer> fn, + ffi.Pointer)>> + fn, ffi.Pointer user_data, int stack_size, ) { @@ -4637,15 +4741,23 @@ class LibClang { ); } - late final _clang_executeOnThread_ptr = - _lookup>( - 'clang_executeOnThread'); - late final _dart_clang_executeOnThread _clang_executeOnThread = - _clang_executeOnThread_ptr.asFunction<_dart_clang_executeOnThread>(); + late final _clang_executeOnThread_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Pointer, + ffi.Uint32)>>('clang_executeOnThread'); + late final _clang_executeOnThread = _clang_executeOnThread_ptr.asFunction< + void Function( + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Pointer, + int)>(); /// Determine the kind of a particular chunk within a completion string. int clang_getCompletionChunkKind( - ffi.Pointer completion_string, + CXCompletionString completion_string, int chunk_number, ) { return _clang_getCompletionChunkKind( @@ -4654,17 +4766,17 @@ class LibClang { ); } - late final _clang_getCompletionChunkKind_ptr = - _lookup>( - 'clang_getCompletionChunkKind'); - late final _dart_clang_getCompletionChunkKind _clang_getCompletionChunkKind = - _clang_getCompletionChunkKind_ptr - .asFunction<_dart_clang_getCompletionChunkKind>(); + late final _clang_getCompletionChunkKind_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXCompletionString, ffi.Uint32)>>('clang_getCompletionChunkKind'); + late final _clang_getCompletionChunkKind = _clang_getCompletionChunkKind_ptr + .asFunction(); /// Retrieve the text associated with a particular chunk within a completion /// string. CXString clang_getCompletionChunkText( - ffi.Pointer completion_string, + CXCompletionString completion_string, int chunk_number, ) { return _clang_getCompletionChunkText( @@ -4673,17 +4785,17 @@ class LibClang { ); } - late final _clang_getCompletionChunkText_ptr = - _lookup>( - 'clang_getCompletionChunkText'); - late final _dart_clang_getCompletionChunkText _clang_getCompletionChunkText = - _clang_getCompletionChunkText_ptr - .asFunction<_dart_clang_getCompletionChunkText>(); + late final _clang_getCompletionChunkText_ptr = _lookup< + ffi.NativeFunction< + CXString Function( + CXCompletionString, ffi.Uint32)>>('clang_getCompletionChunkText'); + late final _clang_getCompletionChunkText = _clang_getCompletionChunkText_ptr + .asFunction(); /// Retrieve the completion string associated with a particular chunk within a /// completion string. - ffi.Pointer clang_getCompletionChunkCompletionString( - ffi.Pointer completion_string, + CXCompletionString clang_getCompletionChunkCompletionString( + CXCompletionString completion_string, int chunk_number, ) { return _clang_getCompletionChunkCompletionString( @@ -4692,17 +4804,17 @@ class LibClang { ); } - late final _clang_getCompletionChunkCompletionString_ptr = - _lookup>( - 'clang_getCompletionChunkCompletionString'); - late final _dart_clang_getCompletionChunkCompletionString - _clang_getCompletionChunkCompletionString = + late final _clang_getCompletionChunkCompletionString_ptr = _lookup< + ffi.NativeFunction< + CXCompletionString Function(CXCompletionString, + ffi.Uint32)>>('clang_getCompletionChunkCompletionString'); + late final _clang_getCompletionChunkCompletionString = _clang_getCompletionChunkCompletionString_ptr - .asFunction<_dart_clang_getCompletionChunkCompletionString>(); + .asFunction(); /// Retrieve the number of chunks in the given code-completion string. int clang_getNumCompletionChunks( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getNumCompletionChunks( completion_string, @@ -4710,15 +4822,14 @@ class LibClang { } late final _clang_getNumCompletionChunks_ptr = - _lookup>( + _lookup>( 'clang_getNumCompletionChunks'); - late final _dart_clang_getNumCompletionChunks _clang_getNumCompletionChunks = - _clang_getNumCompletionChunks_ptr - .asFunction<_dart_clang_getNumCompletionChunks>(); + late final _clang_getNumCompletionChunks = _clang_getNumCompletionChunks_ptr + .asFunction(); /// Determine the priority of this code completion. int clang_getCompletionPriority( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionPriority( completion_string, @@ -4726,16 +4837,15 @@ class LibClang { } late final _clang_getCompletionPriority_ptr = - _lookup>( + _lookup>( 'clang_getCompletionPriority'); - late final _dart_clang_getCompletionPriority _clang_getCompletionPriority = - _clang_getCompletionPriority_ptr - .asFunction<_dart_clang_getCompletionPriority>(); + late final _clang_getCompletionPriority = _clang_getCompletionPriority_ptr + .asFunction(); /// Determine the availability of the entity that this code-completion string /// refers to. int clang_getCompletionAvailability( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionAvailability( completion_string, @@ -4743,16 +4853,16 @@ class LibClang { } late final _clang_getCompletionAvailability_ptr = - _lookup>( + _lookup>( 'clang_getCompletionAvailability'); - late final _dart_clang_getCompletionAvailability - _clang_getCompletionAvailability = _clang_getCompletionAvailability_ptr - .asFunction<_dart_clang_getCompletionAvailability>(); + late final _clang_getCompletionAvailability = + _clang_getCompletionAvailability_ptr + .asFunction(); /// Retrieve the number of annotations associated with the given completion /// string. int clang_getCompletionNumAnnotations( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionNumAnnotations( completion_string, @@ -4760,16 +4870,15 @@ class LibClang { } late final _clang_getCompletionNumAnnotations_ptr = - _lookup>( + _lookup>( 'clang_getCompletionNumAnnotations'); - late final _dart_clang_getCompletionNumAnnotations - _clang_getCompletionNumAnnotations = + late final _clang_getCompletionNumAnnotations = _clang_getCompletionNumAnnotations_ptr - .asFunction<_dart_clang_getCompletionNumAnnotations>(); + .asFunction(); /// Retrieve the annotation associated with the given completion string. CXString clang_getCompletionAnnotation( - ffi.Pointer completion_string, + CXCompletionString completion_string, int annotation_number, ) { return _clang_getCompletionAnnotation( @@ -4778,16 +4887,16 @@ class LibClang { ); } - late final _clang_getCompletionAnnotation_ptr = - _lookup>( - 'clang_getCompletionAnnotation'); - late final _dart_clang_getCompletionAnnotation - _clang_getCompletionAnnotation = _clang_getCompletionAnnotation_ptr - .asFunction<_dart_clang_getCompletionAnnotation>(); + late final _clang_getCompletionAnnotation_ptr = _lookup< + ffi.NativeFunction< + CXString Function(CXCompletionString, + ffi.Uint32)>>('clang_getCompletionAnnotation'); + late final _clang_getCompletionAnnotation = _clang_getCompletionAnnotation_ptr + .asFunction(); /// Retrieve the parent context of the given completion string. CXString clang_getCompletionParent( - ffi.Pointer completion_string, + CXCompletionString completion_string, ffi.Pointer kind, ) { return _clang_getCompletionParent( @@ -4796,17 +4905,18 @@ class LibClang { ); } - late final _clang_getCompletionParent_ptr = - _lookup>( - 'clang_getCompletionParent'); - late final _dart_clang_getCompletionParent _clang_getCompletionParent = - _clang_getCompletionParent_ptr - .asFunction<_dart_clang_getCompletionParent>(); + late final _clang_getCompletionParent_ptr = _lookup< + ffi.NativeFunction< + CXString Function(CXCompletionString, + ffi.Pointer)>>('clang_getCompletionParent'); + late final _clang_getCompletionParent = + _clang_getCompletionParent_ptr.asFunction< + CXString Function(CXCompletionString, ffi.Pointer)>(); /// Retrieve the brief documentation comment attached to the declaration that /// corresponds to the given completion string. CXString clang_getCompletionBriefComment( - ffi.Pointer completion_string, + CXCompletionString completion_string, ) { return _clang_getCompletionBriefComment( completion_string, @@ -4814,15 +4924,15 @@ class LibClang { } late final _clang_getCompletionBriefComment_ptr = - _lookup>( + _lookup>( 'clang_getCompletionBriefComment'); - late final _dart_clang_getCompletionBriefComment - _clang_getCompletionBriefComment = _clang_getCompletionBriefComment_ptr - .asFunction<_dart_clang_getCompletionBriefComment>(); + late final _clang_getCompletionBriefComment = + _clang_getCompletionBriefComment_ptr + .asFunction(); /// Retrieve a completion string for an arbitrary declaration or macro /// definition cursor. - ffi.Pointer clang_getCursorCompletionString( + CXCompletionString clang_getCursorCompletionString( CXCursor cursor, ) { return _clang_getCursorCompletionString( @@ -4831,11 +4941,11 @@ class LibClang { } late final _clang_getCursorCompletionString_ptr = - _lookup>( + _lookup>( 'clang_getCursorCompletionString'); - late final _dart_clang_getCursorCompletionString - _clang_getCursorCompletionString = _clang_getCursorCompletionString_ptr - .asFunction<_dart_clang_getCursorCompletionString>(); + late final _clang_getCursorCompletionString = + _clang_getCursorCompletionString_ptr + .asFunction(); /// Retrieve the number of fix-its for the given completion index. int clang_getCompletionNumFixIts( @@ -4848,12 +4958,12 @@ class LibClang { ); } - late final _clang_getCompletionNumFixIts_ptr = - _lookup>( - 'clang_getCompletionNumFixIts'); - late final _dart_clang_getCompletionNumFixIts _clang_getCompletionNumFixIts = - _clang_getCompletionNumFixIts_ptr - .asFunction<_dart_clang_getCompletionNumFixIts>(); + late final _clang_getCompletionNumFixIts_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function(ffi.Pointer, + ffi.Uint32)>>('clang_getCompletionNumFixIts'); + late final _clang_getCompletionNumFixIts = _clang_getCompletionNumFixIts_ptr + .asFunction, int)>(); /// Fix-its that *must* be applied before inserting the text for the /// corresponding completion. @@ -4871,12 +4981,17 @@ class LibClang { ); } - late final _clang_getCompletionFixIt_ptr = - _lookup>( - 'clang_getCompletionFixIt'); - late final _dart_clang_getCompletionFixIt _clang_getCompletionFixIt = - _clang_getCompletionFixIt_ptr - .asFunction<_dart_clang_getCompletionFixIt>(); + late final _clang_getCompletionFixIt_ptr = _lookup< + ffi.NativeFunction< + CXString Function( + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer)>>('clang_getCompletionFixIt'); + late final _clang_getCompletionFixIt = + _clang_getCompletionFixIt_ptr.asFunction< + CXString Function(ffi.Pointer, int, int, + ffi.Pointer)>(); /// Returns a default set of code-completion options that can be passed to /// clang_codeCompleteAt(). @@ -4885,15 +5000,14 @@ class LibClang { } late final _clang_defaultCodeCompleteOptions_ptr = - _lookup>( + _lookup>( 'clang_defaultCodeCompleteOptions'); - late final _dart_clang_defaultCodeCompleteOptions - _clang_defaultCodeCompleteOptions = _clang_defaultCodeCompleteOptions_ptr - .asFunction<_dart_clang_defaultCodeCompleteOptions>(); + late final _clang_defaultCodeCompleteOptions = + _clang_defaultCodeCompleteOptions_ptr.asFunction(); /// Perform code completion at a given location in a translation unit. ffi.Pointer clang_codeCompleteAt( - ffi.Pointer TU, + CXTranslationUnit TU, ffi.Pointer complete_filename, int complete_line, int complete_column, @@ -4912,11 +5026,25 @@ class LibClang { ); } - late final _clang_codeCompleteAt_ptr = - _lookup>( - 'clang_codeCompleteAt'); - late final _dart_clang_codeCompleteAt _clang_codeCompleteAt = - _clang_codeCompleteAt_ptr.asFunction<_dart_clang_codeCompleteAt>(); + late final _clang_codeCompleteAt_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + CXTranslationUnit, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32)>>('clang_codeCompleteAt'); + late final _clang_codeCompleteAt = _clang_codeCompleteAt_ptr.asFunction< + ffi.Pointer Function( + CXTranslationUnit, + ffi.Pointer, + int, + int, + ffi.Pointer, + int, + int)>(); /// Sort the code-completion results in case-insensitive alphabetical order. void clang_sortCodeCompletionResults( @@ -4929,12 +5057,13 @@ class LibClang { ); } - late final _clang_sortCodeCompletionResults_ptr = - _lookup>( - 'clang_sortCodeCompletionResults'); - late final _dart_clang_sortCodeCompletionResults - _clang_sortCodeCompletionResults = _clang_sortCodeCompletionResults_ptr - .asFunction<_dart_clang_sortCodeCompletionResults>(); + late final _clang_sortCodeCompletionResults_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Uint32)>>('clang_sortCodeCompletionResults'); + late final _clang_sortCodeCompletionResults = + _clang_sortCodeCompletionResults_ptr + .asFunction, int)>(); /// Free the given set of code-completion results. void clang_disposeCodeCompleteResults( @@ -4945,12 +5074,13 @@ class LibClang { ); } - late final _clang_disposeCodeCompleteResults_ptr = - _lookup>( - 'clang_disposeCodeCompleteResults'); - late final _dart_clang_disposeCodeCompleteResults - _clang_disposeCodeCompleteResults = _clang_disposeCodeCompleteResults_ptr - .asFunction<_dart_clang_disposeCodeCompleteResults>(); + late final _clang_disposeCodeCompleteResults_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>( + 'clang_disposeCodeCompleteResults'); + late final _clang_disposeCodeCompleteResults = + _clang_disposeCodeCompleteResults_ptr + .asFunction)>(); /// Determine the number of diagnostics produced prior to the location where /// code completion was performed. @@ -4962,16 +5092,16 @@ class LibClang { ); } - late final _clang_codeCompleteGetNumDiagnostics_ptr = - _lookup>( - 'clang_codeCompleteGetNumDiagnostics'); - late final _dart_clang_codeCompleteGetNumDiagnostics - _clang_codeCompleteGetNumDiagnostics = + late final _clang_codeCompleteGetNumDiagnostics_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function(ffi.Pointer)>>( + 'clang_codeCompleteGetNumDiagnostics'); + late final _clang_codeCompleteGetNumDiagnostics = _clang_codeCompleteGetNumDiagnostics_ptr - .asFunction<_dart_clang_codeCompleteGetNumDiagnostics>(); + .asFunction)>(); /// Retrieve a diagnostic associated with the given code completion. - ffi.Pointer clang_codeCompleteGetDiagnostic( + CXDiagnostic clang_codeCompleteGetDiagnostic( ffi.Pointer Results, int Index, ) { @@ -4981,12 +5111,13 @@ class LibClang { ); } - late final _clang_codeCompleteGetDiagnostic_ptr = - _lookup>( - 'clang_codeCompleteGetDiagnostic'); - late final _dart_clang_codeCompleteGetDiagnostic - _clang_codeCompleteGetDiagnostic = _clang_codeCompleteGetDiagnostic_ptr - .asFunction<_dart_clang_codeCompleteGetDiagnostic>(); + late final _clang_codeCompleteGetDiagnostic_ptr = _lookup< + ffi.NativeFunction< + CXDiagnostic Function(ffi.Pointer, + ffi.Uint32)>>('clang_codeCompleteGetDiagnostic'); + late final _clang_codeCompleteGetDiagnostic = + _clang_codeCompleteGetDiagnostic_ptr.asFunction< + CXDiagnostic Function(ffi.Pointer, int)>(); /// Determines what completions are appropriate for the context the given code /// completion. @@ -4998,12 +5129,12 @@ class LibClang { ); } - late final _clang_codeCompleteGetContexts_ptr = - _lookup>( - 'clang_codeCompleteGetContexts'); - late final _dart_clang_codeCompleteGetContexts - _clang_codeCompleteGetContexts = _clang_codeCompleteGetContexts_ptr - .asFunction<_dart_clang_codeCompleteGetContexts>(); + late final _clang_codeCompleteGetContexts_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint64 Function(ffi.Pointer)>>( + 'clang_codeCompleteGetContexts'); + late final _clang_codeCompleteGetContexts = _clang_codeCompleteGetContexts_ptr + .asFunction)>(); /// Returns the cursor kind for the container for the current code completion /// context. The container is only guaranteed to be set for contexts where a @@ -5019,13 +5150,14 @@ class LibClang { ); } - late final _clang_codeCompleteGetContainerKind_ptr = - _lookup>( - 'clang_codeCompleteGetContainerKind'); - late final _dart_clang_codeCompleteGetContainerKind - _clang_codeCompleteGetContainerKind = - _clang_codeCompleteGetContainerKind_ptr - .asFunction<_dart_clang_codeCompleteGetContainerKind>(); + late final _clang_codeCompleteGetContainerKind_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('clang_codeCompleteGetContainerKind'); + late final _clang_codeCompleteGetContainerKind = + _clang_codeCompleteGetContainerKind_ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); /// Returns the USR for the container for the current code completion context. /// If there is not a container for the current context, this function will @@ -5038,13 +5170,13 @@ class LibClang { ); } - late final _clang_codeCompleteGetContainerUSR_ptr = - _lookup>( - 'clang_codeCompleteGetContainerUSR'); - late final _dart_clang_codeCompleteGetContainerUSR - _clang_codeCompleteGetContainerUSR = + late final _clang_codeCompleteGetContainerUSR_ptr = _lookup< + ffi.NativeFunction< + CXString Function(ffi.Pointer)>>( + 'clang_codeCompleteGetContainerUSR'); + late final _clang_codeCompleteGetContainerUSR = _clang_codeCompleteGetContainerUSR_ptr - .asFunction<_dart_clang_codeCompleteGetContainerUSR>(); + .asFunction)>(); /// Returns the currently-entered selector for an Objective-C message send, /// formatted like "initWithFoo:bar:". Only guaranteed to return a non-empty @@ -5058,13 +5190,13 @@ class LibClang { ); } - late final _clang_codeCompleteGetObjCSelector_ptr = - _lookup>( - 'clang_codeCompleteGetObjCSelector'); - late final _dart_clang_codeCompleteGetObjCSelector - _clang_codeCompleteGetObjCSelector = + late final _clang_codeCompleteGetObjCSelector_ptr = _lookup< + ffi.NativeFunction< + CXString Function(ffi.Pointer)>>( + 'clang_codeCompleteGetObjCSelector'); + late final _clang_codeCompleteGetObjCSelector = _clang_codeCompleteGetObjCSelector_ptr - .asFunction<_dart_clang_codeCompleteGetObjCSelector>(); + .asFunction)>(); /// Return a version string, suitable for showing to a user, but not intended /// to be parsed (the format is not guaranteed to be stable). @@ -5073,10 +5205,9 @@ class LibClang { } late final _clang_getClangVersion_ptr = - _lookup>( - 'clang_getClangVersion'); - late final _dart_clang_getClangVersion _clang_getClangVersion = - _clang_getClangVersion_ptr.asFunction<_dart_clang_getClangVersion>(); + _lookup>('clang_getClangVersion'); + late final _clang_getClangVersion = + _clang_getClangVersion_ptr.asFunction(); /// Enable/disable crash recovery. void clang_toggleCrashRecovery( @@ -5088,20 +5219,19 @@ class LibClang { } late final _clang_toggleCrashRecovery_ptr = - _lookup>( + _lookup>( 'clang_toggleCrashRecovery'); - late final _dart_clang_toggleCrashRecovery _clang_toggleCrashRecovery = - _clang_toggleCrashRecovery_ptr - .asFunction<_dart_clang_toggleCrashRecovery>(); + late final _clang_toggleCrashRecovery = + _clang_toggleCrashRecovery_ptr.asFunction(); /// Visit the set of preprocessor inclusions in a translation unit. The /// visitor function is called with the provided data for every included file. /// This does not include headers included by the PCH file (unless one is /// inspecting the inclusions in the PCH file itself). void clang_getInclusions( - ffi.Pointer tu, - ffi.Pointer> visitor, - ffi.Pointer client_data, + CXTranslationUnit tu, + CXInclusionVisitor visitor, + CXClientData client_data, ) { return _clang_getInclusions( tu, @@ -5110,16 +5240,17 @@ class LibClang { ); } - late final _clang_getInclusions_ptr = - _lookup>( - 'clang_getInclusions'); - late final _dart_clang_getInclusions _clang_getInclusions = - _clang_getInclusions_ptr.asFunction<_dart_clang_getInclusions>(); + late final _clang_getInclusions_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CXTranslationUnit, CXInclusionVisitor, + CXClientData)>>('clang_getInclusions'); + late final _clang_getInclusions = _clang_getInclusions_ptr.asFunction< + void Function(CXTranslationUnit, CXInclusionVisitor, CXClientData)>(); /// If cursor is a statement declaration tries to evaluate the statement and /// if its variable, tries to evaluate its initializer, into its corresponding /// type. - ffi.Pointer clang_Cursor_Evaluate( + CXEvalResult clang_Cursor_Evaluate( CXCursor C, ) { return _clang_Cursor_Evaluate( @@ -5128,14 +5259,14 @@ class LibClang { } late final _clang_Cursor_Evaluate_ptr = - _lookup>( + _lookup>( 'clang_Cursor_Evaluate'); - late final _dart_clang_Cursor_Evaluate _clang_Cursor_Evaluate = - _clang_Cursor_Evaluate_ptr.asFunction<_dart_clang_Cursor_Evaluate>(); + late final _clang_Cursor_Evaluate = + _clang_Cursor_Evaluate_ptr.asFunction(); /// Returns the kind of the evaluated result. int clang_EvalResult_getKind( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getKind( E, @@ -5143,15 +5274,14 @@ class LibClang { } late final _clang_EvalResult_getKind_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getKind'); - late final _dart_clang_EvalResult_getKind _clang_EvalResult_getKind = - _clang_EvalResult_getKind_ptr - .asFunction<_dart_clang_EvalResult_getKind>(); + late final _clang_EvalResult_getKind = + _clang_EvalResult_getKind_ptr.asFunction(); /// Returns the evaluation result as integer if the kind is Int. int clang_EvalResult_getAsInt( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsInt( E, @@ -5159,17 +5289,16 @@ class LibClang { } late final _clang_EvalResult_getAsInt_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsInt'); - late final _dart_clang_EvalResult_getAsInt _clang_EvalResult_getAsInt = - _clang_EvalResult_getAsInt_ptr - .asFunction<_dart_clang_EvalResult_getAsInt>(); + late final _clang_EvalResult_getAsInt = + _clang_EvalResult_getAsInt_ptr.asFunction(); /// Returns the evaluation result as a long long integer if the kind is Int. /// This prevents overflows that may happen if the result is returned with /// clang_EvalResult_getAsInt. int clang_EvalResult_getAsLongLong( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsLongLong( E, @@ -5177,16 +5306,16 @@ class LibClang { } late final _clang_EvalResult_getAsLongLong_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsLongLong'); - late final _dart_clang_EvalResult_getAsLongLong - _clang_EvalResult_getAsLongLong = _clang_EvalResult_getAsLongLong_ptr - .asFunction<_dart_clang_EvalResult_getAsLongLong>(); + late final _clang_EvalResult_getAsLongLong = + _clang_EvalResult_getAsLongLong_ptr + .asFunction(); /// Returns a non-zero value if the kind is Int and the evaluation result /// resulted in an unsigned integer. int clang_EvalResult_isUnsignedInt( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_isUnsignedInt( E, @@ -5194,16 +5323,16 @@ class LibClang { } late final _clang_EvalResult_isUnsignedInt_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_isUnsignedInt'); - late final _dart_clang_EvalResult_isUnsignedInt - _clang_EvalResult_isUnsignedInt = _clang_EvalResult_isUnsignedInt_ptr - .asFunction<_dart_clang_EvalResult_isUnsignedInt>(); + late final _clang_EvalResult_isUnsignedInt = + _clang_EvalResult_isUnsignedInt_ptr + .asFunction(); /// Returns the evaluation result as an unsigned integer if the kind is Int /// and clang_EvalResult_isUnsignedInt is non-zero. int clang_EvalResult_getAsUnsigned( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsUnsigned( E, @@ -5211,15 +5340,15 @@ class LibClang { } late final _clang_EvalResult_getAsUnsigned_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsUnsigned'); - late final _dart_clang_EvalResult_getAsUnsigned - _clang_EvalResult_getAsUnsigned = _clang_EvalResult_getAsUnsigned_ptr - .asFunction<_dart_clang_EvalResult_getAsUnsigned>(); + late final _clang_EvalResult_getAsUnsigned = + _clang_EvalResult_getAsUnsigned_ptr + .asFunction(); /// Returns the evaluation result as double if the kind is double. double clang_EvalResult_getAsDouble( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsDouble( E, @@ -5227,18 +5356,17 @@ class LibClang { } late final _clang_EvalResult_getAsDouble_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_getAsDouble'); - late final _dart_clang_EvalResult_getAsDouble _clang_EvalResult_getAsDouble = - _clang_EvalResult_getAsDouble_ptr - .asFunction<_dart_clang_EvalResult_getAsDouble>(); + late final _clang_EvalResult_getAsDouble = _clang_EvalResult_getAsDouble_ptr + .asFunction(); /// Returns the evaluation result as a constant string if the kind is other /// than Int or float. User must not free this pointer, instead call /// clang_EvalResult_dispose on the CXEvalResult returned by /// clang_Cursor_Evaluate. ffi.Pointer clang_EvalResult_getAsStr( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_getAsStr( E, @@ -5246,15 +5374,14 @@ class LibClang { } late final _clang_EvalResult_getAsStr_ptr = - _lookup>( + _lookup Function(CXEvalResult)>>( 'clang_EvalResult_getAsStr'); - late final _dart_clang_EvalResult_getAsStr _clang_EvalResult_getAsStr = - _clang_EvalResult_getAsStr_ptr - .asFunction<_dart_clang_EvalResult_getAsStr>(); + late final _clang_EvalResult_getAsStr = _clang_EvalResult_getAsStr_ptr + .asFunction Function(CXEvalResult)>(); /// Disposes the created Eval memory. void clang_EvalResult_dispose( - ffi.Pointer E, + CXEvalResult E, ) { return _clang_EvalResult_dispose( E, @@ -5262,14 +5389,13 @@ class LibClang { } late final _clang_EvalResult_dispose_ptr = - _lookup>( + _lookup>( 'clang_EvalResult_dispose'); - late final _dart_clang_EvalResult_dispose _clang_EvalResult_dispose = - _clang_EvalResult_dispose_ptr - .asFunction<_dart_clang_EvalResult_dispose>(); + late final _clang_EvalResult_dispose = + _clang_EvalResult_dispose_ptr.asFunction(); /// Retrieve a remapping. - ffi.Pointer clang_getRemappings( + CXRemapping clang_getRemappings( ffi.Pointer path, ) { return _clang_getRemappings( @@ -5278,13 +5404,13 @@ class LibClang { } late final _clang_getRemappings_ptr = - _lookup>( + _lookup)>>( 'clang_getRemappings'); - late final _dart_clang_getRemappings _clang_getRemappings = - _clang_getRemappings_ptr.asFunction<_dart_clang_getRemappings>(); + late final _clang_getRemappings = _clang_getRemappings_ptr + .asFunction)>(); /// Retrieve a remapping. - ffi.Pointer clang_getRemappingsFromFileList( + CXRemapping clang_getRemappingsFromFileList( ffi.Pointer> filePaths, int numFiles, ) { @@ -5294,16 +5420,17 @@ class LibClang { ); } - late final _clang_getRemappingsFromFileList_ptr = - _lookup>( - 'clang_getRemappingsFromFileList'); - late final _dart_clang_getRemappingsFromFileList - _clang_getRemappingsFromFileList = _clang_getRemappingsFromFileList_ptr - .asFunction<_dart_clang_getRemappingsFromFileList>(); + late final _clang_getRemappingsFromFileList_ptr = _lookup< + ffi.NativeFunction< + CXRemapping Function(ffi.Pointer>, + ffi.Uint32)>>('clang_getRemappingsFromFileList'); + late final _clang_getRemappingsFromFileList = + _clang_getRemappingsFromFileList_ptr.asFunction< + CXRemapping Function(ffi.Pointer>, int)>(); /// Determine the number of remappings. int clang_remap_getNumFiles( - ffi.Pointer arg0, + CXRemapping arg0, ) { return _clang_remap_getNumFiles( arg0, @@ -5311,14 +5438,14 @@ class LibClang { } late final _clang_remap_getNumFiles_ptr = - _lookup>( + _lookup>( 'clang_remap_getNumFiles'); - late final _dart_clang_remap_getNumFiles _clang_remap_getNumFiles = - _clang_remap_getNumFiles_ptr.asFunction<_dart_clang_remap_getNumFiles>(); + late final _clang_remap_getNumFiles = + _clang_remap_getNumFiles_ptr.asFunction(); /// Get the original and the associated filename from the remapping. void clang_remap_getFilenames( - ffi.Pointer arg0, + CXRemapping arg0, int index, ffi.Pointer original, ffi.Pointer transformed, @@ -5331,16 +5458,18 @@ class LibClang { ); } - late final _clang_remap_getFilenames_ptr = - _lookup>( - 'clang_remap_getFilenames'); - late final _dart_clang_remap_getFilenames _clang_remap_getFilenames = - _clang_remap_getFilenames_ptr - .asFunction<_dart_clang_remap_getFilenames>(); + late final _clang_remap_getFilenames_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CXRemapping, ffi.Uint32, ffi.Pointer, + ffi.Pointer)>>('clang_remap_getFilenames'); + late final _clang_remap_getFilenames = + _clang_remap_getFilenames_ptr.asFunction< + void Function(CXRemapping, int, ffi.Pointer, + ffi.Pointer)>(); /// Dispose the remapping. void clang_remap_dispose( - ffi.Pointer arg0, + CXRemapping arg0, ) { return _clang_remap_dispose( arg0, @@ -5348,15 +5477,15 @@ class LibClang { } late final _clang_remap_dispose_ptr = - _lookup>( + _lookup>( 'clang_remap_dispose'); - late final _dart_clang_remap_dispose _clang_remap_dispose = - _clang_remap_dispose_ptr.asFunction<_dart_clang_remap_dispose>(); + late final _clang_remap_dispose = + _clang_remap_dispose_ptr.asFunction(); /// Find references of a declaration in a specific file. int clang_findReferencesInFile( CXCursor cursor, - ffi.Pointer file, + CXFile file, CXCursorAndRangeVisitor visitor, ) { return _clang_findReferencesInFile( @@ -5366,17 +5495,17 @@ class LibClang { ); } - late final _clang_findReferencesInFile_ptr = - _lookup>( - 'clang_findReferencesInFile'); - late final _dart_clang_findReferencesInFile _clang_findReferencesInFile = - _clang_findReferencesInFile_ptr - .asFunction<_dart_clang_findReferencesInFile>(); + late final _clang_findReferencesInFile_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(CXCursor, CXFile, + CXCursorAndRangeVisitor)>>('clang_findReferencesInFile'); + late final _clang_findReferencesInFile = _clang_findReferencesInFile_ptr + .asFunction(); /// Find #import/#include directives in a specific file. int clang_findIncludesInFile( - ffi.Pointer TU, - ffi.Pointer file, + CXTranslationUnit TU, + CXFile file, CXCursorAndRangeVisitor visitor, ) { return _clang_findIncludesInFile( @@ -5386,12 +5515,13 @@ class LibClang { ); } - late final _clang_findIncludesInFile_ptr = - _lookup>( - 'clang_findIncludesInFile'); - late final _dart_clang_findIncludesInFile _clang_findIncludesInFile = - _clang_findIncludesInFile_ptr - .asFunction<_dart_clang_findIncludesInFile>(); + late final _clang_findIncludesInFile_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(CXTranslationUnit, CXFile, + CXCursorAndRangeVisitor)>>('clang_findIncludesInFile'); + late final _clang_findIncludesInFile = + _clang_findIncludesInFile_ptr.asFunction< + int Function(CXTranslationUnit, CXFile, CXCursorAndRangeVisitor)>(); int clang_index_isEntityObjCContainerKind( int arg0, @@ -5402,12 +5532,11 @@ class LibClang { } late final _clang_index_isEntityObjCContainerKind_ptr = - _lookup>( + _lookup>( 'clang_index_isEntityObjCContainerKind'); - late final _dart_clang_index_isEntityObjCContainerKind - _clang_index_isEntityObjCContainerKind = + late final _clang_index_isEntityObjCContainerKind = _clang_index_isEntityObjCContainerKind_ptr - .asFunction<_dart_clang_index_isEntityObjCContainerKind>(); + .asFunction(); ffi.Pointer clang_index_getObjCContainerDeclInfo( ffi.Pointer arg0, @@ -5417,13 +5546,15 @@ class LibClang { ); } - late final _clang_index_getObjCContainerDeclInfo_ptr = - _lookup>( - 'clang_index_getObjCContainerDeclInfo'); - late final _dart_clang_index_getObjCContainerDeclInfo - _clang_index_getObjCContainerDeclInfo = - _clang_index_getObjCContainerDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCContainerDeclInfo>(); + late final _clang_index_getObjCContainerDeclInfo_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>( + 'clang_index_getObjCContainerDeclInfo'); + late final _clang_index_getObjCContainerDeclInfo = + _clang_index_getObjCContainerDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCInterfaceDeclInfo( ffi.Pointer arg0, @@ -5433,13 +5564,15 @@ class LibClang { ); } - late final _clang_index_getObjCInterfaceDeclInfo_ptr = - _lookup>( - 'clang_index_getObjCInterfaceDeclInfo'); - late final _dart_clang_index_getObjCInterfaceDeclInfo - _clang_index_getObjCInterfaceDeclInfo = - _clang_index_getObjCInterfaceDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCInterfaceDeclInfo>(); + late final _clang_index_getObjCInterfaceDeclInfo_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>( + 'clang_index_getObjCInterfaceDeclInfo'); + late final _clang_index_getObjCInterfaceDeclInfo = + _clang_index_getObjCInterfaceDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCCategoryDeclInfo( ffi.Pointer arg0, @@ -5449,13 +5582,15 @@ class LibClang { ); } - late final _clang_index_getObjCCategoryDeclInfo_ptr = - _lookup>( - 'clang_index_getObjCCategoryDeclInfo'); - late final _dart_clang_index_getObjCCategoryDeclInfo - _clang_index_getObjCCategoryDeclInfo = - _clang_index_getObjCCategoryDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCCategoryDeclInfo>(); + late final _clang_index_getObjCCategoryDeclInfo_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>( + 'clang_index_getObjCCategoryDeclInfo'); + late final _clang_index_getObjCCategoryDeclInfo = + _clang_index_getObjCCategoryDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCProtocolRefListInfo( @@ -5466,13 +5601,15 @@ class LibClang { ); } - late final _clang_index_getObjCProtocolRefListInfo_ptr = - _lookup>( - 'clang_index_getObjCProtocolRefListInfo'); - late final _dart_clang_index_getObjCProtocolRefListInfo - _clang_index_getObjCProtocolRefListInfo = - _clang_index_getObjCProtocolRefListInfo_ptr - .asFunction<_dart_clang_index_getObjCProtocolRefListInfo>(); + late final _clang_index_getObjCProtocolRefListInfo_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>( + 'clang_index_getObjCProtocolRefListInfo'); + late final _clang_index_getObjCProtocolRefListInfo = + _clang_index_getObjCProtocolRefListInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getObjCPropertyDeclInfo( ffi.Pointer arg0, @@ -5482,13 +5619,15 @@ class LibClang { ); } - late final _clang_index_getObjCPropertyDeclInfo_ptr = - _lookup>( - 'clang_index_getObjCPropertyDeclInfo'); - late final _dart_clang_index_getObjCPropertyDeclInfo - _clang_index_getObjCPropertyDeclInfo = - _clang_index_getObjCPropertyDeclInfo_ptr - .asFunction<_dart_clang_index_getObjCPropertyDeclInfo>(); + late final _clang_index_getObjCPropertyDeclInfo_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>( + 'clang_index_getObjCPropertyDeclInfo'); + late final _clang_index_getObjCPropertyDeclInfo = + _clang_index_getObjCPropertyDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getIBOutletCollectionAttrInfo( @@ -5499,13 +5638,15 @@ class LibClang { ); } - late final _clang_index_getIBOutletCollectionAttrInfo_ptr = - _lookup>( - 'clang_index_getIBOutletCollectionAttrInfo'); - late final _dart_clang_index_getIBOutletCollectionAttrInfo - _clang_index_getIBOutletCollectionAttrInfo = - _clang_index_getIBOutletCollectionAttrInfo_ptr - .asFunction<_dart_clang_index_getIBOutletCollectionAttrInfo>(); + late final _clang_index_getIBOutletCollectionAttrInfo_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>( + 'clang_index_getIBOutletCollectionAttrInfo'); + late final _clang_index_getIBOutletCollectionAttrInfo = + _clang_index_getIBOutletCollectionAttrInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); ffi.Pointer clang_index_getCXXClassDeclInfo( ffi.Pointer arg0, @@ -5515,15 +5656,17 @@ class LibClang { ); } - late final _clang_index_getCXXClassDeclInfo_ptr = - _lookup>( - 'clang_index_getCXXClassDeclInfo'); - late final _dart_clang_index_getCXXClassDeclInfo - _clang_index_getCXXClassDeclInfo = _clang_index_getCXXClassDeclInfo_ptr - .asFunction<_dart_clang_index_getCXXClassDeclInfo>(); + late final _clang_index_getCXXClassDeclInfo_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('clang_index_getCXXClassDeclInfo'); + late final _clang_index_getCXXClassDeclInfo = + _clang_index_getCXXClassDeclInfo_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); /// For retrieving a custom CXIdxClientContainer attached to a container. - ffi.Pointer clang_index_getClientContainer( + CXIdxClientContainer clang_index_getClientContainer( ffi.Pointer arg0, ) { return _clang_index_getClientContainer( @@ -5531,17 +5674,18 @@ class LibClang { ); } - late final _clang_index_getClientContainer_ptr = - _lookup>( - 'clang_index_getClientContainer'); - late final _dart_clang_index_getClientContainer - _clang_index_getClientContainer = _clang_index_getClientContainer_ptr - .asFunction<_dart_clang_index_getClientContainer>(); + late final _clang_index_getClientContainer_ptr = _lookup< + ffi.NativeFunction< + CXIdxClientContainer Function(ffi.Pointer)>>( + 'clang_index_getClientContainer'); + late final _clang_index_getClientContainer = + _clang_index_getClientContainer_ptr.asFunction< + CXIdxClientContainer Function(ffi.Pointer)>(); /// For setting a custom CXIdxClientContainer attached to a container. void clang_index_setClientContainer( ffi.Pointer arg0, - ffi.Pointer arg1, + CXIdxClientContainer arg1, ) { return _clang_index_setClientContainer( arg0, @@ -5549,15 +5693,17 @@ class LibClang { ); } - late final _clang_index_setClientContainer_ptr = - _lookup>( - 'clang_index_setClientContainer'); - late final _dart_clang_index_setClientContainer - _clang_index_setClientContainer = _clang_index_setClientContainer_ptr - .asFunction<_dart_clang_index_setClientContainer>(); + late final _clang_index_setClientContainer_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + CXIdxClientContainer)>>('clang_index_setClientContainer'); + late final _clang_index_setClientContainer = + _clang_index_setClientContainer_ptr.asFunction< + void Function( + ffi.Pointer, CXIdxClientContainer)>(); /// For retrieving a custom CXIdxClientEntity attached to an entity. - ffi.Pointer clang_index_getClientEntity( + CXIdxClientEntity clang_index_getClientEntity( ffi.Pointer arg0, ) { return _clang_index_getClientEntity( @@ -5565,17 +5711,17 @@ class LibClang { ); } - late final _clang_index_getClientEntity_ptr = - _lookup>( - 'clang_index_getClientEntity'); - late final _dart_clang_index_getClientEntity _clang_index_getClientEntity = - _clang_index_getClientEntity_ptr - .asFunction<_dart_clang_index_getClientEntity>(); + late final _clang_index_getClientEntity_ptr = _lookup< + ffi.NativeFunction< + CXIdxClientEntity Function( + ffi.Pointer)>>('clang_index_getClientEntity'); + late final _clang_index_getClientEntity = _clang_index_getClientEntity_ptr + .asFunction)>(); /// For setting a custom CXIdxClientEntity attached to an entity. void clang_index_setClientEntity( ffi.Pointer arg0, - ffi.Pointer arg1, + CXIdxClientEntity arg1, ) { return _clang_index_setClientEntity( arg0, @@ -5583,17 +5729,18 @@ class LibClang { ); } - late final _clang_index_setClientEntity_ptr = - _lookup>( - 'clang_index_setClientEntity'); - late final _dart_clang_index_setClientEntity _clang_index_setClientEntity = - _clang_index_setClientEntity_ptr - .asFunction<_dart_clang_index_setClientEntity>(); + late final _clang_index_setClientEntity_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + CXIdxClientEntity)>>('clang_index_setClientEntity'); + late final _clang_index_setClientEntity = + _clang_index_setClientEntity_ptr.asFunction< + void Function(ffi.Pointer, CXIdxClientEntity)>(); /// An indexing action/session, to be applied to one or multiple translation /// units. - ffi.Pointer clang_IndexAction_create( - ffi.Pointer CIdx, + CXIndexAction clang_IndexAction_create( + CXIndex CIdx, ) { return _clang_IndexAction_create( CIdx, @@ -5601,15 +5748,14 @@ class LibClang { } late final _clang_IndexAction_create_ptr = - _lookup>( + _lookup>( 'clang_IndexAction_create'); - late final _dart_clang_IndexAction_create _clang_IndexAction_create = - _clang_IndexAction_create_ptr - .asFunction<_dart_clang_IndexAction_create>(); + late final _clang_IndexAction_create = _clang_IndexAction_create_ptr + .asFunction(); /// Destroy the given index action. void clang_IndexAction_dispose( - ffi.Pointer arg0, + CXIndexAction arg0, ) { return _clang_IndexAction_dispose( arg0, @@ -5617,17 +5763,16 @@ class LibClang { } late final _clang_IndexAction_dispose_ptr = - _lookup>( + _lookup>( 'clang_IndexAction_dispose'); - late final _dart_clang_IndexAction_dispose _clang_IndexAction_dispose = - _clang_IndexAction_dispose_ptr - .asFunction<_dart_clang_IndexAction_dispose>(); + late final _clang_IndexAction_dispose = + _clang_IndexAction_dispose_ptr.asFunction(); /// Index the given source file and the translation unit corresponding to that /// file via callbacks implemented through #IndexerCallbacks. int clang_indexSourceFile( - ffi.Pointer arg0, - ffi.Pointer client_data, + CXIndexAction arg0, + CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, @@ -5636,7 +5781,7 @@ class LibClang { int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, int TU_options, ) { return _clang_indexSourceFile( @@ -5655,18 +5800,42 @@ class LibClang { ); } - late final _clang_indexSourceFile_ptr = - _lookup>( - 'clang_indexSourceFile'); - late final _dart_clang_indexSourceFile _clang_indexSourceFile = - _clang_indexSourceFile_ptr.asFunction<_dart_clang_indexSourceFile>(); + late final _clang_indexSourceFile_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXIndexAction, + CXClientData, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer, + ffi.Uint32)>>('clang_indexSourceFile'); + late final _clang_indexSourceFile = _clang_indexSourceFile_ptr.asFunction< + int Function( + CXIndexAction, + CXClientData, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + ffi.Pointer, + int)>(); /// Same as clang_indexSourceFile but requires a full command line for /// command_line_args including argv[0]. This is useful if the standard /// library paths are relative to the binary. int clang_indexSourceFileFullArgv( - ffi.Pointer arg0, - ffi.Pointer client_data, + CXIndexAction arg0, + CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, @@ -5675,7 +5844,7 @@ class LibClang { int num_command_line_args, ffi.Pointer unsaved_files, int num_unsaved_files, - ffi.Pointer> out_TU, + ffi.Pointer out_TU, int TU_options, ) { return _clang_indexSourceFileFullArgv( @@ -5694,22 +5863,46 @@ class LibClang { ); } - late final _clang_indexSourceFileFullArgv_ptr = - _lookup>( - 'clang_indexSourceFileFullArgv'); - late final _dart_clang_indexSourceFileFullArgv - _clang_indexSourceFileFullArgv = _clang_indexSourceFileFullArgv_ptr - .asFunction<_dart_clang_indexSourceFileFullArgv>(); + late final _clang_indexSourceFileFullArgv_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXIndexAction, + CXClientData, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer, + ffi.Uint32, + ffi.Pointer, + ffi.Uint32)>>('clang_indexSourceFileFullArgv'); + late final _clang_indexSourceFileFullArgv = + _clang_indexSourceFileFullArgv_ptr.asFunction< + int Function( + CXIndexAction, + CXClientData, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer>, + int, + ffi.Pointer, + int, + ffi.Pointer, + int)>(); /// Index the given translation unit via callbacks implemented through /// #IndexerCallbacks. int clang_indexTranslationUnit( - ffi.Pointer arg0, - ffi.Pointer client_data, + CXIndexAction arg0, + CXClientData client_data, ffi.Pointer index_callbacks, int index_callbacks_size, int index_options, - ffi.Pointer arg5, + CXTranslationUnit arg5, ) { return _clang_indexTranslationUnit( arg0, @@ -5721,19 +5914,26 @@ class LibClang { ); } - late final _clang_indexTranslationUnit_ptr = - _lookup>( - 'clang_indexTranslationUnit'); - late final _dart_clang_indexTranslationUnit _clang_indexTranslationUnit = - _clang_indexTranslationUnit_ptr - .asFunction<_dart_clang_indexTranslationUnit>(); + late final _clang_indexTranslationUnit_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + CXIndexAction, + CXClientData, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32, + CXTranslationUnit)>>('clang_indexTranslationUnit'); + late final _clang_indexTranslationUnit = + _clang_indexTranslationUnit_ptr.asFunction< + int Function(CXIndexAction, CXClientData, + ffi.Pointer, int, int, CXTranslationUnit)>(); /// Retrieve the CXIdxFile, file, line, column, and offset represented by the /// given CXIdxLoc. void clang_indexLoc_getFileLocation( CXIdxLoc loc, - ffi.Pointer> indexFile, - ffi.Pointer> file, + ffi.Pointer indexFile, + ffi.Pointer file, ffi.Pointer line, ffi.Pointer column, ffi.Pointer offset, @@ -5748,12 +5948,24 @@ class LibClang { ); } - late final _clang_indexLoc_getFileLocation_ptr = - _lookup>( - 'clang_indexLoc_getFileLocation'); - late final _dart_clang_indexLoc_getFileLocation - _clang_indexLoc_getFileLocation = _clang_indexLoc_getFileLocation_ptr - .asFunction<_dart_clang_indexLoc_getFileLocation>(); + late final _clang_indexLoc_getFileLocation_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CXIdxLoc, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('clang_indexLoc_getFileLocation'); + late final _clang_indexLoc_getFileLocation = + _clang_indexLoc_getFileLocation_ptr.asFunction< + void Function( + CXIdxLoc, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Retrieve the CXSourceLocation represented by the given CXIdxLoc. CXSourceLocation clang_indexLoc_getCXSourceLocation( @@ -5765,18 +5977,17 @@ class LibClang { } late final _clang_indexLoc_getCXSourceLocation_ptr = - _lookup>( + _lookup>( 'clang_indexLoc_getCXSourceLocation'); - late final _dart_clang_indexLoc_getCXSourceLocation - _clang_indexLoc_getCXSourceLocation = + late final _clang_indexLoc_getCXSourceLocation = _clang_indexLoc_getCXSourceLocation_ptr - .asFunction<_dart_clang_indexLoc_getCXSourceLocation>(); + .asFunction(); /// Visit the fields of a particular type. int clang_Type_visitFields( CXType T, - ffi.Pointer> visitor, - ffi.Pointer client_data, + CXFieldVisitor visitor, + CXClientData client_data, ) { return _clang_Type_visitFields( T, @@ -5785,11 +5996,12 @@ class LibClang { ); } - late final _clang_Type_visitFields_ptr = - _lookup>( - 'clang_Type_visitFields'); - late final _dart_clang_Type_visitFields _clang_Type_visitFields = - _clang_Type_visitFields_ptr.asFunction<_dart_clang_Type_visitFields>(); + late final _clang_Type_visitFields_ptr = _lookup< + ffi.NativeFunction< + ffi.Uint32 Function( + CXType, CXFieldVisitor, CXClientData)>>('clang_Type_visitFields'); + late final _clang_Type_visitFields = _clang_Type_visitFields_ptr + .asFunction(); } /// Error codes returned by libclang routines. @@ -5827,8 +6039,15 @@ class CXStringSet extends ffi.Struct { class CXVirtualFileOverlayImpl extends ffi.Opaque {} +/// Object encapsulating information about overlaying virtual file/directories +/// over the real file system. +typedef CXVirtualFileOverlay = ffi.Pointer; + class CXModuleMapDescriptorImpl extends ffi.Opaque {} +/// Object encapsulating information about a module.map file. +typedef CXModuleMapDescriptor = ffi.Pointer; + class CXTargetInfoImpl extends ffi.Opaque {} class CXTranslationUnitImpl extends ffi.Opaque {} @@ -5917,6 +6136,10 @@ abstract class CXCursor_ExceptionSpecificationKind { static const int CXCursor_ExceptionSpecificationKind_NoThrow = 9; } +/// An "index" that consists of a set of translation units that would typically +/// be linked together into an executable or library. +typedef CXIndex = ffi.Pointer; + abstract class CXGlobalOptFlags { /// Used to indicate that no special CXIndex options are needed. static const int CXGlobalOpt_None = 0; @@ -5934,6 +6157,9 @@ abstract class CXGlobalOptFlags { static const int CXGlobalOpt_ThreadBackgroundPriorityForAll = 3; } +/// A particular source file that is part of a translation unit. +typedef CXFile = ffi.Pointer; + /// Uniquely identifies a CXFile, that refers to the same underlying file, /// across an indexing session. class CXFileUniqueID extends ffi.Struct { @@ -5941,6 +6167,9 @@ class CXFileUniqueID extends ffi.Struct { external ffi.Array data; } +/// A single translation unit, which resides in an index. +typedef CXTranslationUnit = ffi.Pointer; + /// Identifies a specific source location within a translation unit. class CXSourceLocation extends ffi.Struct { @ffi.Array.multi([2]) @@ -5992,6 +6221,13 @@ abstract class CXDiagnosticSeverity { static const int CXDiagnostic_Fatal = 4; } +/// A group of CXDiagnostics. +typedef CXDiagnosticSet = ffi.Pointer; + +/// A single diagnostic, containing the diagnostic's severity, location, text, +/// source ranges, and fix-it hints. +typedef CXDiagnostic = ffi.Pointer; + /// Describes the kind of error that occurred (if any) in a call to /// clang_loadDiagnostics. abstract class CXLoadDiag_Error { @@ -6168,6 +6404,9 @@ class CXTUResourceUsage extends ffi.Struct { external ffi.Pointer entries; } +/// An opaque type representing target information for a given translation unit. +typedef CXTargetInfo = ffi.Pointer; + /// Describes the kind of entity that a cursor refers to. abstract class CXCursorKind { /// A declaration whose specific kind is not exposed via this interface. @@ -6914,6 +7153,9 @@ abstract class CXTLSKind { class CXCursorSetImpl extends ffi.Opaque {} +/// A fast container representing a set of CXCursors. +typedef CXCursorSet = ffi.Pointer; + /// Describes the kind of type abstract class CXTypeKind { /// Represents an invalid type (e.g., where no type is available). @@ -7174,6 +7416,14 @@ abstract class CXChildVisitResult { static const int CXChildVisit_Recurse = 2; } +/// Visitor invoked for each cursor found by a traversal. +typedef CXCursorVisitor = ffi.Pointer< + ffi.NativeFunction>; + +/// Opaque pointer representing client data that will be passed through to +/// various callbacks and visitors. +typedef CXClientData = ffi.Pointer; + /// Properties for the printing policy. abstract class CXPrintingPolicyProperty { static const int CXPrintingPolicy_Indentation = 0; @@ -7205,6 +7455,10 @@ abstract class CXPrintingPolicyProperty { static const int CXPrintingPolicy_LastProperty = 25; } +/// Opaque pointer representing a policy that controls pretty printing for +/// clang_getCursorPrettyPrinted. +typedef CXPrintingPolicy = ffi.Pointer; + /// Property attributes for a CXCursor_ObjCPropertyDecl. abstract class CXObjCPropertyAttrKind { static const int CXObjCPropertyAttr_noattr = 0; @@ -7235,6 +7489,9 @@ abstract class CXObjCDeclQualifierKind { static const int CXObjCDeclQualifier_Oneway = 32; } +/// The functions in this group provide access to information about modules. +typedef CXModule = ffi.Pointer; + abstract class CXNameRefFlags { /// Include the nested-name-specifier, e.g. Foo:: in x.Foo::y, in the range. static const int CXNameRange_WantQualifier = 1; @@ -7281,9 +7538,12 @@ class CXCompletionResult extends ffi.Struct { /// The code-completion string that describes how to insert this /// code-completion result into the editing buffer. - external ffi.Pointer CompletionString; + external CXCompletionString CompletionString; } +/// A semantic string that describes a code-completion result. +typedef CXCompletionString = ffi.Pointer; + /// Describes a single piece of text within a code-completion string. abstract class CXCompletionChunkKind { /// A code-completion string that describes "optional" text that could be a @@ -7484,6 +7744,13 @@ abstract class CXCompletionContext { static const int CXCompletionContext_Unknown = 8388607; } +/// Visitor invoked for each file in a translation unit (used with +/// clang_getInclusions()). +typedef CXInclusionVisitor = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + CXFile, ffi.Pointer, ffi.Uint32, CXClientData)>>; + abstract class CXEvalResultKind { static const int CXEval_Int = 1; static const int CXEval_Float = 2; @@ -7494,6 +7761,12 @@ abstract class CXEvalResultKind { static const int CXEval_UnExposed = 0; } +/// Evaluation result of a cursor +typedef CXEvalResult = ffi.Pointer; + +/// A remapping of original source files and their translated files. +typedef CXRemapping = ffi.Pointer; + /// @{ abstract class CXVisitorResult { static const int CXVisit_Break = 0; @@ -7503,7 +7776,10 @@ abstract class CXVisitorResult { class CXCursorAndRangeVisitor extends ffi.Struct { external ffi.Pointer context; - external ffi.Pointer> visit; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, CXCursor, CXSourceRange)>> visit; } abstract class CXResult { @@ -7535,7 +7811,7 @@ class CXIdxIncludedFileInfo extends ffi.Struct { external ffi.Pointer filename; /// The actual file that the #include/#import directive resolved to. - external ffi.Pointer file; + external CXFile file; @ffi.Int32() external int isImport; @@ -7551,10 +7827,10 @@ class CXIdxIncludedFileInfo extends ffi.Struct { /// Data for IndexerCallbacks#importedASTFile. class CXIdxImportedASTFileInfo extends ffi.Struct { /// Top level AST file containing the imported PCH, module or submodule. - external ffi.Pointer file; + external CXFile file; /// The imported module or NULL if the AST file is a PCH. - external ffi.Pointer module; + external CXModule module; /// Location where the file is imported. Applicable only for modules. external CXIdxLoc loc; @@ -7834,28 +8110,72 @@ class CXIdxEntityRefInfo extends ffi.Struct { class IndexerCallbacks extends ffi.Struct { /// Called periodically to check whether indexing should be aborted. Should /// return 0 to continue, and non-zero to abort. - external ffi.Pointer> abortQuery; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(CXClientData, ffi.Pointer)>> abortQuery; /// Called at the end of indexing; passes the complete diagnostic set. - external ffi.Pointer> diagnostic; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + CXClientData, CXDiagnosticSet, ffi.Pointer)>> + diagnostic; - external ffi.Pointer> enteredMainFile; + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientFile Function( + CXClientData, CXFile, ffi.Pointer)>> enteredMainFile; /// Called when a file gets #included/#imported. - external ffi.Pointer> ppIncludedFile; + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientFile Function( + CXClientData, ffi.Pointer)>> + ppIncludedFile; /// Called when a AST file (PCH or module) gets imported. - external ffi.Pointer> importedASTFile; + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientASTFile Function( + CXClientData, ffi.Pointer)>> + importedASTFile; /// Called at the beginning of indexing a translation unit. - external ffi.Pointer> startedTranslationUnit; + external ffi.Pointer< + ffi.NativeFunction< + CXIdxClientContainer Function( + CXClientData, ffi.Pointer)>> startedTranslationUnit; - external ffi.Pointer> indexDeclaration; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(CXClientData, ffi.Pointer)>> + indexDeclaration; /// Called to index a reference of an entity. - external ffi.Pointer> indexEntityReference; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(CXClientData, ffi.Pointer)>> + indexEntityReference; } +/// The client's data object that is associated with a CXFile. +typedef CXIdxClientFile = ffi.Pointer; + +/// The client's data object that is associated with an AST file (PCH or +/// module). +typedef CXIdxClientASTFile = ffi.Pointer; + +/// The client's data object that is associated with a semantic container of +/// entities. +typedef CXIdxClientContainer = ffi.Pointer; + +/// The client's data object that is associated with a semantic entity. +typedef CXIdxClientEntity = ffi.Pointer; + +/// An indexing action/session, to be applied to one or multiple translation +/// units. +typedef CXIndexAction = ffi.Pointer; + abstract class CXIndexOptFlags { /// Used to indicate that no special indexing options are needed. static const int CXIndexOpt_None = 0; @@ -7882,6 +8202,10 @@ abstract class CXIndexOptFlags { static const int CXIndexOpt_SkipParsedBodiesInSession = 16; } +/// Visitor invoked for each field found by a traversal. +typedef CXFieldVisitor = ffi + .Pointer>; + const int CINDEX_VERSION_MAJOR = 0; const int CINDEX_VERSION_MINOR = 59; @@ -7889,3156 +8213,3 @@ const int CINDEX_VERSION_MINOR = 59; const int CINDEX_VERSION = 59; const String CINDEX_VERSION_STRING = '0.59'; - -typedef _c_clang_getCString = ffi.Pointer Function( - CXString string, -); - -typedef _dart_clang_getCString = ffi.Pointer Function( - CXString string, -); - -typedef _c_clang_disposeString = ffi.Void Function( - CXString string, -); - -typedef _dart_clang_disposeString = void Function( - CXString string, -); - -typedef _c_clang_disposeStringSet = ffi.Void Function( - ffi.Pointer set_1, -); - -typedef _dart_clang_disposeStringSet = void Function( - ffi.Pointer set_1, -); - -typedef _c_clang_getBuildSessionTimestamp = ffi.Uint64 Function(); - -typedef _dart_clang_getBuildSessionTimestamp = int Function(); - -typedef _c_clang_VirtualFileOverlay_create - = ffi.Pointer Function( - ffi.Uint32 options, -); - -typedef _dart_clang_VirtualFileOverlay_create - = ffi.Pointer Function( - int options, -); - -typedef _c_clang_VirtualFileOverlay_addFileMapping = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer virtualPath, - ffi.Pointer realPath, -); - -typedef _dart_clang_VirtualFileOverlay_addFileMapping = int Function( - ffi.Pointer arg0, - ffi.Pointer virtualPath, - ffi.Pointer realPath, -); - -typedef _c_clang_VirtualFileOverlay_setCaseSensitivity = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 caseSensitive, -); - -typedef _dart_clang_VirtualFileOverlay_setCaseSensitivity = int Function( - ffi.Pointer arg0, - int caseSensitive, -); - -typedef _c_clang_VirtualFileOverlay_writeToBuffer = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Uint32 options, - ffi.Pointer> out_buffer_ptr, - ffi.Pointer out_buffer_size, -); - -typedef _dart_clang_VirtualFileOverlay_writeToBuffer = int Function( - ffi.Pointer arg0, - int options, - ffi.Pointer> out_buffer_ptr, - ffi.Pointer out_buffer_size, -); - -typedef _c_clang_free = ffi.Void Function( - ffi.Pointer buffer, -); - -typedef _dart_clang_free = void Function( - ffi.Pointer buffer, -); - -typedef _c_clang_VirtualFileOverlay_dispose = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_VirtualFileOverlay_dispose = void Function( - ffi.Pointer arg0, -); - -typedef _c_clang_ModuleMapDescriptor_create - = ffi.Pointer Function( - ffi.Uint32 options, -); - -typedef _dart_clang_ModuleMapDescriptor_create - = ffi.Pointer Function( - int options, -); - -typedef _c_clang_ModuleMapDescriptor_setFrameworkModuleName = ffi.Int32 - Function( - ffi.Pointer arg0, - ffi.Pointer name, -); - -typedef _dart_clang_ModuleMapDescriptor_setFrameworkModuleName = int Function( - ffi.Pointer arg0, - ffi.Pointer name, -); - -typedef _c_clang_ModuleMapDescriptor_setUmbrellaHeader = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer name, -); - -typedef _dart_clang_ModuleMapDescriptor_setUmbrellaHeader = int Function( - ffi.Pointer arg0, - ffi.Pointer name, -); - -typedef _c_clang_ModuleMapDescriptor_writeToBuffer = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Uint32 options, - ffi.Pointer> out_buffer_ptr, - ffi.Pointer out_buffer_size, -); - -typedef _dart_clang_ModuleMapDescriptor_writeToBuffer = int Function( - ffi.Pointer arg0, - int options, - ffi.Pointer> out_buffer_ptr, - ffi.Pointer out_buffer_size, -); - -typedef _c_clang_ModuleMapDescriptor_dispose = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_ModuleMapDescriptor_dispose = void Function( - ffi.Pointer arg0, -); - -typedef _c_clang_createIndex = ffi.Pointer Function( - ffi.Int32 excludeDeclarationsFromPCH, - ffi.Int32 displayDiagnostics, -); - -typedef _dart_clang_createIndex = ffi.Pointer Function( - int excludeDeclarationsFromPCH, - int displayDiagnostics, -); - -typedef _c_clang_disposeIndex = ffi.Void Function( - ffi.Pointer index, -); - -typedef _dart_clang_disposeIndex = void Function( - ffi.Pointer index, -); - -typedef _c_clang_CXIndex_setGlobalOptions = ffi.Void Function( - ffi.Pointer arg0, - ffi.Uint32 options, -); - -typedef _dart_clang_CXIndex_setGlobalOptions = void Function( - ffi.Pointer arg0, - int options, -); - -typedef _c_clang_CXIndex_getGlobalOptions = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_CXIndex_getGlobalOptions = int Function( - ffi.Pointer arg0, -); - -typedef _c_clang_CXIndex_setInvocationEmissionPathOption = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer Path, -); - -typedef _dart_clang_CXIndex_setInvocationEmissionPathOption = void Function( - ffi.Pointer arg0, - ffi.Pointer Path, -); - -typedef _c_clang_getFileName = CXString Function( - ffi.Pointer SFile, -); - -typedef _dart_clang_getFileName = CXString Function( - ffi.Pointer SFile, -); - -typedef _c_clang_getFileTime = ffi.Int64 Function( - ffi.Pointer SFile, -); - -typedef _dart_clang_getFileTime = int Function( - ffi.Pointer SFile, -); - -typedef _c_clang_getFileUniqueID = ffi.Int32 Function( - ffi.Pointer file, - ffi.Pointer outID, -); - -typedef _dart_clang_getFileUniqueID = int Function( - ffi.Pointer file, - ffi.Pointer outID, -); - -typedef _c_clang_isFileMultipleIncludeGuarded = ffi.Uint32 Function( - ffi.Pointer tu, - ffi.Pointer file, -); - -typedef _dart_clang_isFileMultipleIncludeGuarded = int Function( - ffi.Pointer tu, - ffi.Pointer file, -); - -typedef _c_clang_getFile = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file_name, -); - -typedef _dart_clang_getFile = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file_name, -); - -typedef _c_clang_getFileContents = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, -); - -typedef _dart_clang_getFileContents = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Pointer size, -); - -typedef _c_clang_File_isEqual = ffi.Int32 Function( - ffi.Pointer file1, - ffi.Pointer file2, -); - -typedef _dart_clang_File_isEqual = int Function( - ffi.Pointer file1, - ffi.Pointer file2, -); - -typedef _c_clang_File_tryGetRealPathName = CXString Function( - ffi.Pointer file, -); - -typedef _dart_clang_File_tryGetRealPathName = CXString Function( - ffi.Pointer file, -); - -typedef _c_clang_getNullLocation = CXSourceLocation Function(); - -typedef _dart_clang_getNullLocation = CXSourceLocation Function(); - -typedef _c_clang_equalLocations = ffi.Uint32 Function( - CXSourceLocation loc1, - CXSourceLocation loc2, -); - -typedef _dart_clang_equalLocations = int Function( - CXSourceLocation loc1, - CXSourceLocation loc2, -); - -typedef _c_clang_getLocation = CXSourceLocation Function( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Uint32 line, - ffi.Uint32 column, -); - -typedef _dart_clang_getLocation = CXSourceLocation Function( - ffi.Pointer tu, - ffi.Pointer file, - int line, - int column, -); - -typedef _c_clang_getLocationForOffset = CXSourceLocation Function( - ffi.Pointer tu, - ffi.Pointer file, - ffi.Uint32 offset, -); - -typedef _dart_clang_getLocationForOffset = CXSourceLocation Function( - ffi.Pointer tu, - ffi.Pointer file, - int offset, -); - -typedef _c_clang_Location_isInSystemHeader = ffi.Int32 Function( - CXSourceLocation location, -); - -typedef _dart_clang_Location_isInSystemHeader = int Function( - CXSourceLocation location, -); - -typedef _c_clang_Location_isFromMainFile = ffi.Int32 Function( - CXSourceLocation location, -); - -typedef _dart_clang_Location_isFromMainFile = int Function( - CXSourceLocation location, -); - -typedef _c_clang_getNullRange = CXSourceRange Function(); - -typedef _dart_clang_getNullRange = CXSourceRange Function(); - -typedef _c_clang_getRange = CXSourceRange Function( - CXSourceLocation begin, - CXSourceLocation end, -); - -typedef _dart_clang_getRange = CXSourceRange Function( - CXSourceLocation begin, - CXSourceLocation end, -); - -typedef _c_clang_equalRanges = ffi.Uint32 Function( - CXSourceRange range1, - CXSourceRange range2, -); - -typedef _dart_clang_equalRanges = int Function( - CXSourceRange range1, - CXSourceRange range2, -); - -typedef _c_clang_Range_isNull = ffi.Int32 Function( - CXSourceRange range, -); - -typedef _dart_clang_Range_isNull = int Function( - CXSourceRange range, -); - -typedef _c_clang_getExpansionLocation = ffi.Void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _dart_clang_getExpansionLocation = void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _c_clang_getPresumedLocation = ffi.Void Function( - CXSourceLocation location, - ffi.Pointer filename, - ffi.Pointer line, - ffi.Pointer column, -); - -typedef _dart_clang_getPresumedLocation = void Function( - CXSourceLocation location, - ffi.Pointer filename, - ffi.Pointer line, - ffi.Pointer column, -); - -typedef _c_clang_getInstantiationLocation = ffi.Void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _dart_clang_getInstantiationLocation = void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _c_clang_getSpellingLocation = ffi.Void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _dart_clang_getSpellingLocation = void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _c_clang_getFileLocation = ffi.Void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _dart_clang_getFileLocation = void Function( - CXSourceLocation location, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _c_clang_getRangeStart = CXSourceLocation Function( - CXSourceRange range, -); - -typedef _dart_clang_getRangeStart = CXSourceLocation Function( - CXSourceRange range, -); - -typedef _c_clang_getRangeEnd = CXSourceLocation Function( - CXSourceRange range, -); - -typedef _dart_clang_getRangeEnd = CXSourceLocation Function( - CXSourceRange range, -); - -typedef _c_clang_getSkippedRanges = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, -); - -typedef _dart_clang_getSkippedRanges = ffi.Pointer Function( - ffi.Pointer tu, - ffi.Pointer file, -); - -typedef _c_clang_getAllSkippedRanges = ffi.Pointer Function( - ffi.Pointer tu, -); - -typedef _dart_clang_getAllSkippedRanges = ffi.Pointer - Function( - ffi.Pointer tu, -); - -typedef _c_clang_disposeSourceRangeList = ffi.Void Function( - ffi.Pointer ranges, -); - -typedef _dart_clang_disposeSourceRangeList = void Function( - ffi.Pointer ranges, -); - -typedef _c_clang_getNumDiagnosticsInSet = ffi.Uint32 Function( - ffi.Pointer Diags, -); - -typedef _dart_clang_getNumDiagnosticsInSet = int Function( - ffi.Pointer Diags, -); - -typedef _c_clang_getDiagnosticInSet = ffi.Pointer Function( - ffi.Pointer Diags, - ffi.Uint32 Index, -); - -typedef _dart_clang_getDiagnosticInSet = ffi.Pointer Function( - ffi.Pointer Diags, - int Index, -); - -typedef _c_clang_loadDiagnostics = ffi.Pointer Function( - ffi.Pointer file, - ffi.Pointer error, - ffi.Pointer errorString, -); - -typedef _dart_clang_loadDiagnostics = ffi.Pointer Function( - ffi.Pointer file, - ffi.Pointer error, - ffi.Pointer errorString, -); - -typedef _c_clang_disposeDiagnosticSet = ffi.Void Function( - ffi.Pointer Diags, -); - -typedef _dart_clang_disposeDiagnosticSet = void Function( - ffi.Pointer Diags, -); - -typedef _c_clang_getChildDiagnostics = ffi.Pointer Function( - ffi.Pointer D, -); - -typedef _dart_clang_getChildDiagnostics = ffi.Pointer Function( - ffi.Pointer D, -); - -typedef _c_clang_getNumDiagnostics = ffi.Uint32 Function( - ffi.Pointer Unit, -); - -typedef _dart_clang_getNumDiagnostics = int Function( - ffi.Pointer Unit, -); - -typedef _c_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - ffi.Uint32 Index, -); - -typedef _dart_clang_getDiagnostic = ffi.Pointer Function( - ffi.Pointer Unit, - int Index, -); - -typedef _c_clang_getDiagnosticSetFromTU = ffi.Pointer Function( - ffi.Pointer Unit, -); - -typedef _dart_clang_getDiagnosticSetFromTU = ffi.Pointer Function( - ffi.Pointer Unit, -); - -typedef _c_clang_disposeDiagnostic = ffi.Void Function( - ffi.Pointer Diagnostic, -); - -typedef _dart_clang_disposeDiagnostic = void Function( - ffi.Pointer Diagnostic, -); - -typedef _c_clang_formatDiagnostic = CXString Function( - ffi.Pointer Diagnostic, - ffi.Uint32 Options, -); - -typedef _dart_clang_formatDiagnostic = CXString Function( - ffi.Pointer Diagnostic, - int Options, -); - -typedef _c_clang_defaultDiagnosticDisplayOptions = ffi.Uint32 Function(); - -typedef _dart_clang_defaultDiagnosticDisplayOptions = int Function(); - -typedef _c_clang_getDiagnosticSeverity = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticSeverity = int Function( - ffi.Pointer arg0, -); - -typedef _c_clang_getDiagnosticLocation = CXSourceLocation Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticLocation = CXSourceLocation Function( - ffi.Pointer arg0, -); - -typedef _c_clang_getDiagnosticSpelling = CXString Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticSpelling = CXString Function( - ffi.Pointer arg0, -); - -typedef _c_clang_getDiagnosticOption = CXString Function( - ffi.Pointer Diag, - ffi.Pointer Disable, -); - -typedef _dart_clang_getDiagnosticOption = CXString Function( - ffi.Pointer Diag, - ffi.Pointer Disable, -); - -typedef _c_clang_getDiagnosticCategory = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticCategory = int Function( - ffi.Pointer arg0, -); - -typedef _c_clang_getDiagnosticCategoryName = CXString Function( - ffi.Uint32 Category, -); - -typedef _dart_clang_getDiagnosticCategoryName = CXString Function( - int Category, -); - -typedef _c_clang_getDiagnosticCategoryText = CXString Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticCategoryText = CXString Function( - ffi.Pointer arg0, -); - -typedef _c_clang_getDiagnosticNumRanges = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getDiagnosticNumRanges = int Function( - ffi.Pointer arg0, -); - -typedef _c_clang_getDiagnosticRange = CXSourceRange Function( - ffi.Pointer Diagnostic, - ffi.Uint32 Range, -); - -typedef _dart_clang_getDiagnosticRange = CXSourceRange Function( - ffi.Pointer Diagnostic, - int Range, -); - -typedef _c_clang_getDiagnosticNumFixIts = ffi.Uint32 Function( - ffi.Pointer Diagnostic, -); - -typedef _dart_clang_getDiagnosticNumFixIts = int Function( - ffi.Pointer Diagnostic, -); - -typedef _c_clang_getDiagnosticFixIt = CXString Function( - ffi.Pointer Diagnostic, - ffi.Uint32 FixIt, - ffi.Pointer ReplacementRange, -); - -typedef _dart_clang_getDiagnosticFixIt = CXString Function( - ffi.Pointer Diagnostic, - int FixIt, - ffi.Pointer ReplacementRange, -); - -typedef _c_clang_getTranslationUnitSpelling = CXString Function( - ffi.Pointer CTUnit, -); - -typedef _dart_clang_getTranslationUnitSpelling = CXString Function( - ffi.Pointer CTUnit, -); - -typedef _c_clang_createTranslationUnitFromSourceFile - = ffi.Pointer Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Int32 num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, - ffi.Uint32 num_unsaved_files, - ffi.Pointer unsaved_files, -); - -typedef _dart_clang_createTranslationUnitFromSourceFile - = ffi.Pointer Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - int num_clang_command_line_args, - ffi.Pointer> clang_command_line_args, - int num_unsaved_files, - ffi.Pointer unsaved_files, -); - -typedef _c_clang_createTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, -); - -typedef _dart_clang_createTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, -); - -typedef _c_clang_createTranslationUnit2 = ffi.Int32 Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, - ffi.Pointer> out_TU, -); - -typedef _dart_clang_createTranslationUnit2 = int Function( - ffi.Pointer CIdx, - ffi.Pointer ast_filename, - ffi.Pointer> out_TU, -); - -typedef _c_clang_defaultEditingTranslationUnitOptions = ffi.Uint32 Function(); - -typedef _dart_clang_defaultEditingTranslationUnitOptions = int Function(); - -typedef _c_clang_parseTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, -); - -typedef _dart_clang_parseTranslationUnit = ffi.Pointer - Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, -); - -typedef _c_clang_parseTranslationUnit2 = ffi.Int32 Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, - ffi.Pointer> out_TU, -); - -typedef _dart_clang_parseTranslationUnit2 = int Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, - ffi.Pointer> out_TU, -); - -typedef _c_clang_parseTranslationUnit2FullArgv = ffi.Int32 Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, - ffi.Pointer> out_TU, -); - -typedef _dart_clang_parseTranslationUnit2FullArgv = int Function( - ffi.Pointer CIdx, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, - ffi.Pointer> out_TU, -); - -typedef _c_clang_defaultSaveOptions = ffi.Uint32 Function( - ffi.Pointer TU, -); - -typedef _dart_clang_defaultSaveOptions = int Function( - ffi.Pointer TU, -); - -typedef _c_clang_saveTranslationUnit = ffi.Int32 Function( - ffi.Pointer TU, - ffi.Pointer FileName, - ffi.Uint32 options, -); - -typedef _dart_clang_saveTranslationUnit = int Function( - ffi.Pointer TU, - ffi.Pointer FileName, - int options, -); - -typedef _c_clang_suspendTranslationUnit = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_suspendTranslationUnit = int Function( - ffi.Pointer arg0, -); - -typedef _c_clang_disposeTranslationUnit = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_disposeTranslationUnit = void Function( - ffi.Pointer arg0, -); - -typedef _c_clang_defaultReparseOptions = ffi.Uint32 Function( - ffi.Pointer TU, -); - -typedef _dart_clang_defaultReparseOptions = int Function( - ffi.Pointer TU, -); - -typedef _c_clang_reparseTranslationUnit = ffi.Int32 Function( - ffi.Pointer TU, - ffi.Uint32 num_unsaved_files, - ffi.Pointer unsaved_files, - ffi.Uint32 options, -); - -typedef _dart_clang_reparseTranslationUnit = int Function( - ffi.Pointer TU, - int num_unsaved_files, - ffi.Pointer unsaved_files, - int options, -); - -typedef _c_clang_getTUResourceUsageName = ffi.Pointer Function( - ffi.Int32 kind, -); - -typedef _dart_clang_getTUResourceUsageName = ffi.Pointer Function( - int kind, -); - -typedef _c_clang_getCXTUResourceUsage = CXTUResourceUsage Function( - ffi.Pointer TU, -); - -typedef _dart_clang_getCXTUResourceUsage = CXTUResourceUsage Function( - ffi.Pointer TU, -); - -typedef _c_clang_disposeCXTUResourceUsage = ffi.Void Function( - CXTUResourceUsage usage, -); - -typedef _dart_clang_disposeCXTUResourceUsage = void Function( - CXTUResourceUsage usage, -); - -typedef _c_clang_getTranslationUnitTargetInfo = ffi.Pointer - Function( - ffi.Pointer CTUnit, -); - -typedef _dart_clang_getTranslationUnitTargetInfo = ffi.Pointer - Function( - ffi.Pointer CTUnit, -); - -typedef _c_clang_TargetInfo_dispose = ffi.Void Function( - ffi.Pointer Info, -); - -typedef _dart_clang_TargetInfo_dispose = void Function( - ffi.Pointer Info, -); - -typedef _c_clang_TargetInfo_getTriple = CXString Function( - ffi.Pointer Info, -); - -typedef _dart_clang_TargetInfo_getTriple = CXString Function( - ffi.Pointer Info, -); - -typedef _c_clang_TargetInfo_getPointerWidth = ffi.Int32 Function( - ffi.Pointer Info, -); - -typedef _dart_clang_TargetInfo_getPointerWidth = int Function( - ffi.Pointer Info, -); - -typedef _c_clang_getNullCursor = CXCursor Function(); - -typedef _dart_clang_getNullCursor = CXCursor Function(); - -typedef _c_clang_getTranslationUnitCursor = CXCursor Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_getTranslationUnitCursor = CXCursor Function( - ffi.Pointer arg0, -); - -typedef _c_clang_equalCursors = ffi.Uint32 Function( - CXCursor arg0, - CXCursor arg1, -); - -typedef _dart_clang_equalCursors = int Function( - CXCursor arg0, - CXCursor arg1, -); - -typedef _c_clang_Cursor_isNull = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_Cursor_isNull = int Function( - CXCursor cursor, -); - -typedef _c_clang_hashCursor = ffi.Uint32 Function( - CXCursor arg0, -); - -typedef _dart_clang_hashCursor = int Function( - CXCursor arg0, -); - -typedef _c_clang_getCursorKind = ffi.Int32 Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorKind = int Function( - CXCursor arg0, -); - -typedef _c_clang_isDeclaration = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isDeclaration = int Function( - int arg0, -); - -typedef _c_clang_isInvalidDeclaration = ffi.Uint32 Function( - CXCursor arg0, -); - -typedef _dart_clang_isInvalidDeclaration = int Function( - CXCursor arg0, -); - -typedef _c_clang_isReference = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isReference = int Function( - int arg0, -); - -typedef _c_clang_isExpression = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isExpression = int Function( - int arg0, -); - -typedef _c_clang_isStatement = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isStatement = int Function( - int arg0, -); - -typedef _c_clang_isAttribute = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isAttribute = int Function( - int arg0, -); - -typedef _c_clang_Cursor_hasAttrs = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_hasAttrs = int Function( - CXCursor C, -); - -typedef _c_clang_isInvalid = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isInvalid = int Function( - int arg0, -); - -typedef _c_clang_isTranslationUnit = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isTranslationUnit = int Function( - int arg0, -); - -typedef _c_clang_isPreprocessing = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isPreprocessing = int Function( - int arg0, -); - -typedef _c_clang_isUnexposed = ffi.Uint32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_isUnexposed = int Function( - int arg0, -); - -typedef _c_clang_getCursorLinkage = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getCursorLinkage = int Function( - CXCursor cursor, -); - -typedef _c_clang_getCursorVisibility = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getCursorVisibility = int Function( - CXCursor cursor, -); - -typedef _c_clang_getCursorAvailability = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getCursorAvailability = int Function( - CXCursor cursor, -); - -typedef _c_clang_getCursorPlatformAvailability = ffi.Int32 Function( - CXCursor cursor, - ffi.Pointer always_deprecated, - ffi.Pointer deprecated_message, - ffi.Pointer always_unavailable, - ffi.Pointer unavailable_message, - ffi.Pointer availability, - ffi.Int32 availability_size, -); - -typedef _dart_clang_getCursorPlatformAvailability = int Function( - CXCursor cursor, - ffi.Pointer always_deprecated, - ffi.Pointer deprecated_message, - ffi.Pointer always_unavailable, - ffi.Pointer unavailable_message, - ffi.Pointer availability, - int availability_size, -); - -typedef _c_clang_disposeCXPlatformAvailability = ffi.Void Function( - ffi.Pointer availability, -); - -typedef _dart_clang_disposeCXPlatformAvailability = void Function( - ffi.Pointer availability, -); - -typedef _c_clang_getCursorLanguage = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getCursorLanguage = int Function( - CXCursor cursor, -); - -typedef _c_clang_getCursorTLSKind = ffi.Int32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getCursorTLSKind = int Function( - CXCursor cursor, -); - -typedef _c_clang_Cursor_getTranslationUnit = ffi.Pointer - Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getTranslationUnit - = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _c_clang_createCXCursorSet = ffi.Pointer Function(); - -typedef _dart_clang_createCXCursorSet = ffi.Pointer Function(); - -typedef _c_clang_disposeCXCursorSet = ffi.Void Function( - ffi.Pointer cset, -); - -typedef _dart_clang_disposeCXCursorSet = void Function( - ffi.Pointer cset, -); - -typedef _c_clang_CXCursorSet_contains = ffi.Uint32 Function( - ffi.Pointer cset, - CXCursor cursor, -); - -typedef _dart_clang_CXCursorSet_contains = int Function( - ffi.Pointer cset, - CXCursor cursor, -); - -typedef _c_clang_CXCursorSet_insert = ffi.Uint32 Function( - ffi.Pointer cset, - CXCursor cursor, -); - -typedef _dart_clang_CXCursorSet_insert = int Function( - ffi.Pointer cset, - CXCursor cursor, -); - -typedef _c_clang_getCursorSemanticParent = CXCursor Function( - CXCursor cursor, -); - -typedef _dart_clang_getCursorSemanticParent = CXCursor Function( - CXCursor cursor, -); - -typedef _c_clang_getCursorLexicalParent = CXCursor Function( - CXCursor cursor, -); - -typedef _dart_clang_getCursorLexicalParent = CXCursor Function( - CXCursor cursor, -); - -typedef _c_clang_getOverriddenCursors = ffi.Void Function( - CXCursor cursor, - ffi.Pointer> overridden, - ffi.Pointer num_overridden, -); - -typedef _dart_clang_getOverriddenCursors = void Function( - CXCursor cursor, - ffi.Pointer> overridden, - ffi.Pointer num_overridden, -); - -typedef _c_clang_disposeOverriddenCursors = ffi.Void Function( - ffi.Pointer overridden, -); - -typedef _dart_clang_disposeOverriddenCursors = void Function( - ffi.Pointer overridden, -); - -typedef _c_clang_getIncludedFile = ffi.Pointer Function( - CXCursor cursor, -); - -typedef _dart_clang_getIncludedFile = ffi.Pointer Function( - CXCursor cursor, -); - -typedef _c_clang_getCursor = CXCursor Function( - ffi.Pointer arg0, - CXSourceLocation arg1, -); - -typedef _dart_clang_getCursor = CXCursor Function( - ffi.Pointer arg0, - CXSourceLocation arg1, -); - -typedef _c_clang_getCursorLocation = CXSourceLocation Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorLocation = CXSourceLocation Function( - CXCursor arg0, -); - -typedef _c_clang_getCursorExtent = CXSourceRange Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorExtent = CXSourceRange Function( - CXCursor arg0, -); - -typedef _c_clang_getCursorType = CXType Function( - CXCursor C, -); - -typedef _dart_clang_getCursorType = CXType Function( - CXCursor C, -); - -typedef _c_clang_getTypeSpelling = CXString Function( - CXType CT, -); - -typedef _dart_clang_getTypeSpelling = CXString Function( - CXType CT, -); - -typedef _c_clang_getTypedefDeclUnderlyingType = CXType Function( - CXCursor C, -); - -typedef _dart_clang_getTypedefDeclUnderlyingType = CXType Function( - CXCursor C, -); - -typedef _c_clang_getEnumDeclIntegerType = CXType Function( - CXCursor C, -); - -typedef _dart_clang_getEnumDeclIntegerType = CXType Function( - CXCursor C, -); - -typedef _c_clang_getEnumConstantDeclValue = ffi.Int64 Function( - CXCursor C, -); - -typedef _dart_clang_getEnumConstantDeclValue = int Function( - CXCursor C, -); - -typedef _c_clang_getEnumConstantDeclUnsignedValue = ffi.Uint64 Function( - CXCursor C, -); - -typedef _dart_clang_getEnumConstantDeclUnsignedValue = int Function( - CXCursor C, -); - -typedef _c_clang_getFieldDeclBitWidth = ffi.Int32 Function( - CXCursor C, -); - -typedef _dart_clang_getFieldDeclBitWidth = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getNumArguments = ffi.Int32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getNumArguments = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getArgument = CXCursor Function( - CXCursor C, - ffi.Uint32 i, -); - -typedef _dart_clang_Cursor_getArgument = CXCursor Function( - CXCursor C, - int i, -); - -typedef _c_clang_Cursor_getNumTemplateArguments = ffi.Int32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getNumTemplateArguments = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getTemplateArgumentKind = ffi.Int32 Function( - CXCursor C, - ffi.Uint32 I, -); - -typedef _dart_clang_Cursor_getTemplateArgumentKind = int Function( - CXCursor C, - int I, -); - -typedef _c_clang_Cursor_getTemplateArgumentType = CXType Function( - CXCursor C, - ffi.Uint32 I, -); - -typedef _dart_clang_Cursor_getTemplateArgumentType = CXType Function( - CXCursor C, - int I, -); - -typedef _c_clang_Cursor_getTemplateArgumentValue = ffi.Int64 Function( - CXCursor C, - ffi.Uint32 I, -); - -typedef _dart_clang_Cursor_getTemplateArgumentValue = int Function( - CXCursor C, - int I, -); - -typedef _c_clang_Cursor_getTemplateArgumentUnsignedValue = ffi.Uint64 Function( - CXCursor C, - ffi.Uint32 I, -); - -typedef _dart_clang_Cursor_getTemplateArgumentUnsignedValue = int Function( - CXCursor C, - int I, -); - -typedef _c_clang_equalTypes = ffi.Uint32 Function( - CXType A, - CXType B, -); - -typedef _dart_clang_equalTypes = int Function( - CXType A, - CXType B, -); - -typedef _c_clang_getCanonicalType = CXType Function( - CXType T, -); - -typedef _dart_clang_getCanonicalType = CXType Function( - CXType T, -); - -typedef _c_clang_isConstQualifiedType = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_isConstQualifiedType = int Function( - CXType T, -); - -typedef _c_clang_Cursor_isMacroFunctionLike = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isMacroFunctionLike = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isMacroBuiltin = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isMacroBuiltin = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isFunctionInlined = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isFunctionInlined = int Function( - CXCursor C, -); - -typedef _c_clang_isVolatileQualifiedType = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_isVolatileQualifiedType = int Function( - CXType T, -); - -typedef _c_clang_isRestrictQualifiedType = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_isRestrictQualifiedType = int Function( - CXType T, -); - -typedef _c_clang_getAddressSpace = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_getAddressSpace = int Function( - CXType T, -); - -typedef _c_clang_getTypedefName = CXString Function( - CXType CT, -); - -typedef _dart_clang_getTypedefName = CXString Function( - CXType CT, -); - -typedef _c_clang_getPointeeType = CXType Function( - CXType T, -); - -typedef _dart_clang_getPointeeType = CXType Function( - CXType T, -); - -typedef _c_clang_getTypeDeclaration = CXCursor Function( - CXType T, -); - -typedef _dart_clang_getTypeDeclaration = CXCursor Function( - CXType T, -); - -typedef _c_clang_getDeclObjCTypeEncoding = CXString Function( - CXCursor C, -); - -typedef _dart_clang_getDeclObjCTypeEncoding = CXString Function( - CXCursor C, -); - -typedef _c_clang_Type_getObjCEncoding = CXString Function( - CXType type, -); - -typedef _dart_clang_Type_getObjCEncoding = CXString Function( - CXType type, -); - -typedef _c_clang_getTypeKindSpelling = CXString Function( - ffi.Int32 K, -); - -typedef _dart_clang_getTypeKindSpelling = CXString Function( - int K, -); - -typedef _c_clang_getFunctionTypeCallingConv = ffi.Int32 Function( - CXType T, -); - -typedef _dart_clang_getFunctionTypeCallingConv = int Function( - CXType T, -); - -typedef _c_clang_getResultType = CXType Function( - CXType T, -); - -typedef _dart_clang_getResultType = CXType Function( - CXType T, -); - -typedef _c_clang_getExceptionSpecificationType = ffi.Int32 Function( - CXType T, -); - -typedef _dart_clang_getExceptionSpecificationType = int Function( - CXType T, -); - -typedef _c_clang_getNumArgTypes = ffi.Int32 Function( - CXType T, -); - -typedef _dart_clang_getNumArgTypes = int Function( - CXType T, -); - -typedef _c_clang_getArgType = CXType Function( - CXType T, - ffi.Uint32 i, -); - -typedef _dart_clang_getArgType = CXType Function( - CXType T, - int i, -); - -typedef _c_clang_Type_getObjCObjectBaseType = CXType Function( - CXType T, -); - -typedef _dart_clang_Type_getObjCObjectBaseType = CXType Function( - CXType T, -); - -typedef _c_clang_Type_getNumObjCProtocolRefs = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_Type_getNumObjCProtocolRefs = int Function( - CXType T, -); - -typedef _c_clang_Type_getObjCProtocolDecl = CXCursor Function( - CXType T, - ffi.Uint32 i, -); - -typedef _dart_clang_Type_getObjCProtocolDecl = CXCursor Function( - CXType T, - int i, -); - -typedef _c_clang_Type_getNumObjCTypeArgs = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_Type_getNumObjCTypeArgs = int Function( - CXType T, -); - -typedef _c_clang_Type_getObjCTypeArg = CXType Function( - CXType T, - ffi.Uint32 i, -); - -typedef _dart_clang_Type_getObjCTypeArg = CXType Function( - CXType T, - int i, -); - -typedef _c_clang_isFunctionTypeVariadic = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_isFunctionTypeVariadic = int Function( - CXType T, -); - -typedef _c_clang_getCursorResultType = CXType Function( - CXCursor C, -); - -typedef _dart_clang_getCursorResultType = CXType Function( - CXCursor C, -); - -typedef _c_clang_getCursorExceptionSpecificationType = ffi.Int32 Function( - CXCursor C, -); - -typedef _dart_clang_getCursorExceptionSpecificationType = int Function( - CXCursor C, -); - -typedef _c_clang_isPODType = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_isPODType = int Function( - CXType T, -); - -typedef _c_clang_getElementType = CXType Function( - CXType T, -); - -typedef _dart_clang_getElementType = CXType Function( - CXType T, -); - -typedef _c_clang_getNumElements = ffi.Int64 Function( - CXType T, -); - -typedef _dart_clang_getNumElements = int Function( - CXType T, -); - -typedef _c_clang_getArrayElementType = CXType Function( - CXType T, -); - -typedef _dart_clang_getArrayElementType = CXType Function( - CXType T, -); - -typedef _c_clang_getArraySize = ffi.Int64 Function( - CXType T, -); - -typedef _dart_clang_getArraySize = int Function( - CXType T, -); - -typedef _c_clang_Type_getNamedType = CXType Function( - CXType T, -); - -typedef _dart_clang_Type_getNamedType = CXType Function( - CXType T, -); - -typedef _c_clang_Type_isTransparentTagTypedef = ffi.Uint32 Function( - CXType T, -); - -typedef _dart_clang_Type_isTransparentTagTypedef = int Function( - CXType T, -); - -typedef _c_clang_Type_getNullability = ffi.Int32 Function( - CXType T, -); - -typedef _dart_clang_Type_getNullability = int Function( - CXType T, -); - -typedef _c_clang_Type_getAlignOf = ffi.Int64 Function( - CXType T, -); - -typedef _dart_clang_Type_getAlignOf = int Function( - CXType T, -); - -typedef _c_clang_Type_getClassType = CXType Function( - CXType T, -); - -typedef _dart_clang_Type_getClassType = CXType Function( - CXType T, -); - -typedef _c_clang_Type_getSizeOf = ffi.Int64 Function( - CXType T, -); - -typedef _dart_clang_Type_getSizeOf = int Function( - CXType T, -); - -typedef _c_clang_Type_getOffsetOf = ffi.Int64 Function( - CXType T, - ffi.Pointer S, -); - -typedef _dart_clang_Type_getOffsetOf = int Function( - CXType T, - ffi.Pointer S, -); - -typedef _c_clang_Type_getModifiedType = CXType Function( - CXType T, -); - -typedef _dart_clang_Type_getModifiedType = CXType Function( - CXType T, -); - -typedef _c_clang_Cursor_getOffsetOfField = ffi.Int64 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getOffsetOfField = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isAnonymous = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isAnonymous = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isAnonymousRecordDecl = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isAnonymousRecordDecl = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isInlineNamespace = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isInlineNamespace = int Function( - CXCursor C, -); - -typedef _c_clang_Type_getNumTemplateArguments = ffi.Int32 Function( - CXType T, -); - -typedef _dart_clang_Type_getNumTemplateArguments = int Function( - CXType T, -); - -typedef _c_clang_Type_getTemplateArgumentAsType = CXType Function( - CXType T, - ffi.Uint32 i, -); - -typedef _dart_clang_Type_getTemplateArgumentAsType = CXType Function( - CXType T, - int i, -); - -typedef _c_clang_Type_getCXXRefQualifier = ffi.Int32 Function( - CXType T, -); - -typedef _dart_clang_Type_getCXXRefQualifier = int Function( - CXType T, -); - -typedef _c_clang_Cursor_isBitField = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isBitField = int Function( - CXCursor C, -); - -typedef _c_clang_isVirtualBase = ffi.Uint32 Function( - CXCursor arg0, -); - -typedef _dart_clang_isVirtualBase = int Function( - CXCursor arg0, -); - -typedef _c_clang_getCXXAccessSpecifier = ffi.Int32 Function( - CXCursor arg0, -); - -typedef _dart_clang_getCXXAccessSpecifier = int Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_getStorageClass = ffi.Int32 Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getStorageClass = int Function( - CXCursor arg0, -); - -typedef _c_clang_getNumOverloadedDecls = ffi.Uint32 Function( - CXCursor cursor, -); - -typedef _dart_clang_getNumOverloadedDecls = int Function( - CXCursor cursor, -); - -typedef _c_clang_getOverloadedDecl = CXCursor Function( - CXCursor cursor, - ffi.Uint32 index, -); - -typedef _dart_clang_getOverloadedDecl = CXCursor Function( - CXCursor cursor, - int index, -); - -typedef _c_clang_getIBOutletCollectionType = CXType Function( - CXCursor arg0, -); - -typedef _dart_clang_getIBOutletCollectionType = CXType Function( - CXCursor arg0, -); - -typedef CXCursorVisitor = ffi.Int32 Function( - CXCursor, - CXCursor, - ffi.Pointer, -); - -typedef _c_clang_visitChildren = ffi.Uint32 Function( - CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _dart_clang_visitChildren = int Function( - CXCursor parent, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _c_clang_getCursorUSR = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorUSR = CXString Function( - CXCursor arg0, -); - -typedef _c_clang_constructUSR_ObjCClass = CXString Function( - ffi.Pointer class_name, -); - -typedef _dart_clang_constructUSR_ObjCClass = CXString Function( - ffi.Pointer class_name, -); - -typedef _c_clang_constructUSR_ObjCCategory = CXString Function( - ffi.Pointer class_name, - ffi.Pointer category_name, -); - -typedef _dart_clang_constructUSR_ObjCCategory = CXString Function( - ffi.Pointer class_name, - ffi.Pointer category_name, -); - -typedef _c_clang_constructUSR_ObjCProtocol = CXString Function( - ffi.Pointer protocol_name, -); - -typedef _dart_clang_constructUSR_ObjCProtocol = CXString Function( - ffi.Pointer protocol_name, -); - -typedef _c_clang_constructUSR_ObjCIvar = CXString Function( - ffi.Pointer name, - CXString classUSR, -); - -typedef _dart_clang_constructUSR_ObjCIvar = CXString Function( - ffi.Pointer name, - CXString classUSR, -); - -typedef _c_clang_constructUSR_ObjCMethod = CXString Function( - ffi.Pointer name, - ffi.Uint32 isInstanceMethod, - CXString classUSR, -); - -typedef _dart_clang_constructUSR_ObjCMethod = CXString Function( - ffi.Pointer name, - int isInstanceMethod, - CXString classUSR, -); - -typedef _c_clang_constructUSR_ObjCProperty = CXString Function( - ffi.Pointer property, - CXString classUSR, -); - -typedef _dart_clang_constructUSR_ObjCProperty = CXString Function( - ffi.Pointer property, - CXString classUSR, -); - -typedef _c_clang_getCursorSpelling = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorSpelling = CXString Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_getSpellingNameRange = CXSourceRange Function( - CXCursor arg0, - ffi.Uint32 pieceIndex, - ffi.Uint32 options, -); - -typedef _dart_clang_Cursor_getSpellingNameRange = CXSourceRange Function( - CXCursor arg0, - int pieceIndex, - int options, -); - -typedef _c_clang_PrintingPolicy_getProperty = ffi.Uint32 Function( - ffi.Pointer Policy, - ffi.Int32 Property, -); - -typedef _dart_clang_PrintingPolicy_getProperty = int Function( - ffi.Pointer Policy, - int Property, -); - -typedef _c_clang_PrintingPolicy_setProperty = ffi.Void Function( - ffi.Pointer Policy, - ffi.Int32 Property, - ffi.Uint32 Value, -); - -typedef _dart_clang_PrintingPolicy_setProperty = void Function( - ffi.Pointer Policy, - int Property, - int Value, -); - -typedef _c_clang_getCursorPrintingPolicy = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorPrintingPolicy = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _c_clang_PrintingPolicy_dispose = ffi.Void Function( - ffi.Pointer Policy, -); - -typedef _dart_clang_PrintingPolicy_dispose = void Function( - ffi.Pointer Policy, -); - -typedef _c_clang_getCursorPrettyPrinted = CXString Function( - CXCursor Cursor, - ffi.Pointer Policy, -); - -typedef _dart_clang_getCursorPrettyPrinted = CXString Function( - CXCursor Cursor, - ffi.Pointer Policy, -); - -typedef _c_clang_getCursorDisplayName = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorDisplayName = CXString Function( - CXCursor arg0, -); - -typedef _c_clang_getCursorReferenced = CXCursor Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorReferenced = CXCursor Function( - CXCursor arg0, -); - -typedef _c_clang_getCursorDefinition = CXCursor Function( - CXCursor arg0, -); - -typedef _dart_clang_getCursorDefinition = CXCursor Function( - CXCursor arg0, -); - -typedef _c_clang_isCursorDefinition = ffi.Uint32 Function( - CXCursor arg0, -); - -typedef _dart_clang_isCursorDefinition = int Function( - CXCursor arg0, -); - -typedef _c_clang_getCanonicalCursor = CXCursor Function( - CXCursor arg0, -); - -typedef _dart_clang_getCanonicalCursor = CXCursor Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_getObjCSelectorIndex = ffi.Int32 Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getObjCSelectorIndex = int Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_isDynamicCall = ffi.Int32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isDynamicCall = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getReceiverType = CXType Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getReceiverType = CXType Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getObjCPropertyAttributes = ffi.Uint32 Function( - CXCursor C, - ffi.Uint32 reserved, -); - -typedef _dart_clang_Cursor_getObjCPropertyAttributes = int Function( - CXCursor C, - int reserved, -); - -typedef _c_clang_Cursor_getObjCPropertyGetterName = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getObjCPropertyGetterName = CXString Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getObjCPropertySetterName = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getObjCPropertySetterName = CXString Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getObjCDeclQualifiers = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getObjCDeclQualifiers = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isObjCOptional = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isObjCOptional = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isVariadic = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_isVariadic = int Function( - CXCursor C, -); - -typedef _c_clang_Cursor_isExternalSymbol = ffi.Uint32 Function( - CXCursor C, - ffi.Pointer language, - ffi.Pointer definedIn, - ffi.Pointer isGenerated, -); - -typedef _dart_clang_Cursor_isExternalSymbol = int Function( - CXCursor C, - ffi.Pointer language, - ffi.Pointer definedIn, - ffi.Pointer isGenerated, -); - -typedef _c_clang_Cursor_getCommentRange = CXSourceRange Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getCommentRange = CXSourceRange Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getRawCommentText = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getRawCommentText = CXString Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getBriefCommentText = CXString Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getBriefCommentText = CXString Function( - CXCursor C, -); - -typedef _c_clang_Cursor_getMangling = CXString Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getMangling = CXString Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_getCXXManglings = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getCXXManglings = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_getObjCManglings = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _dart_clang_Cursor_getObjCManglings = ffi.Pointer Function( - CXCursor arg0, -); - -typedef _c_clang_Cursor_getModule = ffi.Pointer Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_getModule = ffi.Pointer Function( - CXCursor C, -); - -typedef _c_clang_getModuleForFile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_clang_getModuleForFile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _c_clang_Module_getASTFile = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getASTFile = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef _c_clang_Module_getParent = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getParent = ffi.Pointer Function( - ffi.Pointer Module, -); - -typedef _c_clang_Module_getName = CXString Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getName = CXString Function( - ffi.Pointer Module, -); - -typedef _c_clang_Module_getFullName = CXString Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getFullName = CXString Function( - ffi.Pointer Module, -); - -typedef _c_clang_Module_isSystem = ffi.Int32 Function( - ffi.Pointer Module, -); - -typedef _dart_clang_Module_isSystem = int Function( - ffi.Pointer Module, -); - -typedef _c_clang_Module_getNumTopLevelHeaders = ffi.Uint32 Function( - ffi.Pointer arg0, - ffi.Pointer Module, -); - -typedef _dart_clang_Module_getNumTopLevelHeaders = int Function( - ffi.Pointer arg0, - ffi.Pointer Module, -); - -typedef _c_clang_Module_getTopLevelHeader = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer Module, - ffi.Uint32 Index, -); - -typedef _dart_clang_Module_getTopLevelHeader = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer Module, - int Index, -); - -typedef _c_clang_CXXConstructor_isConvertingConstructor = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isConvertingConstructor = int Function( - CXCursor C, -); - -typedef _c_clang_CXXConstructor_isCopyConstructor = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isCopyConstructor = int Function( - CXCursor C, -); - -typedef _c_clang_CXXConstructor_isDefaultConstructor = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isDefaultConstructor = int Function( - CXCursor C, -); - -typedef _c_clang_CXXConstructor_isMoveConstructor = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXConstructor_isMoveConstructor = int Function( - CXCursor C, -); - -typedef _c_clang_CXXField_isMutable = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXField_isMutable = int Function( - CXCursor C, -); - -typedef _c_clang_CXXMethod_isDefaulted = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXMethod_isDefaulted = int Function( - CXCursor C, -); - -typedef _c_clang_CXXMethod_isPureVirtual = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXMethod_isPureVirtual = int Function( - CXCursor C, -); - -typedef _c_clang_CXXMethod_isStatic = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXMethod_isStatic = int Function( - CXCursor C, -); - -typedef _c_clang_CXXMethod_isVirtual = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXMethod_isVirtual = int Function( - CXCursor C, -); - -typedef _c_clang_CXXRecord_isAbstract = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXRecord_isAbstract = int Function( - CXCursor C, -); - -typedef _c_clang_EnumDecl_isScoped = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_EnumDecl_isScoped = int Function( - CXCursor C, -); - -typedef _c_clang_CXXMethod_isConst = ffi.Uint32 Function( - CXCursor C, -); - -typedef _dart_clang_CXXMethod_isConst = int Function( - CXCursor C, -); - -typedef _c_clang_getTemplateCursorKind = ffi.Int32 Function( - CXCursor C, -); - -typedef _dart_clang_getTemplateCursorKind = int Function( - CXCursor C, -); - -typedef _c_clang_getSpecializedCursorTemplate = CXCursor Function( - CXCursor C, -); - -typedef _dart_clang_getSpecializedCursorTemplate = CXCursor Function( - CXCursor C, -); - -typedef _c_clang_getCursorReferenceNameRange = CXSourceRange Function( - CXCursor C, - ffi.Uint32 NameFlags, - ffi.Uint32 PieceIndex, -); - -typedef _dart_clang_getCursorReferenceNameRange = CXSourceRange Function( - CXCursor C, - int NameFlags, - int PieceIndex, -); - -typedef _c_clang_getToken = ffi.Pointer Function( - ffi.Pointer TU, - CXSourceLocation Location, -); - -typedef _dart_clang_getToken = ffi.Pointer Function( - ffi.Pointer TU, - CXSourceLocation Location, -); - -typedef _c_clang_getTokenKind = ffi.Int32 Function( - CXToken arg0, -); - -typedef _dart_clang_getTokenKind = int Function( - CXToken arg0, -); - -typedef _c_clang_getTokenSpelling = CXString Function( - ffi.Pointer arg0, - CXToken arg1, -); - -typedef _dart_clang_getTokenSpelling = CXString Function( - ffi.Pointer arg0, - CXToken arg1, -); - -typedef _c_clang_getTokenLocation = CXSourceLocation Function( - ffi.Pointer arg0, - CXToken arg1, -); - -typedef _dart_clang_getTokenLocation = CXSourceLocation Function( - ffi.Pointer arg0, - CXToken arg1, -); - -typedef _c_clang_getTokenExtent = CXSourceRange Function( - ffi.Pointer arg0, - CXToken arg1, -); - -typedef _dart_clang_getTokenExtent = CXSourceRange Function( - ffi.Pointer arg0, - CXToken arg1, -); - -typedef _c_clang_tokenize = ffi.Void Function( - ffi.Pointer TU, - CXSourceRange Range, - ffi.Pointer> Tokens, - ffi.Pointer NumTokens, -); - -typedef _dart_clang_tokenize = void Function( - ffi.Pointer TU, - CXSourceRange Range, - ffi.Pointer> Tokens, - ffi.Pointer NumTokens, -); - -typedef _c_clang_annotateTokens = ffi.Void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - ffi.Uint32 NumTokens, - ffi.Pointer Cursors, -); - -typedef _dart_clang_annotateTokens = void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - int NumTokens, - ffi.Pointer Cursors, -); - -typedef _c_clang_disposeTokens = ffi.Void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - ffi.Uint32 NumTokens, -); - -typedef _dart_clang_disposeTokens = void Function( - ffi.Pointer TU, - ffi.Pointer Tokens, - int NumTokens, -); - -typedef _c_clang_getCursorKindSpelling = CXString Function( - ffi.Int32 Kind, -); - -typedef _dart_clang_getCursorKindSpelling = CXString Function( - int Kind, -); - -typedef _c_clang_getDefinitionSpellingAndExtent = ffi.Void Function( - CXCursor arg0, - ffi.Pointer> startBuf, - ffi.Pointer> endBuf, - ffi.Pointer startLine, - ffi.Pointer startColumn, - ffi.Pointer endLine, - ffi.Pointer endColumn, -); - -typedef _dart_clang_getDefinitionSpellingAndExtent = void Function( - CXCursor arg0, - ffi.Pointer> startBuf, - ffi.Pointer> endBuf, - ffi.Pointer startLine, - ffi.Pointer startColumn, - ffi.Pointer endLine, - ffi.Pointer endColumn, -); - -typedef _c_clang_enableStackTraces = ffi.Void Function(); - -typedef _dart_clang_enableStackTraces = void Function(); - -typedef _typedefC_1 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_clang_executeOnThread = ffi.Void Function( - ffi.Pointer> fn, - ffi.Pointer user_data, - ffi.Uint32 stack_size, -); - -typedef _dart_clang_executeOnThread = void Function( - ffi.Pointer> fn, - ffi.Pointer user_data, - int stack_size, -); - -typedef _c_clang_getCompletionChunkKind = ffi.Int32 Function( - ffi.Pointer completion_string, - ffi.Uint32 chunk_number, -); - -typedef _dart_clang_getCompletionChunkKind = int Function( - ffi.Pointer completion_string, - int chunk_number, -); - -typedef _c_clang_getCompletionChunkText = CXString Function( - ffi.Pointer completion_string, - ffi.Uint32 chunk_number, -); - -typedef _dart_clang_getCompletionChunkText = CXString Function( - ffi.Pointer completion_string, - int chunk_number, -); - -typedef _c_clang_getCompletionChunkCompletionString = ffi.Pointer - Function( - ffi.Pointer completion_string, - ffi.Uint32 chunk_number, -); - -typedef _dart_clang_getCompletionChunkCompletionString = ffi.Pointer - Function( - ffi.Pointer completion_string, - int chunk_number, -); - -typedef _c_clang_getNumCompletionChunks = ffi.Uint32 Function( - ffi.Pointer completion_string, -); - -typedef _dart_clang_getNumCompletionChunks = int Function( - ffi.Pointer completion_string, -); - -typedef _c_clang_getCompletionPriority = ffi.Uint32 Function( - ffi.Pointer completion_string, -); - -typedef _dart_clang_getCompletionPriority = int Function( - ffi.Pointer completion_string, -); - -typedef _c_clang_getCompletionAvailability = ffi.Int32 Function( - ffi.Pointer completion_string, -); - -typedef _dart_clang_getCompletionAvailability = int Function( - ffi.Pointer completion_string, -); - -typedef _c_clang_getCompletionNumAnnotations = ffi.Uint32 Function( - ffi.Pointer completion_string, -); - -typedef _dart_clang_getCompletionNumAnnotations = int Function( - ffi.Pointer completion_string, -); - -typedef _c_clang_getCompletionAnnotation = CXString Function( - ffi.Pointer completion_string, - ffi.Uint32 annotation_number, -); - -typedef _dart_clang_getCompletionAnnotation = CXString Function( - ffi.Pointer completion_string, - int annotation_number, -); - -typedef _c_clang_getCompletionParent = CXString Function( - ffi.Pointer completion_string, - ffi.Pointer kind, -); - -typedef _dart_clang_getCompletionParent = CXString Function( - ffi.Pointer completion_string, - ffi.Pointer kind, -); - -typedef _c_clang_getCompletionBriefComment = CXString Function( - ffi.Pointer completion_string, -); - -typedef _dart_clang_getCompletionBriefComment = CXString Function( - ffi.Pointer completion_string, -); - -typedef _c_clang_getCursorCompletionString = ffi.Pointer Function( - CXCursor cursor, -); - -typedef _dart_clang_getCursorCompletionString = ffi.Pointer Function( - CXCursor cursor, -); - -typedef _c_clang_getCompletionNumFixIts = ffi.Uint32 Function( - ffi.Pointer results, - ffi.Uint32 completion_index, -); - -typedef _dart_clang_getCompletionNumFixIts = int Function( - ffi.Pointer results, - int completion_index, -); - -typedef _c_clang_getCompletionFixIt = CXString Function( - ffi.Pointer results, - ffi.Uint32 completion_index, - ffi.Uint32 fixit_index, - ffi.Pointer replacement_range, -); - -typedef _dart_clang_getCompletionFixIt = CXString Function( - ffi.Pointer results, - int completion_index, - int fixit_index, - ffi.Pointer replacement_range, -); - -typedef _c_clang_defaultCodeCompleteOptions = ffi.Uint32 Function(); - -typedef _dart_clang_defaultCodeCompleteOptions = int Function(); - -typedef _c_clang_codeCompleteAt = ffi.Pointer Function( - ffi.Pointer TU, - ffi.Pointer complete_filename, - ffi.Uint32 complete_line, - ffi.Uint32 complete_column, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Uint32 options, -); - -typedef _dart_clang_codeCompleteAt = ffi.Pointer - Function( - ffi.Pointer TU, - ffi.Pointer complete_filename, - int complete_line, - int complete_column, - ffi.Pointer unsaved_files, - int num_unsaved_files, - int options, -); - -typedef _c_clang_sortCodeCompletionResults = ffi.Void Function( - ffi.Pointer Results, - ffi.Uint32 NumResults, -); - -typedef _dart_clang_sortCodeCompletionResults = void Function( - ffi.Pointer Results, - int NumResults, -); - -typedef _c_clang_disposeCodeCompleteResults = ffi.Void Function( - ffi.Pointer Results, -); - -typedef _dart_clang_disposeCodeCompleteResults = void Function( - ffi.Pointer Results, -); - -typedef _c_clang_codeCompleteGetNumDiagnostics = ffi.Uint32 Function( - ffi.Pointer Results, -); - -typedef _dart_clang_codeCompleteGetNumDiagnostics = int Function( - ffi.Pointer Results, -); - -typedef _c_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( - ffi.Pointer Results, - ffi.Uint32 Index, -); - -typedef _dart_clang_codeCompleteGetDiagnostic = ffi.Pointer Function( - ffi.Pointer Results, - int Index, -); - -typedef _c_clang_codeCompleteGetContexts = ffi.Uint64 Function( - ffi.Pointer Results, -); - -typedef _dart_clang_codeCompleteGetContexts = int Function( - ffi.Pointer Results, -); - -typedef _c_clang_codeCompleteGetContainerKind = ffi.Int32 Function( - ffi.Pointer Results, - ffi.Pointer IsIncomplete, -); - -typedef _dart_clang_codeCompleteGetContainerKind = int Function( - ffi.Pointer Results, - ffi.Pointer IsIncomplete, -); - -typedef _c_clang_codeCompleteGetContainerUSR = CXString Function( - ffi.Pointer Results, -); - -typedef _dart_clang_codeCompleteGetContainerUSR = CXString Function( - ffi.Pointer Results, -); - -typedef _c_clang_codeCompleteGetObjCSelector = CXString Function( - ffi.Pointer Results, -); - -typedef _dart_clang_codeCompleteGetObjCSelector = CXString Function( - ffi.Pointer Results, -); - -typedef _c_clang_getClangVersion = CXString Function(); - -typedef _dart_clang_getClangVersion = CXString Function(); - -typedef _c_clang_toggleCrashRecovery = ffi.Void Function( - ffi.Uint32 isEnabled, -); - -typedef _dart_clang_toggleCrashRecovery = void Function( - int isEnabled, -); - -typedef CXInclusionVisitor = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint32, - ffi.Pointer, -); - -typedef _c_clang_getInclusions = ffi.Void Function( - ffi.Pointer tu, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _dart_clang_getInclusions = void Function( - ffi.Pointer tu, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _c_clang_Cursor_Evaluate = ffi.Pointer Function( - CXCursor C, -); - -typedef _dart_clang_Cursor_Evaluate = ffi.Pointer Function( - CXCursor C, -); - -typedef _c_clang_EvalResult_getKind = ffi.Int32 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getKind = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsInt = ffi.Int32 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsInt = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsLongLong = ffi.Int64 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsLongLong = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_isUnsignedInt = ffi.Uint32 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_isUnsignedInt = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsUnsigned = ffi.Uint64 Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsUnsigned = int Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsDouble = ffi.Double Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsDouble = double Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_getAsStr = ffi.Pointer Function( - ffi.Pointer E, -); - -typedef _c_clang_EvalResult_dispose = ffi.Void Function( - ffi.Pointer E, -); - -typedef _dart_clang_EvalResult_dispose = void Function( - ffi.Pointer E, -); - -typedef _c_clang_getRemappings = ffi.Pointer Function( - ffi.Pointer path, -); - -typedef _dart_clang_getRemappings = ffi.Pointer Function( - ffi.Pointer path, -); - -typedef _c_clang_getRemappingsFromFileList = ffi.Pointer Function( - ffi.Pointer> filePaths, - ffi.Uint32 numFiles, -); - -typedef _dart_clang_getRemappingsFromFileList = ffi.Pointer Function( - ffi.Pointer> filePaths, - int numFiles, -); - -typedef _c_clang_remap_getNumFiles = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_remap_getNumFiles = int Function( - ffi.Pointer arg0, -); - -typedef _c_clang_remap_getFilenames = ffi.Void Function( - ffi.Pointer arg0, - ffi.Uint32 index, - ffi.Pointer original, - ffi.Pointer transformed, -); - -typedef _dart_clang_remap_getFilenames = void Function( - ffi.Pointer arg0, - int index, - ffi.Pointer original, - ffi.Pointer transformed, -); - -typedef _c_clang_remap_dispose = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_remap_dispose = void Function( - ffi.Pointer arg0, -); - -typedef _c_clang_findReferencesInFile = ffi.Int32 Function( - CXCursor cursor, - ffi.Pointer file, - CXCursorAndRangeVisitor visitor, -); - -typedef _dart_clang_findReferencesInFile = int Function( - CXCursor cursor, - ffi.Pointer file, - CXCursorAndRangeVisitor visitor, -); - -typedef _c_clang_findIncludesInFile = ffi.Int32 Function( - ffi.Pointer TU, - ffi.Pointer file, - CXCursorAndRangeVisitor visitor, -); - -typedef _dart_clang_findIncludesInFile = int Function( - ffi.Pointer TU, - ffi.Pointer file, - CXCursorAndRangeVisitor visitor, -); - -typedef _c_clang_index_isEntityObjCContainerKind = ffi.Int32 Function( - ffi.Int32 arg0, -); - -typedef _dart_clang_index_isEntityObjCContainerKind = int Function( - int arg0, -); - -typedef _c_clang_index_getObjCContainerDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCContainerDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_getObjCInterfaceDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCInterfaceDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_getObjCCategoryDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCCategoryDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_getObjCProtocolRefListInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCProtocolRefListInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_getObjCPropertyDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getObjCPropertyDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_getIBOutletCollectionAttrInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getIBOutletCollectionAttrInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_getCXXClassDeclInfo = ffi.Pointer - Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getCXXClassDeclInfo - = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_getClientContainer = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getClientContainer = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_setClientContainer = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_clang_index_setClientContainer = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _c_clang_index_getClientEntity = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_index_getClientEntity = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_clang_index_setClientEntity = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_clang_index_setClientEntity = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _c_clang_IndexAction_create = ffi.Pointer Function( - ffi.Pointer CIdx, -); - -typedef _dart_clang_IndexAction_create = ffi.Pointer Function( - ffi.Pointer CIdx, -); - -typedef _c_clang_IndexAction_dispose = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_clang_IndexAction_dispose = void Function( - ffi.Pointer arg0, -); - -typedef _c_clang_indexSourceFile = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Pointer> out_TU, - ffi.Uint32 TU_options, -); - -typedef _dart_clang_indexSourceFile = int Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - ffi.Pointer> out_TU, - int TU_options, -); - -typedef _c_clang_indexSourceFileFullArgv = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - ffi.Int32 num_command_line_args, - ffi.Pointer unsaved_files, - ffi.Uint32 num_unsaved_files, - ffi.Pointer> out_TU, - ffi.Uint32 TU_options, -); - -typedef _dart_clang_indexSourceFileFullArgv = int Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - ffi.Pointer source_filename, - ffi.Pointer> command_line_args, - int num_command_line_args, - ffi.Pointer unsaved_files, - int num_unsaved_files, - ffi.Pointer> out_TU, - int TU_options, -); - -typedef _c_clang_indexTranslationUnit = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - ffi.Uint32 index_callbacks_size, - ffi.Uint32 index_options, - ffi.Pointer arg5, -); - -typedef _dart_clang_indexTranslationUnit = int Function( - ffi.Pointer arg0, - ffi.Pointer client_data, - ffi.Pointer index_callbacks, - int index_callbacks_size, - int index_options, - ffi.Pointer arg5, -); - -typedef _c_clang_indexLoc_getFileLocation = ffi.Void Function( - CXIdxLoc loc, - ffi.Pointer> indexFile, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _dart_clang_indexLoc_getFileLocation = void Function( - CXIdxLoc loc, - ffi.Pointer> indexFile, - ffi.Pointer> file, - ffi.Pointer line, - ffi.Pointer column, - ffi.Pointer offset, -); - -typedef _c_clang_indexLoc_getCXSourceLocation = CXSourceLocation Function( - CXIdxLoc loc, -); - -typedef _dart_clang_indexLoc_getCXSourceLocation = CXSourceLocation Function( - CXIdxLoc loc, -); - -typedef CXFieldVisitor = ffi.Int32 Function( - CXCursor, - ffi.Pointer, -); - -typedef _c_clang_Type_visitFields = ffi.Uint32 Function( - CXType T, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _dart_clang_Type_visitFields = int Function( - CXType T, - ffi.Pointer> visitor, - ffi.Pointer client_data, -); - -typedef _typedefC_2 = ffi.Int32 Function( - ffi.Pointer, - CXCursor, - CXSourceRange, -); - -typedef _typedefC_3 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_4 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_5 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_6 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_7 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_8 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_9 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_10 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); diff --git a/test/large_integration_tests/_expected_sqlite_bindings.dart b/test/large_integration_tests/_expected_sqlite_bindings.dart index 9580bd19..b8b13ed5 100644 --- a/test/large_integration_tests/_expected_sqlite_bindings.dart +++ b/test/large_integration_tests/_expected_sqlite_bindings.dart @@ -61,29 +61,30 @@ class SQLite { } late final _sqlite3_libversion_ptr = - _lookup>('sqlite3_libversion'); - late final _dart_sqlite3_libversion _sqlite3_libversion = - _sqlite3_libversion_ptr.asFunction<_dart_sqlite3_libversion>(); + _lookup Function()>>( + 'sqlite3_libversion'); + late final _sqlite3_libversion = + _sqlite3_libversion_ptr.asFunction Function()>(); ffi.Pointer sqlite3_sourceid() { return _sqlite3_sourceid(); } late final _sqlite3_sourceid_ptr = - _lookup>('sqlite3_sourceid'); - late final _dart_sqlite3_sourceid _sqlite3_sourceid = - _sqlite3_sourceid_ptr.asFunction<_dart_sqlite3_sourceid>(); + _lookup Function()>>( + 'sqlite3_sourceid'); + late final _sqlite3_sourceid = + _sqlite3_sourceid_ptr.asFunction Function()>(); int sqlite3_libversion_number() { return _sqlite3_libversion_number(); } late final _sqlite3_libversion_number_ptr = - _lookup>( + _lookup>( 'sqlite3_libversion_number'); - late final _dart_sqlite3_libversion_number _sqlite3_libversion_number = - _sqlite3_libversion_number_ptr - .asFunction<_dart_sqlite3_libversion_number>(); + late final _sqlite3_libversion_number = + _sqlite3_libversion_number_ptr.asFunction(); int sqlite3_compileoption_used( ffi.Pointer zOptName, @@ -94,11 +95,10 @@ class SQLite { } late final _sqlite3_compileoption_used_ptr = - _lookup>( + _lookup)>>( 'sqlite3_compileoption_used'); - late final _dart_sqlite3_compileoption_used _sqlite3_compileoption_used = - _sqlite3_compileoption_used_ptr - .asFunction<_dart_sqlite3_compileoption_used>(); + late final _sqlite3_compileoption_used = _sqlite3_compileoption_used_ptr + .asFunction)>(); ffi.Pointer sqlite3_compileoption_get( int N, @@ -109,11 +109,10 @@ class SQLite { } late final _sqlite3_compileoption_get_ptr = - _lookup>( + _lookup Function(ffi.Int32)>>( 'sqlite3_compileoption_get'); - late final _dart_sqlite3_compileoption_get _sqlite3_compileoption_get = - _sqlite3_compileoption_get_ptr - .asFunction<_dart_sqlite3_compileoption_get>(); + late final _sqlite3_compileoption_get = _sqlite3_compileoption_get_ptr + .asFunction Function(int)>(); /// CAPI3REF: Test To See If The Library Is Threadsafe /// @@ -154,9 +153,9 @@ class SQLite { } late final _sqlite3_threadsafe_ptr = - _lookup>('sqlite3_threadsafe'); - late final _dart_sqlite3_threadsafe _sqlite3_threadsafe = - _sqlite3_threadsafe_ptr.asFunction<_dart_sqlite3_threadsafe>(); + _lookup>('sqlite3_threadsafe'); + late final _sqlite3_threadsafe = + _sqlite3_threadsafe_ptr.asFunction(); /// CAPI3REF: Closing A Database Connection /// DESTRUCTOR: sqlite3 @@ -203,9 +202,10 @@ class SQLite { } late final _sqlite3_close_ptr = - _lookup>('sqlite3_close'); - late final _dart_sqlite3_close _sqlite3_close = - _sqlite3_close_ptr.asFunction<_dart_sqlite3_close>(); + _lookup)>>( + 'sqlite3_close'); + late final _sqlite3_close = + _sqlite3_close_ptr.asFunction)>(); int sqlite3_close_v2( ffi.Pointer arg0, @@ -216,9 +216,10 @@ class SQLite { } late final _sqlite3_close_v2_ptr = - _lookup>('sqlite3_close_v2'); - late final _dart_sqlite3_close_v2 _sqlite3_close_v2 = - _sqlite3_close_v2_ptr.asFunction<_dart_sqlite3_close_v2>(); + _lookup)>>( + 'sqlite3_close_v2'); + late final _sqlite3_close_v2 = + _sqlite3_close_v2_ptr.asFunction)>(); /// CAPI3REF: One-Step Query Execution Interface /// METHOD: sqlite3 @@ -283,7 +284,14 @@ class SQLite { int sqlite3_exec( ffi.Pointer arg0, ffi.Pointer sql, - ffi.Pointer> callback, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>> + callback, ffi.Pointer arg3, ffi.Pointer> errmsg, ) { @@ -296,10 +304,33 @@ class SQLite { ); } - late final _sqlite3_exec_ptr = - _lookup>('sqlite3_exec'); - late final _dart_sqlite3_exec _sqlite3_exec = - _sqlite3_exec_ptr.asFunction<_dart_sqlite3_exec>(); + late final _sqlite3_exec_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>>, + ffi.Pointer, + ffi.Pointer>)>>('sqlite3_exec'); + late final _sqlite3_exec = _sqlite3_exec_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>>, + ffi.Pointer, + ffi.Pointer>)>(); /// CAPI3REF: Initialize The SQLite Library /// @@ -379,36 +410,35 @@ class SQLite { } late final _sqlite3_initialize_ptr = - _lookup>('sqlite3_initialize'); - late final _dart_sqlite3_initialize _sqlite3_initialize = - _sqlite3_initialize_ptr.asFunction<_dart_sqlite3_initialize>(); + _lookup>('sqlite3_initialize'); + late final _sqlite3_initialize = + _sqlite3_initialize_ptr.asFunction(); int sqlite3_shutdown() { return _sqlite3_shutdown(); } late final _sqlite3_shutdown_ptr = - _lookup>('sqlite3_shutdown'); - late final _dart_sqlite3_shutdown _sqlite3_shutdown = - _sqlite3_shutdown_ptr.asFunction<_dart_sqlite3_shutdown>(); + _lookup>('sqlite3_shutdown'); + late final _sqlite3_shutdown = + _sqlite3_shutdown_ptr.asFunction(); int sqlite3_os_init() { return _sqlite3_os_init(); } late final _sqlite3_os_init_ptr = - _lookup>('sqlite3_os_init'); - late final _dart_sqlite3_os_init _sqlite3_os_init = - _sqlite3_os_init_ptr.asFunction<_dart_sqlite3_os_init>(); + _lookup>('sqlite3_os_init'); + late final _sqlite3_os_init = + _sqlite3_os_init_ptr.asFunction(); int sqlite3_os_end() { return _sqlite3_os_end(); } late final _sqlite3_os_end_ptr = - _lookup>('sqlite3_os_end'); - late final _dart_sqlite3_os_end _sqlite3_os_end = - _sqlite3_os_end_ptr.asFunction<_dart_sqlite3_os_end>(); + _lookup>('sqlite3_os_end'); + late final _sqlite3_os_end = _sqlite3_os_end_ptr.asFunction(); /// CAPI3REF: Configuring The SQLite Library /// @@ -448,9 +478,10 @@ class SQLite { } late final _sqlite3_config_ptr = - _lookup>('sqlite3_config'); - late final _dart_sqlite3_config _sqlite3_config = - _sqlite3_config_ptr.asFunction<_dart_sqlite3_config>(); + _lookup>( + 'sqlite3_config'); + late final _sqlite3_config = + _sqlite3_config_ptr.asFunction(); /// CAPI3REF: Configure database connections /// METHOD: sqlite3 @@ -477,10 +508,12 @@ class SQLite { ); } - late final _sqlite3_db_config_ptr = - _lookup>('sqlite3_db_config'); - late final _dart_sqlite3_db_config _sqlite3_db_config = - _sqlite3_db_config_ptr.asFunction<_dart_sqlite3_db_config>(); + late final _sqlite3_db_config_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_db_config'); + late final _sqlite3_db_config = _sqlite3_db_config_ptr + .asFunction, int)>(); /// CAPI3REF: Enable Or Disable Extended Result Codes /// METHOD: sqlite3 @@ -498,12 +531,12 @@ class SQLite { ); } - late final _sqlite3_extended_result_codes_ptr = - _lookup>( - 'sqlite3_extended_result_codes'); - late final _dart_sqlite3_extended_result_codes - _sqlite3_extended_result_codes = _sqlite3_extended_result_codes_ptr - .asFunction<_dart_sqlite3_extended_result_codes>(); + late final _sqlite3_extended_result_codes_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_extended_result_codes'); + late final _sqlite3_extended_result_codes = _sqlite3_extended_result_codes_ptr + .asFunction, int)>(); /// CAPI3REF: Last Insert Rowid /// METHOD: sqlite3 @@ -572,11 +605,10 @@ class SQLite { } late final _sqlite3_last_insert_rowid_ptr = - _lookup>( + _lookup)>>( 'sqlite3_last_insert_rowid'); - late final _dart_sqlite3_last_insert_rowid _sqlite3_last_insert_rowid = - _sqlite3_last_insert_rowid_ptr - .asFunction<_dart_sqlite3_last_insert_rowid>(); + late final _sqlite3_last_insert_rowid = _sqlite3_last_insert_rowid_ptr + .asFunction)>(); /// CAPI3REF: Set the Last Insert Rowid value. /// METHOD: sqlite3 @@ -594,12 +626,12 @@ class SQLite { ); } - late final _sqlite3_set_last_insert_rowid_ptr = - _lookup>( - 'sqlite3_set_last_insert_rowid'); - late final _dart_sqlite3_set_last_insert_rowid - _sqlite3_set_last_insert_rowid = _sqlite3_set_last_insert_rowid_ptr - .asFunction<_dart_sqlite3_set_last_insert_rowid>(); + late final _sqlite3_set_last_insert_rowid_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + sqlite3_int64)>>('sqlite3_set_last_insert_rowid'); + late final _sqlite3_set_last_insert_rowid = _sqlite3_set_last_insert_rowid_ptr + .asFunction, int)>(); /// CAPI3REF: Count The Number Of Rows Modified /// METHOD: sqlite3 @@ -664,9 +696,10 @@ class SQLite { } late final _sqlite3_changes_ptr = - _lookup>('sqlite3_changes'); - late final _dart_sqlite3_changes _sqlite3_changes = - _sqlite3_changes_ptr.asFunction<_dart_sqlite3_changes>(); + _lookup)>>( + 'sqlite3_changes'); + late final _sqlite3_changes = + _sqlite3_changes_ptr.asFunction)>(); /// CAPI3REF: Total Number Of Rows Modified /// METHOD: sqlite3 @@ -710,10 +743,10 @@ class SQLite { } late final _sqlite3_total_changes_ptr = - _lookup>( + _lookup)>>( 'sqlite3_total_changes'); - late final _dart_sqlite3_total_changes _sqlite3_total_changes = - _sqlite3_total_changes_ptr.asFunction<_dart_sqlite3_total_changes>(); + late final _sqlite3_total_changes = _sqlite3_total_changes_ptr + .asFunction)>(); /// CAPI3REF: Interrupt A Long-Running Query /// METHOD: sqlite3 @@ -757,9 +790,10 @@ class SQLite { } late final _sqlite3_interrupt_ptr = - _lookup>('sqlite3_interrupt'); - late final _dart_sqlite3_interrupt _sqlite3_interrupt = - _sqlite3_interrupt_ptr.asFunction<_dart_sqlite3_interrupt>(); + _lookup)>>( + 'sqlite3_interrupt'); + late final _sqlite3_interrupt = + _sqlite3_interrupt_ptr.asFunction)>(); /// CAPI3REF: Determine If An SQL Statement Is Complete /// @@ -801,9 +835,10 @@ class SQLite { } late final _sqlite3_complete_ptr = - _lookup>('sqlite3_complete'); - late final _dart_sqlite3_complete _sqlite3_complete = - _sqlite3_complete_ptr.asFunction<_dart_sqlite3_complete>(); + _lookup)>>( + 'sqlite3_complete'); + late final _sqlite3_complete = + _sqlite3_complete_ptr.asFunction)>(); int sqlite3_complete16( ffi.Pointer sql, @@ -814,9 +849,10 @@ class SQLite { } late final _sqlite3_complete16_ptr = - _lookup>('sqlite3_complete16'); - late final _dart_sqlite3_complete16 _sqlite3_complete16 = - _sqlite3_complete16_ptr.asFunction<_dart_sqlite3_complete16>(); + _lookup)>>( + 'sqlite3_complete16'); + late final _sqlite3_complete16 = + _sqlite3_complete16_ptr.asFunction)>(); /// CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors /// KEYWORDS: {busy-handler callback} {busy handler} @@ -877,7 +913,10 @@ class SQLite { /// or [prepared statement] that invoked the busy handler. int sqlite3_busy_handler( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> + arg1, ffi.Pointer arg2, ) { return _sqlite3_busy_handler( @@ -887,11 +926,21 @@ class SQLite { ); } - late final _sqlite3_busy_handler_ptr = - _lookup>( - 'sqlite3_busy_handler'); - late final _dart_sqlite3_busy_handler _sqlite3_busy_handler = - _sqlite3_busy_handler_ptr.asFunction<_dart_sqlite3_busy_handler>(); + late final _sqlite3_busy_handler_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>>, + ffi.Pointer)>>('sqlite3_busy_handler'); + late final _sqlite3_busy_handler = _sqlite3_busy_handler_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>>, + ffi.Pointer)>(); /// CAPI3REF: Set A Busy Timeout /// METHOD: sqlite3 @@ -922,11 +971,12 @@ class SQLite { ); } - late final _sqlite3_busy_timeout_ptr = - _lookup>( - 'sqlite3_busy_timeout'); - late final _dart_sqlite3_busy_timeout _sqlite3_busy_timeout = - _sqlite3_busy_timeout_ptr.asFunction<_dart_sqlite3_busy_timeout>(); + late final _sqlite3_busy_timeout_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_busy_timeout'); + late final _sqlite3_busy_timeout = _sqlite3_busy_timeout_ptr + .asFunction, int)>(); /// CAPI3REF: Convenience Routines For Running Queries /// METHOD: sqlite3 @@ -1017,10 +1067,23 @@ class SQLite { ); } - late final _sqlite3_get_table_ptr = - _lookup>('sqlite3_get_table'); - late final _dart_sqlite3_get_table _sqlite3_get_table = - _sqlite3_get_table_ptr.asFunction<_dart_sqlite3_get_table>(); + late final _sqlite3_get_table_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('sqlite3_get_table'); + late final _sqlite3_get_table = _sqlite3_get_table_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); void sqlite3_free_table( ffi.Pointer> result, @@ -1030,10 +1093,12 @@ class SQLite { ); } - late final _sqlite3_free_table_ptr = - _lookup>('sqlite3_free_table'); - late final _dart_sqlite3_free_table _sqlite3_free_table = - _sqlite3_free_table_ptr.asFunction<_dart_sqlite3_free_table>(); + late final _sqlite3_free_table_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer>)>>('sqlite3_free_table'); + late final _sqlite3_free_table = _sqlite3_free_table_ptr + .asFunction>)>(); /// CAPI3REF: Formatted String Printing Functions /// @@ -1081,10 +1146,12 @@ class SQLite { ); } - late final _sqlite3_mprintf_ptr = - _lookup>('sqlite3_mprintf'); - late final _dart_sqlite3_mprintf _sqlite3_mprintf = - _sqlite3_mprintf_ptr.asFunction<_dart_sqlite3_mprintf>(); + late final _sqlite3_mprintf_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_mprintf'); + late final _sqlite3_mprintf = _sqlite3_mprintf_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_snprintf( int arg0, @@ -1098,10 +1165,13 @@ class SQLite { ); } - late final _sqlite3_snprintf_ptr = - _lookup>('sqlite3_snprintf'); - late final _dart_sqlite3_snprintf _sqlite3_snprintf = - _sqlite3_snprintf_ptr.asFunction<_dart_sqlite3_snprintf>(); + late final _sqlite3_snprintf_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Int32, ffi.Pointer, + ffi.Pointer)>>('sqlite3_snprintf'); + late final _sqlite3_snprintf = _sqlite3_snprintf_ptr.asFunction< + ffi.Pointer Function( + int, ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Memory Allocation Subsystem /// @@ -1185,9 +1255,10 @@ class SQLite { } late final _sqlite3_malloc_ptr = - _lookup>('sqlite3_malloc'); - late final _dart_sqlite3_malloc _sqlite3_malloc = - _sqlite3_malloc_ptr.asFunction<_dart_sqlite3_malloc>(); + _lookup Function(ffi.Int32)>>( + 'sqlite3_malloc'); + late final _sqlite3_malloc = + _sqlite3_malloc_ptr.asFunction Function(int)>(); ffi.Pointer sqlite3_malloc64( int arg0, @@ -1197,10 +1268,11 @@ class SQLite { ); } - late final _sqlite3_malloc64_ptr = - _lookup>('sqlite3_malloc64'); - late final _dart_sqlite3_malloc64 _sqlite3_malloc64 = - _sqlite3_malloc64_ptr.asFunction<_dart_sqlite3_malloc64>(); + late final _sqlite3_malloc64_ptr = _lookup< + ffi.NativeFunction Function(sqlite3_uint64)>>( + 'sqlite3_malloc64'); + late final _sqlite3_malloc64 = + _sqlite3_malloc64_ptr.asFunction Function(int)>(); ffi.Pointer sqlite3_realloc( ffi.Pointer arg0, @@ -1212,10 +1284,12 @@ class SQLite { ); } - late final _sqlite3_realloc_ptr = - _lookup>('sqlite3_realloc'); - late final _dart_sqlite3_realloc _sqlite3_realloc = - _sqlite3_realloc_ptr.asFunction<_dart_sqlite3_realloc>(); + late final _sqlite3_realloc_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_realloc'); + late final _sqlite3_realloc = _sqlite3_realloc_ptr + .asFunction Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_realloc64( ffi.Pointer arg0, @@ -1227,10 +1301,12 @@ class SQLite { ); } - late final _sqlite3_realloc64_ptr = - _lookup>('sqlite3_realloc64'); - late final _dart_sqlite3_realloc64 _sqlite3_realloc64 = - _sqlite3_realloc64_ptr.asFunction<_dart_sqlite3_realloc64>(); + late final _sqlite3_realloc64_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, sqlite3_uint64)>>('sqlite3_realloc64'); + late final _sqlite3_realloc64 = _sqlite3_realloc64_ptr + .asFunction Function(ffi.Pointer, int)>(); void sqlite3_free( ffi.Pointer arg0, @@ -1241,9 +1317,10 @@ class SQLite { } late final _sqlite3_free_ptr = - _lookup>('sqlite3_free'); - late final _dart_sqlite3_free _sqlite3_free = - _sqlite3_free_ptr.asFunction<_dart_sqlite3_free>(); + _lookup)>>( + 'sqlite3_free'); + late final _sqlite3_free = + _sqlite3_free_ptr.asFunction)>(); int sqlite3_msize( ffi.Pointer arg0, @@ -1253,10 +1330,11 @@ class SQLite { ); } - late final _sqlite3_msize_ptr = - _lookup>('sqlite3_msize'); - late final _dart_sqlite3_msize _sqlite3_msize = - _sqlite3_msize_ptr.asFunction<_dart_sqlite3_msize>(); + late final _sqlite3_msize_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_msize'); + late final _sqlite3_msize = + _sqlite3_msize_ptr.asFunction)>(); /// CAPI3REF: Memory Allocator Statistics /// @@ -1284,10 +1362,10 @@ class SQLite { } late final _sqlite3_memory_used_ptr = - _lookup>( + _lookup>( 'sqlite3_memory_used'); - late final _dart_sqlite3_memory_used _sqlite3_memory_used = - _sqlite3_memory_used_ptr.asFunction<_dart_sqlite3_memory_used>(); + late final _sqlite3_memory_used = + _sqlite3_memory_used_ptr.asFunction(); int sqlite3_memory_highwater( int resetFlag, @@ -1298,11 +1376,10 @@ class SQLite { } late final _sqlite3_memory_highwater_ptr = - _lookup>( + _lookup>( 'sqlite3_memory_highwater'); - late final _dart_sqlite3_memory_highwater _sqlite3_memory_highwater = - _sqlite3_memory_highwater_ptr - .asFunction<_dart_sqlite3_memory_highwater>(); + late final _sqlite3_memory_highwater = + _sqlite3_memory_highwater_ptr.asFunction(); /// CAPI3REF: Pseudo-Random Number Generator /// @@ -1333,10 +1410,12 @@ class SQLite { ); } - late final _sqlite3_randomness_ptr = - _lookup>('sqlite3_randomness'); - late final _dart_sqlite3_randomness _sqlite3_randomness = - _sqlite3_randomness_ptr.asFunction<_dart_sqlite3_randomness>(); + late final _sqlite3_randomness_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int32, ffi.Pointer)>>('sqlite3_randomness'); + late final _sqlite3_randomness = _sqlite3_randomness_ptr + .asFunction)>(); /// CAPI3REF: Compile-Time Authorization Callbacks /// METHOD: sqlite3 @@ -1427,7 +1506,16 @@ class SQLite { /// sqlite3_prepare_v2() to reprepare a statement after a schema change. int sqlite3_set_authorizer( ffi.Pointer arg0, - ffi.Pointer> xAuth, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> + xAuth, ffi.Pointer pUserData, ) { return _sqlite3_set_authorizer( @@ -1437,11 +1525,33 @@ class SQLite { ); } - late final _sqlite3_set_authorizer_ptr = - _lookup>( - 'sqlite3_set_authorizer'); - late final _dart_sqlite3_set_authorizer _sqlite3_set_authorizer = - _sqlite3_set_authorizer_ptr.asFunction<_dart_sqlite3_set_authorizer>(); + late final _sqlite3_set_authorizer_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>, + ffi.Pointer)>>('sqlite3_set_authorizer'); + late final _sqlite3_set_authorizer = _sqlite3_set_authorizer_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>, + ffi.Pointer)>(); /// CAPI3REF: Tracing And Profiling Functions /// METHOD: sqlite3 @@ -1475,7 +1585,11 @@ class SQLite { /// profile callback. ffi.Pointer sqlite3_trace( ffi.Pointer arg0, - ffi.Pointer> xTrace, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>> + xTrace, ffi.Pointer arg2, ) { return _sqlite3_trace( @@ -1485,14 +1599,31 @@ class SQLite { ); } - late final _sqlite3_trace_ptr = - _lookup>('sqlite3_trace'); - late final _dart_sqlite3_trace _sqlite3_trace = - _sqlite3_trace_ptr.asFunction<_dart_sqlite3_trace>(); + late final _sqlite3_trace_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>>('sqlite3_trace'); + late final _sqlite3_trace = _sqlite3_trace_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>(); ffi.Pointer sqlite3_profile( ffi.Pointer arg0, - ffi.Pointer> xProfile, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + sqlite3_uint64)>> + xProfile, ffi.Pointer arg2, ) { return _sqlite3_profile( @@ -1502,10 +1633,23 @@ class SQLite { ); } - late final _sqlite3_profile_ptr = - _lookup>('sqlite3_profile'); - late final _dart_sqlite3_profile _sqlite3_profile = - _sqlite3_profile_ptr.asFunction<_dart_sqlite3_profile>(); + late final _sqlite3_profile_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, sqlite3_uint64)>>, + ffi.Pointer)>>('sqlite3_profile'); + late final _sqlite3_profile = _sqlite3_profile_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, sqlite3_uint64)>>, + ffi.Pointer)>(); /// CAPI3REF: SQL Trace Hook /// METHOD: sqlite3 @@ -1537,7 +1681,11 @@ class SQLite { int sqlite3_trace_v2( ffi.Pointer arg0, int uMask, - ffi.Pointer> xCallback, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Uint32, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> + xCallback, ffi.Pointer pCtx, ) { return _sqlite3_trace_v2( @@ -1548,10 +1696,25 @@ class SQLite { ); } - late final _sqlite3_trace_v2_ptr = - _lookup>('sqlite3_trace_v2'); - late final _dart_sqlite3_trace_v2 _sqlite3_trace_v2 = - _sqlite3_trace_v2_ptr.asFunction<_dart_sqlite3_trace_v2>(); + late final _sqlite3_trace_v2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Uint32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Uint32, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>>('sqlite3_trace_v2'); + late final _sqlite3_trace_v2 = _sqlite3_trace_v2_ptr.asFunction< + int Function( + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Uint32, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>, + ffi.Pointer)>(); /// CAPI3REF: Query Progress Callbacks /// METHOD: sqlite3 @@ -1585,7 +1748,8 @@ class SQLite { void sqlite3_progress_handler( ffi.Pointer arg0, int arg1, - ffi.Pointer> arg2, + ffi.Pointer)>> + arg2, ffi.Pointer arg3, ) { return _sqlite3_progress_handler( @@ -1596,12 +1760,24 @@ class SQLite { ); } - late final _sqlite3_progress_handler_ptr = - _lookup>( - 'sqlite3_progress_handler'); - late final _dart_sqlite3_progress_handler _sqlite3_progress_handler = - _sqlite3_progress_handler_ptr - .asFunction<_dart_sqlite3_progress_handler>(); + late final _sqlite3_progress_handler_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer)>>, + ffi.Pointer)>>('sqlite3_progress_handler'); + late final _sqlite3_progress_handler = + _sqlite3_progress_handler_ptr.asFunction< + void Function( + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer)>>, + ffi.Pointer)>(); /// CAPI3REF: Opening A New Database Connection /// CONSTRUCTOR: sqlite3 @@ -1864,10 +2040,12 @@ class SQLite { ); } - late final _sqlite3_open_ptr = - _lookup>('sqlite3_open'); - late final _dart_sqlite3_open _sqlite3_open = - _sqlite3_open_ptr.asFunction<_dart_sqlite3_open>(); + late final _sqlite3_open_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer>)>>('sqlite3_open'); + late final _sqlite3_open = _sqlite3_open_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer>)>(); int sqlite3_open16( ffi.Pointer filename, @@ -1879,10 +2057,12 @@ class SQLite { ); } - late final _sqlite3_open16_ptr = - _lookup>('sqlite3_open16'); - late final _dart_sqlite3_open16 _sqlite3_open16 = - _sqlite3_open16_ptr.asFunction<_dart_sqlite3_open16>(); + late final _sqlite3_open16_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer>)>>('sqlite3_open16'); + late final _sqlite3_open16 = _sqlite3_open16_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer>)>(); int sqlite3_open_v2( ffi.Pointer filename, @@ -1898,10 +2078,16 @@ class SQLite { ); } - late final _sqlite3_open_v2_ptr = - _lookup>('sqlite3_open_v2'); - late final _dart_sqlite3_open_v2 _sqlite3_open_v2 = - _sqlite3_open_v2_ptr.asFunction<_dart_sqlite3_open_v2>(); + late final _sqlite3_open_v2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer)>>('sqlite3_open_v2'); + late final _sqlite3_open_v2 = _sqlite3_open_v2_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer>, + int, ffi.Pointer)>(); /// CAPI3REF: Obtain Values For URI Parameters /// @@ -1977,11 +2163,13 @@ class SQLite { ); } - late final _sqlite3_uri_parameter_ptr = - _lookup>( - 'sqlite3_uri_parameter'); - late final _dart_sqlite3_uri_parameter _sqlite3_uri_parameter = - _sqlite3_uri_parameter_ptr.asFunction<_dart_sqlite3_uri_parameter>(); + late final _sqlite3_uri_parameter_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_uri_parameter'); + late final _sqlite3_uri_parameter = _sqlite3_uri_parameter_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); int sqlite3_uri_boolean( ffi.Pointer zFile, @@ -1995,11 +2183,12 @@ class SQLite { ); } - late final _sqlite3_uri_boolean_ptr = - _lookup>( - 'sqlite3_uri_boolean'); - late final _dart_sqlite3_uri_boolean _sqlite3_uri_boolean = - _sqlite3_uri_boolean_ptr.asFunction<_dart_sqlite3_uri_boolean>(); + late final _sqlite3_uri_boolean_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('sqlite3_uri_boolean'); + late final _sqlite3_uri_boolean = _sqlite3_uri_boolean_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); int sqlite3_uri_int64( ffi.Pointer arg0, @@ -2013,10 +2202,12 @@ class SQLite { ); } - late final _sqlite3_uri_int64_ptr = - _lookup>('sqlite3_uri_int64'); - late final _dart_sqlite3_uri_int64 _sqlite3_uri_int64 = - _sqlite3_uri_int64_ptr.asFunction<_dart_sqlite3_uri_int64>(); + late final _sqlite3_uri_int64_ptr = _lookup< + ffi.NativeFunction< + sqlite3_int64 Function(ffi.Pointer, ffi.Pointer, + sqlite3_int64)>>('sqlite3_uri_int64'); + late final _sqlite3_uri_int64 = _sqlite3_uri_int64_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); ffi.Pointer sqlite3_uri_key( ffi.Pointer zFilename, @@ -2028,10 +2219,12 @@ class SQLite { ); } - late final _sqlite3_uri_key_ptr = - _lookup>('sqlite3_uri_key'); - late final _dart_sqlite3_uri_key _sqlite3_uri_key = - _sqlite3_uri_key_ptr.asFunction<_dart_sqlite3_uri_key>(); + late final _sqlite3_uri_key_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_uri_key'); + late final _sqlite3_uri_key = _sqlite3_uri_key_ptr + .asFunction Function(ffi.Pointer, int)>(); /// CAPI3REF: Translate filenames /// @@ -2066,12 +2259,12 @@ class SQLite { ); } - late final _sqlite3_filename_database_ptr = - _lookup>( - 'sqlite3_filename_database'); - late final _dart_sqlite3_filename_database _sqlite3_filename_database = - _sqlite3_filename_database_ptr - .asFunction<_dart_sqlite3_filename_database>(); + late final _sqlite3_filename_database_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_filename_database'); + late final _sqlite3_filename_database = _sqlite3_filename_database_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_filename_journal( ffi.Pointer arg0, @@ -2081,12 +2274,12 @@ class SQLite { ); } - late final _sqlite3_filename_journal_ptr = - _lookup>( - 'sqlite3_filename_journal'); - late final _dart_sqlite3_filename_journal _sqlite3_filename_journal = - _sqlite3_filename_journal_ptr - .asFunction<_dart_sqlite3_filename_journal>(); + late final _sqlite3_filename_journal_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_filename_journal'); + late final _sqlite3_filename_journal = _sqlite3_filename_journal_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_filename_wal( ffi.Pointer arg0, @@ -2096,11 +2289,12 @@ class SQLite { ); } - late final _sqlite3_filename_wal_ptr = - _lookup>( - 'sqlite3_filename_wal'); - late final _dart_sqlite3_filename_wal _sqlite3_filename_wal = - _sqlite3_filename_wal_ptr.asFunction<_dart_sqlite3_filename_wal>(); + late final _sqlite3_filename_wal_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_filename_wal'); + late final _sqlite3_filename_wal = _sqlite3_filename_wal_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Database File Corresponding To A Journal /// @@ -2125,12 +2319,12 @@ class SQLite { ); } - late final _sqlite3_database_file_object_ptr = - _lookup>( - 'sqlite3_database_file_object'); - late final _dart_sqlite3_database_file_object _sqlite3_database_file_object = - _sqlite3_database_file_object_ptr - .asFunction<_dart_sqlite3_database_file_object>(); + late final _sqlite3_database_file_object_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_database_file_object'); + late final _sqlite3_database_file_object = _sqlite3_database_file_object_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Create and Destroy VFS Filenames /// @@ -2191,11 +2385,21 @@ class SQLite { ); } - late final _sqlite3_create_filename_ptr = - _lookup>( - 'sqlite3_create_filename'); - late final _dart_sqlite3_create_filename _sqlite3_create_filename = - _sqlite3_create_filename_ptr.asFunction<_dart_sqlite3_create_filename>(); + late final _sqlite3_create_filename_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>('sqlite3_create_filename'); + late final _sqlite3_create_filename = _sqlite3_create_filename_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>)>(); void sqlite3_free_filename( ffi.Pointer arg0, @@ -2206,10 +2410,10 @@ class SQLite { } late final _sqlite3_free_filename_ptr = - _lookup>( + _lookup)>>( 'sqlite3_free_filename'); - late final _dart_sqlite3_free_filename _sqlite3_free_filename = - _sqlite3_free_filename_ptr.asFunction<_dart_sqlite3_free_filename>(); + late final _sqlite3_free_filename = _sqlite3_free_filename_ptr + .asFunction)>(); /// CAPI3REF: Error Codes And Messages /// METHOD: sqlite3 @@ -2270,9 +2474,10 @@ class SQLite { } late final _sqlite3_errcode_ptr = - _lookup>('sqlite3_errcode'); - late final _dart_sqlite3_errcode _sqlite3_errcode = - _sqlite3_errcode_ptr.asFunction<_dart_sqlite3_errcode>(); + _lookup)>>( + 'sqlite3_errcode'); + late final _sqlite3_errcode = + _sqlite3_errcode_ptr.asFunction)>(); int sqlite3_extended_errcode( ffi.Pointer db, @@ -2283,11 +2488,10 @@ class SQLite { } late final _sqlite3_extended_errcode_ptr = - _lookup>( + _lookup)>>( 'sqlite3_extended_errcode'); - late final _dart_sqlite3_extended_errcode _sqlite3_extended_errcode = - _sqlite3_extended_errcode_ptr - .asFunction<_dart_sqlite3_extended_errcode>(); + late final _sqlite3_extended_errcode = _sqlite3_extended_errcode_ptr + .asFunction)>(); ffi.Pointer sqlite3_errmsg( ffi.Pointer arg0, @@ -2297,10 +2501,12 @@ class SQLite { ); } - late final _sqlite3_errmsg_ptr = - _lookup>('sqlite3_errmsg'); - late final _dart_sqlite3_errmsg _sqlite3_errmsg = - _sqlite3_errmsg_ptr.asFunction<_dart_sqlite3_errmsg>(); + late final _sqlite3_errmsg_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_errmsg'); + late final _sqlite3_errmsg = _sqlite3_errmsg_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_errmsg16( ffi.Pointer arg0, @@ -2310,10 +2516,12 @@ class SQLite { ); } - late final _sqlite3_errmsg16_ptr = - _lookup>('sqlite3_errmsg16'); - late final _dart_sqlite3_errmsg16 _sqlite3_errmsg16 = - _sqlite3_errmsg16_ptr.asFunction<_dart_sqlite3_errmsg16>(); + late final _sqlite3_errmsg16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_errmsg16'); + late final _sqlite3_errmsg16 = _sqlite3_errmsg16_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_errstr( int arg0, @@ -2324,9 +2532,10 @@ class SQLite { } late final _sqlite3_errstr_ptr = - _lookup>('sqlite3_errstr'); - late final _dart_sqlite3_errstr _sqlite3_errstr = - _sqlite3_errstr_ptr.asFunction<_dart_sqlite3_errstr>(); + _lookup Function(ffi.Int32)>>( + 'sqlite3_errstr'); + late final _sqlite3_errstr = + _sqlite3_errstr_ptr.asFunction Function(int)>(); /// CAPI3REF: Run-time Limits /// METHOD: sqlite3 @@ -2378,10 +2587,12 @@ class SQLite { ); } - late final _sqlite3_limit_ptr = - _lookup>('sqlite3_limit'); - late final _dart_sqlite3_limit _sqlite3_limit = - _sqlite3_limit_ptr.asFunction<_dart_sqlite3_limit>(); + late final _sqlite3_limit_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32, ffi.Int32)>>('sqlite3_limit'); + late final _sqlite3_limit = _sqlite3_limit_ptr + .asFunction, int, int)>(); /// CAPI3REF: Compiling An SQL Statement /// KEYWORDS: {SQL statement compiler} @@ -2497,10 +2708,21 @@ class SQLite { ); } - late final _sqlite3_prepare_ptr = - _lookup>('sqlite3_prepare'); - late final _dart_sqlite3_prepare _sqlite3_prepare = - _sqlite3_prepare_ptr.asFunction<_dart_sqlite3_prepare>(); + late final _sqlite3_prepare_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>>('sqlite3_prepare'); + late final _sqlite3_prepare = _sqlite3_prepare_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); int sqlite3_prepare_v2( ffi.Pointer db, @@ -2518,10 +2740,21 @@ class SQLite { ); } - late final _sqlite3_prepare_v2_ptr = - _lookup>('sqlite3_prepare_v2'); - late final _dart_sqlite3_prepare_v2 _sqlite3_prepare_v2 = - _sqlite3_prepare_v2_ptr.asFunction<_dart_sqlite3_prepare_v2>(); + late final _sqlite3_prepare_v2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>>('sqlite3_prepare_v2'); + late final _sqlite3_prepare_v2 = _sqlite3_prepare_v2_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); int sqlite3_prepare_v3( ffi.Pointer db, @@ -2541,10 +2774,23 @@ class SQLite { ); } - late final _sqlite3_prepare_v3_ptr = - _lookup>('sqlite3_prepare_v3'); - late final _dart_sqlite3_prepare_v3 _sqlite3_prepare_v3 = - _sqlite3_prepare_v3_ptr.asFunction<_dart_sqlite3_prepare_v3>(); + late final _sqlite3_prepare_v3_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Uint32, + ffi.Pointer>, + ffi.Pointer>)>>('sqlite3_prepare_v3'); + late final _sqlite3_prepare_v3 = _sqlite3_prepare_v3_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer>, + ffi.Pointer>)>(); int sqlite3_prepare16( ffi.Pointer db, @@ -2562,10 +2808,21 @@ class SQLite { ); } - late final _sqlite3_prepare16_ptr = - _lookup>('sqlite3_prepare16'); - late final _dart_sqlite3_prepare16 _sqlite3_prepare16 = - _sqlite3_prepare16_ptr.asFunction<_dart_sqlite3_prepare16>(); + late final _sqlite3_prepare16_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>>('sqlite3_prepare16'); + late final _sqlite3_prepare16 = _sqlite3_prepare16_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); int sqlite3_prepare16_v2( ffi.Pointer db, @@ -2583,11 +2840,21 @@ class SQLite { ); } - late final _sqlite3_prepare16_v2_ptr = - _lookup>( - 'sqlite3_prepare16_v2'); - late final _dart_sqlite3_prepare16_v2 _sqlite3_prepare16_v2 = - _sqlite3_prepare16_v2_ptr.asFunction<_dart_sqlite3_prepare16_v2>(); + late final _sqlite3_prepare16_v2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>)>>('sqlite3_prepare16_v2'); + late final _sqlite3_prepare16_v2 = _sqlite3_prepare16_v2_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer>, + ffi.Pointer>)>(); int sqlite3_prepare16_v3( ffi.Pointer db, @@ -2607,11 +2874,23 @@ class SQLite { ); } - late final _sqlite3_prepare16_v3_ptr = - _lookup>( - 'sqlite3_prepare16_v3'); - late final _dart_sqlite3_prepare16_v3 _sqlite3_prepare16_v3 = - _sqlite3_prepare16_v3_ptr.asFunction<_dart_sqlite3_prepare16_v3>(); + late final _sqlite3_prepare16_v3_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Uint32, + ffi.Pointer>, + ffi.Pointer>)>>('sqlite3_prepare16_v3'); + late final _sqlite3_prepare16_v3 = _sqlite3_prepare16_v3_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer>, + ffi.Pointer>)>(); /// CAPI3REF: Retrieving Statement SQL /// METHOD: sqlite3_stmt @@ -2657,10 +2936,12 @@ class SQLite { ); } - late final _sqlite3_sql_ptr = - _lookup>('sqlite3_sql'); - late final _dart_sqlite3_sql _sqlite3_sql = - _sqlite3_sql_ptr.asFunction<_dart_sqlite3_sql>(); + late final _sqlite3_sql_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_sql'); + late final _sqlite3_sql = _sqlite3_sql_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_expanded_sql( ffi.Pointer pStmt, @@ -2670,11 +2951,12 @@ class SQLite { ); } - late final _sqlite3_expanded_sql_ptr = - _lookup>( - 'sqlite3_expanded_sql'); - late final _dart_sqlite3_expanded_sql _sqlite3_expanded_sql = - _sqlite3_expanded_sql_ptr.asFunction<_dart_sqlite3_expanded_sql>(); + late final _sqlite3_expanded_sql_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_expanded_sql'); + late final _sqlite3_expanded_sql = _sqlite3_expanded_sql_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_normalized_sql( ffi.Pointer pStmt, @@ -2684,11 +2966,12 @@ class SQLite { ); } - late final _sqlite3_normalized_sql_ptr = - _lookup>( - 'sqlite3_normalized_sql'); - late final _dart_sqlite3_normalized_sql _sqlite3_normalized_sql = - _sqlite3_normalized_sql_ptr.asFunction<_dart_sqlite3_normalized_sql>(); + late final _sqlite3_normalized_sql_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_normalized_sql'); + late final _sqlite3_normalized_sql = _sqlite3_normalized_sql_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Determine If An SQL Statement Writes The Database /// METHOD: sqlite3_stmt @@ -2730,11 +3013,11 @@ class SQLite { ); } - late final _sqlite3_stmt_readonly_ptr = - _lookup>( - 'sqlite3_stmt_readonly'); - late final _dart_sqlite3_stmt_readonly _sqlite3_stmt_readonly = - _sqlite3_stmt_readonly_ptr.asFunction<_dart_sqlite3_stmt_readonly>(); + late final _sqlite3_stmt_readonly_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_stmt_readonly'); + late final _sqlite3_stmt_readonly = _sqlite3_stmt_readonly_ptr + .asFunction)>(); /// CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement /// METHOD: sqlite3_stmt @@ -2752,11 +3035,11 @@ class SQLite { ); } - late final _sqlite3_stmt_isexplain_ptr = - _lookup>( - 'sqlite3_stmt_isexplain'); - late final _dart_sqlite3_stmt_isexplain _sqlite3_stmt_isexplain = - _sqlite3_stmt_isexplain_ptr.asFunction<_dart_sqlite3_stmt_isexplain>(); + late final _sqlite3_stmt_isexplain_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_stmt_isexplain'); + late final _sqlite3_stmt_isexplain = _sqlite3_stmt_isexplain_ptr + .asFunction)>(); /// CAPI3REF: Determine If A Prepared Statement Has Been Reset /// METHOD: sqlite3_stmt @@ -2783,10 +3066,11 @@ class SQLite { ); } - late final _sqlite3_stmt_busy_ptr = - _lookup>('sqlite3_stmt_busy'); - late final _dart_sqlite3_stmt_busy _sqlite3_stmt_busy = - _sqlite3_stmt_busy_ptr.asFunction<_dart_sqlite3_stmt_busy>(); + late final _sqlite3_stmt_busy_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_stmt_busy'); + late final _sqlite3_stmt_busy = _sqlite3_stmt_busy_ptr + .asFunction)>(); /// CAPI3REF: Binding Values To Prepared Statements /// KEYWORDS: {host parameter} {host parameters} {host parameter name} @@ -2927,7 +3211,8 @@ class SQLite { int arg1, ffi.Pointer arg2, int n, - ffi.Pointer> arg4, + ffi.Pointer)>> + arg4, ) { return _sqlite3_bind_blob( arg0, @@ -2938,17 +3223,33 @@ class SQLite { ); } - late final _sqlite3_bind_blob_ptr = - _lookup>('sqlite3_bind_blob'); - late final _dart_sqlite3_bind_blob _sqlite3_bind_blob = - _sqlite3_bind_blob_ptr.asFunction<_dart_sqlite3_bind_blob>(); + late final _sqlite3_bind_blob_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_bind_blob'); + late final _sqlite3_bind_blob = _sqlite3_bind_blob_ptr.asFunction< + int Function( + ffi.Pointer, + int, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); int sqlite3_bind_blob64( ffi.Pointer arg0, int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer)>> + arg4, ) { return _sqlite3_bind_blob64( arg0, @@ -2959,11 +3260,25 @@ class SQLite { ); } - late final _sqlite3_bind_blob64_ptr = - _lookup>( - 'sqlite3_bind_blob64'); - late final _dart_sqlite3_bind_blob64 _sqlite3_bind_blob64 = - _sqlite3_bind_blob64_ptr.asFunction<_dart_sqlite3_bind_blob64>(); + late final _sqlite3_bind_blob64_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + sqlite3_uint64, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_bind_blob64'); + late final _sqlite3_bind_blob64 = _sqlite3_bind_blob64_ptr.asFunction< + int Function( + ffi.Pointer, + int, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); int sqlite3_bind_double( ffi.Pointer arg0, @@ -2977,11 +3292,12 @@ class SQLite { ); } - late final _sqlite3_bind_double_ptr = - _lookup>( - 'sqlite3_bind_double'); - late final _dart_sqlite3_bind_double _sqlite3_bind_double = - _sqlite3_bind_double_ptr.asFunction<_dart_sqlite3_bind_double>(); + late final _sqlite3_bind_double_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Double)>>('sqlite3_bind_double'); + late final _sqlite3_bind_double = _sqlite3_bind_double_ptr + .asFunction, int, double)>(); int sqlite3_bind_int( ffi.Pointer arg0, @@ -2995,10 +3311,12 @@ class SQLite { ); } - late final _sqlite3_bind_int_ptr = - _lookup>('sqlite3_bind_int'); - late final _dart_sqlite3_bind_int _sqlite3_bind_int = - _sqlite3_bind_int_ptr.asFunction<_dart_sqlite3_bind_int>(); + late final _sqlite3_bind_int_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Int32)>>('sqlite3_bind_int'); + late final _sqlite3_bind_int = _sqlite3_bind_int_ptr + .asFunction, int, int)>(); int sqlite3_bind_int64( ffi.Pointer arg0, @@ -3012,10 +3330,12 @@ class SQLite { ); } - late final _sqlite3_bind_int64_ptr = - _lookup>('sqlite3_bind_int64'); - late final _dart_sqlite3_bind_int64 _sqlite3_bind_int64 = - _sqlite3_bind_int64_ptr.asFunction<_dart_sqlite3_bind_int64>(); + late final _sqlite3_bind_int64_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + sqlite3_int64)>>('sqlite3_bind_int64'); + late final _sqlite3_bind_int64 = _sqlite3_bind_int64_ptr + .asFunction, int, int)>(); int sqlite3_bind_null( ffi.Pointer arg0, @@ -3027,17 +3347,20 @@ class SQLite { ); } - late final _sqlite3_bind_null_ptr = - _lookup>('sqlite3_bind_null'); - late final _dart_sqlite3_bind_null _sqlite3_bind_null = - _sqlite3_bind_null_ptr.asFunction<_dart_sqlite3_bind_null>(); + late final _sqlite3_bind_null_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_bind_null'); + late final _sqlite3_bind_null = _sqlite3_bind_null_ptr + .asFunction, int)>(); int sqlite3_bind_text( ffi.Pointer arg0, int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer)>> + arg4, ) { return _sqlite3_bind_text( arg0, @@ -3048,17 +3371,33 @@ class SQLite { ); } - late final _sqlite3_bind_text_ptr = - _lookup>('sqlite3_bind_text'); - late final _dart_sqlite3_bind_text _sqlite3_bind_text = - _sqlite3_bind_text_ptr.asFunction<_dart_sqlite3_bind_text>(); + late final _sqlite3_bind_text_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_bind_text'); + late final _sqlite3_bind_text = _sqlite3_bind_text_ptr.asFunction< + int Function( + ffi.Pointer, + int, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); int sqlite3_bind_text16( ffi.Pointer arg0, int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer)>> + arg4, ) { return _sqlite3_bind_text16( arg0, @@ -3069,18 +3408,33 @@ class SQLite { ); } - late final _sqlite3_bind_text16_ptr = - _lookup>( - 'sqlite3_bind_text16'); - late final _dart_sqlite3_bind_text16 _sqlite3_bind_text16 = - _sqlite3_bind_text16_ptr.asFunction<_dart_sqlite3_bind_text16>(); + late final _sqlite3_bind_text16_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_bind_text16'); + late final _sqlite3_bind_text16 = _sqlite3_bind_text16_ptr.asFunction< + int Function( + ffi.Pointer, + int, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); int sqlite3_bind_text64( ffi.Pointer arg0, int arg1, ffi.Pointer arg2, int arg3, - ffi.Pointer> arg4, + ffi.Pointer)>> + arg4, int encoding, ) { return _sqlite3_bind_text64( @@ -3093,11 +3447,25 @@ class SQLite { ); } - late final _sqlite3_bind_text64_ptr = - _lookup>( - 'sqlite3_bind_text64'); - late final _dart_sqlite3_bind_text64 _sqlite3_bind_text64 = - _sqlite3_bind_text64_ptr.asFunction<_dart_sqlite3_bind_text64>(); + late final _sqlite3_bind_text64_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + sqlite3_uint64, + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Uint8)>>('sqlite3_bind_text64'); + late final _sqlite3_bind_text64 = _sqlite3_bind_text64_ptr.asFunction< + int Function( + ffi.Pointer, + int, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>, + int)>(); int sqlite3_bind_value( ffi.Pointer arg0, @@ -3111,17 +3479,21 @@ class SQLite { ); } - late final _sqlite3_bind_value_ptr = - _lookup>('sqlite3_bind_value'); - late final _dart_sqlite3_bind_value _sqlite3_bind_value = - _sqlite3_bind_value_ptr.asFunction<_dart_sqlite3_bind_value>(); + late final _sqlite3_bind_value_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Pointer)>>('sqlite3_bind_value'); + late final _sqlite3_bind_value = _sqlite3_bind_value_ptr.asFunction< + int Function( + ffi.Pointer, int, ffi.Pointer)>(); int sqlite3_bind_pointer( ffi.Pointer arg0, int arg1, ffi.Pointer arg2, ffi.Pointer arg3, - ffi.Pointer> arg4, + ffi.Pointer)>> + arg4, ) { return _sqlite3_bind_pointer( arg0, @@ -3132,11 +3504,25 @@ class SQLite { ); } - late final _sqlite3_bind_pointer_ptr = - _lookup>( - 'sqlite3_bind_pointer'); - late final _dart_sqlite3_bind_pointer _sqlite3_bind_pointer = - _sqlite3_bind_pointer_ptr.asFunction<_dart_sqlite3_bind_pointer>(); + late final _sqlite3_bind_pointer_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_bind_pointer'); + late final _sqlite3_bind_pointer = _sqlite3_bind_pointer_ptr.asFunction< + int Function( + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction)>>)>(); int sqlite3_bind_zeroblob( ffi.Pointer arg0, @@ -3150,11 +3536,12 @@ class SQLite { ); } - late final _sqlite3_bind_zeroblob_ptr = - _lookup>( - 'sqlite3_bind_zeroblob'); - late final _dart_sqlite3_bind_zeroblob _sqlite3_bind_zeroblob = - _sqlite3_bind_zeroblob_ptr.asFunction<_dart_sqlite3_bind_zeroblob>(); + late final _sqlite3_bind_zeroblob_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Int32)>>('sqlite3_bind_zeroblob'); + late final _sqlite3_bind_zeroblob = _sqlite3_bind_zeroblob_ptr + .asFunction, int, int)>(); int sqlite3_bind_zeroblob64( ffi.Pointer arg0, @@ -3168,11 +3555,12 @@ class SQLite { ); } - late final _sqlite3_bind_zeroblob64_ptr = - _lookup>( - 'sqlite3_bind_zeroblob64'); - late final _dart_sqlite3_bind_zeroblob64 _sqlite3_bind_zeroblob64 = - _sqlite3_bind_zeroblob64_ptr.asFunction<_dart_sqlite3_bind_zeroblob64>(); + late final _sqlite3_bind_zeroblob64_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + sqlite3_uint64)>>('sqlite3_bind_zeroblob64'); + late final _sqlite3_bind_zeroblob64 = _sqlite3_bind_zeroblob64_ptr + .asFunction, int, int)>(); /// CAPI3REF: Number Of SQL Parameters /// METHOD: sqlite3_stmt @@ -3199,12 +3587,11 @@ class SQLite { ); } - late final _sqlite3_bind_parameter_count_ptr = - _lookup>( - 'sqlite3_bind_parameter_count'); - late final _dart_sqlite3_bind_parameter_count _sqlite3_bind_parameter_count = - _sqlite3_bind_parameter_count_ptr - .asFunction<_dart_sqlite3_bind_parameter_count>(); + late final _sqlite3_bind_parameter_count_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_bind_parameter_count'); + late final _sqlite3_bind_parameter_count = _sqlite3_bind_parameter_count_ptr + .asFunction)>(); /// CAPI3REF: Name Of A Host Parameter /// METHOD: sqlite3_stmt @@ -3240,12 +3627,13 @@ class SQLite { ); } - late final _sqlite3_bind_parameter_name_ptr = - _lookup>( - 'sqlite3_bind_parameter_name'); - late final _dart_sqlite3_bind_parameter_name _sqlite3_bind_parameter_name = - _sqlite3_bind_parameter_name_ptr - .asFunction<_dart_sqlite3_bind_parameter_name>(); + late final _sqlite3_bind_parameter_name_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_bind_parameter_name'); + late final _sqlite3_bind_parameter_name = + _sqlite3_bind_parameter_name_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Index Of A Parameter With A Given Name /// METHOD: sqlite3_stmt @@ -3271,12 +3659,13 @@ class SQLite { ); } - late final _sqlite3_bind_parameter_index_ptr = - _lookup>( - 'sqlite3_bind_parameter_index'); - late final _dart_sqlite3_bind_parameter_index _sqlite3_bind_parameter_index = - _sqlite3_bind_parameter_index_ptr - .asFunction<_dart_sqlite3_bind_parameter_index>(); + late final _sqlite3_bind_parameter_index_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_bind_parameter_index'); + late final _sqlite3_bind_parameter_index = + _sqlite3_bind_parameter_index_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Reset All Bindings On A Prepared Statement /// METHOD: sqlite3_stmt @@ -3292,11 +3681,11 @@ class SQLite { ); } - late final _sqlite3_clear_bindings_ptr = - _lookup>( - 'sqlite3_clear_bindings'); - late final _dart_sqlite3_clear_bindings _sqlite3_clear_bindings = - _sqlite3_clear_bindings_ptr.asFunction<_dart_sqlite3_clear_bindings>(); + late final _sqlite3_clear_bindings_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_clear_bindings'); + late final _sqlite3_clear_bindings = _sqlite3_clear_bindings_ptr + .asFunction)>(); /// CAPI3REF: Number Of Columns In A Result Set /// METHOD: sqlite3_stmt @@ -3318,11 +3707,11 @@ class SQLite { ); } - late final _sqlite3_column_count_ptr = - _lookup>( - 'sqlite3_column_count'); - late final _dart_sqlite3_column_count _sqlite3_column_count = - _sqlite3_column_count_ptr.asFunction<_dart_sqlite3_column_count>(); + late final _sqlite3_column_count_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_column_count'); + late final _sqlite3_column_count = _sqlite3_column_count_ptr + .asFunction)>(); /// CAPI3REF: Column Names In A Result Set /// METHOD: sqlite3_stmt @@ -3359,11 +3748,12 @@ class SQLite { ); } - late final _sqlite3_column_name_ptr = - _lookup>( - 'sqlite3_column_name'); - late final _dart_sqlite3_column_name _sqlite3_column_name = - _sqlite3_column_name_ptr.asFunction<_dart_sqlite3_column_name>(); + late final _sqlite3_column_name_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_name'); + late final _sqlite3_column_name = _sqlite3_column_name_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_name16( ffi.Pointer arg0, @@ -3375,11 +3765,12 @@ class SQLite { ); } - late final _sqlite3_column_name16_ptr = - _lookup>( - 'sqlite3_column_name16'); - late final _dart_sqlite3_column_name16 _sqlite3_column_name16 = - _sqlite3_column_name16_ptr.asFunction<_dart_sqlite3_column_name16>(); + late final _sqlite3_column_name16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_name16'); + late final _sqlite3_column_name16 = _sqlite3_column_name16_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Source Of Data In A Query Result /// METHOD: sqlite3_stmt @@ -3431,12 +3822,13 @@ class SQLite { ); } - late final _sqlite3_column_database_name_ptr = - _lookup>( - 'sqlite3_column_database_name'); - late final _dart_sqlite3_column_database_name _sqlite3_column_database_name = - _sqlite3_column_database_name_ptr - .asFunction<_dart_sqlite3_column_database_name>(); + late final _sqlite3_column_database_name_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_database_name'); + late final _sqlite3_column_database_name = + _sqlite3_column_database_name_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_database_name16( ffi.Pointer arg0, @@ -3448,12 +3840,13 @@ class SQLite { ); } - late final _sqlite3_column_database_name16_ptr = - _lookup>( - 'sqlite3_column_database_name16'); - late final _dart_sqlite3_column_database_name16 - _sqlite3_column_database_name16 = _sqlite3_column_database_name16_ptr - .asFunction<_dart_sqlite3_column_database_name16>(); + late final _sqlite3_column_database_name16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_database_name16'); + late final _sqlite3_column_database_name16 = + _sqlite3_column_database_name16_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_table_name( ffi.Pointer arg0, @@ -3465,12 +3858,13 @@ class SQLite { ); } - late final _sqlite3_column_table_name_ptr = - _lookup>( - 'sqlite3_column_table_name'); - late final _dart_sqlite3_column_table_name _sqlite3_column_table_name = - _sqlite3_column_table_name_ptr - .asFunction<_dart_sqlite3_column_table_name>(); + late final _sqlite3_column_table_name_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_table_name'); + late final _sqlite3_column_table_name = + _sqlite3_column_table_name_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_table_name16( ffi.Pointer arg0, @@ -3482,12 +3876,13 @@ class SQLite { ); } - late final _sqlite3_column_table_name16_ptr = - _lookup>( - 'sqlite3_column_table_name16'); - late final _dart_sqlite3_column_table_name16 _sqlite3_column_table_name16 = - _sqlite3_column_table_name16_ptr - .asFunction<_dart_sqlite3_column_table_name16>(); + late final _sqlite3_column_table_name16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_table_name16'); + late final _sqlite3_column_table_name16 = + _sqlite3_column_table_name16_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_origin_name( ffi.Pointer arg0, @@ -3499,12 +3894,13 @@ class SQLite { ); } - late final _sqlite3_column_origin_name_ptr = - _lookup>( - 'sqlite3_column_origin_name'); - late final _dart_sqlite3_column_origin_name _sqlite3_column_origin_name = - _sqlite3_column_origin_name_ptr - .asFunction<_dart_sqlite3_column_origin_name>(); + late final _sqlite3_column_origin_name_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_origin_name'); + late final _sqlite3_column_origin_name = + _sqlite3_column_origin_name_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_origin_name16( ffi.Pointer arg0, @@ -3516,12 +3912,13 @@ class SQLite { ); } - late final _sqlite3_column_origin_name16_ptr = - _lookup>( - 'sqlite3_column_origin_name16'); - late final _dart_sqlite3_column_origin_name16 _sqlite3_column_origin_name16 = - _sqlite3_column_origin_name16_ptr - .asFunction<_dart_sqlite3_column_origin_name16>(); + late final _sqlite3_column_origin_name16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_origin_name16'); + late final _sqlite3_column_origin_name16 = + _sqlite3_column_origin_name16_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Declared Datatype Of A Query Result /// METHOD: sqlite3_stmt @@ -3561,11 +3958,12 @@ class SQLite { ); } - late final _sqlite3_column_decltype_ptr = - _lookup>( - 'sqlite3_column_decltype'); - late final _dart_sqlite3_column_decltype _sqlite3_column_decltype = - _sqlite3_column_decltype_ptr.asFunction<_dart_sqlite3_column_decltype>(); + late final _sqlite3_column_decltype_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_decltype'); + late final _sqlite3_column_decltype = _sqlite3_column_decltype_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_decltype16( ffi.Pointer arg0, @@ -3577,12 +3975,13 @@ class SQLite { ); } - late final _sqlite3_column_decltype16_ptr = - _lookup>( - 'sqlite3_column_decltype16'); - late final _dart_sqlite3_column_decltype16 _sqlite3_column_decltype16 = - _sqlite3_column_decltype16_ptr - .asFunction<_dart_sqlite3_column_decltype16>(); + late final _sqlite3_column_decltype16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_column_decltype16'); + late final _sqlite3_column_decltype16 = + _sqlite3_column_decltype16_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Evaluate An SQL Statement /// METHOD: sqlite3_stmt @@ -3672,10 +4071,11 @@ class SQLite { ); } - late final _sqlite3_step_ptr = - _lookup>('sqlite3_step'); - late final _dart_sqlite3_step _sqlite3_step = - _sqlite3_step_ptr.asFunction<_dart_sqlite3_step>(); + late final _sqlite3_step_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_step'); + late final _sqlite3_step = + _sqlite3_step_ptr.asFunction)>(); /// CAPI3REF: Number of columns in a result set /// METHOD: sqlite3_stmt @@ -3702,10 +4102,11 @@ class SQLite { ); } - late final _sqlite3_data_count_ptr = - _lookup>('sqlite3_data_count'); - late final _dart_sqlite3_data_count _sqlite3_data_count = - _sqlite3_data_count_ptr.asFunction<_dart_sqlite3_data_count>(); + late final _sqlite3_data_count_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_data_count'); + late final _sqlite3_data_count = _sqlite3_data_count_ptr + .asFunction)>(); /// CAPI3REF: Result Values From A Query /// KEYWORDS: {column access functions} @@ -3924,11 +4325,12 @@ class SQLite { ); } - late final _sqlite3_column_blob_ptr = - _lookup>( - 'sqlite3_column_blob'); - late final _dart_sqlite3_column_blob _sqlite3_column_blob = - _sqlite3_column_blob_ptr.asFunction<_dart_sqlite3_column_blob>(); + late final _sqlite3_column_blob_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_blob'); + late final _sqlite3_column_blob = _sqlite3_column_blob_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); double sqlite3_column_double( ffi.Pointer arg0, @@ -3940,11 +4342,12 @@ class SQLite { ); } - late final _sqlite3_column_double_ptr = - _lookup>( - 'sqlite3_column_double'); - late final _dart_sqlite3_column_double _sqlite3_column_double = - _sqlite3_column_double_ptr.asFunction<_dart_sqlite3_column_double>(); + late final _sqlite3_column_double_ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_double'); + late final _sqlite3_column_double = _sqlite3_column_double_ptr + .asFunction, int)>(); int sqlite3_column_int( ffi.Pointer arg0, @@ -3956,10 +4359,12 @@ class SQLite { ); } - late final _sqlite3_column_int_ptr = - _lookup>('sqlite3_column_int'); - late final _dart_sqlite3_column_int _sqlite3_column_int = - _sqlite3_column_int_ptr.asFunction<_dart_sqlite3_column_int>(); + late final _sqlite3_column_int_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_int'); + late final _sqlite3_column_int = _sqlite3_column_int_ptr + .asFunction, int)>(); int sqlite3_column_int64( ffi.Pointer arg0, @@ -3971,11 +4376,12 @@ class SQLite { ); } - late final _sqlite3_column_int64_ptr = - _lookup>( - 'sqlite3_column_int64'); - late final _dart_sqlite3_column_int64 _sqlite3_column_int64 = - _sqlite3_column_int64_ptr.asFunction<_dart_sqlite3_column_int64>(); + late final _sqlite3_column_int64_ptr = _lookup< + ffi.NativeFunction< + sqlite3_int64 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_int64'); + late final _sqlite3_column_int64 = _sqlite3_column_int64_ptr + .asFunction, int)>(); ffi.Pointer sqlite3_column_text( ffi.Pointer arg0, @@ -3987,11 +4393,12 @@ class SQLite { ); } - late final _sqlite3_column_text_ptr = - _lookup>( - 'sqlite3_column_text'); - late final _dart_sqlite3_column_text _sqlite3_column_text = - _sqlite3_column_text_ptr.asFunction<_dart_sqlite3_column_text>(); + late final _sqlite3_column_text_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_text'); + late final _sqlite3_column_text = _sqlite3_column_text_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_text16( ffi.Pointer arg0, @@ -4003,11 +4410,12 @@ class SQLite { ); } - late final _sqlite3_column_text16_ptr = - _lookup>( - 'sqlite3_column_text16'); - late final _dart_sqlite3_column_text16 _sqlite3_column_text16 = - _sqlite3_column_text16_ptr.asFunction<_dart_sqlite3_column_text16>(); + late final _sqlite3_column_text16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_text16'); + late final _sqlite3_column_text16 = _sqlite3_column_text16_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); ffi.Pointer sqlite3_column_value( ffi.Pointer arg0, @@ -4019,11 +4427,12 @@ class SQLite { ); } - late final _sqlite3_column_value_ptr = - _lookup>( - 'sqlite3_column_value'); - late final _dart_sqlite3_column_value _sqlite3_column_value = - _sqlite3_column_value_ptr.asFunction<_dart_sqlite3_column_value>(); + late final _sqlite3_column_value_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_value'); + late final _sqlite3_column_value = _sqlite3_column_value_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); int sqlite3_column_bytes( ffi.Pointer arg0, @@ -4035,11 +4444,12 @@ class SQLite { ); } - late final _sqlite3_column_bytes_ptr = - _lookup>( - 'sqlite3_column_bytes'); - late final _dart_sqlite3_column_bytes _sqlite3_column_bytes = - _sqlite3_column_bytes_ptr.asFunction<_dart_sqlite3_column_bytes>(); + late final _sqlite3_column_bytes_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_bytes'); + late final _sqlite3_column_bytes = _sqlite3_column_bytes_ptr + .asFunction, int)>(); int sqlite3_column_bytes16( ffi.Pointer arg0, @@ -4051,11 +4461,12 @@ class SQLite { ); } - late final _sqlite3_column_bytes16_ptr = - _lookup>( - 'sqlite3_column_bytes16'); - late final _dart_sqlite3_column_bytes16 _sqlite3_column_bytes16 = - _sqlite3_column_bytes16_ptr.asFunction<_dart_sqlite3_column_bytes16>(); + late final _sqlite3_column_bytes16_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_bytes16'); + late final _sqlite3_column_bytes16 = _sqlite3_column_bytes16_ptr + .asFunction, int)>(); int sqlite3_column_type( ffi.Pointer arg0, @@ -4067,11 +4478,12 @@ class SQLite { ); } - late final _sqlite3_column_type_ptr = - _lookup>( - 'sqlite3_column_type'); - late final _dart_sqlite3_column_type _sqlite3_column_type = - _sqlite3_column_type_ptr.asFunction<_dart_sqlite3_column_type>(); + late final _sqlite3_column_type_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_column_type'); + late final _sqlite3_column_type = _sqlite3_column_type_ptr + .asFunction, int)>(); /// CAPI3REF: Destroy A Prepared Statement Object /// DESTRUCTOR: sqlite3_stmt @@ -4105,10 +4517,11 @@ class SQLite { ); } - late final _sqlite3_finalize_ptr = - _lookup>('sqlite3_finalize'); - late final _dart_sqlite3_finalize _sqlite3_finalize = - _sqlite3_finalize_ptr.asFunction<_dart_sqlite3_finalize>(); + late final _sqlite3_finalize_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_finalize'); + late final _sqlite3_finalize = _sqlite3_finalize_ptr + .asFunction)>(); /// CAPI3REF: Reset A Prepared Statement Object /// METHOD: sqlite3_stmt @@ -4141,10 +4554,11 @@ class SQLite { ); } - late final _sqlite3_reset_ptr = - _lookup>('sqlite3_reset'); - late final _dart_sqlite3_reset _sqlite3_reset = - _sqlite3_reset_ptr.asFunction<_dart_sqlite3_reset>(); + late final _sqlite3_reset_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_reset'); + late final _sqlite3_reset = + _sqlite3_reset_ptr.asFunction)>(); /// CAPI3REF: Create Or Redefine SQL Functions /// KEYWORDS: {function creation routines} @@ -4275,9 +4689,19 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xFunc, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xStep, + ffi.Pointer< + ffi.NativeFunction)>> + xFinal, ) { return _sqlite3_create_function( db, @@ -4292,10 +4716,49 @@ class SQLite { } late final _sqlite3_create_function_ptr = - _lookup>( + _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>( 'sqlite3_create_function'); - late final _dart_sqlite3_create_function _sqlite3_create_function = - _sqlite3_create_function_ptr.asFunction<_dart_sqlite3_create_function>(); + late final _sqlite3_create_function = _sqlite3_create_function_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>(); int sqlite3_create_function16( ffi.Pointer db, @@ -4303,9 +4766,19 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xFunc, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xStep, + ffi.Pointer< + ffi.NativeFunction)>> + xFinal, ) { return _sqlite3_create_function16( db, @@ -4320,11 +4793,50 @@ class SQLite { } late final _sqlite3_create_function16_ptr = - _lookup>( + _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>( 'sqlite3_create_function16'); - late final _dart_sqlite3_create_function16 _sqlite3_create_function16 = - _sqlite3_create_function16_ptr - .asFunction<_dart_sqlite3_create_function16>(); + late final _sqlite3_create_function16 = + _sqlite3_create_function16_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>(); int sqlite3_create_function_v2( ffi.Pointer db, @@ -4332,10 +4844,21 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xDestroy, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xFunc, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xStep, + ffi.Pointer< + ffi.NativeFunction)>> + xFinal, + ffi.Pointer)>> + xDestroy, ) { return _sqlite3_create_function_v2( db, @@ -4351,11 +4874,55 @@ class SQLite { } late final _sqlite3_create_function_v2_ptr = - _lookup>( + _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_create_function_v2'); - late final _dart_sqlite3_create_function_v2 _sqlite3_create_function_v2 = - _sqlite3_create_function_v2_ptr - .asFunction<_dart_sqlite3_create_function_v2>(); + late final _sqlite3_create_function_v2 = + _sqlite3_create_function_v2_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>(); int sqlite3_create_window_function( ffi.Pointer db, @@ -4363,11 +4930,24 @@ class SQLite { int nArg, int eTextRep, ffi.Pointer pApp, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xValue, - ffi.Pointer> xInverse, - ffi.Pointer> xDestroy, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xStep, + ffi.Pointer< + ffi.NativeFunction)>> + xFinal, + ffi.Pointer< + ffi.NativeFunction)>> + xValue, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>> + xInverse, + ffi.Pointer)>> + xDestroy, ) { return _sqlite3_create_window_function( db, @@ -4384,11 +4964,61 @@ class SQLite { } late final _sqlite3_create_window_function_ptr = - _lookup>( + _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( 'sqlite3_create_window_function'); - late final _dart_sqlite3_create_window_function - _sqlite3_create_window_function = _sqlite3_create_window_function_ptr - .asFunction<_dart_sqlite3_create_window_function>(); + late final _sqlite3_create_window_function = + _sqlite3_create_window_function_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Pointer>)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>(); int sqlite3_aggregate_count( ffi.Pointer arg0, @@ -4398,11 +5028,11 @@ class SQLite { ); } - late final _sqlite3_aggregate_count_ptr = - _lookup>( - 'sqlite3_aggregate_count'); - late final _dart_sqlite3_aggregate_count _sqlite3_aggregate_count = - _sqlite3_aggregate_count_ptr.asFunction<_dart_sqlite3_aggregate_count>(); + late final _sqlite3_aggregate_count_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_aggregate_count'); + late final _sqlite3_aggregate_count = _sqlite3_aggregate_count_ptr + .asFunction)>(); int sqlite3_expired( ffi.Pointer arg0, @@ -4412,10 +5042,11 @@ class SQLite { ); } - late final _sqlite3_expired_ptr = - _lookup>('sqlite3_expired'); - late final _dart_sqlite3_expired _sqlite3_expired = - _sqlite3_expired_ptr.asFunction<_dart_sqlite3_expired>(); + late final _sqlite3_expired_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_expired'); + late final _sqlite3_expired = _sqlite3_expired_ptr + .asFunction)>(); int sqlite3_transfer_bindings( ffi.Pointer arg0, @@ -4427,35 +5058,40 @@ class SQLite { ); } - late final _sqlite3_transfer_bindings_ptr = - _lookup>( - 'sqlite3_transfer_bindings'); - late final _dart_sqlite3_transfer_bindings _sqlite3_transfer_bindings = - _sqlite3_transfer_bindings_ptr - .asFunction<_dart_sqlite3_transfer_bindings>(); + late final _sqlite3_transfer_bindings_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_transfer_bindings'); + late final _sqlite3_transfer_bindings = + _sqlite3_transfer_bindings_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); int sqlite3_global_recover() { return _sqlite3_global_recover(); } late final _sqlite3_global_recover_ptr = - _lookup>( + _lookup>( 'sqlite3_global_recover'); - late final _dart_sqlite3_global_recover _sqlite3_global_recover = - _sqlite3_global_recover_ptr.asFunction<_dart_sqlite3_global_recover>(); + late final _sqlite3_global_recover = + _sqlite3_global_recover_ptr.asFunction(); void sqlite3_thread_cleanup() { return _sqlite3_thread_cleanup(); } late final _sqlite3_thread_cleanup_ptr = - _lookup>( + _lookup>( 'sqlite3_thread_cleanup'); - late final _dart_sqlite3_thread_cleanup _sqlite3_thread_cleanup = - _sqlite3_thread_cleanup_ptr.asFunction<_dart_sqlite3_thread_cleanup>(); + late final _sqlite3_thread_cleanup = + _sqlite3_thread_cleanup_ptr.asFunction(); int sqlite3_memory_alarm( - ffi.Pointer> arg0, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, sqlite3_int64, ffi.Int32)>> + arg0, ffi.Pointer arg1, int arg2, ) { @@ -4466,11 +5102,23 @@ class SQLite { ); } - late final _sqlite3_memory_alarm_ptr = - _lookup>( - 'sqlite3_memory_alarm'); - late final _dart_sqlite3_memory_alarm _sqlite3_memory_alarm = - _sqlite3_memory_alarm_ptr.asFunction<_dart_sqlite3_memory_alarm>(); + late final _sqlite3_memory_alarm_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, sqlite3_int64, ffi.Int32)>>, + ffi.Pointer, + sqlite3_int64)>>('sqlite3_memory_alarm'); + late final _sqlite3_memory_alarm = _sqlite3_memory_alarm_ptr.asFunction< + int Function( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, sqlite3_int64, ffi.Int32)>>, + ffi.Pointer, + int)>(); /// CAPI3REF: Obtaining SQL Values /// METHOD: sqlite3_value @@ -4606,10 +5254,12 @@ class SQLite { ); } - late final _sqlite3_value_blob_ptr = - _lookup>('sqlite3_value_blob'); - late final _dart_sqlite3_value_blob _sqlite3_value_blob = - _sqlite3_value_blob_ptr.asFunction<_dart_sqlite3_value_blob>(); + late final _sqlite3_value_blob_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_value_blob'); + late final _sqlite3_value_blob = _sqlite3_value_blob_ptr + .asFunction Function(ffi.Pointer)>(); double sqlite3_value_double( ffi.Pointer arg0, @@ -4619,11 +5269,11 @@ class SQLite { ); } - late final _sqlite3_value_double_ptr = - _lookup>( - 'sqlite3_value_double'); - late final _dart_sqlite3_value_double _sqlite3_value_double = - _sqlite3_value_double_ptr.asFunction<_dart_sqlite3_value_double>(); + late final _sqlite3_value_double_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_double'); + late final _sqlite3_value_double = _sqlite3_value_double_ptr + .asFunction)>(); int sqlite3_value_int( ffi.Pointer arg0, @@ -4633,10 +5283,11 @@ class SQLite { ); } - late final _sqlite3_value_int_ptr = - _lookup>('sqlite3_value_int'); - late final _dart_sqlite3_value_int _sqlite3_value_int = - _sqlite3_value_int_ptr.asFunction<_dart_sqlite3_value_int>(); + late final _sqlite3_value_int_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_int'); + late final _sqlite3_value_int = _sqlite3_value_int_ptr + .asFunction)>(); int sqlite3_value_int64( ffi.Pointer arg0, @@ -4646,11 +5297,12 @@ class SQLite { ); } - late final _sqlite3_value_int64_ptr = - _lookup>( - 'sqlite3_value_int64'); - late final _dart_sqlite3_value_int64 _sqlite3_value_int64 = - _sqlite3_value_int64_ptr.asFunction<_dart_sqlite3_value_int64>(); + late final _sqlite3_value_int64_ptr = _lookup< + ffi.NativeFunction< + sqlite3_int64 Function( + ffi.Pointer)>>('sqlite3_value_int64'); + late final _sqlite3_value_int64 = _sqlite3_value_int64_ptr + .asFunction)>(); ffi.Pointer sqlite3_value_pointer( ffi.Pointer arg0, @@ -4662,11 +5314,13 @@ class SQLite { ); } - late final _sqlite3_value_pointer_ptr = - _lookup>( - 'sqlite3_value_pointer'); - late final _dart_sqlite3_value_pointer _sqlite3_value_pointer = - _sqlite3_value_pointer_ptr.asFunction<_dart_sqlite3_value_pointer>(); + late final _sqlite3_value_pointer_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_value_pointer'); + late final _sqlite3_value_pointer = _sqlite3_value_pointer_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer sqlite3_value_text( ffi.Pointer arg0, @@ -4676,10 +5330,12 @@ class SQLite { ); } - late final _sqlite3_value_text_ptr = - _lookup>('sqlite3_value_text'); - late final _dart_sqlite3_value_text _sqlite3_value_text = - _sqlite3_value_text_ptr.asFunction<_dart_sqlite3_value_text>(); + late final _sqlite3_value_text_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_value_text'); + late final _sqlite3_value_text = _sqlite3_value_text_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); ffi.Pointer sqlite3_value_text16( ffi.Pointer arg0, @@ -4689,11 +5345,12 @@ class SQLite { ); } - late final _sqlite3_value_text16_ptr = - _lookup>( - 'sqlite3_value_text16'); - late final _dart_sqlite3_value_text16 _sqlite3_value_text16 = - _sqlite3_value_text16_ptr.asFunction<_dart_sqlite3_value_text16>(); + late final _sqlite3_value_text16_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_value_text16'); + late final _sqlite3_value_text16 = _sqlite3_value_text16_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_value_text16le( ffi.Pointer arg0, @@ -4703,11 +5360,12 @@ class SQLite { ); } - late final _sqlite3_value_text16le_ptr = - _lookup>( - 'sqlite3_value_text16le'); - late final _dart_sqlite3_value_text16le _sqlite3_value_text16le = - _sqlite3_value_text16le_ptr.asFunction<_dart_sqlite3_value_text16le>(); + late final _sqlite3_value_text16le_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_value_text16le'); + late final _sqlite3_value_text16le = _sqlite3_value_text16le_ptr + .asFunction Function(ffi.Pointer)>(); ffi.Pointer sqlite3_value_text16be( ffi.Pointer arg0, @@ -4717,11 +5375,12 @@ class SQLite { ); } - late final _sqlite3_value_text16be_ptr = - _lookup>( - 'sqlite3_value_text16be'); - late final _dart_sqlite3_value_text16be _sqlite3_value_text16be = - _sqlite3_value_text16be_ptr.asFunction<_dart_sqlite3_value_text16be>(); + late final _sqlite3_value_text16be_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_value_text16be'); + late final _sqlite3_value_text16be = _sqlite3_value_text16be_ptr + .asFunction Function(ffi.Pointer)>(); int sqlite3_value_bytes( ffi.Pointer arg0, @@ -4731,11 +5390,11 @@ class SQLite { ); } - late final _sqlite3_value_bytes_ptr = - _lookup>( - 'sqlite3_value_bytes'); - late final _dart_sqlite3_value_bytes _sqlite3_value_bytes = - _sqlite3_value_bytes_ptr.asFunction<_dart_sqlite3_value_bytes>(); + late final _sqlite3_value_bytes_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_bytes'); + late final _sqlite3_value_bytes = _sqlite3_value_bytes_ptr + .asFunction)>(); int sqlite3_value_bytes16( ffi.Pointer arg0, @@ -4745,11 +5404,11 @@ class SQLite { ); } - late final _sqlite3_value_bytes16_ptr = - _lookup>( - 'sqlite3_value_bytes16'); - late final _dart_sqlite3_value_bytes16 _sqlite3_value_bytes16 = - _sqlite3_value_bytes16_ptr.asFunction<_dart_sqlite3_value_bytes16>(); + late final _sqlite3_value_bytes16_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_bytes16'); + late final _sqlite3_value_bytes16 = _sqlite3_value_bytes16_ptr + .asFunction)>(); int sqlite3_value_type( ffi.Pointer arg0, @@ -4759,10 +5418,11 @@ class SQLite { ); } - late final _sqlite3_value_type_ptr = - _lookup>('sqlite3_value_type'); - late final _dart_sqlite3_value_type _sqlite3_value_type = - _sqlite3_value_type_ptr.asFunction<_dart_sqlite3_value_type>(); + late final _sqlite3_value_type_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_type'); + late final _sqlite3_value_type = _sqlite3_value_type_ptr + .asFunction)>(); int sqlite3_value_numeric_type( ffi.Pointer arg0, @@ -4772,12 +5432,11 @@ class SQLite { ); } - late final _sqlite3_value_numeric_type_ptr = - _lookup>( - 'sqlite3_value_numeric_type'); - late final _dart_sqlite3_value_numeric_type _sqlite3_value_numeric_type = - _sqlite3_value_numeric_type_ptr - .asFunction<_dart_sqlite3_value_numeric_type>(); + late final _sqlite3_value_numeric_type_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_numeric_type'); + late final _sqlite3_value_numeric_type = _sqlite3_value_numeric_type_ptr + .asFunction)>(); int sqlite3_value_nochange( ffi.Pointer arg0, @@ -4787,11 +5446,11 @@ class SQLite { ); } - late final _sqlite3_value_nochange_ptr = - _lookup>( - 'sqlite3_value_nochange'); - late final _dart_sqlite3_value_nochange _sqlite3_value_nochange = - _sqlite3_value_nochange_ptr.asFunction<_dart_sqlite3_value_nochange>(); + late final _sqlite3_value_nochange_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_nochange'); + late final _sqlite3_value_nochange = _sqlite3_value_nochange_ptr + .asFunction)>(); int sqlite3_value_frombind( ffi.Pointer arg0, @@ -4801,11 +5460,11 @@ class SQLite { ); } - late final _sqlite3_value_frombind_ptr = - _lookup>( - 'sqlite3_value_frombind'); - late final _dart_sqlite3_value_frombind _sqlite3_value_frombind = - _sqlite3_value_frombind_ptr.asFunction<_dart_sqlite3_value_frombind>(); + late final _sqlite3_value_frombind_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_frombind'); + late final _sqlite3_value_frombind = _sqlite3_value_frombind_ptr + .asFunction)>(); /// CAPI3REF: Finding The Subtype Of SQL Values /// METHOD: sqlite3_value @@ -4823,11 +5482,11 @@ class SQLite { ); } - late final _sqlite3_value_subtype_ptr = - _lookup>( - 'sqlite3_value_subtype'); - late final _dart_sqlite3_value_subtype _sqlite3_value_subtype = - _sqlite3_value_subtype_ptr.asFunction<_dart_sqlite3_value_subtype>(); + late final _sqlite3_value_subtype_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_subtype'); + late final _sqlite3_value_subtype = _sqlite3_value_subtype_ptr + .asFunction)>(); /// CAPI3REF: Copy And Free SQL Values /// METHOD: sqlite3_value @@ -4849,10 +5508,12 @@ class SQLite { ); } - late final _sqlite3_value_dup_ptr = - _lookup>('sqlite3_value_dup'); - late final _dart_sqlite3_value_dup _sqlite3_value_dup = - _sqlite3_value_dup_ptr.asFunction<_dart_sqlite3_value_dup>(); + late final _sqlite3_value_dup_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_value_dup'); + late final _sqlite3_value_dup = _sqlite3_value_dup_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); void sqlite3_value_free( ffi.Pointer arg0, @@ -4862,10 +5523,11 @@ class SQLite { ); } - late final _sqlite3_value_free_ptr = - _lookup>('sqlite3_value_free'); - late final _dart_sqlite3_value_free _sqlite3_value_free = - _sqlite3_value_free_ptr.asFunction<_dart_sqlite3_value_free>(); + late final _sqlite3_value_free_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_value_free'); + late final _sqlite3_value_free = _sqlite3_value_free_ptr + .asFunction)>(); /// CAPI3REF: Obtain Aggregate Function Context /// METHOD: sqlite3_context @@ -4918,12 +5580,13 @@ class SQLite { ); } - late final _sqlite3_aggregate_context_ptr = - _lookup>( - 'sqlite3_aggregate_context'); - late final _dart_sqlite3_aggregate_context _sqlite3_aggregate_context = - _sqlite3_aggregate_context_ptr - .asFunction<_dart_sqlite3_aggregate_context>(); + late final _sqlite3_aggregate_context_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_aggregate_context'); + late final _sqlite3_aggregate_context = + _sqlite3_aggregate_context_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: User Data For Functions /// METHOD: sqlite3_context @@ -4944,10 +5607,12 @@ class SQLite { ); } - late final _sqlite3_user_data_ptr = - _lookup>('sqlite3_user_data'); - late final _dart_sqlite3_user_data _sqlite3_user_data = - _sqlite3_user_data_ptr.asFunction<_dart_sqlite3_user_data>(); + late final _sqlite3_user_data_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_user_data'); + late final _sqlite3_user_data = _sqlite3_user_data_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); /// CAPI3REF: Database Connection For Functions /// METHOD: sqlite3_context @@ -4965,12 +5630,13 @@ class SQLite { ); } - late final _sqlite3_context_db_handle_ptr = - _lookup>( - 'sqlite3_context_db_handle'); - late final _dart_sqlite3_context_db_handle _sqlite3_context_db_handle = - _sqlite3_context_db_handle_ptr - .asFunction<_dart_sqlite3_context_db_handle>(); + late final _sqlite3_context_db_handle_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_context_db_handle'); + late final _sqlite3_context_db_handle = + _sqlite3_context_db_handle_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); /// CAPI3REF: Function Auxiliary Data /// METHOD: sqlite3_context @@ -5037,17 +5703,19 @@ class SQLite { ); } - late final _sqlite3_get_auxdata_ptr = - _lookup>( - 'sqlite3_get_auxdata'); - late final _dart_sqlite3_get_auxdata _sqlite3_get_auxdata = - _sqlite3_get_auxdata_ptr.asFunction<_dart_sqlite3_get_auxdata>(); + late final _sqlite3_get_auxdata_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_get_auxdata'); + late final _sqlite3_get_auxdata = _sqlite3_get_auxdata_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); void sqlite3_set_auxdata( ffi.Pointer arg0, int N, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_set_auxdata( arg0, @@ -5057,11 +5725,23 @@ class SQLite { ); } - late final _sqlite3_set_auxdata_ptr = - _lookup>( - 'sqlite3_set_auxdata'); - late final _dart_sqlite3_set_auxdata _sqlite3_set_auxdata = - _sqlite3_set_auxdata_ptr.asFunction<_dart_sqlite3_set_auxdata>(); + late final _sqlite3_set_auxdata_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_set_auxdata'); + late final _sqlite3_set_auxdata = _sqlite3_set_auxdata_ptr.asFunction< + void Function( + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction)>>)>(); /// CAPI3REF: Setting The Result Of An SQL Function /// METHOD: sqlite3_context @@ -5211,7 +5891,8 @@ class SQLite { ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_result_blob( arg0, @@ -5221,17 +5902,30 @@ class SQLite { ); } - late final _sqlite3_result_blob_ptr = - _lookup>( - 'sqlite3_result_blob'); - late final _dart_sqlite3_result_blob _sqlite3_result_blob = - _sqlite3_result_blob_ptr.asFunction<_dart_sqlite3_result_blob>(); + late final _sqlite3_result_blob_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_result_blob'); + late final _sqlite3_result_blob = _sqlite3_result_blob_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); void sqlite3_result_blob64( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_result_blob64( arg0, @@ -5241,11 +5935,23 @@ class SQLite { ); } - late final _sqlite3_result_blob64_ptr = - _lookup>( - 'sqlite3_result_blob64'); - late final _dart_sqlite3_result_blob64 _sqlite3_result_blob64 = - _sqlite3_result_blob64_ptr.asFunction<_dart_sqlite3_result_blob64>(); + late final _sqlite3_result_blob64_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sqlite3_uint64, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_result_blob64'); + late final _sqlite3_result_blob64 = _sqlite3_result_blob64_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); void sqlite3_result_double( ffi.Pointer arg0, @@ -5257,11 +5963,12 @@ class SQLite { ); } - late final _sqlite3_result_double_ptr = - _lookup>( - 'sqlite3_result_double'); - late final _dart_sqlite3_result_double _sqlite3_result_double = - _sqlite3_result_double_ptr.asFunction<_dart_sqlite3_result_double>(); + late final _sqlite3_result_double_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Double)>>('sqlite3_result_double'); + late final _sqlite3_result_double = _sqlite3_result_double_ptr + .asFunction, double)>(); void sqlite3_result_error( ffi.Pointer arg0, @@ -5275,11 +5982,13 @@ class SQLite { ); } - late final _sqlite3_result_error_ptr = - _lookup>( - 'sqlite3_result_error'); - late final _dart_sqlite3_result_error _sqlite3_result_error = - _sqlite3_result_error_ptr.asFunction<_dart_sqlite3_result_error>(); + late final _sqlite3_result_error_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('sqlite3_result_error'); + late final _sqlite3_result_error = _sqlite3_result_error_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, int)>(); void sqlite3_result_error16( ffi.Pointer arg0, @@ -5293,11 +6002,13 @@ class SQLite { ); } - late final _sqlite3_result_error16_ptr = - _lookup>( - 'sqlite3_result_error16'); - late final _dart_sqlite3_result_error16 _sqlite3_result_error16 = - _sqlite3_result_error16_ptr.asFunction<_dart_sqlite3_result_error16>(); + late final _sqlite3_result_error16_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('sqlite3_result_error16'); + late final _sqlite3_result_error16 = _sqlite3_result_error16_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer, int)>(); void sqlite3_result_error_toobig( ffi.Pointer arg0, @@ -5307,12 +6018,11 @@ class SQLite { ); } - late final _sqlite3_result_error_toobig_ptr = - _lookup>( - 'sqlite3_result_error_toobig'); - late final _dart_sqlite3_result_error_toobig _sqlite3_result_error_toobig = - _sqlite3_result_error_toobig_ptr - .asFunction<_dart_sqlite3_result_error_toobig>(); + late final _sqlite3_result_error_toobig_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_result_error_toobig'); + late final _sqlite3_result_error_toobig = _sqlite3_result_error_toobig_ptr + .asFunction)>(); void sqlite3_result_error_nomem( ffi.Pointer arg0, @@ -5322,12 +6032,11 @@ class SQLite { ); } - late final _sqlite3_result_error_nomem_ptr = - _lookup>( - 'sqlite3_result_error_nomem'); - late final _dart_sqlite3_result_error_nomem _sqlite3_result_error_nomem = - _sqlite3_result_error_nomem_ptr - .asFunction<_dart_sqlite3_result_error_nomem>(); + late final _sqlite3_result_error_nomem_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_result_error_nomem'); + late final _sqlite3_result_error_nomem = _sqlite3_result_error_nomem_ptr + .asFunction)>(); void sqlite3_result_error_code( ffi.Pointer arg0, @@ -5339,12 +6048,12 @@ class SQLite { ); } - late final _sqlite3_result_error_code_ptr = - _lookup>( - 'sqlite3_result_error_code'); - late final _dart_sqlite3_result_error_code _sqlite3_result_error_code = - _sqlite3_result_error_code_ptr - .asFunction<_dart_sqlite3_result_error_code>(); + late final _sqlite3_result_error_code_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_result_error_code'); + late final _sqlite3_result_error_code = _sqlite3_result_error_code_ptr + .asFunction, int)>(); void sqlite3_result_int( ffi.Pointer arg0, @@ -5356,10 +6065,12 @@ class SQLite { ); } - late final _sqlite3_result_int_ptr = - _lookup>('sqlite3_result_int'); - late final _dart_sqlite3_result_int _sqlite3_result_int = - _sqlite3_result_int_ptr.asFunction<_dart_sqlite3_result_int>(); + late final _sqlite3_result_int_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_result_int'); + late final _sqlite3_result_int = _sqlite3_result_int_ptr + .asFunction, int)>(); void sqlite3_result_int64( ffi.Pointer arg0, @@ -5371,11 +6082,12 @@ class SQLite { ); } - late final _sqlite3_result_int64_ptr = - _lookup>( - 'sqlite3_result_int64'); - late final _dart_sqlite3_result_int64 _sqlite3_result_int64 = - _sqlite3_result_int64_ptr.asFunction<_dart_sqlite3_result_int64>(); + late final _sqlite3_result_int64_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + sqlite3_int64)>>('sqlite3_result_int64'); + late final _sqlite3_result_int64 = _sqlite3_result_int64_ptr + .asFunction, int)>(); void sqlite3_result_null( ffi.Pointer arg0, @@ -5385,17 +6097,18 @@ class SQLite { ); } - late final _sqlite3_result_null_ptr = - _lookup>( - 'sqlite3_result_null'); - late final _dart_sqlite3_result_null _sqlite3_result_null = - _sqlite3_result_null_ptr.asFunction<_dart_sqlite3_result_null>(); + late final _sqlite3_result_null_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_result_null'); + late final _sqlite3_result_null = _sqlite3_result_null_ptr + .asFunction)>(); void sqlite3_result_text( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_result_text( arg0, @@ -5405,17 +6118,30 @@ class SQLite { ); } - late final _sqlite3_result_text_ptr = - _lookup>( - 'sqlite3_result_text'); - late final _dart_sqlite3_result_text _sqlite3_result_text = - _sqlite3_result_text_ptr.asFunction<_dart_sqlite3_result_text>(); + late final _sqlite3_result_text_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_result_text'); + late final _sqlite3_result_text = _sqlite3_result_text_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); void sqlite3_result_text64( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, int encoding, ) { return _sqlite3_result_text64( @@ -5427,17 +6153,30 @@ class SQLite { ); } - late final _sqlite3_result_text64_ptr = - _lookup>( - 'sqlite3_result_text64'); - late final _dart_sqlite3_result_text64 _sqlite3_result_text64 = - _sqlite3_result_text64_ptr.asFunction<_dart_sqlite3_result_text64>(); + late final _sqlite3_result_text64_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + sqlite3_uint64, + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Uint8)>>('sqlite3_result_text64'); + late final _sqlite3_result_text64 = _sqlite3_result_text64_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>, + int)>(); void sqlite3_result_text16( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_result_text16( arg0, @@ -5447,17 +6186,30 @@ class SQLite { ); } - late final _sqlite3_result_text16_ptr = - _lookup>( - 'sqlite3_result_text16'); - late final _dart_sqlite3_result_text16 _sqlite3_result_text16 = - _sqlite3_result_text16_ptr.asFunction<_dart_sqlite3_result_text16>(); + late final _sqlite3_result_text16_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_result_text16'); + late final _sqlite3_result_text16 = _sqlite3_result_text16_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); void sqlite3_result_text16le( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_result_text16le( arg0, @@ -5467,17 +6219,30 @@ class SQLite { ); } - late final _sqlite3_result_text16le_ptr = - _lookup>( - 'sqlite3_result_text16le'); - late final _dart_sqlite3_result_text16le _sqlite3_result_text16le = - _sqlite3_result_text16le_ptr.asFunction<_dart_sqlite3_result_text16le>(); + late final _sqlite3_result_text16le_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_result_text16le'); + late final _sqlite3_result_text16le = _sqlite3_result_text16le_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); void sqlite3_result_text16be( ffi.Pointer arg0, ffi.Pointer arg1, int arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_result_text16be( arg0, @@ -5487,11 +6252,23 @@ class SQLite { ); } - late final _sqlite3_result_text16be_ptr = - _lookup>( - 'sqlite3_result_text16be'); - late final _dart_sqlite3_result_text16be _sqlite3_result_text16be = - _sqlite3_result_text16be_ptr.asFunction<_dart_sqlite3_result_text16be>(); + late final _sqlite3_result_text16be_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_result_text16be'); + late final _sqlite3_result_text16be = _sqlite3_result_text16be_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer< + ffi.NativeFunction)>>)>(); void sqlite3_result_value( ffi.Pointer arg0, @@ -5503,17 +6280,20 @@ class SQLite { ); } - late final _sqlite3_result_value_ptr = - _lookup>( - 'sqlite3_result_value'); - late final _dart_sqlite3_result_value _sqlite3_result_value = - _sqlite3_result_value_ptr.asFunction<_dart_sqlite3_result_value>(); + late final _sqlite3_result_value_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_result_value'); + late final _sqlite3_result_value = _sqlite3_result_value_ptr.asFunction< + void Function( + ffi.Pointer, ffi.Pointer)>(); void sqlite3_result_pointer( ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, - ffi.Pointer> arg3, + ffi.Pointer)>> + arg3, ) { return _sqlite3_result_pointer( arg0, @@ -5523,11 +6303,23 @@ class SQLite { ); } - late final _sqlite3_result_pointer_ptr = - _lookup>( - 'sqlite3_result_pointer'); - late final _dart_sqlite3_result_pointer _sqlite3_result_pointer = - _sqlite3_result_pointer_ptr.asFunction<_dart_sqlite3_result_pointer>(); + late final _sqlite3_result_pointer_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer)>>)>>('sqlite3_result_pointer'); + late final _sqlite3_result_pointer = _sqlite3_result_pointer_ptr.asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction)>>)>(); void sqlite3_result_zeroblob( ffi.Pointer arg0, @@ -5539,11 +6331,12 @@ class SQLite { ); } - late final _sqlite3_result_zeroblob_ptr = - _lookup>( - 'sqlite3_result_zeroblob'); - late final _dart_sqlite3_result_zeroblob _sqlite3_result_zeroblob = - _sqlite3_result_zeroblob_ptr.asFunction<_dart_sqlite3_result_zeroblob>(); + late final _sqlite3_result_zeroblob_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_result_zeroblob'); + late final _sqlite3_result_zeroblob = _sqlite3_result_zeroblob_ptr + .asFunction, int)>(); int sqlite3_result_zeroblob64( ffi.Pointer arg0, @@ -5555,12 +6348,12 @@ class SQLite { ); } - late final _sqlite3_result_zeroblob64_ptr = - _lookup>( - 'sqlite3_result_zeroblob64'); - late final _dart_sqlite3_result_zeroblob64 _sqlite3_result_zeroblob64 = - _sqlite3_result_zeroblob64_ptr - .asFunction<_dart_sqlite3_result_zeroblob64>(); + late final _sqlite3_result_zeroblob64_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + sqlite3_uint64)>>('sqlite3_result_zeroblob64'); + late final _sqlite3_result_zeroblob64 = _sqlite3_result_zeroblob64_ptr + .asFunction, int)>(); /// CAPI3REF: Setting The Subtype Of An SQL Function /// METHOD: sqlite3_context @@ -5582,11 +6375,12 @@ class SQLite { ); } - late final _sqlite3_result_subtype_ptr = - _lookup>( - 'sqlite3_result_subtype'); - late final _dart_sqlite3_result_subtype _sqlite3_result_subtype = - _sqlite3_result_subtype_ptr.asFunction<_dart_sqlite3_result_subtype>(); + late final _sqlite3_result_subtype_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Uint32)>>('sqlite3_result_subtype'); + late final _sqlite3_result_subtype = _sqlite3_result_subtype_ptr + .asFunction, int)>(); /// CAPI3REF: Define New Collating Sequences /// METHOD: sqlite3 @@ -5672,7 +6466,11 @@ class SQLite { ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xCompare, ) { return _sqlite3_create_collation( arg0, @@ -5683,20 +6481,50 @@ class SQLite { ); } - late final _sqlite3_create_collation_ptr = - _lookup>( - 'sqlite3_create_collation'); - late final _dart_sqlite3_create_collation _sqlite3_create_collation = - _sqlite3_create_collation_ptr - .asFunction<_dart_sqlite3_create_collation>(); + late final _sqlite3_create_collation_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>>( + 'sqlite3_create_collation'); + late final _sqlite3_create_collation = + _sqlite3_create_collation_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>(); int sqlite3_create_collation_v2( ffi.Pointer arg0, ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, - ffi.Pointer> xDestroy, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xCompare, + ffi.Pointer)>> + xDestroy, ) { return _sqlite3_create_collation_v2( arg0, @@ -5708,19 +6536,54 @@ class SQLite { ); } - late final _sqlite3_create_collation_v2_ptr = - _lookup>( - 'sqlite3_create_collation_v2'); - late final _dart_sqlite3_create_collation_v2 _sqlite3_create_collation_v2 = - _sqlite3_create_collation_v2_ptr - .asFunction<_dart_sqlite3_create_collation_v2>(); + late final _sqlite3_create_collation_v2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_create_collation_v2'); + late final _sqlite3_create_collation_v2 = + _sqlite3_create_collation_v2_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>(); int sqlite3_create_collation16( ffi.Pointer arg0, ffi.Pointer zName, int eTextRep, ffi.Pointer pArg, - ffi.Pointer> xCompare, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xCompare, ) { return _sqlite3_create_collation16( arg0, @@ -5731,12 +6594,37 @@ class SQLite { ); } - late final _sqlite3_create_collation16_ptr = - _lookup>( - 'sqlite3_create_collation16'); - late final _dart_sqlite3_create_collation16 _sqlite3_create_collation16 = - _sqlite3_create_collation16_ptr - .asFunction<_dart_sqlite3_create_collation16>(); + late final _sqlite3_create_collation16_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>>( + 'sqlite3_create_collation16'); + late final _sqlite3_create_collation16 = + _sqlite3_create_collation16_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>(); /// CAPI3REF: Collation Needed Callbacks /// METHOD: sqlite3 @@ -5766,7 +6654,11 @@ class SQLite { int sqlite3_collation_needed( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>> + arg2, ) { return _sqlite3_collation_needed( arg0, @@ -5775,17 +6667,40 @@ class SQLite { ); } - late final _sqlite3_collation_needed_ptr = - _lookup>( - 'sqlite3_collation_needed'); - late final _dart_sqlite3_collation_needed _sqlite3_collation_needed = - _sqlite3_collation_needed_ptr - .asFunction<_dart_sqlite3_collation_needed>(); + late final _sqlite3_collation_needed_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>>( + 'sqlite3_collation_needed'); + late final _sqlite3_collation_needed = + _sqlite3_collation_needed_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>(); int sqlite3_collation_needed16( ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer> arg2, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>> + arg2, ) { return _sqlite3_collation_needed16( arg0, @@ -5794,12 +6709,31 @@ class SQLite { ); } - late final _sqlite3_collation_needed16_ptr = - _lookup>( - 'sqlite3_collation_needed16'); - late final _dart_sqlite3_collation_needed16 _sqlite3_collation_needed16 = - _sqlite3_collation_needed16_ptr - .asFunction<_dart_sqlite3_collation_needed16>(); + late final _sqlite3_collation_needed16_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>>( + 'sqlite3_collation_needed16'); + late final _sqlite3_collation_needed16 = + _sqlite3_collation_needed16_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>)>(); /// CAPI3REF: Suspend Execution For A Short Time /// @@ -5825,9 +6759,10 @@ class SQLite { } late final _sqlite3_sleep_ptr = - _lookup>('sqlite3_sleep'); - late final _dart_sqlite3_sleep _sqlite3_sleep = - _sqlite3_sleep_ptr.asFunction<_dart_sqlite3_sleep>(); + _lookup>( + 'sqlite3_sleep'); + late final _sqlite3_sleep = + _sqlite3_sleep_ptr.asFunction(); /// CAPI3REF: Name Of The Folder Holding Temporary Files /// @@ -5961,12 +6896,12 @@ class SQLite { ); } - late final _sqlite3_win32_set_directory_ptr = - _lookup>( - 'sqlite3_win32_set_directory'); - late final _dart_sqlite3_win32_set_directory _sqlite3_win32_set_directory = - _sqlite3_win32_set_directory_ptr - .asFunction<_dart_sqlite3_win32_set_directory>(); + late final _sqlite3_win32_set_directory_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Uint64, + ffi.Pointer)>>('sqlite3_win32_set_directory'); + late final _sqlite3_win32_set_directory = _sqlite3_win32_set_directory_ptr + .asFunction)>(); int sqlite3_win32_set_directory8( int type, @@ -5978,12 +6913,12 @@ class SQLite { ); } - late final _sqlite3_win32_set_directory8_ptr = - _lookup>( - 'sqlite3_win32_set_directory8'); - late final _dart_sqlite3_win32_set_directory8 _sqlite3_win32_set_directory8 = - _sqlite3_win32_set_directory8_ptr - .asFunction<_dart_sqlite3_win32_set_directory8>(); + late final _sqlite3_win32_set_directory8_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Uint64, + ffi.Pointer)>>('sqlite3_win32_set_directory8'); + late final _sqlite3_win32_set_directory8 = _sqlite3_win32_set_directory8_ptr + .asFunction)>(); int sqlite3_win32_set_directory16( int type, @@ -5995,12 +6930,12 @@ class SQLite { ); } - late final _sqlite3_win32_set_directory16_ptr = - _lookup>( - 'sqlite3_win32_set_directory16'); - late final _dart_sqlite3_win32_set_directory16 - _sqlite3_win32_set_directory16 = _sqlite3_win32_set_directory16_ptr - .asFunction<_dart_sqlite3_win32_set_directory16>(); + late final _sqlite3_win32_set_directory16_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Uint64, + ffi.Pointer)>>('sqlite3_win32_set_directory16'); + late final _sqlite3_win32_set_directory16 = _sqlite3_win32_set_directory16_ptr + .asFunction)>(); /// CAPI3REF: Test For Auto-Commit Mode /// KEYWORDS: {autocommit mode} @@ -6031,10 +6966,10 @@ class SQLite { } late final _sqlite3_get_autocommit_ptr = - _lookup>( + _lookup)>>( 'sqlite3_get_autocommit'); - late final _dart_sqlite3_get_autocommit _sqlite3_get_autocommit = - _sqlite3_get_autocommit_ptr.asFunction<_dart_sqlite3_get_autocommit>(); + late final _sqlite3_get_autocommit = _sqlite3_get_autocommit_ptr + .asFunction)>(); /// CAPI3REF: Find The Database Handle Of A Prepared Statement /// METHOD: sqlite3_stmt @@ -6053,10 +6988,12 @@ class SQLite { ); } - late final _sqlite3_db_handle_ptr = - _lookup>('sqlite3_db_handle'); - late final _dart_sqlite3_db_handle _sqlite3_db_handle = - _sqlite3_db_handle_ptr.asFunction<_dart_sqlite3_db_handle>(); + late final _sqlite3_db_handle_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_db_handle'); + late final _sqlite3_db_handle = _sqlite3_db_handle_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Return The Filename For A Database Connection /// METHOD: sqlite3 @@ -6096,11 +7033,13 @@ class SQLite { ); } - late final _sqlite3_db_filename_ptr = - _lookup>( - 'sqlite3_db_filename'); - late final _dart_sqlite3_db_filename _sqlite3_db_filename = - _sqlite3_db_filename_ptr.asFunction<_dart_sqlite3_db_filename>(); + late final _sqlite3_db_filename_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_db_filename'); + late final _sqlite3_db_filename = _sqlite3_db_filename_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Determine if a database is read-only /// METHOD: sqlite3 @@ -6118,11 +7057,12 @@ class SQLite { ); } - late final _sqlite3_db_readonly_ptr = - _lookup>( - 'sqlite3_db_readonly'); - late final _dart_sqlite3_db_readonly _sqlite3_db_readonly = - _sqlite3_db_readonly_ptr.asFunction<_dart_sqlite3_db_readonly>(); + late final _sqlite3_db_readonly_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_db_readonly'); + late final _sqlite3_db_readonly = _sqlite3_db_readonly_ptr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: Find the next prepared statement /// METHOD: sqlite3 @@ -6146,10 +7086,13 @@ class SQLite { ); } - late final _sqlite3_next_stmt_ptr = - _lookup>('sqlite3_next_stmt'); - late final _dart_sqlite3_next_stmt _sqlite3_next_stmt = - _sqlite3_next_stmt_ptr.asFunction<_dart_sqlite3_next_stmt>(); + late final _sqlite3_next_stmt_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_next_stmt'); + late final _sqlite3_next_stmt = _sqlite3_next_stmt_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Commit And Rollback Notification Callbacks /// METHOD: sqlite3 @@ -6198,7 +7141,8 @@ class SQLite { /// See also the [sqlite3_update_hook()] interface. ffi.Pointer sqlite3_commit_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer)>> + arg1, ffi.Pointer arg2, ) { return _sqlite3_commit_hook( @@ -6208,15 +7152,25 @@ class SQLite { ); } - late final _sqlite3_commit_hook_ptr = - _lookup>( - 'sqlite3_commit_hook'); - late final _dart_sqlite3_commit_hook _sqlite3_commit_hook = - _sqlite3_commit_hook_ptr.asFunction<_dart_sqlite3_commit_hook>(); + late final _sqlite3_commit_hook_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer)>>, + ffi.Pointer)>>('sqlite3_commit_hook'); + late final _sqlite3_commit_hook = _sqlite3_commit_hook_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Pointer)>(); ffi.Pointer sqlite3_rollback_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer)>> + arg1, ffi.Pointer arg2, ) { return _sqlite3_rollback_hook( @@ -6226,11 +7180,19 @@ class SQLite { ); } - late final _sqlite3_rollback_hook_ptr = - _lookup>( - 'sqlite3_rollback_hook'); - late final _dart_sqlite3_rollback_hook _sqlite3_rollback_hook = - _sqlite3_rollback_hook_ptr.asFunction<_dart_sqlite3_rollback_hook>(); + late final _sqlite3_rollback_hook_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Pointer)>>('sqlite3_rollback_hook'); + late final _sqlite3_rollback_hook = _sqlite3_rollback_hook_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Pointer)>(); /// CAPI3REF: Data Change Notification Callbacks /// METHOD: sqlite3 @@ -6281,7 +7243,15 @@ class SQLite { /// and [sqlite3_preupdate_hook()] interfaces. ffi.Pointer sqlite3_update_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + sqlite3_int64)>> + arg1, ffi.Pointer arg2, ) { return _sqlite3_update_hook( @@ -6291,11 +7261,31 @@ class SQLite { ); } - late final _sqlite3_update_hook_ptr = - _lookup>( - 'sqlite3_update_hook'); - late final _dart_sqlite3_update_hook _sqlite3_update_hook = - _sqlite3_update_hook_ptr.asFunction<_dart_sqlite3_update_hook>(); + late final _sqlite3_update_hook_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + sqlite3_int64)>>, + ffi.Pointer)>>('sqlite3_update_hook'); + late final _sqlite3_update_hook = _sqlite3_update_hook_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + sqlite3_int64)>>, + ffi.Pointer)>(); /// CAPI3REF: Enable Or Disable Shared Pager Cache /// @@ -6343,11 +7333,10 @@ class SQLite { } late final _sqlite3_enable_shared_cache_ptr = - _lookup>( + _lookup>( 'sqlite3_enable_shared_cache'); - late final _dart_sqlite3_enable_shared_cache _sqlite3_enable_shared_cache = - _sqlite3_enable_shared_cache_ptr - .asFunction<_dart_sqlite3_enable_shared_cache>(); + late final _sqlite3_enable_shared_cache = + _sqlite3_enable_shared_cache_ptr.asFunction(); /// CAPI3REF: Attempt To Free Heap Memory /// @@ -6370,10 +7359,10 @@ class SQLite { } late final _sqlite3_release_memory_ptr = - _lookup>( + _lookup>( 'sqlite3_release_memory'); - late final _dart_sqlite3_release_memory _sqlite3_release_memory = - _sqlite3_release_memory_ptr.asFunction<_dart_sqlite3_release_memory>(); + late final _sqlite3_release_memory = + _sqlite3_release_memory_ptr.asFunction(); /// CAPI3REF: Free Memory Used By A Database Connection /// METHOD: sqlite3 @@ -6394,11 +7383,10 @@ class SQLite { } late final _sqlite3_db_release_memory_ptr = - _lookup>( + _lookup)>>( 'sqlite3_db_release_memory'); - late final _dart_sqlite3_db_release_memory _sqlite3_db_release_memory = - _sqlite3_db_release_memory_ptr - .asFunction<_dart_sqlite3_db_release_memory>(); + late final _sqlite3_db_release_memory = _sqlite3_db_release_memory_ptr + .asFunction)>(); /// CAPI3REF: Impose A Limit On Heap Size /// @@ -6471,11 +7459,10 @@ class SQLite { } late final _sqlite3_soft_heap_limit64_ptr = - _lookup>( + _lookup>( 'sqlite3_soft_heap_limit64'); - late final _dart_sqlite3_soft_heap_limit64 _sqlite3_soft_heap_limit64 = - _sqlite3_soft_heap_limit64_ptr - .asFunction<_dart_sqlite3_soft_heap_limit64>(); + late final _sqlite3_soft_heap_limit64 = + _sqlite3_soft_heap_limit64_ptr.asFunction(); int sqlite3_hard_heap_limit64( int N, @@ -6486,11 +7473,10 @@ class SQLite { } late final _sqlite3_hard_heap_limit64_ptr = - _lookup>( + _lookup>( 'sqlite3_hard_heap_limit64'); - late final _dart_sqlite3_hard_heap_limit64 _sqlite3_hard_heap_limit64 = - _sqlite3_hard_heap_limit64_ptr - .asFunction<_dart_sqlite3_hard_heap_limit64>(); + late final _sqlite3_hard_heap_limit64 = + _sqlite3_hard_heap_limit64_ptr.asFunction(); /// CAPI3REF: Deprecated Soft Heap Limit Interface /// DEPRECATED @@ -6508,10 +7494,10 @@ class SQLite { } late final _sqlite3_soft_heap_limit_ptr = - _lookup>( + _lookup>( 'sqlite3_soft_heap_limit'); - late final _dart_sqlite3_soft_heap_limit _sqlite3_soft_heap_limit = - _sqlite3_soft_heap_limit_ptr.asFunction<_dart_sqlite3_soft_heap_limit>(); + late final _sqlite3_soft_heap_limit = + _sqlite3_soft_heap_limit_ptr.asFunction(); /// CAPI3REF: Extract Metadata About A Column Of A Table /// METHOD: sqlite3 @@ -6604,12 +7590,30 @@ class SQLite { ); } - late final _sqlite3_table_column_metadata_ptr = - _lookup>( - 'sqlite3_table_column_metadata'); - late final _dart_sqlite3_table_column_metadata - _sqlite3_table_column_metadata = _sqlite3_table_column_metadata_ptr - .asFunction<_dart_sqlite3_table_column_metadata>(); + late final _sqlite3_table_column_metadata_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('sqlite3_table_column_metadata'); + late final _sqlite3_table_column_metadata = + _sqlite3_table_column_metadata_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// CAPI3REF: Load An Extension /// METHOD: sqlite3 @@ -6667,11 +7671,16 @@ class SQLite { ); } - late final _sqlite3_load_extension_ptr = - _lookup>( - 'sqlite3_load_extension'); - late final _dart_sqlite3_load_extension _sqlite3_load_extension = - _sqlite3_load_extension_ptr.asFunction<_dart_sqlite3_load_extension>(); + late final _sqlite3_load_extension_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('sqlite3_load_extension'); + late final _sqlite3_load_extension = _sqlite3_load_extension_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); /// CAPI3REF: Enable Or Disable Extension Loading /// METHOD: sqlite3 @@ -6706,12 +7715,12 @@ class SQLite { ); } - late final _sqlite3_enable_load_extension_ptr = - _lookup>( - 'sqlite3_enable_load_extension'); - late final _dart_sqlite3_enable_load_extension - _sqlite3_enable_load_extension = _sqlite3_enable_load_extension_ptr - .asFunction<_dart_sqlite3_enable_load_extension>(); + late final _sqlite3_enable_load_extension_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_enable_load_extension'); + late final _sqlite3_enable_load_extension = _sqlite3_enable_load_extension_ptr + .asFunction, int)>(); /// CAPI3REF: Automatically Load Statically Linked Extensions /// @@ -6748,18 +7757,20 @@ class SQLite { /// See also: [sqlite3_reset_auto_extension()] /// and [sqlite3_cancel_auto_extension()] int sqlite3_auto_extension( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ) { return _sqlite3_auto_extension( xEntryPoint, ); } - late final _sqlite3_auto_extension_ptr = - _lookup>( - 'sqlite3_auto_extension'); - late final _dart_sqlite3_auto_extension _sqlite3_auto_extension = - _sqlite3_auto_extension_ptr.asFunction<_dart_sqlite3_auto_extension>(); + late final _sqlite3_auto_extension_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer>)>>( + 'sqlite3_auto_extension'); + late final _sqlite3_auto_extension = _sqlite3_auto_extension_ptr.asFunction< + int Function(ffi.Pointer>)>(); /// CAPI3REF: Cancel Automatic Extension Loading /// @@ -6770,19 +7781,21 @@ class SQLite { /// unregistered and it returns 0 if X was not on the list of initialization /// routines. int sqlite3_cancel_auto_extension( - ffi.Pointer> xEntryPoint, + ffi.Pointer> xEntryPoint, ) { return _sqlite3_cancel_auto_extension( xEntryPoint, ); } - late final _sqlite3_cancel_auto_extension_ptr = - _lookup>( - 'sqlite3_cancel_auto_extension'); - late final _dart_sqlite3_cancel_auto_extension - _sqlite3_cancel_auto_extension = _sqlite3_cancel_auto_extension_ptr - .asFunction<_dart_sqlite3_cancel_auto_extension>(); + late final _sqlite3_cancel_auto_extension_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer>)>>( + 'sqlite3_cancel_auto_extension'); + late final _sqlite3_cancel_auto_extension = + _sqlite3_cancel_auto_extension_ptr.asFunction< + int Function(ffi.Pointer>)>(); /// CAPI3REF: Reset Automatic Extension Loading /// @@ -6793,11 +7806,10 @@ class SQLite { } late final _sqlite3_reset_auto_extension_ptr = - _lookup>( + _lookup>( 'sqlite3_reset_auto_extension'); - late final _dart_sqlite3_reset_auto_extension _sqlite3_reset_auto_extension = - _sqlite3_reset_auto_extension_ptr - .asFunction<_dart_sqlite3_reset_auto_extension>(); + late final _sqlite3_reset_auto_extension = + _sqlite3_reset_auto_extension_ptr.asFunction(); /// CAPI3REF: Register A Virtual Table Implementation /// METHOD: sqlite3 @@ -6843,18 +7855,24 @@ class SQLite { ); } - late final _sqlite3_create_module_ptr = - _lookup>( - 'sqlite3_create_module'); - late final _dart_sqlite3_create_module _sqlite3_create_module = - _sqlite3_create_module_ptr.asFunction<_dart_sqlite3_create_module>(); + late final _sqlite3_create_module_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('sqlite3_create_module'); + late final _sqlite3_create_module = _sqlite3_create_module_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); int sqlite3_create_module_v2( ffi.Pointer db, ffi.Pointer zName, ffi.Pointer p, ffi.Pointer pClientData, - ffi.Pointer> xDestroy, + ffi.Pointer)>> + xDestroy, ) { return _sqlite3_create_module_v2( db, @@ -6865,12 +7883,27 @@ class SQLite { ); } - late final _sqlite3_create_module_v2_ptr = - _lookup>( - 'sqlite3_create_module_v2'); - late final _dart_sqlite3_create_module_v2 _sqlite3_create_module_v2 = - _sqlite3_create_module_v2_ptr - .asFunction<_dart_sqlite3_create_module_v2>(); + late final _sqlite3_create_module_v2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_create_module_v2'); + late final _sqlite3_create_module_v2 = + _sqlite3_create_module_v2_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>(); /// CAPI3REF: Remove Unnecessary Virtual Table Implementations /// METHOD: sqlite3 @@ -6892,11 +7925,12 @@ class SQLite { ); } - late final _sqlite3_drop_modules_ptr = - _lookup>( - 'sqlite3_drop_modules'); - late final _dart_sqlite3_drop_modules _sqlite3_drop_modules = - _sqlite3_drop_modules_ptr.asFunction<_dart_sqlite3_drop_modules>(); + late final _sqlite3_drop_modules_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer>)>>('sqlite3_drop_modules'); + late final _sqlite3_drop_modules = _sqlite3_drop_modules_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer>)>(); /// CAPI3REF: Declare The Schema Of A Virtual Table /// @@ -6914,11 +7948,12 @@ class SQLite { ); } - late final _sqlite3_declare_vtab_ptr = - _lookup>( - 'sqlite3_declare_vtab'); - late final _dart_sqlite3_declare_vtab _sqlite3_declare_vtab = - _sqlite3_declare_vtab_ptr.asFunction<_dart_sqlite3_declare_vtab>(); + late final _sqlite3_declare_vtab_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_declare_vtab'); + late final _sqlite3_declare_vtab = _sqlite3_declare_vtab_ptr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: Overload A Function For A Virtual Table /// METHOD: sqlite3 @@ -6947,12 +7982,13 @@ class SQLite { ); } - late final _sqlite3_overload_function_ptr = - _lookup>( - 'sqlite3_overload_function'); - late final _dart_sqlite3_overload_function _sqlite3_overload_function = - _sqlite3_overload_function_ptr - .asFunction<_dart_sqlite3_overload_function>(); + late final _sqlite3_overload_function_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('sqlite3_overload_function'); + late final _sqlite3_overload_function = + _sqlite3_overload_function_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Open A BLOB For Incremental I/O /// METHOD: sqlite3 @@ -7055,10 +8091,25 @@ class SQLite { ); } - late final _sqlite3_blob_open_ptr = - _lookup>('sqlite3_blob_open'); - late final _dart_sqlite3_blob_open _sqlite3_blob_open = - _sqlite3_blob_open_ptr.asFunction<_dart_sqlite3_blob_open>(); + late final _sqlite3_blob_open_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + sqlite3_int64, + ffi.Int32, + ffi.Pointer>)>>('sqlite3_blob_open'); + late final _sqlite3_blob_open = _sqlite3_blob_open_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer>)>(); /// CAPI3REF: Move a BLOB Handle to a New Row /// METHOD: sqlite3_blob @@ -7091,11 +8142,12 @@ class SQLite { ); } - late final _sqlite3_blob_reopen_ptr = - _lookup>( - 'sqlite3_blob_reopen'); - late final _dart_sqlite3_blob_reopen _sqlite3_blob_reopen = - _sqlite3_blob_reopen_ptr.asFunction<_dart_sqlite3_blob_reopen>(); + late final _sqlite3_blob_reopen_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + sqlite3_int64)>>('sqlite3_blob_reopen'); + late final _sqlite3_blob_reopen = _sqlite3_blob_reopen_ptr + .asFunction, int)>(); /// CAPI3REF: Close A BLOB Handle /// DESTRUCTOR: sqlite3_blob @@ -7124,10 +8176,11 @@ class SQLite { ); } - late final _sqlite3_blob_close_ptr = - _lookup>('sqlite3_blob_close'); - late final _dart_sqlite3_blob_close _sqlite3_blob_close = - _sqlite3_blob_close_ptr.asFunction<_dart_sqlite3_blob_close>(); + late final _sqlite3_blob_close_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_blob_close'); + late final _sqlite3_blob_close = _sqlite3_blob_close_ptr + .asFunction)>(); /// CAPI3REF: Return The Size Of An Open BLOB /// METHOD: sqlite3_blob @@ -7149,10 +8202,11 @@ class SQLite { ); } - late final _sqlite3_blob_bytes_ptr = - _lookup>('sqlite3_blob_bytes'); - late final _dart_sqlite3_blob_bytes _sqlite3_blob_bytes = - _sqlite3_blob_bytes_ptr.asFunction<_dart_sqlite3_blob_bytes>(); + late final _sqlite3_blob_bytes_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_blob_bytes'); + late final _sqlite3_blob_bytes = _sqlite3_blob_bytes_ptr + .asFunction)>(); /// CAPI3REF: Read Data From A BLOB Incrementally /// METHOD: sqlite3_blob @@ -7193,10 +8247,13 @@ class SQLite { ); } - late final _sqlite3_blob_read_ptr = - _lookup>('sqlite3_blob_read'); - late final _dart_sqlite3_blob_read _sqlite3_blob_read = - _sqlite3_blob_read_ptr.asFunction<_dart_sqlite3_blob_read>(); + late final _sqlite3_blob_read_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32)>>('sqlite3_blob_read'); + late final _sqlite3_blob_read = _sqlite3_blob_read_ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer, int, int)>(); /// CAPI3REF: Write Data Into A BLOB Incrementally /// METHOD: sqlite3_blob @@ -7250,10 +8307,13 @@ class SQLite { ); } - late final _sqlite3_blob_write_ptr = - _lookup>('sqlite3_blob_write'); - late final _dart_sqlite3_blob_write _sqlite3_blob_write = - _sqlite3_blob_write_ptr.asFunction<_dart_sqlite3_blob_write>(); + late final _sqlite3_blob_write_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32)>>('sqlite3_blob_write'); + late final _sqlite3_blob_write = _sqlite3_blob_write_ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer, int, int)>(); /// CAPI3REF: Virtual File System Objects /// @@ -7290,10 +8350,12 @@ class SQLite { ); } - late final _sqlite3_vfs_find_ptr = - _lookup>('sqlite3_vfs_find'); - late final _dart_sqlite3_vfs_find _sqlite3_vfs_find = - _sqlite3_vfs_find_ptr.asFunction<_dart_sqlite3_vfs_find>(); + late final _sqlite3_vfs_find_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_vfs_find'); + late final _sqlite3_vfs_find = _sqlite3_vfs_find_ptr + .asFunction Function(ffi.Pointer)>(); int sqlite3_vfs_register( ffi.Pointer arg0, @@ -7305,11 +8367,12 @@ class SQLite { ); } - late final _sqlite3_vfs_register_ptr = - _lookup>( - 'sqlite3_vfs_register'); - late final _dart_sqlite3_vfs_register _sqlite3_vfs_register = - _sqlite3_vfs_register_ptr.asFunction<_dart_sqlite3_vfs_register>(); + late final _sqlite3_vfs_register_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_vfs_register'); + late final _sqlite3_vfs_register = _sqlite3_vfs_register_ptr + .asFunction, int)>(); int sqlite3_vfs_unregister( ffi.Pointer arg0, @@ -7320,10 +8383,10 @@ class SQLite { } late final _sqlite3_vfs_unregister_ptr = - _lookup>( + _lookup)>>( 'sqlite3_vfs_unregister'); - late final _dart_sqlite3_vfs_unregister _sqlite3_vfs_unregister = - _sqlite3_vfs_unregister_ptr.asFunction<_dart_sqlite3_vfs_unregister>(); + late final _sqlite3_vfs_unregister = _sqlite3_vfs_unregister_ptr + .asFunction)>(); /// CAPI3REF: Mutexes /// @@ -7445,11 +8508,11 @@ class SQLite { ); } - late final _sqlite3_mutex_alloc_ptr = - _lookup>( - 'sqlite3_mutex_alloc'); - late final _dart_sqlite3_mutex_alloc _sqlite3_mutex_alloc = - _sqlite3_mutex_alloc_ptr.asFunction<_dart_sqlite3_mutex_alloc>(); + late final _sqlite3_mutex_alloc_ptr = _lookup< + ffi.NativeFunction Function(ffi.Int32)>>( + 'sqlite3_mutex_alloc'); + late final _sqlite3_mutex_alloc = _sqlite3_mutex_alloc_ptr + .asFunction Function(int)>(); void sqlite3_mutex_free( ffi.Pointer arg0, @@ -7459,10 +8522,11 @@ class SQLite { ); } - late final _sqlite3_mutex_free_ptr = - _lookup>('sqlite3_mutex_free'); - late final _dart_sqlite3_mutex_free _sqlite3_mutex_free = - _sqlite3_mutex_free_ptr.asFunction<_dart_sqlite3_mutex_free>(); + late final _sqlite3_mutex_free_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_mutex_free'); + late final _sqlite3_mutex_free = _sqlite3_mutex_free_ptr + .asFunction)>(); void sqlite3_mutex_enter( ffi.Pointer arg0, @@ -7472,11 +8536,11 @@ class SQLite { ); } - late final _sqlite3_mutex_enter_ptr = - _lookup>( - 'sqlite3_mutex_enter'); - late final _dart_sqlite3_mutex_enter _sqlite3_mutex_enter = - _sqlite3_mutex_enter_ptr.asFunction<_dart_sqlite3_mutex_enter>(); + late final _sqlite3_mutex_enter_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_mutex_enter'); + late final _sqlite3_mutex_enter = _sqlite3_mutex_enter_ptr + .asFunction)>(); int sqlite3_mutex_try( ffi.Pointer arg0, @@ -7486,10 +8550,11 @@ class SQLite { ); } - late final _sqlite3_mutex_try_ptr = - _lookup>('sqlite3_mutex_try'); - late final _dart_sqlite3_mutex_try _sqlite3_mutex_try = - _sqlite3_mutex_try_ptr.asFunction<_dart_sqlite3_mutex_try>(); + late final _sqlite3_mutex_try_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_mutex_try'); + late final _sqlite3_mutex_try = _sqlite3_mutex_try_ptr + .asFunction)>(); void sqlite3_mutex_leave( ffi.Pointer arg0, @@ -7499,11 +8564,11 @@ class SQLite { ); } - late final _sqlite3_mutex_leave_ptr = - _lookup>( - 'sqlite3_mutex_leave'); - late final _dart_sqlite3_mutex_leave _sqlite3_mutex_leave = - _sqlite3_mutex_leave_ptr.asFunction<_dart_sqlite3_mutex_leave>(); + late final _sqlite3_mutex_leave_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_mutex_leave'); + late final _sqlite3_mutex_leave = _sqlite3_mutex_leave_ptr + .asFunction)>(); int sqlite3_mutex_held( ffi.Pointer arg0, @@ -7513,10 +8578,11 @@ class SQLite { ); } - late final _sqlite3_mutex_held_ptr = - _lookup>('sqlite3_mutex_held'); - late final _dart_sqlite3_mutex_held _sqlite3_mutex_held = - _sqlite3_mutex_held_ptr.asFunction<_dart_sqlite3_mutex_held>(); + late final _sqlite3_mutex_held_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_mutex_held'); + late final _sqlite3_mutex_held = _sqlite3_mutex_held_ptr + .asFunction)>(); int sqlite3_mutex_notheld( ffi.Pointer arg0, @@ -7526,11 +8592,11 @@ class SQLite { ); } - late final _sqlite3_mutex_notheld_ptr = - _lookup>( - 'sqlite3_mutex_notheld'); - late final _dart_sqlite3_mutex_notheld _sqlite3_mutex_notheld = - _sqlite3_mutex_notheld_ptr.asFunction<_dart_sqlite3_mutex_notheld>(); + late final _sqlite3_mutex_notheld_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_mutex_notheld'); + late final _sqlite3_mutex_notheld = _sqlite3_mutex_notheld_ptr + .asFunction)>(); /// CAPI3REF: Retrieve the mutex for a database connection /// METHOD: sqlite3 @@ -7548,10 +8614,12 @@ class SQLite { ); } - late final _sqlite3_db_mutex_ptr = - _lookup>('sqlite3_db_mutex'); - late final _dart_sqlite3_db_mutex _sqlite3_db_mutex = - _sqlite3_db_mutex_ptr.asFunction<_dart_sqlite3_db_mutex>(); + late final _sqlite3_db_mutex_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_db_mutex'); + late final _sqlite3_db_mutex = _sqlite3_db_mutex_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Low-Level Control Of Database Files /// METHOD: sqlite3 @@ -7606,11 +8674,13 @@ class SQLite { ); } - late final _sqlite3_file_control_ptr = - _lookup>( - 'sqlite3_file_control'); - late final _dart_sqlite3_file_control _sqlite3_file_control = - _sqlite3_file_control_ptr.asFunction<_dart_sqlite3_file_control>(); + late final _sqlite3_file_control_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('sqlite3_file_control'); + late final _sqlite3_file_control = _sqlite3_file_control_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); /// CAPI3REF: Testing Interface /// @@ -7636,10 +8706,10 @@ class SQLite { } late final _sqlite3_test_control_ptr = - _lookup>( + _lookup>( 'sqlite3_test_control'); - late final _dart_sqlite3_test_control _sqlite3_test_control = - _sqlite3_test_control_ptr.asFunction<_dart_sqlite3_test_control>(); + late final _sqlite3_test_control = + _sqlite3_test_control_ptr.asFunction(); /// CAPI3REF: SQL Keyword Checking /// @@ -7691,10 +8761,10 @@ class SQLite { } late final _sqlite3_keyword_count_ptr = - _lookup>( + _lookup>( 'sqlite3_keyword_count'); - late final _dart_sqlite3_keyword_count _sqlite3_keyword_count = - _sqlite3_keyword_count_ptr.asFunction<_dart_sqlite3_keyword_count>(); + late final _sqlite3_keyword_count = + _sqlite3_keyword_count_ptr.asFunction(); int sqlite3_keyword_name( int arg0, @@ -7708,11 +8778,13 @@ class SQLite { ); } - late final _sqlite3_keyword_name_ptr = - _lookup>( - 'sqlite3_keyword_name'); - late final _dart_sqlite3_keyword_name _sqlite3_keyword_name = - _sqlite3_keyword_name_ptr.asFunction<_dart_sqlite3_keyword_name>(); + late final _sqlite3_keyword_name_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Int32, ffi.Pointer>, + ffi.Pointer)>>('sqlite3_keyword_name'); + late final _sqlite3_keyword_name = _sqlite3_keyword_name_ptr.asFunction< + int Function( + int, ffi.Pointer>, ffi.Pointer)>(); int sqlite3_keyword_check( ffi.Pointer arg0, @@ -7724,11 +8796,12 @@ class SQLite { ); } - late final _sqlite3_keyword_check_ptr = - _lookup>( - 'sqlite3_keyword_check'); - late final _dart_sqlite3_keyword_check _sqlite3_keyword_check = - _sqlite3_keyword_check_ptr.asFunction<_dart_sqlite3_keyword_check>(); + late final _sqlite3_keyword_check_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_keyword_check'); + late final _sqlite3_keyword_check = _sqlite3_keyword_check_ptr + .asFunction, int)>(); /// CAPI3REF: Create A New Dynamic String Object /// CONSTRUCTOR: sqlite3_str @@ -7761,10 +8834,12 @@ class SQLite { ); } - late final _sqlite3_str_new_ptr = - _lookup>('sqlite3_str_new'); - late final _dart_sqlite3_str_new _sqlite3_str_new = - _sqlite3_str_new_ptr.asFunction<_dart_sqlite3_str_new>(); + late final _sqlite3_str_new_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_str_new'); + late final _sqlite3_str_new = _sqlite3_str_new_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Finalize A Dynamic String /// DESTRUCTOR: sqlite3_str @@ -7785,10 +8860,12 @@ class SQLite { ); } - late final _sqlite3_str_finish_ptr = - _lookup>('sqlite3_str_finish'); - late final _dart_sqlite3_str_finish _sqlite3_str_finish = - _sqlite3_str_finish_ptr.asFunction<_dart_sqlite3_str_finish>(); + late final _sqlite3_str_finish_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_str_finish'); + late final _sqlite3_str_finish = _sqlite3_str_finish_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: Add Content To A Dynamic String /// METHOD: sqlite3_str @@ -7830,11 +8907,12 @@ class SQLite { ); } - late final _sqlite3_str_appendf_ptr = - _lookup>( - 'sqlite3_str_appendf'); - late final _dart_sqlite3_str_appendf _sqlite3_str_appendf = - _sqlite3_str_appendf_ptr.asFunction<_dart_sqlite3_str_appendf>(); + late final _sqlite3_str_appendf_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_str_appendf'); + late final _sqlite3_str_appendf = _sqlite3_str_appendf_ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); void sqlite3_str_append( ffi.Pointer arg0, @@ -7848,10 +8926,12 @@ class SQLite { ); } - late final _sqlite3_str_append_ptr = - _lookup>('sqlite3_str_append'); - late final _dart_sqlite3_str_append _sqlite3_str_append = - _sqlite3_str_append_ptr.asFunction<_dart_sqlite3_str_append>(); + late final _sqlite3_str_append_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('sqlite3_str_append'); + late final _sqlite3_str_append = _sqlite3_str_append_ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); void sqlite3_str_appendall( ffi.Pointer arg0, @@ -7863,11 +8943,12 @@ class SQLite { ); } - late final _sqlite3_str_appendall_ptr = - _lookup>( - 'sqlite3_str_appendall'); - late final _dart_sqlite3_str_appendall _sqlite3_str_appendall = - _sqlite3_str_appendall_ptr.asFunction<_dart_sqlite3_str_appendall>(); + late final _sqlite3_str_appendall_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_str_appendall'); + late final _sqlite3_str_appendall = _sqlite3_str_appendall_ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); void sqlite3_str_appendchar( ffi.Pointer arg0, @@ -7881,11 +8962,12 @@ class SQLite { ); } - late final _sqlite3_str_appendchar_ptr = - _lookup>( - 'sqlite3_str_appendchar'); - late final _dart_sqlite3_str_appendchar _sqlite3_str_appendchar = - _sqlite3_str_appendchar_ptr.asFunction<_dart_sqlite3_str_appendchar>(); + late final _sqlite3_str_appendchar_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32, + ffi.Int8)>>('sqlite3_str_appendchar'); + late final _sqlite3_str_appendchar = _sqlite3_str_appendchar_ptr + .asFunction, int, int)>(); void sqlite3_str_reset( ffi.Pointer arg0, @@ -7896,9 +8978,10 @@ class SQLite { } late final _sqlite3_str_reset_ptr = - _lookup>('sqlite3_str_reset'); - late final _dart_sqlite3_str_reset _sqlite3_str_reset = - _sqlite3_str_reset_ptr.asFunction<_dart_sqlite3_str_reset>(); + _lookup)>>( + 'sqlite3_str_reset'); + late final _sqlite3_str_reset = _sqlite3_str_reset_ptr + .asFunction)>(); /// CAPI3REF: Status Of A Dynamic String /// METHOD: sqlite3_str @@ -7936,10 +9019,10 @@ class SQLite { } late final _sqlite3_str_errcode_ptr = - _lookup>( + _lookup)>>( 'sqlite3_str_errcode'); - late final _dart_sqlite3_str_errcode _sqlite3_str_errcode = - _sqlite3_str_errcode_ptr.asFunction<_dart_sqlite3_str_errcode>(); + late final _sqlite3_str_errcode = _sqlite3_str_errcode_ptr + .asFunction)>(); int sqlite3_str_length( ffi.Pointer arg0, @@ -7950,9 +9033,10 @@ class SQLite { } late final _sqlite3_str_length_ptr = - _lookup>('sqlite3_str_length'); - late final _dart_sqlite3_str_length _sqlite3_str_length = - _sqlite3_str_length_ptr.asFunction<_dart_sqlite3_str_length>(); + _lookup)>>( + 'sqlite3_str_length'); + late final _sqlite3_str_length = _sqlite3_str_length_ptr + .asFunction)>(); ffi.Pointer sqlite3_str_value( ffi.Pointer arg0, @@ -7962,10 +9046,12 @@ class SQLite { ); } - late final _sqlite3_str_value_ptr = - _lookup>('sqlite3_str_value'); - late final _dart_sqlite3_str_value _sqlite3_str_value = - _sqlite3_str_value_ptr.asFunction<_dart_sqlite3_str_value>(); + late final _sqlite3_str_value_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('sqlite3_str_value'); + late final _sqlite3_str_value = _sqlite3_str_value_ptr + .asFunction Function(ffi.Pointer)>(); /// CAPI3REF: SQLite Runtime Status /// @@ -8005,15 +9091,17 @@ class SQLite { ); } - late final _sqlite3_status_ptr = - _lookup>('sqlite3_status'); - late final _dart_sqlite3_status _sqlite3_status = - _sqlite3_status_ptr.asFunction<_dart_sqlite3_status>(); + late final _sqlite3_status_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Int32, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('sqlite3_status'); + late final _sqlite3_status = _sqlite3_status_ptr.asFunction< + int Function(int, ffi.Pointer, ffi.Pointer, int)>(); int sqlite3_status64( int op, - ffi.Pointer pCurrent, - ffi.Pointer pHighwater, + ffi.Pointer pCurrent, + ffi.Pointer pHighwater, int resetFlag, ) { return _sqlite3_status64( @@ -8024,10 +9112,13 @@ class SQLite { ); } - late final _sqlite3_status64_ptr = - _lookup>('sqlite3_status64'); - late final _dart_sqlite3_status64 _sqlite3_status64 = - _sqlite3_status64_ptr.asFunction<_dart_sqlite3_status64>(); + late final _sqlite3_status64_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Int32, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('sqlite3_status64'); + late final _sqlite3_status64 = _sqlite3_status64_ptr.asFunction< + int Function( + int, ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Database Connection Status /// METHOD: sqlite3 @@ -8066,10 +9157,17 @@ class SQLite { ); } - late final _sqlite3_db_status_ptr = - _lookup>('sqlite3_db_status'); - late final _dart_sqlite3_db_status _sqlite3_db_status = - _sqlite3_db_status_ptr.asFunction<_dart_sqlite3_db_status>(); + late final _sqlite3_db_status_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('sqlite3_db_status'); + late final _sqlite3_db_status = _sqlite3_db_status_ptr.asFunction< + int Function(ffi.Pointer, int, ffi.Pointer, + ffi.Pointer, int)>(); /// CAPI3REF: Prepared Statement Status /// METHOD: sqlite3_stmt @@ -8105,11 +9203,12 @@ class SQLite { ); } - late final _sqlite3_stmt_status_ptr = - _lookup>( - 'sqlite3_stmt_status'); - late final _dart_sqlite3_stmt_status _sqlite3_stmt_status = - _sqlite3_stmt_status_ptr.asFunction<_dart_sqlite3_stmt_status>(); + late final _sqlite3_stmt_status_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Int32)>>('sqlite3_stmt_status'); + late final _sqlite3_stmt_status = _sqlite3_stmt_status_ptr + .asFunction, int, int)>(); /// CAPI3REF: Online Backup API. /// @@ -8309,11 +9408,19 @@ class SQLite { ); } - late final _sqlite3_backup_init_ptr = - _lookup>( - 'sqlite3_backup_init'); - late final _dart_sqlite3_backup_init _sqlite3_backup_init = - _sqlite3_backup_init_ptr.asFunction<_dart_sqlite3_backup_init>(); + late final _sqlite3_backup_init_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('sqlite3_backup_init'); + late final _sqlite3_backup_init = _sqlite3_backup_init_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); int sqlite3_backup_step( ffi.Pointer p, @@ -8325,11 +9432,12 @@ class SQLite { ); } - late final _sqlite3_backup_step_ptr = - _lookup>( - 'sqlite3_backup_step'); - late final _dart_sqlite3_backup_step _sqlite3_backup_step = - _sqlite3_backup_step_ptr.asFunction<_dart_sqlite3_backup_step>(); + late final _sqlite3_backup_step_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_backup_step'); + late final _sqlite3_backup_step = _sqlite3_backup_step_ptr + .asFunction, int)>(); int sqlite3_backup_finish( ffi.Pointer p, @@ -8339,11 +9447,11 @@ class SQLite { ); } - late final _sqlite3_backup_finish_ptr = - _lookup>( - 'sqlite3_backup_finish'); - late final _dart_sqlite3_backup_finish _sqlite3_backup_finish = - _sqlite3_backup_finish_ptr.asFunction<_dart_sqlite3_backup_finish>(); + late final _sqlite3_backup_finish_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_backup_finish'); + late final _sqlite3_backup_finish = _sqlite3_backup_finish_ptr + .asFunction)>(); int sqlite3_backup_remaining( ffi.Pointer p, @@ -8353,12 +9461,11 @@ class SQLite { ); } - late final _sqlite3_backup_remaining_ptr = - _lookup>( - 'sqlite3_backup_remaining'); - late final _dart_sqlite3_backup_remaining _sqlite3_backup_remaining = - _sqlite3_backup_remaining_ptr - .asFunction<_dart_sqlite3_backup_remaining>(); + late final _sqlite3_backup_remaining_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_backup_remaining'); + late final _sqlite3_backup_remaining = _sqlite3_backup_remaining_ptr + .asFunction)>(); int sqlite3_backup_pagecount( ffi.Pointer p, @@ -8368,12 +9475,11 @@ class SQLite { ); } - late final _sqlite3_backup_pagecount_ptr = - _lookup>( - 'sqlite3_backup_pagecount'); - late final _dart_sqlite3_backup_pagecount _sqlite3_backup_pagecount = - _sqlite3_backup_pagecount_ptr - .asFunction<_dart_sqlite3_backup_pagecount>(); + late final _sqlite3_backup_pagecount_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_backup_pagecount'); + late final _sqlite3_backup_pagecount = _sqlite3_backup_pagecount_ptr + .asFunction)>(); /// CAPI3REF: Unlock Notification /// METHOD: sqlite3 @@ -8490,7 +9596,11 @@ class SQLite { /// SQLITE_LOCKED.)^ int sqlite3_unlock_notify( ffi.Pointer pBlocked, - ffi.Pointer> xNotify, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer>, ffi.Int32)>> + xNotify, ffi.Pointer pNotifyArg, ) { return _sqlite3_unlock_notify( @@ -8500,11 +9610,23 @@ class SQLite { ); } - late final _sqlite3_unlock_notify_ptr = - _lookup>( - 'sqlite3_unlock_notify'); - late final _dart_sqlite3_unlock_notify _sqlite3_unlock_notify = - _sqlite3_unlock_notify_ptr.asFunction<_dart_sqlite3_unlock_notify>(); + late final _sqlite3_unlock_notify_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer>, ffi.Int32)>>, + ffi.Pointer)>>('sqlite3_unlock_notify'); + late final _sqlite3_unlock_notify = _sqlite3_unlock_notify_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer>, ffi.Int32)>>, + ffi.Pointer)>(); /// CAPI3REF: String Comparison /// @@ -8522,10 +9644,12 @@ class SQLite { ); } - late final _sqlite3_stricmp_ptr = - _lookup>('sqlite3_stricmp'); - late final _dart_sqlite3_stricmp _sqlite3_stricmp = - _sqlite3_stricmp_ptr.asFunction<_dart_sqlite3_stricmp>(); + late final _sqlite3_stricmp_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_stricmp'); + late final _sqlite3_stricmp = _sqlite3_stricmp_ptr + .asFunction, ffi.Pointer)>(); int sqlite3_strnicmp( ffi.Pointer arg0, @@ -8539,10 +9663,12 @@ class SQLite { ); } - late final _sqlite3_strnicmp_ptr = - _lookup>('sqlite3_strnicmp'); - late final _dart_sqlite3_strnicmp _sqlite3_strnicmp = - _sqlite3_strnicmp_ptr.asFunction<_dart_sqlite3_strnicmp>(); + late final _sqlite3_strnicmp_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('sqlite3_strnicmp'); + late final _sqlite3_strnicmp = _sqlite3_strnicmp_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: String Globbing /// @@ -8567,10 +9693,12 @@ class SQLite { ); } - late final _sqlite3_strglob_ptr = - _lookup>('sqlite3_strglob'); - late final _dart_sqlite3_strglob _sqlite3_strglob = - _sqlite3_strglob_ptr.asFunction<_dart_sqlite3_strglob>(); + late final _sqlite3_strglob_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_strglob'); + late final _sqlite3_strglob = _sqlite3_strglob_ptr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: String LIKE Matching /// @@ -8603,10 +9731,12 @@ class SQLite { ); } - late final _sqlite3_strlike_ptr = - _lookup>('sqlite3_strlike'); - late final _dart_sqlite3_strlike _sqlite3_strlike = - _sqlite3_strlike_ptr.asFunction<_dart_sqlite3_strlike>(); + late final _sqlite3_strlike_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Uint32)>>('sqlite3_strlike'); + late final _sqlite3_strlike = _sqlite3_strlike_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Error Logging Interface /// @@ -8637,10 +9767,11 @@ class SQLite { ); } - late final _sqlite3_log_ptr = - _lookup>('sqlite3_log'); - late final _dart_sqlite3_log _sqlite3_log = - _sqlite3_log_ptr.asFunction<_dart_sqlite3_log>(); + late final _sqlite3_log_ptr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int32, ffi.Pointer)>>('sqlite3_log'); + late final _sqlite3_log = + _sqlite3_log_ptr.asFunction)>(); /// CAPI3REF: Write-Ahead Log Commit Hook /// METHOD: sqlite3 @@ -8676,7 +9807,11 @@ class SQLite { /// overwrite any prior [sqlite3_wal_hook()] settings. ffi.Pointer sqlite3_wal_hook( ffi.Pointer arg0, - ffi.Pointer> arg1, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>> + arg1, ffi.Pointer arg2, ) { return _sqlite3_wal_hook( @@ -8686,10 +9821,26 @@ class SQLite { ); } - late final _sqlite3_wal_hook_ptr = - _lookup>('sqlite3_wal_hook'); - late final _dart_sqlite3_wal_hook _sqlite3_wal_hook = - _sqlite3_wal_hook_ptr.asFunction<_dart_sqlite3_wal_hook>(); + late final _sqlite3_wal_hook_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>, + ffi.Pointer)>>('sqlite3_wal_hook'); + late final _sqlite3_wal_hook = _sqlite3_wal_hook_ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Int32)>>, + ffi.Pointer)>(); /// CAPI3REF: Configure an auto-checkpoint /// METHOD: sqlite3 @@ -8728,12 +9879,12 @@ class SQLite { ); } - late final _sqlite3_wal_autocheckpoint_ptr = - _lookup>( - 'sqlite3_wal_autocheckpoint'); - late final _dart_sqlite3_wal_autocheckpoint _sqlite3_wal_autocheckpoint = - _sqlite3_wal_autocheckpoint_ptr - .asFunction<_dart_sqlite3_wal_autocheckpoint>(); + late final _sqlite3_wal_autocheckpoint_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_wal_autocheckpoint'); + late final _sqlite3_wal_autocheckpoint = _sqlite3_wal_autocheckpoint_ptr + .asFunction, int)>(); /// CAPI3REF: Checkpoint a database /// METHOD: sqlite3 @@ -8763,11 +9914,12 @@ class SQLite { ); } - late final _sqlite3_wal_checkpoint_ptr = - _lookup>( - 'sqlite3_wal_checkpoint'); - late final _dart_sqlite3_wal_checkpoint _sqlite3_wal_checkpoint = - _sqlite3_wal_checkpoint_ptr.asFunction<_dart_sqlite3_wal_checkpoint>(); + late final _sqlite3_wal_checkpoint_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_wal_checkpoint'); + late final _sqlite3_wal_checkpoint = _sqlite3_wal_checkpoint_ptr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: Checkpoint a database /// METHOD: sqlite3 @@ -8875,12 +10027,18 @@ class SQLite { ); } - late final _sqlite3_wal_checkpoint_v2_ptr = - _lookup>( - 'sqlite3_wal_checkpoint_v2'); - late final _dart_sqlite3_wal_checkpoint_v2 _sqlite3_wal_checkpoint_v2 = - _sqlite3_wal_checkpoint_v2_ptr - .asFunction<_dart_sqlite3_wal_checkpoint_v2>(); + late final _sqlite3_wal_checkpoint_v2_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer)>>('sqlite3_wal_checkpoint_v2'); + late final _sqlite3_wal_checkpoint_v2 = + _sqlite3_wal_checkpoint_v2_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Virtual Table Interface Configuration /// @@ -8908,11 +10066,12 @@ class SQLite { ); } - late final _sqlite3_vtab_config_ptr = - _lookup>( - 'sqlite3_vtab_config'); - late final _dart_sqlite3_vtab_config _sqlite3_vtab_config = - _sqlite3_vtab_config_ptr.asFunction<_dart_sqlite3_vtab_config>(); + late final _sqlite3_vtab_config_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('sqlite3_vtab_config'); + late final _sqlite3_vtab_config = _sqlite3_vtab_config_ptr + .asFunction, int)>(); /// CAPI3REF: Determine The Virtual Table Conflict Policy /// @@ -8931,11 +10090,10 @@ class SQLite { } late final _sqlite3_vtab_on_conflict_ptr = - _lookup>( + _lookup)>>( 'sqlite3_vtab_on_conflict'); - late final _dart_sqlite3_vtab_on_conflict _sqlite3_vtab_on_conflict = - _sqlite3_vtab_on_conflict_ptr - .asFunction<_dart_sqlite3_vtab_on_conflict>(); + late final _sqlite3_vtab_on_conflict = _sqlite3_vtab_on_conflict_ptr + .asFunction)>(); /// CAPI3REF: Determine If Virtual Table Column Access Is For UPDATE /// @@ -8960,11 +10118,11 @@ class SQLite { ); } - late final _sqlite3_vtab_nochange_ptr = - _lookup>( - 'sqlite3_vtab_nochange'); - late final _dart_sqlite3_vtab_nochange _sqlite3_vtab_nochange = - _sqlite3_vtab_nochange_ptr.asFunction<_dart_sqlite3_vtab_nochange>(); + late final _sqlite3_vtab_nochange_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_vtab_nochange'); + late final _sqlite3_vtab_nochange = _sqlite3_vtab_nochange_ptr + .asFunction)>(); /// CAPI3REF: Determine The Collation For a Virtual Table Constraint /// @@ -8987,11 +10145,12 @@ class SQLite { ); } - late final _sqlite3_vtab_collation_ptr = - _lookup>( - 'sqlite3_vtab_collation'); - late final _dart_sqlite3_vtab_collation _sqlite3_vtab_collation = - _sqlite3_vtab_collation_ptr.asFunction<_dart_sqlite3_vtab_collation>(); + late final _sqlite3_vtab_collation_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Int32)>>('sqlite3_vtab_collation'); + late final _sqlite3_vtab_collation = _sqlite3_vtab_collation_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); /// CAPI3REF: Prepared Statement Scan Status /// METHOD: sqlite3_stmt @@ -9036,11 +10195,13 @@ class SQLite { ); } - late final _sqlite3_stmt_scanstatus_ptr = - _lookup>( - 'sqlite3_stmt_scanstatus'); - late final _dart_sqlite3_stmt_scanstatus _sqlite3_stmt_scanstatus = - _sqlite3_stmt_scanstatus_ptr.asFunction<_dart_sqlite3_stmt_scanstatus>(); + late final _sqlite3_stmt_scanstatus_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, ffi.Int32, + ffi.Pointer)>>('sqlite3_stmt_scanstatus'); + late final _sqlite3_stmt_scanstatus = _sqlite3_stmt_scanstatus_ptr.asFunction< + int Function( + ffi.Pointer, int, int, ffi.Pointer)>(); /// CAPI3REF: Zero Scan-Status Counters /// METHOD: sqlite3_stmt @@ -9058,11 +10219,10 @@ class SQLite { } late final _sqlite3_stmt_scanstatus_reset_ptr = - _lookup>( + _lookup)>>( 'sqlite3_stmt_scanstatus_reset'); - late final _dart_sqlite3_stmt_scanstatus_reset - _sqlite3_stmt_scanstatus_reset = _sqlite3_stmt_scanstatus_reset_ptr - .asFunction<_dart_sqlite3_stmt_scanstatus_reset>(); + late final _sqlite3_stmt_scanstatus_reset = _sqlite3_stmt_scanstatus_reset_ptr + .asFunction)>(); /// CAPI3REF: Flush caches to disk mid-transaction /// @@ -9101,10 +10261,10 @@ class SQLite { } late final _sqlite3_db_cacheflush_ptr = - _lookup>( + _lookup)>>( 'sqlite3_db_cacheflush'); - late final _dart_sqlite3_db_cacheflush _sqlite3_db_cacheflush = - _sqlite3_db_cacheflush_ptr.asFunction<_dart_sqlite3_db_cacheflush>(); + late final _sqlite3_db_cacheflush = _sqlite3_db_cacheflush_ptr + .asFunction)>(); /// CAPI3REF: Low-level system error code /// @@ -9123,10 +10283,10 @@ class SQLite { } late final _sqlite3_system_errno_ptr = - _lookup>( + _lookup)>>( 'sqlite3_system_errno'); - late final _dart_sqlite3_system_errno _sqlite3_system_errno = - _sqlite3_system_errno_ptr.asFunction<_dart_sqlite3_system_errno>(); + late final _sqlite3_system_errno = _sqlite3_system_errno_ptr + .asFunction)>(); /// CAPI3REF: Record A Database Snapshot /// CONSTRUCTOR: sqlite3_snapshot @@ -9181,11 +10341,14 @@ class SQLite { ); } - late final _sqlite3_snapshot_get_ptr = - _lookup>( - 'sqlite3_snapshot_get'); - late final _dart_sqlite3_snapshot_get _sqlite3_snapshot_get = - _sqlite3_snapshot_get_ptr.asFunction<_dart_sqlite3_snapshot_get>(); + late final _sqlite3_snapshot_get_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>>( + 'sqlite3_snapshot_get'); + late final _sqlite3_snapshot_get = _sqlite3_snapshot_get_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(); /// CAPI3REF: Start a read transaction on an historical snapshot /// METHOD: sqlite3_snapshot @@ -9240,11 +10403,13 @@ class SQLite { ); } - late final _sqlite3_snapshot_open_ptr = - _lookup>( - 'sqlite3_snapshot_open'); - late final _dart_sqlite3_snapshot_open _sqlite3_snapshot_open = - _sqlite3_snapshot_open_ptr.asFunction<_dart_sqlite3_snapshot_open>(); + late final _sqlite3_snapshot_open_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('sqlite3_snapshot_open'); + late final _sqlite3_snapshot_open = _sqlite3_snapshot_open_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// CAPI3REF: Destroy a snapshot /// DESTRUCTOR: sqlite3_snapshot @@ -9263,11 +10428,11 @@ class SQLite { ); } - late final _sqlite3_snapshot_free_ptr = - _lookup>( - 'sqlite3_snapshot_free'); - late final _dart_sqlite3_snapshot_free _sqlite3_snapshot_free = - _sqlite3_snapshot_free_ptr.asFunction<_dart_sqlite3_snapshot_free>(); + late final _sqlite3_snapshot_free_ptr = _lookup< + ffi.NativeFunction)>>( + 'sqlite3_snapshot_free'); + late final _sqlite3_snapshot_free = _sqlite3_snapshot_free_ptr + .asFunction)>(); /// CAPI3REF: Compare the ages of two snapshot handles. /// METHOD: sqlite3_snapshot @@ -9302,11 +10467,13 @@ class SQLite { ); } - late final _sqlite3_snapshot_cmp_ptr = - _lookup>( - 'sqlite3_snapshot_cmp'); - late final _dart_sqlite3_snapshot_cmp _sqlite3_snapshot_cmp = - _sqlite3_snapshot_cmp_ptr.asFunction<_dart_sqlite3_snapshot_cmp>(); + late final _sqlite3_snapshot_cmp_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_snapshot_cmp'); + late final _sqlite3_snapshot_cmp = _sqlite3_snapshot_cmp_ptr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); /// CAPI3REF: Recover snapshots from a wal file /// METHOD: sqlite3_snapshot @@ -9339,12 +10506,12 @@ class SQLite { ); } - late final _sqlite3_snapshot_recover_ptr = - _lookup>( - 'sqlite3_snapshot_recover'); - late final _dart_sqlite3_snapshot_recover _sqlite3_snapshot_recover = - _sqlite3_snapshot_recover_ptr - .asFunction<_dart_sqlite3_snapshot_recover>(); + late final _sqlite3_snapshot_recover_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('sqlite3_snapshot_recover'); + late final _sqlite3_snapshot_recover = _sqlite3_snapshot_recover_ptr + .asFunction, ffi.Pointer)>(); /// CAPI3REF: Serialize a database /// @@ -9383,7 +10550,7 @@ class SQLite { ffi.Pointer sqlite3_serialize( ffi.Pointer db, ffi.Pointer zSchema, - ffi.Pointer piSize, + ffi.Pointer piSize, int mFlags, ) { return _sqlite3_serialize( @@ -9394,10 +10561,16 @@ class SQLite { ); } - late final _sqlite3_serialize_ptr = - _lookup>('sqlite3_serialize'); - late final _dart_sqlite3_serialize _sqlite3_serialize = - _sqlite3_serialize_ptr.asFunction<_dart_sqlite3_serialize>(); + late final _sqlite3_serialize_ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32)>>('sqlite3_serialize'); + late final _sqlite3_serialize = _sqlite3_serialize_ptr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); /// CAPI3REF: Deserialize a database /// @@ -9444,11 +10617,18 @@ class SQLite { ); } - late final _sqlite3_deserialize_ptr = - _lookup>( - 'sqlite3_deserialize'); - late final _dart_sqlite3_deserialize _sqlite3_deserialize = - _sqlite3_deserialize_ptr.asFunction<_dart_sqlite3_deserialize>(); + late final _sqlite3_deserialize_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + sqlite3_int64, + sqlite3_int64, + ffi.Uint32)>>('sqlite3_deserialize'); + late final _sqlite3_deserialize = _sqlite3_deserialize_ptr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, int)>(); /// Register a geometry callback named zGeom that can be used as part of an /// R-Tree geometry query as follows: @@ -9457,7 +10637,14 @@ class SQLite { int sqlite3_rtree_geometry_callback( ffi.Pointer db, ffi.Pointer zGeom, - ffi.Pointer> xGeom, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer)>> + xGeom, ffi.Pointer pContext, ) { return _sqlite3_rtree_geometry_callback( @@ -9468,12 +10655,32 @@ class SQLite { ); } - late final _sqlite3_rtree_geometry_callback_ptr = - _lookup>( - 'sqlite3_rtree_geometry_callback'); - late final _dart_sqlite3_rtree_geometry_callback - _sqlite3_rtree_geometry_callback = _sqlite3_rtree_geometry_callback_ptr - .asFunction<_dart_sqlite3_rtree_geometry_callback>(); + late final _sqlite3_rtree_geometry_callback_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer)>>, + ffi.Pointer)>>('sqlite3_rtree_geometry_callback'); + late final _sqlite3_rtree_geometry_callback = + _sqlite3_rtree_geometry_callback_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer)>>, + ffi.Pointer)>(); /// Register a 2nd-generation geometry callback named zScore that can be /// used as part of an R-Tree geometry query as follows: @@ -9482,9 +10689,13 @@ class SQLite { int sqlite3_rtree_query_callback( ffi.Pointer db, ffi.Pointer zQueryFunc, - ffi.Pointer> xQueryFunc, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer)>> + xQueryFunc, ffi.Pointer pContext, - ffi.Pointer> xDestructor, + ffi.Pointer)>> + xDestructor, ) { return _sqlite3_rtree_query_callback( db, @@ -9495,63 +10706,136 @@ class SQLite { ); } - late final _sqlite3_rtree_query_callback_ptr = - _lookup>( - 'sqlite3_rtree_query_callback'); - late final _dart_sqlite3_rtree_query_callback _sqlite3_rtree_query_callback = - _sqlite3_rtree_query_callback_ptr - .asFunction<_dart_sqlite3_rtree_query_callback>(); + late final _sqlite3_rtree_query_callback_ptr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer)>>, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>>( + 'sqlite3_rtree_query_callback'); + late final _sqlite3_rtree_query_callback = + _sqlite3_rtree_query_callback_ptr.asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer)>>, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>(); } class sqlite3 extends ffi.Opaque {} +class sqlite3_file extends ffi.Struct { + /// Methods for an open file + external ffi.Pointer pMethods; +} + class sqlite3_io_methods extends ffi.Struct { @ffi.Int32() external int iVersion; - external ffi.Pointer> xClose; - - external ffi.Pointer> xRead; - - external ffi.Pointer> xWrite; - - external ffi.Pointer> xTruncate; - - external ffi.Pointer> xSync; - - external ffi.Pointer> xFileSize; - - external ffi.Pointer> xLock; - - external ffi.Pointer> xUnlock; - - external ffi.Pointer> xCheckReservedLock; - - external ffi.Pointer> xFileControl; - - external ffi.Pointer> xSectorSize; - - external ffi.Pointer> xDeviceCharacteristics; + external ffi.Pointer< + ffi.NativeFunction)>> xClose; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, sqlite3_int64)>> xRead; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, sqlite3_int64)>> xWrite; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, sqlite3_int64)>> + xTruncate; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xSync; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> + xFileSize; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xLock; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xUnlock; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> + xCheckReservedLock; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xFileControl; + + external ffi.Pointer< + ffi.NativeFunction)>> + xSectorSize; + + external ffi.Pointer< + ffi.NativeFunction)>> + xDeviceCharacteristics; /// Methods above are valid for version 1 - external ffi.Pointer> xShmMap; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, ffi.Int32, + ffi.Int32, ffi.Pointer>)>> xShmMap; - external ffi.Pointer> xShmLock; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32, ffi.Int32, ffi.Int32)>> + xShmLock; - external ffi.Pointer> xShmBarrier; + external ffi.Pointer< + ffi.NativeFunction)>> + xShmBarrier; - external ffi.Pointer> xShmUnmap; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xShmUnmap; /// Methods above are valid for version 2 - external ffi.Pointer> xFetch; - - external ffi.Pointer> xUnfetch; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, sqlite3_int64, + ffi.Int32, ffi.Pointer>)>> xFetch; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, sqlite3_int64, + ffi.Pointer)>> xUnfetch; } -class sqlite3_file extends ffi.Struct { - /// Methods for an open file - external ffi.Pointer pMethods; -} +typedef sqlite3_int64 = sqlite_int64; +typedef sqlite_int64 = ffi.Int64; class sqlite3_mutex extends ffi.Opaque {} @@ -9579,112 +10863,329 @@ class sqlite3_vfs extends ffi.Struct { /// Pointer to application-specific data external ffi.Pointer pAppData; - external ffi.Pointer> xOpen; - - external ffi.Pointer> xDelete; - - external ffi.Pointer> xAccess; - - external ffi.Pointer> xFullPathname; - - external ffi.Pointer> xDlOpen; - - external ffi.Pointer> xDlError; - - external ffi.Pointer> xDlSym; - - external ffi.Pointer> xDlClose; - - external ffi.Pointer> xRandomness; - - external ffi.Pointer> xSleep; - - external ffi.Pointer> xCurrentTime; - - external ffi.Pointer> xGetLastError; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>> xOpen; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer, ffi.Int32)>> + xDelete; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>> xAccess; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>> xFullPathname; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>> xDlOpen; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xDlError; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer> Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> xDlSym; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>> xDlClose; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xRandomness; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xSleep; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> xCurrentTime; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xGetLastError; /// The methods above are in version 1 of the sqlite_vfs object /// definition. Those that follow are added in version 2 or later - external ffi.Pointer> xCurrentTimeInt64; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> + xCurrentTimeInt64; /// The methods above are in versions 1 and 2 of the sqlite_vfs object. /// Those below are for version 3 and greater. - external ffi.Pointer> xSetSystemCall; - - external ffi.Pointer> xGetSystemCall; - - external ffi.Pointer> xNextSystemCall; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + sqlite3_syscall_ptr)>> xSetSystemCall; + + external ffi.Pointer< + ffi.NativeFunction< + sqlite3_syscall_ptr Function( + ffi.Pointer, ffi.Pointer)>> xGetSystemCall; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>> + xNextSystemCall; } +typedef sqlite3_syscall_ptr + = ffi.Pointer>; + class sqlite3_mem_methods extends ffi.Struct { /// Memory allocation function - external ffi.Pointer> xMalloc; + external ffi.Pointer< + ffi.NativeFunction Function(ffi.Int32)>> xMalloc; /// Free a prior allocation - external ffi.Pointer> xFree; + external ffi + .Pointer)>> + xFree; /// Resize an allocation - external ffi.Pointer> xRealloc; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Int32)>> + xRealloc; /// Return the size of an allocation - external ffi.Pointer> xSize; + external ffi.Pointer< + ffi.NativeFunction)>> xSize; /// Round up request size to allocation size - external ffi.Pointer> xRoundup; + external ffi.Pointer> + xRoundup; /// Initialize the memory allocator - external ffi.Pointer> xInit; + external ffi.Pointer< + ffi.NativeFunction)>> xInit; /// Deinitialize the memory allocator - external ffi.Pointer> xShutdown; + external ffi + .Pointer)>> + xShutdown; /// Argument to xInit() and xShutdown() external ffi.Pointer pAppData; } +typedef sqlite3_uint64 = sqlite_uint64; +typedef sqlite_uint64 = ffi.Uint64; + class sqlite3_stmt extends ffi.Opaque {} class sqlite3_value extends ffi.Opaque {} class sqlite3_context extends ffi.Opaque {} -class sqlite3_index_constraint extends ffi.Struct { - /// Column constrained. -1 for ROWID - @ffi.Int32() - external int iColumn; - - /// Constraint operator - @ffi.Uint8() - external int op; - - /// True if this constraint is usable - @ffi.Uint8() - external int usable; +/// CAPI3REF: Virtual Table Instance Object +/// KEYWORDS: sqlite3_vtab +/// +/// Every [virtual table module] implementation uses a subclass +/// of this object to describe a particular instance +/// of the [virtual table]. Each subclass will +/// be tailored to the specific needs of the module implementation. +/// The purpose of this superclass is to define certain fields that are +/// common to all module implementations. +/// +/// ^Virtual tables methods can set an error message by assigning a +/// string obtained from [sqlite3_mprintf()] to zErrMsg. The method should +/// take care that any prior string is freed by a call to [sqlite3_free()] +/// prior to assigning a new string to zErrMsg. ^After the error message +/// is delivered up to the client application, the string will be automatically +/// freed by sqlite3_free() and the zErrMsg field will be zeroed. +class sqlite3_vtab extends ffi.Struct { + /// The module for this virtual table + external ffi.Pointer pModule; - /// Used internally - xBestIndex should ignore + /// Number of open cursors @ffi.Int32() - external int iTermOffset; + external int nRef; + + /// Error message from sqlite3_mprintf() + external ffi.Pointer zErrMsg; } -class sqlite3_index_orderby extends ffi.Struct { - /// Column number +/// CAPI3REF: Virtual Table Object +/// KEYWORDS: sqlite3_module {virtual table module} +/// +/// This structure, sometimes called a "virtual table module", +/// defines the implementation of a [virtual table]. +/// This structure consists mostly of methods for the module. +/// +/// ^A virtual table module is created by filling in a persistent +/// instance of this structure and passing a pointer to that instance +/// to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. +/// ^The registration remains valid until it is replaced by a different +/// module or until the [database connection] closes. The content +/// of this structure must not change while it is registered with +/// any database connection. +class sqlite3_module extends ffi.Struct { @ffi.Int32() - external int iColumn; + external int iVersion; - /// True for DESC. False for ASC. - @ffi.Uint8() - external int desc; -} + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>)>> xCreate; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>)>> xConnect; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> + xBestIndex; + + external ffi.Pointer< + ffi.NativeFunction)>> + xDisconnect; + + external ffi.Pointer< + ffi.NativeFunction)>> + xDestroy; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer>)>> xOpen; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer)>> xClose; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>> xFilter; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer)>> xNext; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer)>> xEof; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>> xColumn; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>> xRowid; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer)>> xUpdate; + + external ffi.Pointer< + ffi.NativeFunction)>> xBegin; + + external ffi.Pointer< + ffi.NativeFunction)>> xSync; + + external ffi.Pointer< + ffi.NativeFunction)>> + xCommit; + + external ffi.Pointer< + ffi.NativeFunction)>> + xRollback; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>>, + ffi.Pointer>)>> xFindFunction; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> xRename; -/// Outputs -class sqlite3_index_constraint_usage extends ffi.Struct { - /// if >0, constraint is part of argv to xFilter - @ffi.Int32() - external int argvIndex; + /// The methods above are in version 1 of the sqlite_module object. Those + /// below are for version 2 and greater. + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xSavepoint; - /// Do not code a test for this constraint - @ffi.Uint8() - external int omit; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xRelease; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> + xRollbackTo; + + /// The methods above are in versions 1 and 2 of the sqlite_module object. + /// Those below are for version 3 and greater. + external ffi.Pointer< + ffi.NativeFunction)>> + xShadowName; } /// CAPI3REF: Virtual Table Indexing Information @@ -9824,7 +11325,7 @@ class sqlite3_index_info extends ffi.Struct { external double estimatedCost; /// Estimated number of rows returned - @ffi.Int64() + @sqlite3_int64() external int estimatedRows; /// Mask of SQLITE_INDEX_SCAN_* flags @@ -9832,10 +11333,49 @@ class sqlite3_index_info extends ffi.Struct { external int idxFlags; /// Input: Mask of columns used by statement - @ffi.Uint64() + @sqlite3_uint64() external int colUsed; } +class sqlite3_index_constraint extends ffi.Struct { + /// Column constrained. -1 for ROWID + @ffi.Int32() + external int iColumn; + + /// Constraint operator + @ffi.Uint8() + external int op; + + /// True if this constraint is usable + @ffi.Uint8() + external int usable; + + /// Used internally - xBestIndex should ignore + @ffi.Int32() + external int iTermOffset; +} + +class sqlite3_index_orderby extends ffi.Struct { + /// Column number + @ffi.Int32() + external int iColumn; + + /// True for DESC. False for ASC. + @ffi.Uint8() + external int desc; +} + +/// Outputs +class sqlite3_index_constraint_usage extends ffi.Struct { + /// if >0, constraint is part of argv to xFilter + @ffi.Int32() + external int argvIndex; + + /// Do not code a test for this constraint + @ffi.Uint8() + external int omit; +} + /// CAPI3REF: Virtual Table Cursor Object /// KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} /// @@ -9856,123 +11396,40 @@ class sqlite3_vtab_cursor extends ffi.Struct { external ffi.Pointer pVtab; } -/// CAPI3REF: Virtual Table Object -/// KEYWORDS: sqlite3_module {virtual table module} -/// -/// This structure, sometimes called a "virtual table module", -/// defines the implementation of a [virtual table]. -/// This structure consists mostly of methods for the module. -/// -/// ^A virtual table module is created by filling in a persistent -/// instance of this structure and passing a pointer to that instance -/// to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -/// ^The registration remains valid until it is replaced by a different -/// module or until the [database connection] closes. The content -/// of this structure must not change while it is registered with -/// any database connection. -class sqlite3_module extends ffi.Struct { - @ffi.Int32() - external int iVersion; - - external ffi.Pointer> xCreate; - - external ffi.Pointer> xConnect; - - external ffi.Pointer> xBestIndex; - - external ffi.Pointer> xDisconnect; - - external ffi.Pointer> xDestroy; - - external ffi.Pointer> xOpen; - - external ffi.Pointer> xClose; - - external ffi.Pointer> xFilter; - - external ffi.Pointer> xNext; - - external ffi.Pointer> xEof; - - external ffi.Pointer> xColumn; - - external ffi.Pointer> xRowid; - - external ffi.Pointer> xUpdate; - - external ffi.Pointer> xBegin; - - external ffi.Pointer> xSync; - - external ffi.Pointer> xCommit; - - external ffi.Pointer> xRollback; - - external ffi.Pointer> xFindFunction; - - external ffi.Pointer> xRename; - - /// The methods above are in version 1 of the sqlite_module object. Those - /// below are for version 2 and greater. - external ffi.Pointer> xSavepoint; - - external ffi.Pointer> xRelease; - - external ffi.Pointer> xRollbackTo; - - /// The methods above are in versions 1 and 2 of the sqlite_module object. - /// Those below are for version 3 and greater. - external ffi.Pointer> xShadowName; -} - -/// CAPI3REF: Virtual Table Instance Object -/// KEYWORDS: sqlite3_vtab -/// -/// Every [virtual table module] implementation uses a subclass -/// of this object to describe a particular instance -/// of the [virtual table]. Each subclass will -/// be tailored to the specific needs of the module implementation. -/// The purpose of this superclass is to define certain fields that are -/// common to all module implementations. -/// -/// ^Virtual tables methods can set an error message by assigning a -/// string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -/// take care that any prior string is freed by a call to [sqlite3_free()] -/// prior to assigning a new string to zErrMsg. ^After the error message -/// is delivered up to the client application, the string will be automatically -/// freed by sqlite3_free() and the zErrMsg field will be zeroed. -class sqlite3_vtab extends ffi.Struct { - /// The module for this virtual table - external ffi.Pointer pModule; - - /// Number of open cursors - @ffi.Int32() - external int nRef; - - /// Error message from sqlite3_mprintf() - external ffi.Pointer zErrMsg; -} - class sqlite3_blob extends ffi.Opaque {} class sqlite3_mutex_methods extends ffi.Struct { - external ffi.Pointer> xMutexInit; + external ffi.Pointer> xMutexInit; - external ffi.Pointer> xMutexEnd; + external ffi.Pointer> xMutexEnd; - external ffi.Pointer> xMutexAlloc; + external ffi.Pointer< + ffi.NativeFunction Function(ffi.Int32)>> + xMutexAlloc; - external ffi.Pointer> xMutexFree; + external ffi.Pointer< + ffi.NativeFunction)>> + xMutexFree; - external ffi.Pointer> xMutexEnter; + external ffi.Pointer< + ffi.NativeFunction)>> + xMutexEnter; - external ffi.Pointer> xMutexTry; + external ffi.Pointer< + ffi.NativeFunction)>> + xMutexTry; - external ffi.Pointer> xMutexLeave; + external ffi.Pointer< + ffi.NativeFunction)>> + xMutexLeave; - external ffi.Pointer> xMutexHeld; + external ffi.Pointer< + ffi.NativeFunction)>> + xMutexHeld; - external ffi.Pointer> xMutexNotheld; + external ffi.Pointer< + ffi.NativeFunction)>> + xMutexNotheld; } class sqlite3_str extends ffi.Opaque {} @@ -9993,51 +11450,105 @@ class sqlite3_pcache_methods2 extends ffi.Struct { external ffi.Pointer pArg; - external ffi.Pointer> xInit; - - external ffi.Pointer> xShutdown; - - external ffi.Pointer> xCreate; - - external ffi.Pointer> xCachesize; - - external ffi.Pointer> xPagecount; - - external ffi.Pointer> xFetch; - - external ffi.Pointer> xUnpin; - - external ffi.Pointer> xRekey; - - external ffi.Pointer> xTruncate; - - external ffi.Pointer> xDestroy; - - external ffi.Pointer> xShrink; + external ffi.Pointer< + ffi.NativeFunction)>> xInit; + + external ffi + .Pointer)>> + xShutdown; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32, ffi.Int32, ffi.Int32)>> xCreate; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32)>> + xCachesize; + + external ffi.Pointer< + ffi.NativeFunction)>> + xPagecount; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Uint32, ffi.Int32)>> xFetch; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Int32)>> xUnpin; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, + ffi.Uint32)>> xRekey; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Uint32)>> + xTruncate; + + external ffi.Pointer< + ffi.NativeFunction)>> + xDestroy; + + external ffi.Pointer< + ffi.NativeFunction)>> + xShrink; } class sqlite3_pcache_methods extends ffi.Struct { external ffi.Pointer pArg; - external ffi.Pointer> xInit; - - external ffi.Pointer> xShutdown; - - external ffi.Pointer> xCreate; - - external ffi.Pointer> xCachesize; - - external ffi.Pointer> xPagecount; - - external ffi.Pointer> xFetch; - - external ffi.Pointer> xUnpin; - - external ffi.Pointer> xRekey; - - external ffi.Pointer> xTruncate; - - external ffi.Pointer> xDestroy; + external ffi.Pointer< + ffi.NativeFunction)>> xInit; + + external ffi + .Pointer)>> + xShutdown; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Int32, ffi.Int32)>> xCreate; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int32)>> + xCachesize; + + external ffi.Pointer< + ffi.NativeFunction)>> + xPagecount; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Uint32, ffi.Int32)>> xFetch; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>> xUnpin; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Uint32, ffi.Uint32)>> xRekey; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Uint32)>> + xTruncate; + + external ffi.Pointer< + ffi.NativeFunction)>> + xDestroy; } class sqlite3_backup extends ffi.Opaque {} @@ -10076,15 +11587,19 @@ class sqlite3_rtree_geometry extends ffi.Struct { external int nParam; /// Parameters passed to SQL geom function - external ffi.Pointer aParam; + external ffi.Pointer aParam; /// Callback implementation user data external ffi.Pointer pUser; /// Called by SQLite to clean up pUser - external ffi.Pointer> xDelUser; + external ffi + .Pointer)>> + xDelUser; } +typedef sqlite3_rtree_dbl = ffi.Double; + /// A pointer to a structure of the following type is passed as the /// argument to scored geometry callback registered using /// sqlite3_rtree_query_callback(). @@ -10101,16 +11616,18 @@ class sqlite3_rtree_query_info extends ffi.Struct { external int nParam; /// value of function parameters - external ffi.Pointer aParam; + external ffi.Pointer aParam; /// callback can use this, if desired external ffi.Pointer pUser; /// function to free pUser - external ffi.Pointer> xDelUser; + external ffi + .Pointer)>> + xDelUser; /// Coordinates of node or entry to check - external ffi.Pointer aCoord; + external ffi.Pointer aCoord; /// Number of pending entries in the queue external ffi.Pointer anQueue; @@ -10128,11 +11645,11 @@ class sqlite3_rtree_query_info extends ffi.Struct { external int mxLevel; /// Rowid for current entry - @ffi.Int64() + @sqlite3_int64() external int iRowid; /// Score of parent node - @ffi.Double() + @sqlite3_rtree_dbl() external double rParentScore; /// Visibility of parent node @@ -10144,21 +11661,13 @@ class sqlite3_rtree_query_info extends ffi.Struct { external int eWithin; /// OUT: Write the score here - @ffi.Double() + @sqlite3_rtree_dbl() external double rScore; /// Original SQL values of parameters external ffi.Pointer> apSqlParam; } -class Fts5Context extends ffi.Opaque {} - -class Fts5PhraseIter extends ffi.Struct { - external ffi.Pointer a; - - external ffi.Pointer b; -} - /// EXTENSION API FUNCTIONS /// /// xUserData(pFts): @@ -10373,53 +11882,181 @@ class Fts5ExtensionApi extends ffi.Struct { @ffi.Int32() external int iVersion; - external ffi.Pointer> xUserData; - - external ffi.Pointer> xColumnCount; - - external ffi.Pointer> xRowCount; - - external ffi.Pointer> xColumnTotalSize; - - external ffi.Pointer> xTokenize; - - external ffi.Pointer> xPhraseCount; - - external ffi.Pointer> xPhraseSize; - - external ffi.Pointer> xInstCount; - - external ffi.Pointer> xInst; - - external ffi.Pointer> xRowid; - - external ffi.Pointer> xColumnText; - - external ffi.Pointer> xColumnSize; - - external ffi.Pointer> xQueryPhrase; - - external ffi.Pointer> xSetAuxdata; - - external ffi.Pointer> xGetAuxdata; - - external ffi.Pointer> xPhraseFirst; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>> xUserData; + + external ffi.Pointer< + ffi.NativeFunction)>> + xColumnCount; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> xRowCount; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Pointer)>> xColumnTotalSize; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Int32)>>)>> xTokenize; + + external ffi.Pointer< + ffi.NativeFunction)>> + xPhraseCount; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>> xPhraseSize; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>> xInstCount; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> xInst; + + external ffi.Pointer< + ffi.NativeFunction)>> + xRowid; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer>, + ffi.Pointer)>> xColumnText; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32, ffi.Pointer)>> + xColumnSize; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>)>> xQueryPhrase; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>> xSetAuxdata; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Int32)>> xGetAuxdata; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> xPhraseFirst; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> xPhraseNext; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer)>> xPhraseFirstColumn; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>> xPhraseNextColumn; +} - external ffi.Pointer> xPhraseNext; +class Fts5Context extends ffi.Opaque {} - external ffi.Pointer> xPhraseFirstColumn; +class Fts5PhraseIter extends ffi.Struct { + external ffi.Pointer a; - external ffi.Pointer> xPhraseNextColumn; + external ffi.Pointer b; } class Fts5Tokenizer extends ffi.Opaque {} class fts5_tokenizer extends ffi.Struct { - external ffi.Pointer> xCreate; - - external ffi.Pointer> xDelete; - - external ffi.Pointer> xTokenize; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer>, + ffi.Int32, + ffi.Pointer>)>> xCreate; + + external ffi.Pointer< + ffi.NativeFunction)>> + xDelete; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Int32)>>)>> xTokenize; } class fts5_api extends ffi.Struct { @@ -10428,15 +12065,50 @@ class fts5_api extends ffi.Struct { external int iVersion; /// Create a new tokenizer - external ffi.Pointer> xCreateTokenizer; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>> + xCreateTokenizer; /// Find an existing tokenizer - external ffi.Pointer> xFindTokenizer; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer)>> xFindTokenizer; /// Create a new auxiliary function - external ffi.Pointer> xCreateFunction; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + fts5_extension_function, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>)>> + xCreateFunction; } +typedef fts5_extension_function = ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer>)>>; + const String SQLITE_VERSION = '3.32.3'; const int SQLITE_VERSION_NUMBER = 3032003; @@ -11317,3801 +12989,3 @@ const int FTS5_TOKENIZE_DOCUMENT = 4; const int FTS5_TOKENIZE_AUX = 8; const int FTS5_TOKEN_COLOCATED = 1; - -typedef _c_sqlite3_libversion = ffi.Pointer Function(); - -typedef _dart_sqlite3_libversion = ffi.Pointer Function(); - -typedef _c_sqlite3_sourceid = ffi.Pointer Function(); - -typedef _dart_sqlite3_sourceid = ffi.Pointer Function(); - -typedef _c_sqlite3_libversion_number = ffi.Int32 Function(); - -typedef _dart_sqlite3_libversion_number = int Function(); - -typedef _c_sqlite3_compileoption_used = ffi.Int32 Function( - ffi.Pointer zOptName, -); - -typedef _dart_sqlite3_compileoption_used = int Function( - ffi.Pointer zOptName, -); - -typedef _c_sqlite3_compileoption_get = ffi.Pointer Function( - ffi.Int32 N, -); - -typedef _dart_sqlite3_compileoption_get = ffi.Pointer Function( - int N, -); - -typedef _c_sqlite3_threadsafe = ffi.Int32 Function(); - -typedef _dart_sqlite3_threadsafe = int Function(); - -typedef _c_sqlite3_close = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_close = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_close_v2 = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_close_v2 = int Function( - ffi.Pointer arg0, -); - -typedef _typedefC_1 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer>, -); - -typedef _c_sqlite3_exec = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer sql, - ffi.Pointer> callback, - ffi.Pointer arg3, - ffi.Pointer> errmsg, -); - -typedef _dart_sqlite3_exec = int Function( - ffi.Pointer arg0, - ffi.Pointer sql, - ffi.Pointer> callback, - ffi.Pointer arg3, - ffi.Pointer> errmsg, -); - -typedef _c_sqlite3_initialize = ffi.Int32 Function(); - -typedef _dart_sqlite3_initialize = int Function(); - -typedef _c_sqlite3_shutdown = ffi.Int32 Function(); - -typedef _dart_sqlite3_shutdown = int Function(); - -typedef _c_sqlite3_os_init = ffi.Int32 Function(); - -typedef _dart_sqlite3_os_init = int Function(); - -typedef _c_sqlite3_os_end = ffi.Int32 Function(); - -typedef _dart_sqlite3_os_end = int Function(); - -typedef _c_sqlite3_config = ffi.Int32 Function( - ffi.Int32 arg0, -); - -typedef _dart_sqlite3_config = int Function( - int arg0, -); - -typedef _c_sqlite3_db_config = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 op, -); - -typedef _dart_sqlite3_db_config = int Function( - ffi.Pointer arg0, - int op, -); - -typedef _c_sqlite3_extended_result_codes = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 onoff, -); - -typedef _dart_sqlite3_extended_result_codes = int Function( - ffi.Pointer arg0, - int onoff, -); - -typedef _c_sqlite3_last_insert_rowid = ffi.Int64 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_last_insert_rowid = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_set_last_insert_rowid = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int64 arg1, -); - -typedef _dart_sqlite3_set_last_insert_rowid = void Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_changes = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_changes = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_total_changes = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_total_changes = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_interrupt = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_interrupt = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_complete = ffi.Int32 Function( - ffi.Pointer sql, -); - -typedef _dart_sqlite3_complete = int Function( - ffi.Pointer sql, -); - -typedef _c_sqlite3_complete16 = ffi.Int32 Function( - ffi.Pointer sql, -); - -typedef _dart_sqlite3_complete16 = int Function( - ffi.Pointer sql, -); - -typedef _typedefC_44 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _c_sqlite3_busy_handler = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_busy_handler = int Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _c_sqlite3_busy_timeout = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 ms, -); - -typedef _dart_sqlite3_busy_timeout = int Function( - ffi.Pointer arg0, - int ms, -); - -typedef _c_sqlite3_get_table = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Pointer>> pazResult, - ffi.Pointer pnRow, - ffi.Pointer pnColumn, - ffi.Pointer> pzErrmsg, -); - -typedef _dart_sqlite3_get_table = int Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Pointer>> pazResult, - ffi.Pointer pnRow, - ffi.Pointer pnColumn, - ffi.Pointer> pzErrmsg, -); - -typedef _c_sqlite3_free_table = ffi.Void Function( - ffi.Pointer> result, -); - -typedef _dart_sqlite3_free_table = void Function( - ffi.Pointer> result, -); - -typedef _c_sqlite3_mprintf = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_mprintf = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_snprintf = ffi.Pointer Function( - ffi.Int32 arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_snprintf = ffi.Pointer Function( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, -); - -typedef _c_sqlite3_malloc = ffi.Pointer Function( - ffi.Int32 arg0, -); - -typedef _dart_sqlite3_malloc = ffi.Pointer Function( - int arg0, -); - -typedef _c_sqlite3_malloc64 = ffi.Pointer Function( - ffi.Uint64 arg0, -); - -typedef _dart_sqlite3_malloc64 = ffi.Pointer Function( - int arg0, -); - -typedef _c_sqlite3_realloc = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_realloc = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_realloc64 = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Uint64 arg1, -); - -typedef _dart_sqlite3_realloc64 = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_free = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_free = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_msize = ffi.Uint64 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_msize = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_memory_used = ffi.Int64 Function(); - -typedef _dart_sqlite3_memory_used = int Function(); - -typedef _c_sqlite3_memory_highwater = ffi.Int64 Function( - ffi.Int32 resetFlag, -); - -typedef _dart_sqlite3_memory_highwater = int Function( - int resetFlag, -); - -typedef _c_sqlite3_randomness = ffi.Void Function( - ffi.Int32 N, - ffi.Pointer P, -); - -typedef _dart_sqlite3_randomness = void Function( - int N, - ffi.Pointer P, -); - -typedef _typedefC_45 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _c_sqlite3_set_authorizer = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer> xAuth, - ffi.Pointer pUserData, -); - -typedef _dart_sqlite3_set_authorizer = int Function( - ffi.Pointer arg0, - ffi.Pointer> xAuth, - ffi.Pointer pUserData, -); - -typedef _typedefC_46 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _c_sqlite3_trace = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> xTrace, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_trace = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> xTrace, - ffi.Pointer arg2, -); - -typedef _typedefC_47 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint64, -); - -typedef _c_sqlite3_profile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> xProfile, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_profile = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> xProfile, - ffi.Pointer arg2, -); - -typedef _typedefC_48 = ffi.Int32 Function( - ffi.Uint32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _c_sqlite3_trace_v2 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Uint32 uMask, - ffi.Pointer> xCallback, - ffi.Pointer pCtx, -); - -typedef _dart_sqlite3_trace_v2 = int Function( - ffi.Pointer arg0, - int uMask, - ffi.Pointer> xCallback, - ffi.Pointer pCtx, -); - -typedef _typedefC_49 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _c_sqlite3_progress_handler = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer> arg2, - ffi.Pointer arg3, -); - -typedef _dart_sqlite3_progress_handler = void Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer> arg2, - ffi.Pointer arg3, -); - -typedef _c_sqlite3_open = ffi.Int32 Function( - ffi.Pointer filename, - ffi.Pointer> ppDb, -); - -typedef _dart_sqlite3_open = int Function( - ffi.Pointer filename, - ffi.Pointer> ppDb, -); - -typedef _c_sqlite3_open16 = ffi.Int32 Function( - ffi.Pointer filename, - ffi.Pointer> ppDb, -); - -typedef _dart_sqlite3_open16 = int Function( - ffi.Pointer filename, - ffi.Pointer> ppDb, -); - -typedef _c_sqlite3_open_v2 = ffi.Int32 Function( - ffi.Pointer filename, - ffi.Pointer> ppDb, - ffi.Int32 flags, - ffi.Pointer zVfs, -); - -typedef _dart_sqlite3_open_v2 = int Function( - ffi.Pointer filename, - ffi.Pointer> ppDb, - int flags, - ffi.Pointer zVfs, -); - -typedef _c_sqlite3_uri_parameter = ffi.Pointer Function( - ffi.Pointer zFilename, - ffi.Pointer zParam, -); - -typedef _dart_sqlite3_uri_parameter = ffi.Pointer Function( - ffi.Pointer zFilename, - ffi.Pointer zParam, -); - -typedef _c_sqlite3_uri_boolean = ffi.Int32 Function( - ffi.Pointer zFile, - ffi.Pointer zParam, - ffi.Int32 bDefault, -); - -typedef _dart_sqlite3_uri_boolean = int Function( - ffi.Pointer zFile, - ffi.Pointer zParam, - int bDefault, -); - -typedef _c_sqlite3_uri_int64 = ffi.Int64 Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int64 arg2, -); - -typedef _dart_sqlite3_uri_int64 = int Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, -); - -typedef _c_sqlite3_uri_key = ffi.Pointer Function( - ffi.Pointer zFilename, - ffi.Int32 N, -); - -typedef _dart_sqlite3_uri_key = ffi.Pointer Function( - ffi.Pointer zFilename, - int N, -); - -typedef _c_sqlite3_filename_database = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_filename_database = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_filename_journal = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_filename_journal = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_filename_wal = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_filename_wal = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_database_file_object = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_database_file_object = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_create_filename = ffi.Pointer Function( - ffi.Pointer zDatabase, - ffi.Pointer zJournal, - ffi.Pointer zWal, - ffi.Int32 nParam, - ffi.Pointer> azParam, -); - -typedef _dart_sqlite3_create_filename = ffi.Pointer Function( - ffi.Pointer zDatabase, - ffi.Pointer zJournal, - ffi.Pointer zWal, - int nParam, - ffi.Pointer> azParam, -); - -typedef _c_sqlite3_free_filename = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_free_filename = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_errcode = ffi.Int32 Function( - ffi.Pointer db, -); - -typedef _dart_sqlite3_errcode = int Function( - ffi.Pointer db, -); - -typedef _c_sqlite3_extended_errcode = ffi.Int32 Function( - ffi.Pointer db, -); - -typedef _dart_sqlite3_extended_errcode = int Function( - ffi.Pointer db, -); - -typedef _c_sqlite3_errmsg = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_errmsg = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_errmsg16 = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_errmsg16 = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_errstr = ffi.Pointer Function( - ffi.Int32 arg0, -); - -typedef _dart_sqlite3_errstr = ffi.Pointer Function( - int arg0, -); - -typedef _c_sqlite3_limit = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 id, - ffi.Int32 newVal, -); - -typedef _dart_sqlite3_limit = int Function( - ffi.Pointer arg0, - int id, - int newVal, -); - -typedef _c_sqlite3_prepare = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Int32 nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _dart_sqlite3_prepare = int Function( - ffi.Pointer db, - ffi.Pointer zSql, - int nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _c_sqlite3_prepare_v2 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Int32 nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _dart_sqlite3_prepare_v2 = int Function( - ffi.Pointer db, - ffi.Pointer zSql, - int nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _c_sqlite3_prepare_v3 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Int32 nByte, - ffi.Uint32 prepFlags, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _dart_sqlite3_prepare_v3 = int Function( - ffi.Pointer db, - ffi.Pointer zSql, - int nByte, - int prepFlags, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _c_sqlite3_prepare16 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Int32 nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _dart_sqlite3_prepare16 = int Function( - ffi.Pointer db, - ffi.Pointer zSql, - int nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _c_sqlite3_prepare16_v2 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Int32 nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _dart_sqlite3_prepare16_v2 = int Function( - ffi.Pointer db, - ffi.Pointer zSql, - int nByte, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _c_sqlite3_prepare16_v3 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSql, - ffi.Int32 nByte, - ffi.Uint32 prepFlags, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _dart_sqlite3_prepare16_v3 = int Function( - ffi.Pointer db, - ffi.Pointer zSql, - int nByte, - int prepFlags, - ffi.Pointer> ppStmt, - ffi.Pointer> pzTail, -); - -typedef _c_sqlite3_sql = ffi.Pointer Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_sql = ffi.Pointer Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_expanded_sql = ffi.Pointer Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_expanded_sql = ffi.Pointer Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_normalized_sql = ffi.Pointer Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_normalized_sql = ffi.Pointer Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_stmt_readonly = ffi.Int32 Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_stmt_readonly = int Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_stmt_isexplain = ffi.Int32 Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_stmt_isexplain = int Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_stmt_busy = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_stmt_busy = int Function( - ffi.Pointer arg0, -); - -typedef _typedefC_50 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_bind_blob = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2, - ffi.Int32 n, - ffi.Pointer> arg4, -); - -typedef _dart_sqlite3_bind_blob = int Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - int n, - ffi.Pointer> arg4, -); - -typedef _typedefC_51 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_bind_blob64 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2, - ffi.Uint64 arg3, - ffi.Pointer> arg4, -); - -typedef _dart_sqlite3_bind_blob64 = int Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer> arg4, -); - -typedef _c_sqlite3_bind_double = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Double arg2, -); - -typedef _dart_sqlite3_bind_double = int Function( - ffi.Pointer arg0, - int arg1, - double arg2, -); - -typedef _c_sqlite3_bind_int = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Int32 arg2, -); - -typedef _dart_sqlite3_bind_int = int Function( - ffi.Pointer arg0, - int arg1, - int arg2, -); - -typedef _c_sqlite3_bind_int64 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Int64 arg2, -); - -typedef _dart_sqlite3_bind_int64 = int Function( - ffi.Pointer arg0, - int arg1, - int arg2, -); - -typedef _c_sqlite3_bind_null = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_bind_null = int Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _typedefC_52 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_bind_text = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2, - ffi.Int32 arg3, - ffi.Pointer> arg4, -); - -typedef _dart_sqlite3_bind_text = int Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer> arg4, -); - -typedef _typedefC_53 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_bind_text16 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2, - ffi.Int32 arg3, - ffi.Pointer> arg4, -); - -typedef _dart_sqlite3_bind_text16 = int Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer> arg4, -); - -typedef _typedefC_54 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_bind_text64 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2, - ffi.Uint64 arg3, - ffi.Pointer> arg4, - ffi.Uint8 encoding, -); - -typedef _dart_sqlite3_bind_text64 = int Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer> arg4, - int encoding, -); - -typedef _c_sqlite3_bind_value = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_bind_value = int Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, -); - -typedef _typedefC_55 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_bind_pointer = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer> arg4, -); - -typedef _dart_sqlite3_bind_pointer = int Function( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer> arg4, -); - -typedef _c_sqlite3_bind_zeroblob = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Int32 n, -); - -typedef _dart_sqlite3_bind_zeroblob = int Function( - ffi.Pointer arg0, - int arg1, - int n, -); - -typedef _c_sqlite3_bind_zeroblob64 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, - ffi.Uint64 arg2, -); - -typedef _dart_sqlite3_bind_zeroblob64 = int Function( - ffi.Pointer arg0, - int arg1, - int arg2, -); - -typedef _c_sqlite3_bind_parameter_count = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_bind_parameter_count = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_bind_parameter_name = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_bind_parameter_name = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_bind_parameter_index = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zName, -); - -typedef _dart_sqlite3_bind_parameter_index = int Function( - ffi.Pointer arg0, - ffi.Pointer zName, -); - -typedef _c_sqlite3_clear_bindings = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_clear_bindings = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_column_count = ffi.Int32 Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_column_count = int Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_column_name = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 N, -); - -typedef _dart_sqlite3_column_name = ffi.Pointer Function( - ffi.Pointer arg0, - int N, -); - -typedef _c_sqlite3_column_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 N, -); - -typedef _dart_sqlite3_column_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - int N, -); - -typedef _c_sqlite3_column_database_name = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_database_name = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_column_database_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_database_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_column_table_name = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_table_name = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_column_table_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_table_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_column_origin_name = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_origin_name = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_column_origin_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_origin_name16 = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_column_decltype = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_decltype = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_column_decltype16 = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_column_decltype16 = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_step = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_step = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_data_count = ffi.Int32 Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_data_count = int Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_column_blob = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_blob = ffi.Pointer Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_double = ffi.Double Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_double = double Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_int = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_int = int Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_int64 = ffi.Int64 Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_int64 = int Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_text = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_text = ffi.Pointer Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_text16 = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_text16 = ffi.Pointer Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_value = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_value = ffi.Pointer Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_bytes = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_bytes = int Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_bytes16 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_bytes16 = int Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_column_type = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 iCol, -); - -typedef _dart_sqlite3_column_type = int Function( - ffi.Pointer arg0, - int iCol, -); - -typedef _c_sqlite3_finalize = ffi.Int32 Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_finalize = int Function( - ffi.Pointer pStmt, -); - -typedef _c_sqlite3_reset = ffi.Int32 Function( - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_reset = int Function( - ffi.Pointer pStmt, -); - -typedef _typedefC_56 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_57 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_58 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_create_function = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - ffi.Int32 nArg, - ffi.Int32 eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, -); - -typedef _dart_sqlite3_create_function = int Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - int nArg, - int eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, -); - -typedef _typedefC_59 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_60 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_61 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_create_function16 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - ffi.Int32 nArg, - ffi.Int32 eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, -); - -typedef _dart_sqlite3_create_function16 = int Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - int nArg, - int eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, -); - -typedef _typedefC_62 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_63 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_64 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_65 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_create_function_v2 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - ffi.Int32 nArg, - ffi.Int32 eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xDestroy, -); - -typedef _dart_sqlite3_create_function_v2 = int Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - int nArg, - int eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xFunc, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xDestroy, -); - -typedef _typedefC_66 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_67 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_68 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_69 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_70 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_create_window_function = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - ffi.Int32 nArg, - ffi.Int32 eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xValue, - ffi.Pointer> xInverse, - ffi.Pointer> xDestroy, -); - -typedef _dart_sqlite3_create_window_function = int Function( - ffi.Pointer db, - ffi.Pointer zFunctionName, - int nArg, - int eTextRep, - ffi.Pointer pApp, - ffi.Pointer> xStep, - ffi.Pointer> xFinal, - ffi.Pointer> xValue, - ffi.Pointer> xInverse, - ffi.Pointer> xDestroy, -); - -typedef _c_sqlite3_aggregate_count = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_aggregate_count = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_expired = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_expired = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_transfer_bindings = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_sqlite3_transfer_bindings = int Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _c_sqlite3_global_recover = ffi.Int32 Function(); - -typedef _dart_sqlite3_global_recover = int Function(); - -typedef _c_sqlite3_thread_cleanup = ffi.Void Function(); - -typedef _dart_sqlite3_thread_cleanup = void Function(); - -typedef _typedefC_71 = ffi.Void Function( - ffi.Pointer, - ffi.Int64, - ffi.Int32, -); - -typedef _c_sqlite3_memory_alarm = ffi.Int32 Function( - ffi.Pointer> arg0, - ffi.Pointer arg1, - ffi.Int64 arg2, -); - -typedef _dart_sqlite3_memory_alarm = int Function( - ffi.Pointer> arg0, - ffi.Pointer arg1, - int arg2, -); - -typedef _c_sqlite3_value_blob = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_blob = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_double = ffi.Double Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_double = double Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_int = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_int = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_int64 = ffi.Int64 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_int64 = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_pointer = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_sqlite3_value_pointer = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _c_sqlite3_value_text = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_text = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_text16 = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_text16 = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_text16le = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_text16le = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_text16be = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_text16be = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_bytes = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_bytes = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_bytes16 = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_bytes16 = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_type = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_type = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_numeric_type = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_numeric_type = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_nochange = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_nochange = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_frombind = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_frombind = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_subtype = ffi.Uint32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_subtype = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_dup = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_dup = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_value_free = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_value_free = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_aggregate_context = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 nBytes, -); - -typedef _dart_sqlite3_aggregate_context = ffi.Pointer Function( - ffi.Pointer arg0, - int nBytes, -); - -typedef _c_sqlite3_user_data = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_user_data = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_context_db_handle = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_context_db_handle = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_get_auxdata = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 N, -); - -typedef _dart_sqlite3_get_auxdata = ffi.Pointer Function( - ffi.Pointer arg0, - int N, -); - -typedef _typedefC_72 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_set_auxdata = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int32 N, - ffi.Pointer arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_set_auxdata = void Function( - ffi.Pointer arg0, - int N, - ffi.Pointer arg2, - ffi.Pointer> arg3, -); - -typedef _typedefC_73 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_blob = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_result_blob = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer> arg3, -); - -typedef _typedefC_74 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_blob64 = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Uint64 arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_result_blob64 = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer> arg3, -); - -typedef _c_sqlite3_result_double = ffi.Void Function( - ffi.Pointer arg0, - ffi.Double arg1, -); - -typedef _dart_sqlite3_result_double = void Function( - ffi.Pointer arg0, - double arg1, -); - -typedef _c_sqlite3_result_error = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, -); - -typedef _dart_sqlite3_result_error = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, -); - -typedef _c_sqlite3_result_error16 = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, -); - -typedef _dart_sqlite3_result_error16 = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, -); - -typedef _c_sqlite3_result_error_toobig = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_result_error_toobig = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_result_error_nomem = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_result_error_nomem = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_result_error_code = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_result_error_code = void Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_result_int = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_result_int = void Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_result_int64 = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int64 arg1, -); - -typedef _dart_sqlite3_result_int64 = void Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_result_null = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_result_null = void Function( - ffi.Pointer arg0, -); - -typedef _typedefC_75 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_text = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_result_text = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer> arg3, -); - -typedef _typedefC_76 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_text64 = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Uint64 arg2, - ffi.Pointer> arg3, - ffi.Uint8 encoding, -); - -typedef _dart_sqlite3_result_text64 = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer> arg3, - int encoding, -); - -typedef _typedefC_77 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_text16 = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_result_text16 = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer> arg3, -); - -typedef _typedefC_78 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_text16le = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_result_text16le = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer> arg3, -); - -typedef _typedefC_79 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_text16be = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_result_text16be = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer> arg3, -); - -typedef _c_sqlite3_result_value = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_sqlite3_result_value = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _typedefC_80 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_result_pointer = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, -); - -typedef _dart_sqlite3_result_pointer = void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, -); - -typedef _c_sqlite3_result_zeroblob = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int32 n, -); - -typedef _dart_sqlite3_result_zeroblob = void Function( - ffi.Pointer arg0, - int n, -); - -typedef _c_sqlite3_result_zeroblob64 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Uint64 n, -); - -typedef _dart_sqlite3_result_zeroblob64 = int Function( - ffi.Pointer arg0, - int n, -); - -typedef _c_sqlite3_result_subtype = ffi.Void Function( - ffi.Pointer arg0, - ffi.Uint32 arg1, -); - -typedef _dart_sqlite3_result_subtype = void Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _typedefC_81 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _c_sqlite3_create_collation = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zName, - ffi.Int32 eTextRep, - ffi.Pointer pArg, - ffi.Pointer> xCompare, -); - -typedef _dart_sqlite3_create_collation = int Function( - ffi.Pointer arg0, - ffi.Pointer zName, - int eTextRep, - ffi.Pointer pArg, - ffi.Pointer> xCompare, -); - -typedef _typedefC_82 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_83 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_create_collation_v2 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zName, - ffi.Int32 eTextRep, - ffi.Pointer pArg, - ffi.Pointer> xCompare, - ffi.Pointer> xDestroy, -); - -typedef _dart_sqlite3_create_collation_v2 = int Function( - ffi.Pointer arg0, - ffi.Pointer zName, - int eTextRep, - ffi.Pointer pArg, - ffi.Pointer> xCompare, - ffi.Pointer> xDestroy, -); - -typedef _typedefC_84 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _c_sqlite3_create_collation16 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zName, - ffi.Int32 eTextRep, - ffi.Pointer pArg, - ffi.Pointer> xCompare, -); - -typedef _dart_sqlite3_create_collation16 = int Function( - ffi.Pointer arg0, - ffi.Pointer zName, - int eTextRep, - ffi.Pointer pArg, - ffi.Pointer> xCompare, -); - -typedef _typedefC_85 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _c_sqlite3_collation_needed = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer> arg2, -); - -typedef _dart_sqlite3_collation_needed = int Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer> arg2, -); - -typedef _typedefC_86 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _c_sqlite3_collation_needed16 = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer> arg2, -); - -typedef _dart_sqlite3_collation_needed16 = int Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer> arg2, -); - -typedef _c_sqlite3_sleep = ffi.Int32 Function( - ffi.Int32 arg0, -); - -typedef _dart_sqlite3_sleep = int Function( - int arg0, -); - -typedef _c_sqlite3_win32_set_directory = ffi.Int32 Function( - ffi.Uint64 type, - ffi.Pointer zValue, -); - -typedef _dart_sqlite3_win32_set_directory = int Function( - int type, - ffi.Pointer zValue, -); - -typedef _c_sqlite3_win32_set_directory8 = ffi.Int32 Function( - ffi.Uint64 type, - ffi.Pointer zValue, -); - -typedef _dart_sqlite3_win32_set_directory8 = int Function( - int type, - ffi.Pointer zValue, -); - -typedef _c_sqlite3_win32_set_directory16 = ffi.Int32 Function( - ffi.Uint64 type, - ffi.Pointer zValue, -); - -typedef _dart_sqlite3_win32_set_directory16 = int Function( - int type, - ffi.Pointer zValue, -); - -typedef _c_sqlite3_get_autocommit = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_get_autocommit = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_db_handle = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_db_handle = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_db_filename = ffi.Pointer Function( - ffi.Pointer db, - ffi.Pointer zDbName, -); - -typedef _dart_sqlite3_db_filename = ffi.Pointer Function( - ffi.Pointer db, - ffi.Pointer zDbName, -); - -typedef _c_sqlite3_db_readonly = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zDbName, -); - -typedef _dart_sqlite3_db_readonly = int Function( - ffi.Pointer db, - ffi.Pointer zDbName, -); - -typedef _c_sqlite3_next_stmt = ffi.Pointer Function( - ffi.Pointer pDb, - ffi.Pointer pStmt, -); - -typedef _dart_sqlite3_next_stmt = ffi.Pointer Function( - ffi.Pointer pDb, - ffi.Pointer pStmt, -); - -typedef _typedefC_87 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _c_sqlite3_commit_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_commit_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _typedefC_88 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_rollback_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_rollback_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _typedefC_89 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Int64, -); - -typedef _c_sqlite3_update_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_update_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _c_sqlite3_enable_shared_cache = ffi.Int32 Function( - ffi.Int32 arg0, -); - -typedef _dart_sqlite3_enable_shared_cache = int Function( - int arg0, -); - -typedef _c_sqlite3_release_memory = ffi.Int32 Function( - ffi.Int32 arg0, -); - -typedef _dart_sqlite3_release_memory = int Function( - int arg0, -); - -typedef _c_sqlite3_db_release_memory = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_db_release_memory = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_soft_heap_limit64 = ffi.Int64 Function( - ffi.Int64 N, -); - -typedef _dart_sqlite3_soft_heap_limit64 = int Function( - int N, -); - -typedef _c_sqlite3_hard_heap_limit64 = ffi.Int64 Function( - ffi.Int64 N, -); - -typedef _dart_sqlite3_hard_heap_limit64 = int Function( - int N, -); - -typedef _c_sqlite3_soft_heap_limit = ffi.Void Function( - ffi.Int32 N, -); - -typedef _dart_sqlite3_soft_heap_limit = void Function( - int N, -); - -typedef _c_sqlite3_table_column_metadata = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zDbName, - ffi.Pointer zTableName, - ffi.Pointer zColumnName, - ffi.Pointer> pzDataType, - ffi.Pointer> pzCollSeq, - ffi.Pointer pNotNull, - ffi.Pointer pPrimaryKey, - ffi.Pointer pAutoinc, -); - -typedef _dart_sqlite3_table_column_metadata = int Function( - ffi.Pointer db, - ffi.Pointer zDbName, - ffi.Pointer zTableName, - ffi.Pointer zColumnName, - ffi.Pointer> pzDataType, - ffi.Pointer> pzCollSeq, - ffi.Pointer pNotNull, - ffi.Pointer pPrimaryKey, - ffi.Pointer pAutoinc, -); - -typedef _c_sqlite3_load_extension = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zFile, - ffi.Pointer zProc, - ffi.Pointer> pzErrMsg, -); - -typedef _dart_sqlite3_load_extension = int Function( - ffi.Pointer db, - ffi.Pointer zFile, - ffi.Pointer zProc, - ffi.Pointer> pzErrMsg, -); - -typedef _c_sqlite3_enable_load_extension = ffi.Int32 Function( - ffi.Pointer db, - ffi.Int32 onoff, -); - -typedef _dart_sqlite3_enable_load_extension = int Function( - ffi.Pointer db, - int onoff, -); - -typedef _typedefC_90 = ffi.Void Function(); - -typedef _c_sqlite3_auto_extension = ffi.Int32 Function( - ffi.Pointer> xEntryPoint, -); - -typedef _dart_sqlite3_auto_extension = int Function( - ffi.Pointer> xEntryPoint, -); - -typedef _typedefC_91 = ffi.Void Function(); - -typedef _c_sqlite3_cancel_auto_extension = ffi.Int32 Function( - ffi.Pointer> xEntryPoint, -); - -typedef _dart_sqlite3_cancel_auto_extension = int Function( - ffi.Pointer> xEntryPoint, -); - -typedef _c_sqlite3_reset_auto_extension = ffi.Void Function(); - -typedef _dart_sqlite3_reset_auto_extension = void Function(); - -typedef _c_sqlite3_create_module = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zName, - ffi.Pointer p, - ffi.Pointer pClientData, -); - -typedef _dart_sqlite3_create_module = int Function( - ffi.Pointer db, - ffi.Pointer zName, - ffi.Pointer p, - ffi.Pointer pClientData, -); - -typedef _typedefC_116 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_create_module_v2 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zName, - ffi.Pointer p, - ffi.Pointer pClientData, - ffi.Pointer> xDestroy, -); - -typedef _dart_sqlite3_create_module_v2 = int Function( - ffi.Pointer db, - ffi.Pointer zName, - ffi.Pointer p, - ffi.Pointer pClientData, - ffi.Pointer> xDestroy, -); - -typedef _c_sqlite3_drop_modules = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer> azKeep, -); - -typedef _dart_sqlite3_drop_modules = int Function( - ffi.Pointer db, - ffi.Pointer> azKeep, -); - -typedef _c_sqlite3_declare_vtab = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zSQL, -); - -typedef _dart_sqlite3_declare_vtab = int Function( - ffi.Pointer arg0, - ffi.Pointer zSQL, -); - -typedef _c_sqlite3_overload_function = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zFuncName, - ffi.Int32 nArg, -); - -typedef _dart_sqlite3_overload_function = int Function( - ffi.Pointer arg0, - ffi.Pointer zFuncName, - int nArg, -); - -typedef _c_sqlite3_blob_open = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zDb, - ffi.Pointer zTable, - ffi.Pointer zColumn, - ffi.Int64 iRow, - ffi.Int32 flags, - ffi.Pointer> ppBlob, -); - -typedef _dart_sqlite3_blob_open = int Function( - ffi.Pointer arg0, - ffi.Pointer zDb, - ffi.Pointer zTable, - ffi.Pointer zColumn, - int iRow, - int flags, - ffi.Pointer> ppBlob, -); - -typedef _c_sqlite3_blob_reopen = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int64 arg1, -); - -typedef _dart_sqlite3_blob_reopen = int Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_blob_close = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_blob_close = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_blob_bytes = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_blob_bytes = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_blob_read = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer Z, - ffi.Int32 N, - ffi.Int32 iOffset, -); - -typedef _dart_sqlite3_blob_read = int Function( - ffi.Pointer arg0, - ffi.Pointer Z, - int N, - int iOffset, -); - -typedef _c_sqlite3_blob_write = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer z, - ffi.Int32 n, - ffi.Int32 iOffset, -); - -typedef _dart_sqlite3_blob_write = int Function( - ffi.Pointer arg0, - ffi.Pointer z, - int n, - int iOffset, -); - -typedef _c_sqlite3_vfs_find = ffi.Pointer Function( - ffi.Pointer zVfsName, -); - -typedef _dart_sqlite3_vfs_find = ffi.Pointer Function( - ffi.Pointer zVfsName, -); - -typedef _c_sqlite3_vfs_register = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 makeDflt, -); - -typedef _dart_sqlite3_vfs_register = int Function( - ffi.Pointer arg0, - int makeDflt, -); - -typedef _c_sqlite3_vfs_unregister = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_vfs_unregister = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_mutex_alloc = ffi.Pointer Function( - ffi.Int32 arg0, -); - -typedef _dart_sqlite3_mutex_alloc = ffi.Pointer Function( - int arg0, -); - -typedef _c_sqlite3_mutex_free = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_mutex_free = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_mutex_enter = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_mutex_enter = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_mutex_try = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_mutex_try = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_mutex_leave = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_mutex_leave = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_mutex_held = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_mutex_held = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_mutex_notheld = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_mutex_notheld = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_db_mutex = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_db_mutex = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_file_control = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer zDbName, - ffi.Int32 op, - ffi.Pointer arg3, -); - -typedef _dart_sqlite3_file_control = int Function( - ffi.Pointer arg0, - ffi.Pointer zDbName, - int op, - ffi.Pointer arg3, -); - -typedef _c_sqlite3_test_control = ffi.Int32 Function( - ffi.Int32 op, -); - -typedef _dart_sqlite3_test_control = int Function( - int op, -); - -typedef _c_sqlite3_keyword_count = ffi.Int32 Function(); - -typedef _dart_sqlite3_keyword_count = int Function(); - -typedef _c_sqlite3_keyword_name = ffi.Int32 Function( - ffi.Int32 arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_keyword_name = int Function( - int arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _c_sqlite3_keyword_check = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_keyword_check = int Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_str_new = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_str_new = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_str_finish = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_str_finish = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_str_appendf = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer zFormat, -); - -typedef _dart_sqlite3_str_appendf = void Function( - ffi.Pointer arg0, - ffi.Pointer zFormat, -); - -typedef _c_sqlite3_str_append = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer zIn, - ffi.Int32 N, -); - -typedef _dart_sqlite3_str_append = void Function( - ffi.Pointer arg0, - ffi.Pointer zIn, - int N, -); - -typedef _c_sqlite3_str_appendall = ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer zIn, -); - -typedef _dart_sqlite3_str_appendall = void Function( - ffi.Pointer arg0, - ffi.Pointer zIn, -); - -typedef _c_sqlite3_str_appendchar = ffi.Void Function( - ffi.Pointer arg0, - ffi.Int32 N, - ffi.Int8 C, -); - -typedef _dart_sqlite3_str_appendchar = void Function( - ffi.Pointer arg0, - int N, - int C, -); - -typedef _c_sqlite3_str_reset = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_str_reset = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_str_errcode = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_str_errcode = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_str_length = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_str_length = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_str_value = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_str_value = ffi.Pointer Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_status = ffi.Int32 Function( - ffi.Int32 op, - ffi.Pointer pCurrent, - ffi.Pointer pHighwater, - ffi.Int32 resetFlag, -); - -typedef _dart_sqlite3_status = int Function( - int op, - ffi.Pointer pCurrent, - ffi.Pointer pHighwater, - int resetFlag, -); - -typedef _c_sqlite3_status64 = ffi.Int32 Function( - ffi.Int32 op, - ffi.Pointer pCurrent, - ffi.Pointer pHighwater, - ffi.Int32 resetFlag, -); - -typedef _dart_sqlite3_status64 = int Function( - int op, - ffi.Pointer pCurrent, - ffi.Pointer pHighwater, - int resetFlag, -); - -typedef _c_sqlite3_db_status = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 op, - ffi.Pointer pCur, - ffi.Pointer pHiwtr, - ffi.Int32 resetFlg, -); - -typedef _dart_sqlite3_db_status = int Function( - ffi.Pointer arg0, - int op, - ffi.Pointer pCur, - ffi.Pointer pHiwtr, - int resetFlg, -); - -typedef _c_sqlite3_stmt_status = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 op, - ffi.Int32 resetFlg, -); - -typedef _dart_sqlite3_stmt_status = int Function( - ffi.Pointer arg0, - int op, - int resetFlg, -); - -typedef _c_sqlite3_backup_init = ffi.Pointer Function( - ffi.Pointer pDest, - ffi.Pointer zDestName, - ffi.Pointer pSource, - ffi.Pointer zSourceName, -); - -typedef _dart_sqlite3_backup_init = ffi.Pointer Function( - ffi.Pointer pDest, - ffi.Pointer zDestName, - ffi.Pointer pSource, - ffi.Pointer zSourceName, -); - -typedef _c_sqlite3_backup_step = ffi.Int32 Function( - ffi.Pointer p, - ffi.Int32 nPage, -); - -typedef _dart_sqlite3_backup_step = int Function( - ffi.Pointer p, - int nPage, -); - -typedef _c_sqlite3_backup_finish = ffi.Int32 Function( - ffi.Pointer p, -); - -typedef _dart_sqlite3_backup_finish = int Function( - ffi.Pointer p, -); - -typedef _c_sqlite3_backup_remaining = ffi.Int32 Function( - ffi.Pointer p, -); - -typedef _dart_sqlite3_backup_remaining = int Function( - ffi.Pointer p, -); - -typedef _c_sqlite3_backup_pagecount = ffi.Int32 Function( - ffi.Pointer p, -); - -typedef _dart_sqlite3_backup_pagecount = int Function( - ffi.Pointer p, -); - -typedef _typedefC_147 = ffi.Void Function( - ffi.Pointer>, - ffi.Int32, -); - -typedef _c_sqlite3_unlock_notify = ffi.Int32 Function( - ffi.Pointer pBlocked, - ffi.Pointer> xNotify, - ffi.Pointer pNotifyArg, -); - -typedef _dart_sqlite3_unlock_notify = int Function( - ffi.Pointer pBlocked, - ffi.Pointer> xNotify, - ffi.Pointer pNotifyArg, -); - -typedef _c_sqlite3_stricmp = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _dart_sqlite3_stricmp = int Function( - ffi.Pointer arg0, - ffi.Pointer arg1, -); - -typedef _c_sqlite3_strnicmp = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Int32 arg2, -); - -typedef _dart_sqlite3_strnicmp = int Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, -); - -typedef _c_sqlite3_strglob = ffi.Int32 Function( - ffi.Pointer zGlob, - ffi.Pointer zStr, -); - -typedef _dart_sqlite3_strglob = int Function( - ffi.Pointer zGlob, - ffi.Pointer zStr, -); - -typedef _c_sqlite3_strlike = ffi.Int32 Function( - ffi.Pointer zGlob, - ffi.Pointer zStr, - ffi.Uint32 cEsc, -); - -typedef _dart_sqlite3_strlike = int Function( - ffi.Pointer zGlob, - ffi.Pointer zStr, - int cEsc, -); - -typedef _c_sqlite3_log = ffi.Void Function( - ffi.Int32 iErrCode, - ffi.Pointer zFormat, -); - -typedef _dart_sqlite3_log = void Function( - int iErrCode, - ffi.Pointer zFormat, -); - -typedef _typedefC_148 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, -); - -typedef _c_sqlite3_wal_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _dart_sqlite3_wal_hook = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, -); - -typedef _c_sqlite3_wal_autocheckpoint = ffi.Int32 Function( - ffi.Pointer db, - ffi.Int32 N, -); - -typedef _dart_sqlite3_wal_autocheckpoint = int Function( - ffi.Pointer db, - int N, -); - -typedef _c_sqlite3_wal_checkpoint = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zDb, -); - -typedef _dart_sqlite3_wal_checkpoint = int Function( - ffi.Pointer db, - ffi.Pointer zDb, -); - -typedef _c_sqlite3_wal_checkpoint_v2 = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zDb, - ffi.Int32 eMode, - ffi.Pointer pnLog, - ffi.Pointer pnCkpt, -); - -typedef _dart_sqlite3_wal_checkpoint_v2 = int Function( - ffi.Pointer db, - ffi.Pointer zDb, - int eMode, - ffi.Pointer pnLog, - ffi.Pointer pnCkpt, -); - -typedef _c_sqlite3_vtab_config = ffi.Int32 Function( - ffi.Pointer arg0, - ffi.Int32 op, -); - -typedef _dart_sqlite3_vtab_config = int Function( - ffi.Pointer arg0, - int op, -); - -typedef _c_sqlite3_vtab_on_conflict = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_vtab_on_conflict = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_vtab_nochange = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_vtab_nochange = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_vtab_collation = ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Int32 arg1, -); - -typedef _dart_sqlite3_vtab_collation = ffi.Pointer Function( - ffi.Pointer arg0, - int arg1, -); - -typedef _c_sqlite3_stmt_scanstatus = ffi.Int32 Function( - ffi.Pointer pStmt, - ffi.Int32 idx, - ffi.Int32 iScanStatusOp, - ffi.Pointer pOut, -); - -typedef _dart_sqlite3_stmt_scanstatus = int Function( - ffi.Pointer pStmt, - int idx, - int iScanStatusOp, - ffi.Pointer pOut, -); - -typedef _c_sqlite3_stmt_scanstatus_reset = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_stmt_scanstatus_reset = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_db_cacheflush = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_db_cacheflush = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_system_errno = ffi.Int32 Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_system_errno = int Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_snapshot_get = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer> ppSnapshot, -); - -typedef _dart_sqlite3_snapshot_get = int Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer> ppSnapshot, -); - -typedef _c_sqlite3_snapshot_open = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer pSnapshot, -); - -typedef _dart_sqlite3_snapshot_open = int Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer pSnapshot, -); - -typedef _c_sqlite3_snapshot_free = ffi.Void Function( - ffi.Pointer arg0, -); - -typedef _dart_sqlite3_snapshot_free = void Function( - ffi.Pointer arg0, -); - -typedef _c_sqlite3_snapshot_cmp = ffi.Int32 Function( - ffi.Pointer p1, - ffi.Pointer p2, -); - -typedef _dart_sqlite3_snapshot_cmp = int Function( - ffi.Pointer p1, - ffi.Pointer p2, -); - -typedef _c_sqlite3_snapshot_recover = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zDb, -); - -typedef _dart_sqlite3_snapshot_recover = int Function( - ffi.Pointer db, - ffi.Pointer zDb, -); - -typedef _c_sqlite3_serialize = ffi.Pointer Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer piSize, - ffi.Uint32 mFlags, -); - -typedef _dart_sqlite3_serialize = ffi.Pointer Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer piSize, - int mFlags, -); - -typedef _c_sqlite3_deserialize = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer pData, - ffi.Int64 szDb, - ffi.Int64 szBuf, - ffi.Uint32 mFlags, -); - -typedef _dart_sqlite3_deserialize = int Function( - ffi.Pointer db, - ffi.Pointer zSchema, - ffi.Pointer pData, - int szDb, - int szBuf, - int mFlags, -); - -typedef _typedefC_151 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, -); - -typedef _c_sqlite3_rtree_geometry_callback = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zGeom, - ffi.Pointer> xGeom, - ffi.Pointer pContext, -); - -typedef _dart_sqlite3_rtree_geometry_callback = int Function( - ffi.Pointer db, - ffi.Pointer zGeom, - ffi.Pointer> xGeom, - ffi.Pointer pContext, -); - -typedef _typedefC_152 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_153 = ffi.Void Function( - ffi.Pointer, -); - -typedef _c_sqlite3_rtree_query_callback = ffi.Int32 Function( - ffi.Pointer db, - ffi.Pointer zQueryFunc, - ffi.Pointer> xQueryFunc, - ffi.Pointer pContext, - ffi.Pointer> xDestructor, -); - -typedef _dart_sqlite3_rtree_query_callback = int Function( - ffi.Pointer db, - ffi.Pointer zQueryFunc, - ffi.Pointer> xQueryFunc, - ffi.Pointer pContext, - ffi.Pointer> xDestructor, -); - -typedef _typedefC_2 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_3 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int64, -); - -typedef _typedefC_4 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Int64, -); - -typedef _typedefC_5 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int64, -); - -typedef _typedefC_6 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_7 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_8 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_9 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_10 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_11 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_12 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_13 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_14 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_15 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32, -); - -typedef _typedefC_16 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_17 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_18 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int64, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_19 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int64, - ffi.Pointer, -); - -typedef _typedefC_20 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_21 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_22 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_23 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_24 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_25 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_27 = ffi.Void Function(); - -typedef _typedefC_26 = ffi.Pointer> Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_28 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_29 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_30 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_31 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_32 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_33 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef sqlite3_syscall_ptr = ffi.Void Function(); - -typedef _typedefC_34 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, -); - -typedef _typedefC_35 = ffi.Pointer> - Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_36 = ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_37 = ffi.Pointer Function( - ffi.Int32, -); - -typedef _typedefC_38 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_39 = ffi.Pointer Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_40 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_41 = ffi.Int32 Function( - ffi.Int32, -); - -typedef _typedefC_42 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_43 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_92 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>, -); - -typedef _typedefC_93 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>, -); - -typedef _typedefC_94 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_95 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_96 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_97 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer>, -); - -typedef _typedefC_98 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_99 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_100 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_101 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_102 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_103 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_104 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer, -); - -typedef _typedefC_105 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_106 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_107 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_108 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_109 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_110 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer>>, - ffi.Pointer>, -); - -typedef _typedefC_111 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_112 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_113 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_114 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_115 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_117 = ffi.Int32 Function(); - -typedef _typedefC_118 = ffi.Int32 Function(); - -typedef _typedefC_119 = ffi.Pointer Function( - ffi.Int32, -); - -typedef _typedefC_120 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_121 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_122 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_123 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_124 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_125 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_126 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_127 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_128 = ffi.Pointer Function( - ffi.Int32, - ffi.Int32, - ffi.Int32, -); - -typedef _typedefC_129 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_130 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_131 = ffi.Pointer Function( - ffi.Pointer, - ffi.Uint32, - ffi.Int32, -); - -typedef _typedefC_132 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_133 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint32, - ffi.Uint32, -); - -typedef _typedefC_134 = ffi.Void Function( - ffi.Pointer, - ffi.Uint32, -); - -typedef _typedefC_135 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_136 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_137 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_138 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_139 = ffi.Pointer Function( - ffi.Int32, - ffi.Int32, -); - -typedef _typedefC_140 = ffi.Void Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_141 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_142 = ffi.Pointer Function( - ffi.Pointer, - ffi.Uint32, - ffi.Int32, -); - -typedef _typedefC_143 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_144 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Uint32, - ffi.Uint32, -); - -typedef _typedefC_145 = ffi.Void Function( - ffi.Pointer, - ffi.Uint32, -); - -typedef _typedefC_146 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_149 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_150 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_154 = ffi.Pointer Function( - ffi.Pointer, -); - -typedef _typedefC_155 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_156 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_157 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_158 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32, -); - -typedef _typedefC_159 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer>, -); - -typedef _typedefC_160 = ffi.Int32 Function( - ffi.Pointer, -); - -typedef _typedefC_161 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_162 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_163 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_164 = ffi.Int64 Function( - ffi.Pointer, -); - -typedef _typedefC_165 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, - ffi.Pointer, -); - -typedef _typedefC_166 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, -); - -typedef _typedefC_167 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_168 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer>, -); - -typedef _typedefC_169 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_170 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, -); - -typedef _typedefC_171 = ffi.Pointer Function( - ffi.Pointer, - ffi.Int32, -); - -typedef _typedefC_172 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_173 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_174 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_175 = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, -); - -typedef _typedefC_176 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_177 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_178 = ffi.Int32 Function( - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Int32, - ffi.Int32, -); - -typedef _typedefC_179 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_180 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_181 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, -); - -typedef _typedefC_182 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, -); - -typedef fts5_extension_function = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>, -); - -typedef _typedefC_183 = ffi.Void Function( - ffi.Pointer, -); - -typedef _typedefC_184 = ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, -); diff --git a/test/large_integration_tests/large_test.dart b/test/large_integration_tests/large_test.dart index b7cf797d..35bb635d 100644 --- a/test/large_integration_tests/large_test.dart +++ b/test/large_integration_tests/large_test.dart @@ -37,6 +37,9 @@ ${strings.headers}: - '**Documentation.h' - '**FataErrorHandler.h' - '**Index.h' +${strings.typedefmap}: + 'size_t': 'IntPtr' + 'time_t': 'Int64' ''') as YamlMap); final library = parse(config); @@ -59,6 +62,8 @@ ${strings.headers}: - third_party/cjson_library/cJSON.h ${strings.includeDirectives}: - '**cJSON.h' +${strings.typedefmap}: + 'size_t': 'IntPtr' ''') as YamlMap); final library = parse(config); diff --git a/test/native_test/native_test_bindings.dart b/test/native_test/native_test_bindings.dart index 620771c3..ef7ee459 100644 --- a/test/native_test/native_test_bindings.dart +++ b/test/native_test/native_test_bindings.dart @@ -29,9 +29,10 @@ class NativeLibrary { } late final _Function1Bool_ptr = - _lookup>('Function1Bool'); - late final _dart_Function1Bool _Function1Bool = - _Function1Bool_ptr.asFunction<_dart_Function1Bool>(); + _lookup>( + 'Function1Bool'); + late final _Function1Bool = + _Function1Bool_ptr.asFunction(); int Function1Uint8( int x, @@ -42,9 +43,10 @@ class NativeLibrary { } late final _Function1Uint8_ptr = - _lookup>('Function1Uint8'); - late final _dart_Function1Uint8 _Function1Uint8 = - _Function1Uint8_ptr.asFunction<_dart_Function1Uint8>(); + _lookup>( + 'Function1Uint8'); + late final _Function1Uint8 = + _Function1Uint8_ptr.asFunction(); int Function1Uint16( int x, @@ -55,9 +57,10 @@ class NativeLibrary { } late final _Function1Uint16_ptr = - _lookup>('Function1Uint16'); - late final _dart_Function1Uint16 _Function1Uint16 = - _Function1Uint16_ptr.asFunction<_dart_Function1Uint16>(); + _lookup>( + 'Function1Uint16'); + late final _Function1Uint16 = + _Function1Uint16_ptr.asFunction(); int Function1Uint32( int x, @@ -68,9 +71,10 @@ class NativeLibrary { } late final _Function1Uint32_ptr = - _lookup>('Function1Uint32'); - late final _dart_Function1Uint32 _Function1Uint32 = - _Function1Uint32_ptr.asFunction<_dart_Function1Uint32>(); + _lookup>( + 'Function1Uint32'); + late final _Function1Uint32 = + _Function1Uint32_ptr.asFunction(); int Function1Uint64( int x, @@ -81,9 +85,10 @@ class NativeLibrary { } late final _Function1Uint64_ptr = - _lookup>('Function1Uint64'); - late final _dart_Function1Uint64 _Function1Uint64 = - _Function1Uint64_ptr.asFunction<_dart_Function1Uint64>(); + _lookup>( + 'Function1Uint64'); + late final _Function1Uint64 = + _Function1Uint64_ptr.asFunction(); int Function1Int8( int x, @@ -94,9 +99,9 @@ class NativeLibrary { } late final _Function1Int8_ptr = - _lookup>('Function1Int8'); - late final _dart_Function1Int8 _Function1Int8 = - _Function1Int8_ptr.asFunction<_dart_Function1Int8>(); + _lookup>('Function1Int8'); + late final _Function1Int8 = + _Function1Int8_ptr.asFunction(); int Function1Int16( int x, @@ -107,9 +112,10 @@ class NativeLibrary { } late final _Function1Int16_ptr = - _lookup>('Function1Int16'); - late final _dart_Function1Int16 _Function1Int16 = - _Function1Int16_ptr.asFunction<_dart_Function1Int16>(); + _lookup>( + 'Function1Int16'); + late final _Function1Int16 = + _Function1Int16_ptr.asFunction(); int Function1Int32( int x, @@ -120,9 +126,10 @@ class NativeLibrary { } late final _Function1Int32_ptr = - _lookup>('Function1Int32'); - late final _dart_Function1Int32 _Function1Int32 = - _Function1Int32_ptr.asFunction<_dart_Function1Int32>(); + _lookup>( + 'Function1Int32'); + late final _Function1Int32 = + _Function1Int32_ptr.asFunction(); int Function1Int64( int x, @@ -133,9 +140,10 @@ class NativeLibrary { } late final _Function1Int64_ptr = - _lookup>('Function1Int64'); - late final _dart_Function1Int64 _Function1Int64 = - _Function1Int64_ptr.asFunction<_dart_Function1Int64>(); + _lookup>( + 'Function1Int64'); + late final _Function1Int64 = + _Function1Int64_ptr.asFunction(); int Function1IntPtr( int x, @@ -146,9 +154,10 @@ class NativeLibrary { } late final _Function1IntPtr_ptr = - _lookup>('Function1IntPtr'); - late final _dart_Function1IntPtr _Function1IntPtr = - _Function1IntPtr_ptr.asFunction<_dart_Function1IntPtr>(); + _lookup>( + 'Function1IntPtr'); + late final _Function1IntPtr = + _Function1IntPtr_ptr.asFunction(); double Function1Float( double x, @@ -159,9 +168,10 @@ class NativeLibrary { } late final _Function1Float_ptr = - _lookup>('Function1Float'); - late final _dart_Function1Float _Function1Float = - _Function1Float_ptr.asFunction<_dart_Function1Float>(); + _lookup>( + 'Function1Float'); + late final _Function1Float = + _Function1Float_ptr.asFunction(); double Function1Double( double x, @@ -172,18 +182,20 @@ class NativeLibrary { } late final _Function1Double_ptr = - _lookup>('Function1Double'); - late final _dart_Function1Double _Function1Double = - _Function1Double_ptr.asFunction<_dart_Function1Double>(); + _lookup>( + 'Function1Double'); + late final _Function1Double = + _Function1Double_ptr.asFunction(); ffi.Pointer getStruct1() { return _getStruct1(); } late final _getStruct1_ptr = - _lookup>('getStruct1'); - late final _dart_getStruct1 _getStruct1 = - _getStruct1_ptr.asFunction<_dart_getStruct1>(); + _lookup Function()>>( + 'getStruct1'); + late final _getStruct1 = + _getStruct1_ptr.asFunction Function()>(); Struct3 Function1StructReturnByValue( int a, @@ -197,12 +209,12 @@ class NativeLibrary { ); } - late final _Function1StructReturnByValue_ptr = - _lookup>( - 'Function1StructReturnByValue'); - late final _dart_Function1StructReturnByValue _Function1StructReturnByValue = - _Function1StructReturnByValue_ptr.asFunction< - _dart_Function1StructReturnByValue>(); + late final _Function1StructReturnByValue_ptr = _lookup< + ffi.NativeFunction< + Struct3 Function(ffi.Int32, ffi.Int32, + ffi.Int32)>>('Function1StructReturnByValue'); + late final _Function1StructReturnByValue = _Function1StructReturnByValue_ptr + .asFunction(); int Function1StructPassByValue( Struct3 sum_a_b_c, @@ -213,11 +225,10 @@ class NativeLibrary { } late final _Function1StructPassByValue_ptr = - _lookup>( + _lookup>( 'Function1StructPassByValue'); - late final _dart_Function1StructPassByValue _Function1StructPassByValue = - _Function1StructPassByValue_ptr.asFunction< - _dart_Function1StructPassByValue>(); + late final _Function1StructPassByValue = + _Function1StructPassByValue_ptr.asFunction(); } class Struct1 extends ffi.Struct { @@ -238,123 +249,3 @@ class Struct3 extends ffi.Struct { @ffi.Int32() external int c; } - -typedef _c_Function1Bool = ffi.Uint8 Function( - ffi.Uint8 x, -); - -typedef _dart_Function1Bool = int Function( - int x, -); - -typedef _c_Function1Uint8 = ffi.Uint8 Function( - ffi.Uint8 x, -); - -typedef _dart_Function1Uint8 = int Function( - int x, -); - -typedef _c_Function1Uint16 = ffi.Uint16 Function( - ffi.Uint16 x, -); - -typedef _dart_Function1Uint16 = int Function( - int x, -); - -typedef _c_Function1Uint32 = ffi.Uint32 Function( - ffi.Uint32 x, -); - -typedef _dart_Function1Uint32 = int Function( - int x, -); - -typedef _c_Function1Uint64 = ffi.Uint64 Function( - ffi.Uint64 x, -); - -typedef _dart_Function1Uint64 = int Function( - int x, -); - -typedef _c_Function1Int8 = ffi.Int8 Function( - ffi.Int8 x, -); - -typedef _dart_Function1Int8 = int Function( - int x, -); - -typedef _c_Function1Int16 = ffi.Int16 Function( - ffi.Int16 x, -); - -typedef _dart_Function1Int16 = int Function( - int x, -); - -typedef _c_Function1Int32 = ffi.Int32 Function( - ffi.Int32 x, -); - -typedef _dart_Function1Int32 = int Function( - int x, -); - -typedef _c_Function1Int64 = ffi.Int64 Function( - ffi.Int64 x, -); - -typedef _dart_Function1Int64 = int Function( - int x, -); - -typedef _c_Function1IntPtr = ffi.IntPtr Function( - ffi.IntPtr x, -); - -typedef _dart_Function1IntPtr = int Function( - int x, -); - -typedef _c_Function1Float = ffi.Float Function( - ffi.Float x, -); - -typedef _dart_Function1Float = double Function( - double x, -); - -typedef _c_Function1Double = ffi.Double Function( - ffi.Double x, -); - -typedef _dart_Function1Double = double Function( - double x, -); - -typedef _c_getStruct1 = ffi.Pointer Function(); - -typedef _dart_getStruct1 = ffi.Pointer Function(); - -typedef _c_Function1StructReturnByValue = Struct3 Function( - ffi.Int32 a, - ffi.Int32 b, - ffi.Int32 c, -); - -typedef _dart_Function1StructReturnByValue = Struct3 Function( - int a, - int b, - int c, -); - -typedef _c_Function1StructPassByValue = ffi.Int32 Function( - Struct3 sum_a_b_c, -); - -typedef _dart_Function1StructPassByValue = int Function( - Struct3 sum_a_b_c, -); diff --git a/test/rename_tests/rename.h b/test/rename_tests/rename.h index 8ff6d88c..71ec5bc5 100644 --- a/test/rename_tests/rename.h +++ b/test/rename_tests/rename.h @@ -26,10 +26,15 @@ struct AnyMatchStruct5 int _underscore; }; +typedef struct Struct5{ + int a; +} Struct5_Alias; + void func1(struct Struct1 *s); void test_func2(struct Test_Struct2 *s); void fullMatch_func3(struct FullMatchStruct3 *s); void memberRename_func4(int _underscore, float fullMatch, int); +void typedefRenameFunc(Struct5_Alias s); enum Enum1 { diff --git a/test/rename_tests/rename_test.dart b/test/rename_tests/rename_test.dart index bb4f0ee5..f362a114 100644 --- a/test/rename_tests/rename_test.dart +++ b/test/rename_tests/rename_test.dart @@ -31,7 +31,7 @@ ${strings.headers}: ${strings.entryPoints}: - 'test/rename_tests/rename.h' -functions: +${strings.functions}: ${strings.rename}: 'test_(.*)': '\$1' '.*': '$functionPrefix\$0' @@ -42,7 +42,7 @@ functions: 'fullMatch': 'fullMatchSuccess' '': 'unnamed' -structs: +${strings.structs}: ${strings.rename}: 'Test_(.*)': '\$1' '.*': '$structPrefix\$0' @@ -54,7 +54,7 @@ structs: '.*': '_(.*)': '\$1' -enums: +${strings.enums}: ${strings.rename}: 'Test_(.*)': '\$1' '.*': '$enumPrefix\$0' @@ -64,17 +64,20 @@ enums: '_(.*)': '\$1' 'fullMatch': 'fullMatchSuccess' -unnamed-enums: +${strings.unnamedEnums}: ${strings.rename}: '_(.*)': '\$1' 'unnamedFullMatch': 'unnamedFullMatchSuccess' -macros: +${strings.macros}: ${strings.rename}: 'Test_(.*)': '\$1' '.*': '$macroPrefix\$0' 'FullMatchMacro3': 'Macro3' +${strings.typedefs}: + ${strings.rename}: + 'Struct5_Alias': 'Struct5_Alias_Renamed' ''') as yaml.YamlMap)); }); @@ -150,6 +153,10 @@ macros: expect(actual.getBindingAsString('unnamedFullMatchSuccess'), expected.getBindingAsString('unnamedFullMatchSuccess')); }); + test('typedef rename', () { + expect(actual.getBindingAsString('Struct5_Alias_Renamed'), + expected.getBindingAsString('Struct5_Alias_Renamed')); + }); }); } @@ -220,6 +227,21 @@ Library expectedLibrary() { ), ], ), + Func( + name: '${functionPrefix}typedefRenameFunc', + originalName: 'typedefRenameFunc', + returnType: Type.nativeType( + SupportedNativeType.Void, + ), + parameters: [ + Parameter( + name: 's', + type: Type.typealias(Typealias( + name: 'Struct5_Alias_Renamed', + type: Type.struct(Struc(name: '${structPrefix}Struct5')))), + ), + ], + ), struc1, struc2, struc3,