Created
May 14, 2011 21:02
-
-
Save niallo/972629 to your computer and use it in GitHub Desktop.
ctypes circular definition work around
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ctypes import * | |
class NANNY_TIMER(Structure): | |
_fields_ = [("when", c_long), | |
("data", c_void_p), | |
("f", POINTER(NANNY_TIMER_CB)) | |
] | |
# XXX is there a way around this hack for circular definition? | |
class NANNY_TIMED_T(Structure): | |
pass | |
class NANNY_TIMED_T(Structure): | |
_fields_ = [("next", POINTER(NANNY_TIMED_T)), | |
("timer", POINTER(NANNY_TIMER)), | |
("interval", c_long), | |
("last", c_long), | |
("cmd", c_char_p), | |
("envplen", c_int), | |
("envp", POINTER(c_char_p)) | |
] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment