Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

use ffi to handle C-varargs #22

Open
sbinet opened this issue Jun 5, 2015 · 0 comments
Open

use ffi to handle C-varargs #22

sbinet opened this issue Jun 5, 2015 · 0 comments
Assignees

Comments

@sbinet
Copy link
Owner

sbinet commented Jun 5, 2015

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

@sbinet sbinet self-assigned this Jun 5, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant