clisp-cvs Digest, Vol 42, Issue 21

View: New views
1 Messages — Rating Filter:   Alert me  

clisp-cvs Digest, Vol 42, Issue 21

by clisp-cvs-request :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Send clisp-cvs mailing list submissions to
        clisp-cvs@...

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/clisp-cvs
or, via email, send a message with subject or body 'help' to
        clisp-cvs-request@...

You can reach the person managing the list at
        clisp-cvs-owner@...

When replying, please edit your Subject line so it is more specific
than "Re: Contents of clisp-cvs digest..."


CLISP CVS commits for today

Today's Topics:

   1. clisp/modules/bindings/glibc test.tst,1.11,1.12 (Sam Steingold)
   2. clisp/src ChangeLog, 1.7174, 1.7175 constsym.d, 1.393, 1.394
      foreign.d, 1.197, 1.198 foreign1.lisp, 1.134, 1.135 subr.d,
      1.272, 1.273 (Sam Steingold)


----------------------------------------------------------------------

Message: 1
Date: Mon, 26 Oct 2009 20:32:13 +0000
From: Sam Steingold <sds@...>
Subject: clisp/modules/bindings/glibc test.tst,1.11,1.12
To: clisp-cvs@...
Message-ID: <E1N2WEf-0007QA-3b@...>

Update of /cvsroot/clisp/clisp/modules/bindings/glibc
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28520/modules/bindings/glibc

Modified Files:
        test.tst
Log Message:
fix (describe 'linux:wait)
* foreign.d (PARSE-FOREIGN-INTTYPE): implement
* constsym.d, subr.d (parse_foreign_inttype): declare
* foreign1.lisp (parse-c-type): use it for internal int types
(deparse-c-type): handle internal int types


Index: test.tst
===================================================================
RCS file: /cvsroot/clisp/clisp/modules/bindings/glibc/test.tst,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- test.tst 8 Oct 2009 18:58:38 -0000 1.11
+++ test.tst 26 Oct 2009 20:32:11 -0000 1.12
@@ -26,6 +26,9 @@
 (listp (show (loop :for i :from 0 :to 140
                :collect (cons i (linux:strerror i))) :pretty t)) T
 
+;; check that we can DESCRIBE the foreign int types
+(describe 'linux:wait) NIL
+
 ;;; signal handling examples:
 (listp (show (loop :for i :from 0 :to linux:_NSIG
                :collect (cons i (linux:strsignal i))) :pretty t)) T




------------------------------

Message: 2
Date: Mon, 26 Oct 2009 20:32:13 +0000
From: Sam Steingold <sds@...>
Subject: clisp/src ChangeLog, 1.7174, 1.7175 constsym.d, 1.393, 1.394
        foreign.d, 1.197, 1.198 foreign1.lisp, 1.134, 1.135 subr.d, 1.272,
        1.273
To: clisp-cvs@...
Message-ID: <E1N2WEf-0007QE-I9@...>

Update of /cvsroot/clisp/clisp/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28520/src

Modified Files:
        ChangeLog constsym.d foreign.d foreign1.lisp subr.d
Log Message:
fix (describe 'linux:wait)
* foreign.d (PARSE-FOREIGN-INTTYPE): implement
* constsym.d, subr.d (parse_foreign_inttype): declare
* foreign1.lisp (parse-c-type): use it for internal int types
(deparse-c-type): handle internal int types


Index: subr.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/subr.d,v
retrieving revision 1.272
retrieving revision 1.273
diff -u -d -r1.272 -r1.273
--- subr.d 2 Oct 2009 10:55:13 -0000 1.272
+++ subr.d 26 Oct 2009 20:32:11 -0000 1.273
@@ -1390,6 +1390,7 @@
 LISPFUNNR(unsigned_foreign_address,1)
 LISPFUNNR(foreign_address_unsigned,1)
 LISPFUNNR(foreign_address,1)
+LISPFUNNF(parse_foreign_inttype,1)
 LISPFUN(foreign_function,seclass_read,2,0,norest,key,1,(kw(name)) )
 LISPFUNN(sizeof,1)
 LISPFUNN(bitsizeof,1)

Index: constsym.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/constsym.d,v
retrieving revision 1.393
retrieving revision 1.394
diff -u -d -r1.393 -r1.394
--- constsym.d 2 Oct 2009 10:55:13 -0000 1.393
+++ constsym.d 26 Oct 2009 20:32:11 -0000 1.394
@@ -1169,6 +1169,7 @@
 LISPSYM(validp,"VALIDP",ffi)
 LISPSYM(set_validp,"SET-VALIDP",ffi) /* ABI */
 LISPSYM(set_foreign_pointer,"SET-FOREIGN-POINTER",ffi)
+LISPSYM(parse_foreign_inttype,"PARSE-FOREIGN-INTTYPE",ffi)
 LISPSYM(sizeof,"%SIZEOF",ffi) /* ABI */
 LISPSYM(bitsizeof,"%BITSIZEOF",ffi) /* ABI */
 LISPSYM(find_foreign_variable,"FIND-FOREIGN-VARIABLE",ffi) /* ABI */

Index: ChangeLog
===================================================================
RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
retrieving revision 1.7174
retrieving revision 1.7175
diff -u -d -r1.7174 -r1.7175
--- ChangeLog 25 Oct 2009 14:01:16 -0000 1.7174
+++ ChangeLog 26 Oct 2009 20:32:11 -0000 1.7175
@@ -1,3 +1,11 @@
+2009-10-26  Sam Steingold  <sds@...>
+
+ fix (describe 'linux:wait)
+ * foreign.d (PARSE-FOREIGN-INTTYPE): implement
+ * constsym.d, subr.d (parse_foreign_inttype): declare
+ * foreign1.lisp (parse-c-type): use it for internal int types
+ (deparse-c-type): handle internal int types
+
 2009-10-25  Vladimir Tzankov  <vtzankov@...>
 
  * time.d (seconds_west) [MULTITHREAD]: use reentrant functions for

Index: foreign1.lisp
===================================================================
RCS file: /cvsroot/clisp/clisp/src/foreign1.lisp,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -d -r1.134 -r1.135
--- foreign1.lisp 26 Jun 2009 04:02:17 -0000 1.134
+++ foreign1.lisp 26 Oct 2009 20:32:11 -0000 1.135
@@ -213,8 +213,12 @@
                  typespec))
         (when name (setf (gethash name *c-type-table*) c-type))
         c-type)
-      (error (TEXT "FFI type should be a symbol, not ~S")
-             typespec))
+      (if (stringp typespec)
+        (let ((c-type (parse-foreign-inttype typespec)))
+          (when name (setf (gethash name *c-type-table*) c-type))
+          c-type)
+        (error (TEXT "FFI type should be a symbol, not ~S")
+               typespec)))
     (flet ((invalid (typespec)
              (error (TEXT "Invalid FFI type: ~S")
                     typespec))
@@ -453,7 +457,7 @@
                (list slot (deparse slottype)))
              (deparse (ctype)
                (or (cdr (assoc ctype alist :test #'eq))
-                   (if (symbolp ctype)
+                   (if (or (symbolp ctype) (stringp ctype))
                      ;; <simple-c-type>, c-pointer, c-string
                      (new-type ctype ctype)
                      (let ((typespec (list (svref ctype 0))))

Index: foreign.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/foreign.d,v
retrieving revision 1.197
retrieving revision 1.198
diff -u -d -r1.197 -r1.198
--- foreign.d 8 Oct 2009 14:57:28 -0000 1.197
+++ foreign.d 26 Oct 2009 20:32:11 -0000 1.198
@@ -281,6 +281,14 @@
   } else shifthash(O(foreign_inttype_table),name,inttype,true);
 }
 
+LISPFUNNF(parse_foreign_inttype,1) { /* "size_t" --> FFI:UINT64 */
+  object inttype = gethash(STACK_0,O(foreign_inttype_table),false);
+  if (eq(inttype,nullobj))
+    error(error_condition,GETTEXT("No foreign int type named ~S"));
+  VALUES1(inttype);
+  skipSTACK(1);
+}
+
 /* A foreign value descriptor describes an item of foreign data.
  <c-type> ::=
    <simple-c-type>   as described in impnotes.html#dffi




------------------------------

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

------------------------------

_______________________________________________
clisp-cvs mailing list
clisp-cvs@...
https://lists.sourceforge.net/lists/listinfo/clisp-cvs


End of clisp-cvs Digest, Vol 42, Issue 21
*****************************************

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
clisp-devel mailing list
clisp-devel@...
https://lists.sourceforge.net/lists/listinfo/clisp-devel