Skip to content

Commit

Permalink
Use DLL function instead of pointer in Python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-s committed May 12, 2024
1 parent c49bedb commit c096346
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/python-bindings.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@
:function-prefix function-prefix
:error-map error-map)
(format nil
"~a = CFUNCTYPE(~a, ~{~a~^, ~})(c_void_p.in_dll(~a, '~a').value)"
"~a = ~a.~a
~a.restype = ~a
~a.argtypes = [~{~a~^, ~}]"
(coerce-to-c-name callable-name)
library-name
(coerce-to-c-name callable-name)
(coerce-to-c-name callable-name)
(python-type return-type)
(coerce-to-c-name callable-name)
(append
(loop :for (name type) :in typed-lambda-list
:collect (python-type type))
(and result-type
(list (format nil "POINTER(~a)" (python-type result-type)))))
library-name
(coerce-to-c-name callable-name))))
(list (format nil "POINTER(~a)" (python-type result-type))))))))

(defun write-default-python-header (library stream &optional (omit-init-call nil))
(let ((name (library-c-name library)))
Expand Down

0 comments on commit c096346

Please sign in to comment.