[pywin32-checkins] pywin32/win32/src win32apimodule.cpp,1.35,1.36
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2004-04-09 11:22:01
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25602 Modified Files: win32apimodule.cpp Log Message: Add MAKEWORD and MAKELONG Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** win32apimodule.cpp 30 Mar 2004 04:24:01 -0000 1.35 --- win32apimodule.cpp 9 Apr 2004 11:08:37 -0000 1.36 *************** *** 3366,3369 **** --- 3366,3395 ---- } + // @pymethod int|win32api|MAKEWORD|creates a WORD value by concatenating the specified values. + static PyObject * + PyMAKEWORD(PyObject *self, PyObject *args) + { + int hi, lo; + if (!PyArg_ParseTuple(args, "ii:MAKEWORD", + &lo, // @pyparm int|low||Specifies the low-order byte of the new value. + &hi)) // @pyparm int|high||Specifies the high-order byte of the new value. + return NULL; + return Py_BuildValue("i", (int)MAKEWORD(lo, hi)); + // @comm This is simply a wrapper to a C++ macro. + } + + // @pymethod int|win32api|MAKELONG|creates a LONG value by concatenating the specified values. + static PyObject * + PyMAKELONG(PyObject *self, PyObject *args) + { + int hi, lo; + if (!PyArg_ParseTuple(args, "ii:MAKELONG", + &lo, // @pyparm int|low||Specifies the low-order byte of the new value. + &hi)) // @pyparm int|high||Specifies the high-order byte of the new value. + return NULL; + return Py_BuildValue("i", (long)MAKELONG(lo, hi)); + // @comm This is simply a wrapper to a C++ macro. + } + // @pymethod int|win32api|RGB|An interface to the win32api RGB macro. static PyObject * *************** *** 4363,4366 **** --- 4389,4394 ---- {"RGB", PyRGB, 1}, // @pymeth RGB|An interface to the win32api RGB macro. {"MAKELANGID", PyMAKELANGID, 1}, // @pymeth MAKELANGID|Creates a language identifier from a primary language identifier and a sublanguage identifier. + {"MAKEWORD", PyMAKEWORD, 1}, // @pymeth MAKEWORD|creates a WORD value by concatenating the specified values. + {"MAKELONG", PyMAKELONG, 1}, // @pymeth MAKELONG|creates a LONG value by concatenating the specified values. {NULL, NULL} }; |