objective-c/exception-bridge.lisp
in-package#:luv.objective-c
declaim
notinlineobjective-c-message-definition-nameobjective-c-message-definition-selectorobjective-c-message-definition-selector-pointer
defparameter*objective-c-exception-bridge-source-directory*#.
uiop:pathname-directory-pathname
"The source checkout embedded when this Lisp file is compiled or loaded."defunobjective-c-exception-bridge-library
let
stamp
file-write-date
merge-pathnames
formatnil"../build/objective-c-exception-bridge-~D.dylib"stamp
*objective-c-exception-bridge-source-directory*defunensure-objective-c-exception-bridge
Build and load the native Objective-C catch frame when its source changed.
let
when
ensure-directories-existlibrary
uiop:run-program
list"clang""-fno-objc-arc""-fexceptions""-fobjc-exceptions""-Wall""-Wextra""-Werror""-dynamiclib""-framework""Foundation""-o"
:output*standard-output*:error-output*error-output*uiop:native-namestringlibrary
uiop:native-namestringsource
cffi:load-foreign-librarylibrary
defparameter*objective-c-exception-bridge*"Current CFFI handle for the hot-reloadable native exception bridge."
defunobjective-c-bridge-function
name
defun%invoke-objective-c-message
cffi:foreign-funcall-pointer
objective-c-bridge-function"luv_objc_invoke"
:pointerreceiver:pointerselector:pointerreturn-value:sizereturn-size:sizeargument-count:pointerarguments:pointerargument-sizes:pointerfailure:intdefun%free-objective-c-native-failure
failure
defunnullable-native-string
pointer
unless
cffi:null-pointer-ppointer
cffi:foreign-string-to-lisppointer
defuncall-with-objective-c-exception-boundary
Invoke definition natively, translating any Objective-C exception to Lisp.
cffi:with-foreign-object
failure'
:structobjective-c-native-failure
let
status
%invoke-objective-c-message
objective-c-pointerreceiver
objective-c-message-definition-selector-pointerdefinition
resultresult-sizeargument-countargumentsargument-sizesfailureunless
zeropstatus
multiple-value-bind
namereasoncall-stack
error:message
objective-c-message-definition-namedefinition
:receiverreceiver:selectorobjective-c-message-definition-selectordefinition
:namename:reasonreason:call-stackcall-stackdefparameter *objective-c-exception-bridge-source-directory*
The source checkout embedded when this Lisp file is compiled or loaded.
define-arithmetic-operator or
Logical disjunction of tests and raw truth values.
define-style library
The library band: eyebrow, site name, and the three doors.
define-arithmetic-operator not
Logical negation of one test or raw truth value.
define-arithmetic-operator <
Test whether one compatible scalar is less than another.
defun %invoke-objective-c-message
(receiver selector return-value return-size argument-count arguments
argument-sizes failure)defun nullable-native-string
(pointer)define-style type
Headings, paragraphs, figures and their IDs, mentions, marks.
defun call-with-objective-c-exception-boundary
(definition receiver result result-size arguments argument-sizes argument-count)defclass definition
One top-level defining form of a source file.
define-arithmetic-operator =
Test whether two compatible scalars are equal.
define-condition objective-c-bridge-error
The native boundary could not perform a declared Objective-C message.
One native catch frame around every declared Objective-C message.