This repository was archived by the owner on Jul 24, 2023. It is now read-only.
This repository was archived by the owner on Jul 24, 2023. It is now read-only.
use ffi to handle C-varargs #22
Open
Description
The CPython
API is using varargs a lot.
e.g.:
https://docs.python.org/2/c-api/arg.html
int PyArg_ParseTuple(PyObject *args, const char *format, ...);
int PyArg_ParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char *keywords[], ...);
consider using FFI
(or github.com/gonuts/ffi
) to marshal back and forth between C-varargs and Go-varargs-interface{}
like is done in gopy:
https://github.com/qur/gopy/blob/master/lib/utils.c#L25
https://github.com/qur/gopy/blob/master/lib/arg.go#L89