Skip to content

Commit e3e6340

Browse files
authored
[ffigen] Update urls after repo merge (#203)
Bug: * https://github.com/dart-lang/ffigen/issues/635
1 parent b90e4e8 commit e3e6340

File tree

9 files changed

+59
-56
lines changed

9 files changed

+59
-56
lines changed

pkgs/ffigen/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
[![pub package](https://img.shields.io/pub/v/ffigen.svg)](https://pub.dev/packages/ffigen)
2-
[![ffigen](https://github.com/dart-lang/native/actions/workflows/ffigen.yml/badge.svg)](https://github.com/dart-lang/native/actions/workflows/ffigen.yml)
1+
[![Build Status](https://github.com/dart-lang/native/actions/workflows/ffigen.yml/badge.svg)](https://github.com/dart-lang/native/actions/workflows/ffigen.yml)
32
[![Coverage Status](https://coveralls.io/repos/github/dart-lang/native/badge.svg?branch=main)](https://coveralls.io/github/dart-lang/native?branch=main)
3+
[![pub package](https://img.shields.io/pub/v/ffigen.svg)](https://pub.dev/packages/ffigen)
4+
[![package publisher](https://img.shields.io/pub/publisher/ffigen.svg)](https://pub.dev/packages/ffigen/publisher)
45

56
Binding generator for [FFI](https://dart.dev/guides/libraries/c-interop) bindings.
67

pkgs/ffigen/example/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Examples
22

3-
- [Simple](https://github.com/dart-lang/ffigen/tree/main/example/simple)
4-
- [cJSON](https://github.com/dart-lang/ffigen/tree/main/example/c_json)
5-
- [LibClang](https://github.com/dart-lang/ffigen/tree/main/example/libclang-example)
6-
- [ObjectiveC](https://github.com/dart-lang/ffigen/tree/main/example/objective_c)
7-
- [Swift](https://github.com/dart-lang/ffigen/tree/main/example/swift)
3+
- [Simple](https://github.com/dart-lang/native/tree/main/pkgs/ffigen/example/simple)
4+
- [cJSON](https://github.com/dart-lang/native/tree/main/pkgs/ffigen/example/c_json)
5+
- [LibClang](https://github.com/dart-lang/native/tree/main/pkgs/ffigen/example/libclang-example)
6+
- [ObjectiveC](https://github.com/dart-lang/native/tree/main/pkgs/ffigen/example/objective_c)
7+
- [Swift](https://github.com/dart-lang/native/tree/main/pkgs/ffigen/example/swift)

pkgs/ffigen/example/libclang-example/config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ output: 'generated_bindings.dart'
1010
# - '/usr/local/opt/llvm'
1111

1212
# Bash style Glob matching is also supported.
13-
# TODO(11): Globs dont work on windows if they begin with '.' or '..'.
13+
# TODO(https://github.com/dart-lang/ffigen/issues/11): Globs dont work on
14+
# windows if they begin with '.' or '..'.
1415
headers:
1516
entry-points:
1617
- ../../third_party/libclang/include/clang-c/Index.h
@@ -33,7 +34,7 @@ functions:
3334
- 'clang_.*' # Typedefs for Native and Dart type for these functions will be generated.
3435
structs:
3536
include:
36-
- 'CX.*'
37+
- 'CX.*'
3738
enums:
3839
include:
3940
- 'CXTypeKind' # Full names are given higher priority than regexp.

pkgs/ffigen/example/swift/example.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'dart:ffi';
66
import 'swift_api_bindings.dart';
77

88
void main() {
9-
// TODO(#443): Add a test for this.
9+
// TODO(https://github.com/dart-lang/ffigen/issues/443): Add a test for this.
1010
final lib = SwiftLibrary(DynamicLibrary.open('libswiftapi.dylib'));
1111
final object = SwiftClass.new1(lib);
1212
print(object.sayHello());

pkgs/ffigen/lib/src/header_parser/sub_parsers/compounddecl_parser.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,13 @@ int _compoundMembersVisitor(clang_types.CXCursor cursor,
255255

256256
final mt = cursor.toCodeGenType();
257257
if (mt is IncompleteArray) {
258-
// TODO(68): Structs with flexible Array Members are not supported.
258+
// TODO(https://github.com/dart-lang/ffigen/issues/68): Structs with
259+
// flexible Array Members are not supported.
259260
parsed.flexibleArrayMember = true;
260261
}
261262
if (clang.clang_getFieldDeclBitWidth(cursor) != -1) {
262-
// TODO(84): Struct with bitfields are not suppoorted.
263+
// TODO(https://github.com/dart-lang/ffigen/issues/84): Struct with
264+
// bitfields are not suppoorted.
263265
parsed.bitFieldMember = true;
264266
}
265267
if (mt is HandleType) {

pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ BindingType? parseObjCCategoryDeclaration(clang_types.CXCursor cursor) {
302302
return null;
303303
}
304304

305-
// TODO(#347): Currently any interface with a category bypasses the filters.
305+
// TODO(https://github.com/dart-lang/ffigen/issues/347): Currently any
306+
// interface with a category bypasses the filters.
306307
final itf = itfCursor.type().toCodeGenType();
307308
if (itf is! ObjCInterface) {
308309
_logger.severe(

pkgs/ffigen/test/README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[![Build Status](https://github.com/dart-lang/ffigen/workflows/Dart%20CI/badge.svg)](https://github.com/dart-lang/ffigen/actions?query=workflow%3A"Dart+CI")
2-
[![Coverage Status](https://coveralls.io/repos/github/dart-lang/ffigen/badge.svg?branch=main)](https://coveralls.io/github/dart-lang/ffigen?branch=main)
3-
41
# ffigen testing
52

63
## Running Tests
@@ -23,18 +20,18 @@
2320
Some tests verify that the generated Dart FFI bindings match a golden file.
2421

2522
For example, the test
26-
[`test/native_test/native_test.dart`](https://github.com/dart-lang/ffigen/blob/main/test/native_test/native_test.dart)
23+
[`test/native_test/native_test.dart`](https://github.com/dart-lang/native/tree/main/pkgs/ffigen/test/native_test/native_test.dart)
2724
works by:
2825

2926
1. Loading the dynamic library for
30-
[`test/native_test/native_test.c`](https://github.com/dart-lang/ffigen/blob/main/test/native_test/native_test.c)
27+
[`test/native_test/native_test.c`](https://github.com/dart-lang/native/tree/main/pkgs/ffigen/test/native_test/native_test.c)
3128
(which was generated by `dart run test/setup.dart`).
3229

3330
2. Generating binding files for that dynamic library in the
3431
`test/debug_generated` directory.
3532

3633
3. Comparing the golden file (i.e.
37-
[`test/native_test/_expected_native_test_bindings.dart`](https://github.com/dart-lang/ffigen/blob/main/test/native_test/_expected_native_test_bindings.dart))
34+
[`test/native_test/_expected_native_test_bindings.dart`](https://github.com/dart-lang/native/tree/main/pkgs/ffigen/test/native_test/_expected_native_test_bindings.dart))
3835
to the generated file and generating a test failure if they do not match.
3936

4037
4. Using the *golden* bindings to excercise the dynamic library.

pkgs/ffigen/test/header_parser_tests/struct_fptr_fields.h

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,37 @@
44

55
typedef int (*ArithmeticOperation)(int a, int b);
66

7-
struct S
8-
{
9-
// Function pointer field, but no parameters.
10-
int (*func1)(void);
11-
// Function pointer field with parameters.
12-
int (*comparator)(int a, int b);
13-
// Function pointer field with lot of parameters
14-
int (*veryManyArguments)(double a, float b, char *c, int d, long long e);
15-
// Function pointer field with parameters, but no names
16-
int (*argsDontHaveNames)(int, int, int, float, char *);
17-
// Function pointer through typedef
18-
ArithmeticOperation operation;
19-
// Pointer to function pointer
20-
void (**sortPtr)(int *array, int len);
21-
// Function pointer with a function pointer parameter
22-
void (*sortBy)(int *array, int len, int (*evaluator)(int x));
23-
// Function where few parameters are named. This should not
24-
// produce parameters in output.
25-
void (*improperlyDeclaredParams)(int a, int, char);
26-
// Function pointer with 2 function pointer parameters
27-
void (*sortByWithFallback)(int *array,
28-
int (*primaryEvaluator)(int x),
29-
int (*fallbackEvaluator)(int x));
7+
struct S {
8+
// Function pointer field, but no parameters.
9+
int (*func1)(void);
10+
// Function pointer field with parameters.
11+
int (*comparator)(int a, int b);
12+
// Function pointer field with lot of parameters
13+
int (*veryManyArguments)(double a, float b, char *c, int d, long long e);
14+
// Function pointer field with parameters, but no names
15+
int (*argsDontHaveNames)(int, int, int, float, char *);
16+
// Function pointer through typedef
17+
ArithmeticOperation operation;
18+
// Pointer to function pointer
19+
void (**sortPtr)(int *array, int len);
20+
// Function pointer with a function pointer parameter
21+
void (*sortBy)(int *array, int len, int (*evaluator)(int x));
22+
// Function where few parameters are named. This should not
23+
// produce parameters in output.
24+
void (*improperlyDeclaredParams)(int a, int, char);
25+
// Function pointer with 2 function pointer parameters
26+
void (*sortByWithFallback)(int *array, int (*primaryEvaluator)(int x),
27+
int (*fallbackEvaluator)(int x));
3028

31-
// TODO(#545): Handle remaining cases of parsing param names
32-
// ---
33-
// Array of function pointers. Does not produce proper output right now.
34-
void (*manyFunctions[2])(char a, char b);
35-
// Function pointer returning function pointer. Does not produce valid output.
36-
int (*(*functionReturningFunction)(int a, int b))(int c, int d);
37-
// Function pointer returning function pointer. The return type has param
38-
// names, but the function itself doesn't. This also shouldn't produce
39-
// any parameters in output.
40-
int (*(*functionReturningFunctionImproper)(int a, int b))(int, int);
29+
// TODO(https://github.com/dart-lang/ffigen/issues/545): Handle remaining
30+
// cases of parsing param names.
31+
// ---
32+
// Array of function pointers. Does not produce proper output right now.
33+
void (*manyFunctions[2])(char a, char b);
34+
// Function pointer returning function pointer. Does not produce valid output.
35+
int (*(*functionReturningFunction)(int a, int b))(int c, int d);
36+
// Function pointer returning function pointer. The return type has param
37+
// names, but the function itself doesn't. This also shouldn't produce
38+
// any parameters in output.
39+
int (*(*functionReturningFunctionImproper)(int a, int b))(int, int);
4140
};
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#import <Foundation/NSObject.h>
22
#import <Foundation/NSString.h>
33

4-
// TODO(#309): strConcat should just be a static function.
5-
@interface StringUtil : NSObject {}
6-
+ (NSString*)strConcat:(NSString*)a with:(NSString*)b;
4+
// TODO(https://github.com/dart-lang/ffigen/issues/309): strConcat should just
5+
// be a static function.
6+
@interface StringUtil : NSObject {
7+
}
8+
+ (NSString *)strConcat:(NSString *)a with:(NSString *)b;
79
@end
810

911
@implementation StringUtil
10-
+ (NSString*)strConcat:(NSString*)a with:(NSString*)b {
12+
+ (NSString *)strConcat:(NSString *)a with:(NSString *)b {
1113
return [a stringByAppendingString:b];
1214
}
1315
@end

0 commit comments

Comments
 (0)