[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pypy-dev
Subject:    Re: [pypy-dev] Recursive struct definition in rffi?
From:       Armin Rigo <arigo () tunes ! org>
Date:       2016-06-27 6:51:36
Message-ID: CAMSv6X21jLLpfqFxzTydn-GXszU3pkMWsW_EmS+WtdO+7-C7+w () mail ! gmail ! com
[Download RAW message or body]

Hi John,

On 27 June 2016 at 04:31, John Zhang <John.Zhang@anu.edu.au> wrote:
> I'm using RFFI to reflect a C API interface that my colleague has developed.
> During this process I encountered the problem of not knowing how to define a
> recursive struct definition.
> e.g. How do I define a struct like the following:
> typedef struct A A;
> struct A {
> …
> void (*fn) (A*);
> }

See lltype.ForwardReference(), e.g. in translator/c/test/test_genc.py .


A bientôt,

Armin.
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic