Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
Merge 30cab3e into c70e29c
Browse files Browse the repository at this point in the history
  • Loading branch information
mannprerak2 committed Aug 11, 2020
2 parents c70e29c + 30cab3e commit 18eb236
Show file tree
Hide file tree
Showing 11 changed files with 378 additions and 20 deletions.
26 changes: 23 additions & 3 deletions example/c_json/cjson_generated_bindings.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
/// AUTO GENERATED FILE, DO NOT EDIT.
///
/// Generated by `package:ffigen`.
// Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
import 'dart:ffi' as ffi;

/// Holds bindings to cJSON.
Expand Down
25 changes: 25 additions & 0 deletions example/c_json/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,28 @@ ffigen:
include-directives:
- '**cJSON.h'
comments: false

preamble: |
// Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
11 changes: 8 additions & 3 deletions example/libclang-example/generated_bindings.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/// AUTO GENERATED FILE, DO NOT EDIT.
///
/// Generated by `package:ffigen`.
// Part of the LLVM Project, under the Apache License v2.0 with LLVM
// Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.

import 'dart:ffi' as ffi;

Expand Down
17 changes: 11 additions & 6 deletions example/libclang-example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,19 @@ ffigen:
# False by default.
array-workaround: true

# The header of the file, this is pasted as it is.
preamble: |
/// AUTO GENERATED FILE, DO NOT EDIT.
///
/// Generated by `package:ffigen`.
# Doc Comments for generated binings.
# Comments can be disabled by using comments: false
comments:
style: doxygen # Options - doxygen(default) / any.
length: full # Options - brief / full(default).

# The header of the file, this is pasted as it is.
preamble: |
// Part of the LLVM Project, under the Apache License v2.0 with LLVM
// Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
12 changes: 9 additions & 3 deletions lib/src/header_parser/clang_bindings/clang_bindings.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/// AUTO GENERATED FILE, DO NOT EDIT.
///
/// Generated by `package:ffigen`.
// Part of the LLVM Project, under the Apache License v2.0 with LLVM
// Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.

import 'dart:ffi' as ffi;

/// Holds bindings to LibClang.
Expand Down
25 changes: 24 additions & 1 deletion test/example_tests/cjson_example_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,30 @@ ${strings.headers}:
${strings.includeDirectives}:
- '**cJSON.h'
${strings.comments}: false
''') as YamlMap);
${strings.preamble}: |
// Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.''') as YamlMap);
final library = parse(config);

matchLibraryWithExpected(
Expand Down
14 changes: 10 additions & 4 deletions test/example_tests/libclang_example_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,19 @@ ${strings.enums}:
${strings.name}: 'LibClang'
${strings.description}: 'Holds bindings to LibClang.'
${strings.arrayWorkaround}: true
${strings.preamble}: |
/// AUTO GENERATED FILE, DO NOT EDIT.
///
/// Generated by `package:ffigen`.
${strings.comments}:
${strings.style}: ${strings.doxygen}
${strings.length}: ${strings.full}
${strings.preamble}: |
// Part of the LLVM Project, under the Apache License v2.0 with LLVM
// Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
''') as YamlMap);
final library = parse(config);

Expand Down
24 changes: 24 additions & 0 deletions third_party/cjson_library/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Copyright (c) 2009-2017 Dave Gamble and cJSON contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


Files generated from cJSON source code are
- example/c_json/cjson_generated_bindings.dart
- test/large_integration_tests/_expected_cjson_bindings.dart

0 comments on commit 18eb236

Please sign in to comment.