unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Zajcev Evgeny <lg.zevlg@gmail.com>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: Juri Linkov <juri@jurta.org>, joakim@verona.se, emacs-devel@gnu.org
Subject: Re: FFI
Date: Sun, 18 Apr 2010 22:53:57 +0400	[thread overview]
Message-ID: <m27ho48ud6.fsf@macbook-air-0000-0000.local> (raw)
In-Reply-To: <8739yt9nks.fsf@mid.deneb.enyo.de> (Florian Weimer's message of "Sun, 18 Apr 2010 10:22:59 +0200")

Florian Weimer <fw@deneb.enyo.de> writes:

> * Juri Linkov:
>
>> If using its implementation in GNU Emacs is not possible due to legal
>> reasons, then maybe at least it would be a good idea to implement
>> FFI in GNU Emacs compatible with SXEmacs.  In this case all existing
>> library bindings will be readily available for GNU Emacs.
>
> This is only true if Emacs also implements all SXEmacs types, so it is
> a bit more ambitious than just implementing the FFI.

I think I can port SXEmacsen FFI to GNU Emacs with small blood.
SXEmacsen FFI does not uses lisp types (it does actually, but this is
another question), so you can create almost any data accessible from
FFI with only numbers, floats and strings.  Let me show live example:

    (setq db (sqlite-open "~/mtest.db"))
      ==> #<ffiobject type=pointer size=4 fotype=0 foptr=0xb6a6600>
    (sqlite-execute db "CREATE TABLE PARAMS
       (NAME VARCHAR(256) NULL, VALUE VARCHAR(1024) NULL)")
      ==> t
    (sqlite-execute db "INSERT INTO PARAMS (NAME,VALUE)
       VALUES (?, ?)" '("nthoteh" "HRCHRCCR"))
      ==> t
    (sqlite-rows db "select * from params")
      ==> (("nthoteh" "HRCHRCCR"))
    (sqlite-close db)
      ==> 0

As you can see there are only strings, and numbers (boolean type is
done via dinamic type/value translators implemented in ffi)

thanks

-- 
lg




  reply	other threads:[~2010-04-18 18:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-17 19:55 Embedding SQLite Florian Weimer
2010-04-17 21:58 ` Deniz Dogan
2010-04-18  3:21   ` John Wiegley
2010-04-18  3:52     ` Juanma Barranquero
2010-04-18  5:39       ` tomas
2010-04-18  6:43         ` joakim
2010-04-18  8:09           ` FFI (was: Embedding SQLite) Juri Linkov
2010-04-18  8:22             ` FFI Florian Weimer
2010-04-18 18:53               ` Zajcev Evgeny [this message]
2010-04-18 20:25                 ` FFI Florian Weimer
2010-04-19  6:39                   ` FFI Zajcev Evgeny
2010-04-19  7:31                     ` FFI joakim
2010-04-19  8:33                       ` FFI Zajcev Evgeny
2010-04-19  7:44                     ` telepathy (was: FFI) Michael Albinus
2010-04-19  8:25                       ` telepathy Zajcev Evgeny
2010-04-19  8:56                         ` telepathy Michael Albinus
2010-04-20  2:28                       ` telepathy (was: FFI) Jan Moringen
2010-04-20  7:15                         ` telepathy Zajcev Evgeny
2010-04-20  8:26                         ` telepathy Michael Albinus
2010-04-21  2:00                           ` telepathy Jan Moringen
     [not found]                     ` <jwv4oj7d07h.fsf-monnier+emacs@gnu.org>
2010-04-19 13:52                       ` FFI Florian Weimer
2010-04-19  8:43                   ` FFI Andreas Schwab
2010-04-18  6:53     ` Embedding SQLite Florian Weimer
2010-04-18  9:33     ` Leo
     [not found] ` <jwvy6gked8g.fsf-monnier+emacs@gnu.org>
2010-04-18 20:23   ` Florian Weimer
2010-04-19 18:26 ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m27ho48ud6.fsf@macbook-air-0000-0000.local \
    --to=lg.zevlg@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=fw@deneb.enyo.de \
    --cc=joakim@verona.se \
    --cc=juri@jurta.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).