Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ffi-export-predicate #101

Merged
merged 1 commit into from Sep 24, 2016

Conversation

cbaggers
Copy link
Contributor

@cbaggers cbaggers commented Sep 22, 2016

This allows the user to provide a predicate to determine which of the generated symbols will be exported from the cffi/c2ffi specified package.

By default no symbols are exported (so that the current behaviour is maintained)

The predicate is specified in same the fashion as :ffi-type-transformer & :ffi-name-transformer

    :ffi-export-predicate "test-c2ffi.ffi::ffi-export-predicate"

The predicate function has the following form

(defun ffi-export-predicate (symbol)
  (alexandria:starts-with-subseq "NK-" (symbol-name symbol)))

We also switch to using uiop's define-package so that using asdf:load-system :force t doesnt throw errors when it hits defpackage

This allows the user to provide a predicate to determine which of the
generated symbols will be exported from the cffi/c2ffi specified
package.

By default no symbols are exported (so the current behaviour is maintained)

The predicate is specified in the fashion as :ffi-type-transformer &
:ffi-name-transformer

```
    :ffi-export-predicate "test-c2ffi.ffi::ffi-export-predicate"
```

The predicate function has the following form

```
(defun ffi-export-predicate (symbol)
  (alexandria:starts-with-subseq "NK-" (symbol-name symbol)))
```
@cbaggers cbaggers force-pushed the feature-c2ffi-export-predicate branch from a99875b to 2dbed5f Compare September 23, 2016 14:37
@attila-lendvai attila-lendvai merged commit 88e9616 into cffi:master Sep 24, 2016
@attila-lendvai
Copy link
Member

thanks, merged with a small follow-up commit that makes sure that the predicate accepts &allow-other-keys for future extendability.

@cbaggers
Copy link
Contributor Author

Thanks man, that's great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants