This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Closures without VA-stuff


Hi!

I am seeking a library providing a very simple feature like this:
int test(void *d, int x);
int main()
{
  struct data
  {
    int a, b;
  };
  data d;
  int(*fun)(int) = create_closure(test, &d);
  fun(4); // invokes test(d, 4)
}
So I have found two libraries: ffcall and libffi.
Such things are possible with libffi (and even ffcall), but there is no way to 
do simply that, you always need this "varaidic stuff". Why isn't there any 
simple function to create closures? Any suggestions what I should try to do?
I am asking you, because libffi looks promising. ;)

Jonathan

------------------------
Operating System: GNU/Linux
Kernel: Linux 2.6.31.5-0.1-default
Distribution: openSuSE 11.2
Qt: 4.6.1
KDE Development Platform: 4.3.82 (KDE 4.3.82 (KDE 4.4 >= 20091211)) "release 
1"
KMail: 1.13.0
http://gnu.org/
http://kde.org/
http://windows7sins.org/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]