rpav / cl-autowrap

(c-include "file.h") => complete FFI wrapper
BSD 2-Clause "Simplified" License
212 stars 41 forks source link

change default foreign type name when it is conflict with common lisp package. #105

Open jingtaozf opened 4 years ago

jingtaozf commented 4 years ago

In some cases, the parameter name of a C function may be "t" or other symbols in common lisp package, which make them illegal parameter name.

We have to rename them to avoid such conflict.

One case is for the following spec:

{ "tag": "function", "name": "ASN1_TYPE_pack_sequence", "ns": 0, "location": "/usr/include/openssl/asn1.h:525:12", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "it", "type": { "tag": ":pointer", "type": { "tag": "ASN1_ITEM" } } }, { "tag": "parameter", "name": "s", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "t", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "ASN1_TYPE" } } } }], "return-type": { "tag": ":pointer", "type": { "tag": "ASN1_TYPE" } } },