From 92c0048854d91da1a1e5e49634b98a36a479f3b2 Mon Sep 17 00:00:00 2001
From: Kaz Kylheku <kaz@kylheku.com>
Date: Mon, 26 Jun 2017 07:22:06 -0700
Subject: ffi: new macro, deffi-sym.

* lisplib.c (ffi_set_entries): Add deffi-sym to autload list.

* share/txr/stdlib/ffi.tl (deffi-sym): New macro.

* txr.1: Documented.
---
 txr.1 | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

(limited to 'txr.1')

diff --git a/txr.1 b/txr.1
index 27b1bad9..42c6bb0f 100644
--- a/txr.1
+++ b/txr.1
@@ -56438,6 +56438,48 @@ form need not be surrounded by a call to the
 macro.
 .RE
 
+.coNP Macro @ deffi-sym
+.synb
+.mets (deffi-sym < name < var-expr <> [ type-sym ])
+.syne
+.desc
+The
+.code deffi-sym
+macro defines a global lexical variable called
+.code name
+whose value is a
+.code cptr
+object that refers to a symbol in a foreign library.
+
+The
+.meta name
+argument gives the name for the variable to be defined.
+This definition takes place place as if by the
+.code defparml
+macro.
+
+The
+.meta var-expr
+is syntax which specifies the foreign pointer, using exactly the same
+conventions as described for the
+.code deffi-var
+macro, allowing for a short-hand notation if this form is
+enclosed in a
+.code with-dyn-lib
+macro invocation.
+
+The optional
+.meta type-sym
+argument must be a symbol. If it is absent, it defaults to nil.
+This argument specifies the type label for the
+.code cptr
+object which holds the pointer to the foreign symbol.
+
+The result value of
+.meta deffi-sym
+is the symbol
+.metn name .
+
 .coNP Macro @ typedef
 .synb
 .mets (typedef < name << type-syntax )
-- 
cgit v1.2.3