Next, let's consider creating a cythonfile.pxd
file for the necessary cdef
declarations of Tmux that we need to be aware of. We need to look at the struct cmd_entry
declaration and work backwards from this:
struct cmd_entry { const char *name; const char *alias; const char *args_template; int args_lower; int args_upper; const char *usage; int flags; void (*key_binding)(struct cmd *, int); int (*check)(struct args *); enum cmd_retval (*execc)(struct cmd *, struct cmd_q *); };
As you can see, cmd_entry
depends on several other types, so we need to work backwards a little bit. If you're going to be lazy and live dangerously, you can get away with it sometimes if you don't care about accessing the data correctly by casting any pointers such as void *
. But if you're a seasoned C programmer, you know this is fairly dangerous and should be avoided. You can see this type depends on struct cmd *
, struct cmd_q *
and struct...