/[fetter]/verrazano-support/support.lisp
ViewVC logotype

Contents of /verrazano-support/support.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Fri Sep 2 08:26:52 2005 UTC (8 years, 7 months ago) by rhashem
Branch: MAIN, rhashem
CVS Tags: HEAD, HEAD
Changes since 1.1: +0 -0 lines

Initial import.
1 ; utility routines for users of Verrazano-generated packages
2
3 (defpackage "VERRAZANO-SUPPORT"
4 (:nicknames "VZN")
5 (:use "COMMON-LISP" "CFFI")
6 (:export "VTABLE-LOOKUP"
7 "VIRTUAL-FUNCALL"))
8
9 (in-package "VERRAZANO-SUPPORT")
10
11 ; lookup the pointer to a given function
12 (defun vtable-lookup (pobj indx coff)
13 (let ((vptr (cffi:mem-ref pobj :pointer coff)))
14 (cffi:mem-aref vptr :pointer (- indx 2))))
15
16 ; macro for emitting a virtual function call
17 (defmacro virtual-funcall (pobj indx coff &rest body)
18 `(foreign-funcall (vtable-lookup ,pobj ,indx ,coff) ,@body))
19

  ViewVC Help
Powered by ViewVC 1.1.5