emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU TLS lisp bindings


From: William M. Perry
Subject: Re: GNU TLS lisp bindings
Date: Fri, 14 Dec 2001 13:50:33 -0500
User-agent: Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.5 (asparagus, i686-pc-linux)

Simon Josefsson <address@hidden> writes:

> Scott Lanning <address@hidden> writes:
>
>> Also, are there other cases in emacs code (or rogue patches)
>> where someone has "exposed the C API"? I'd like to see them
>> for examples.
>
> Have a look at William Perry's Foreign Function Interface for XEmacs.
> Something like it would be useful for these kind of projects, I think.

I've been thinking more and more about the FFI stuff, and was experimenting
with allowing struct access the other day.  To make the FFI truly useful
you would need to have something like:

(define-c-struct name-of-struct
   ((pointer char) . name-of-member-1)
   (int            . name-of-member-2)
   .
   .
   )

This could work like cl's defstruct and automatically define accessor
functions for the slots.  (name-of-struct-name-of-member-1 obj) returns
name-of-member-1 and (set-name-of-struct-name-of-member-1 obj val) would
set a new value for it.  I'm not sure how this would interact with
compilers that reorder structure members to pack them tightly or align word
boundaries, etc.  Is that legal in ANSI C?

> On the other hand, I'm not sure if it would be possible to use FFI for
> the GNU TLS bindings since good TLS integration means modifying TCP
> read() and write() within Emacs.

If you could modify the read/write routines used by a process from lisp,
this could be doable.  Maybe not pretty though.

>> Certainly I will analyze Simon's patch. :)
>
> Argh!  I shouldn't have posted the code, it is a horrible evening hack.
> It was the functionality I was after.

Hehehehe - always a danger!  I posted Emacs/W3 after an evenings hacking
8.5 years ago and it still hasn't gone away.  :)

-bp
-- 
Ceterum censeo vi esse delendam



reply via email to

[Prev in Thread] Current Thread [Next in Thread]