Displaying 2 results from an estimated 2 matches for "pyimport_getmoduledict".
2019 Jun 25
3
[PATCH libnbd] generator: Add Mutable type to the generator.
...{ args; ret } =
pr " for (size_t i = 0; i < %s; ++i)\n" len;
pr " PyList_SET_ITEM (py_%s, i, PyLong_FromUnsignedLong (%s[i]));\n" n n
| BytesIn _ -> ()
+ | Mutable (Int n) ->
+ pr " PyObject *py_%s_dict = PyImport_GetModuleDict ();\n" n;
+ pr " PyObject *py_%s_mod = PyMapping_GetItemString (py_%s_dict, \"ctypes\");\n" n n;
+ pr " PyObject *py_%s = PyObject_CallMethod (py_%s_mod, \"c_int\", \"i\", *%s);\n" n n n
| Opaque n ->...
2019 Jun 25
0
Re: [PATCH libnbd] generator: Add Mutable type to the generator.
...pr " for (size_t i = 0; i < %s; ++i)\n" len;
> pr " PyList_SET_ITEM (py_%s, i, PyLong_FromUnsignedLong (%s[i]));\n" n n
> | BytesIn _ -> ()
> + | Mutable (Int n) ->
> + pr " PyObject *py_%s_dict = PyImport_GetModuleDict ();\n" n;
> + pr " PyObject *py_%s_mod = PyMapping_GetItemString (py_%s_dict, \"ctypes\");\n" n n;
> + pr " PyObject *py_%s = PyObject_CallMethod (py_%s_mod, \"c_int\", \"i\", *%s);\n" n n n
PyMapping_GetItemStrin...