Merge branch 'lyze-cffi-export-package'
* lyze-cffi-export-package: Add user documentation to the export package extension. Extend the export feature in the CFFI module to support exporting to a particular package.
This commit is contained in:
commit
0ee304188c
3 changed files with 20 additions and 10 deletions
|
|
@ -5,6 +5,10 @@ See the RELEASENOTES file for a summary of changes in each release.
|
||||||
Version 3.0.8 (in progress)
|
Version 3.0.8 (in progress)
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
2015-09-09: lyze
|
||||||
|
[CFFI] Extend the "export" feature in the CFFI module to support
|
||||||
|
exporting to a specified package.
|
||||||
|
|
||||||
2015-09-04: olly
|
2015-09-04: olly
|
||||||
[Python] Fix docstrings for %callback functions.
|
[Python] Fix docstrings for %callback functions.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -284,9 +284,11 @@ Let's edit the interface file such that the C type "div_t*" is changed
|
||||||
%feature("export");
|
%feature("export");
|
||||||
|
|
||||||
%feature("inline") lispsort_double;
|
%feature("inline") lispsort_double;
|
||||||
|
|
||||||
%feature("intern_function", "my-lispify") lispsort_double;
|
%feature("intern_function", "my-lispify") lispsort_double;
|
||||||
|
%feature("export", package="'some-other-package") lispsort_double;
|
||||||
|
|
||||||
%rename func123 renamed_cool_func;
|
%rename func123 renamed_cool_func;
|
||||||
|
|
||||||
%ignore "pointer_func";
|
%ignore "pointer_func";
|
||||||
|
|
||||||
%include "test.h"
|
%include "test.h"
|
||||||
|
|
@ -310,11 +312,12 @@ The feature <i>intern_function</i> ensures that all C names are
|
||||||
lispsort_double;</i>, here we are using an additional feature
|
lispsort_double;</i>, here we are using an additional feature
|
||||||
which allows us to use our lispify function.
|
which allows us to use our lispify function.
|
||||||
</p>
|
</p>
|
||||||
<p>The <i>export</i> feature allows us to export the symbols. The <i>inline</i>
|
<p>The <i>export</i> feature allows us to export the symbols. If
|
||||||
feature declaims the declared function as inline. The <i>rename</i>
|
the <i>package</i> argument is given, then the symbol will be exported to
|
||||||
directive allows us to change the name(it is useful when
|
the specified Lisp package. The <i>inline</i> feature declaims the
|
||||||
generating C wrapper code for handling overloaded
|
declared function as inline. The <i>rename</i> directive allows us to
|
||||||
functions). The <i>ignore</i> directive ignores a certain
|
change the name(it is useful when generating C wrapper code for handling
|
||||||
|
overloaded functions). The <i>ignore</i> directive ignores a certain
|
||||||
declaration.
|
declaration.
|
||||||
</p>
|
</p>
|
||||||
<p>There are several other things which are possible, to see some
|
<p>There are several other things which are possible, to see some
|
||||||
|
|
@ -381,7 +384,7 @@ The feature <i>intern_function</i> ensures that all C names are
|
||||||
(n :int)
|
(n :int)
|
||||||
(array :pointer))
|
(array :pointer))
|
||||||
|
|
||||||
(cl:export '#.(my-lispify "lispsort_double" 'function))
|
(cl:export '#.(my-lispify "lispsort_double" 'function) 'some-other-package)
|
||||||
|
|
||||||
(cffi:defcenum #.(swig-lispify "color" 'enumname)
|
(cffi:defcenum #.(swig-lispify "color" 'enumname)
|
||||||
#.(swig-lispify "RED" 'enumvalue :keyword)
|
#.(swig-lispify "RED" 'enumvalue :keyword)
|
||||||
|
|
|
||||||
|
|
@ -860,8 +860,11 @@ void CFFI::emit_struct_union(Node *n, bool un = false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFFI::emit_export(Node *n, String *name) {
|
void CFFI::emit_export(Node *n, String *name) {
|
||||||
if (GetInt(n, "feature:export"))
|
if (GetInt(n, "feature:export")) {
|
||||||
Printf(f_cl, "\n(cl:export '%s)\n", name);
|
String* package = Getattr(n, "feature:export:package");
|
||||||
|
Printf(f_cl, "\n(cl:export '%s%s%s)\n", name, package ? " " : "",
|
||||||
|
package ? package : "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFFI::emit_inline(Node *n, String *name) {
|
void CFFI::emit_inline(Node *n, String *name) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue