Mercurial > pytave
comparison oct-py-types.h @ 374:d362cdd1ddeb
pyobject: add conversion methods for single, intX, and uintX types
* oct-py-types.cc, oct-py-types.h (pytave::extract_py_uint64): New function.
* __py_struct_from_dict__.cc (F__py_uint64_scalar_value__): New function.
(F__py_int64_scalar_value__): Simplify and clean up style. Add %!tests.
* @pyobject/pyobject.m (pyobject.single, pyobject.int8, pyobject.int16,
pyobject.int32, pyobject.uint8, pyobject.uint16, pyobject.uint32,
pyobject.uint64): New conversion methods.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Fri, 26 Aug 2016 18:51:42 -0700 |
parents | eac35d84ef0d |
children | c4b78e449c62 |
comparison
equal
deleted
inserted
replaced
373:0e4097c66788 | 374:d362cdd1ddeb |
---|---|
101 //! @param obj Python int or long object | 101 //! @param obj Python int or long object |
102 //! @return integer value of @a obj | 102 //! @return integer value of @a obj |
103 int64_t | 103 int64_t |
104 extract_py_int64 (PyObject *obj); | 104 extract_py_int64 (PyObject *obj); |
105 | 105 |
106 //! Extract the integer value of the given Python int or long object. | |
107 //! | |
108 //! @param obj Python int or long object | |
109 //! @return integer value of @a obj | |
110 uint64_t | |
111 extract_py_uint64 (PyObject *obj); | |
112 | |
106 //! Create a Python int object with the value of the given @c int32_t value. | 113 //! Create a Python int object with the value of the given @c int32_t value. |
107 //! | 114 //! |
108 //! @param value integer value | 115 //! @param value integer value |
109 //! @return Python int or long object | 116 //! @return Python int or long object |
110 PyObject * | 117 PyObject * |