Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
Labels

Comments

@sbinet
Copy link
Owner

@sbinet 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 added the enhancement label Jun 5, 2015
@sbinet sbinet self-assigned this Jun 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.