Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9945/extensions
Modified Files:
Tag: py3k
PyFUNCDESC.cpp PyIType.cpp PySTGMEDIUM.cpp PyTYPEATTR.cpp
PyVARDESC.cpp
Log Message:
Changes to build for Py3k
Index: PyTYPEATTR.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyTYPEATTR.cpp,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -d -r1.3 -r1.3.2.1
*** PyTYPEATTR.cpp 24 May 2007 06:01:04 -0000 1.3
--- PyTYPEATTR.cpp 29 Aug 2008 08:27:37 -0000 1.3.2.1
***************
*** 29,33 ****
// @object TYPEATTR|A TYPEATTR object represents a COM TYPEATTR structure.
! static struct PyMethodDef PyTYPEATTR_methods[] = {
{NULL}
};
--- 29,33 ----
// @object TYPEATTR|A TYPEATTR object represents a COM TYPEATTR structure.
! struct PyMethodDef PyTYPEATTR::methods[] = {
{NULL}
};
***************
*** 49,74 ****
PyTypeObject PyTYPEATTR::Type =
{
! PyObject_HEAD_INIT(&PyType_Type)
! 0,
"PyTYPEATTR",
sizeof(PyTYPEATTR),
0,
! PyTYPEATTR::deallocFunc, /* tp_dealloc */
! 0, /* tp_print */
! PyTYPEATTR::getattr, /* tp_getattr */
! PyTYPEATTR::setattr, /* tp_setattr */
! 0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
&PyTYPEATTR_Sequence, /* tp_as_sequence */
0, /* tp_as_mapping */
! 0,
0, /* tp_call */
! 0, /* tp_str */
};
#define OFF(e) offsetof(PyTYPEATTR, e)
! /*static*/ struct memberlist PyTYPEATTR::memberlist[] = {
{"iid", T_OBJECT,OFF(iid)},// @prop <o PyIID>|iid|The IID
{"lcid", T_INT, OFF(lcid)}, // @prop int|lcid|The lcid
--- 49,95 ----
PyTypeObject PyTYPEATTR::Type =
{
! PYWIN_OBJECT_HEAD
"PyTYPEATTR",
sizeof(PyTYPEATTR),
0,
! PyTYPEATTR::deallocFunc, /* tp_dealloc */
! 0, /* tp_print */
! 0, /* tp_getattr */
! 0, /* tp_setattr */
! 0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
&PyTYPEATTR_Sequence, /* tp_as_sequence */
0, /* tp_as_mapping */
! 0, /* tp_hash */
0, /* tp_call */
! 0, /* tp_str */
! PyObject_GenericGetAttr, /* tp_getattro */
! PyObject_GenericSetAttr, /* tp_setattro */
! 0, /* tp_as_buffer */
! Py_TPFLAGS_DEFAULT, /* tp_flags */
! 0, /* tp_doc */
! 0, /* tp_traverse */
! 0, /* tp_clear */
! 0, /* tp_richcompare */
! 0, /* tp_weaklistoffset */
! 0, /* tp_iter */
! 0, /* tp_iternext */
! PyTYPEATTR::methods, /* tp_methods */
! PyTYPEATTR::members, /* tp_members */
! 0, /* tp_getset */
! 0, /* tp_base */
! 0, /* tp_dict */
! 0, /* tp_descr_get */
! 0, /* tp_descr_set */
! 0, /* tp_dictoffset */
! 0, /* tp_init */
! 0, /* tp_alloc */
! 0, /* tp_new */
};
#define OFF(e) offsetof(PyTYPEATTR, e)
! /*static*/ struct PyMemberDef PyTYPEATTR::members[] = {
{"iid", T_OBJECT,OFF(iid)},// @prop <o PyIID>|iid|The IID
{"lcid", T_INT, OFF(lcid)}, // @prop int|lcid|The lcid
***************
*** 152,175 ****
}
- PyObject *PyTYPEATTR::getattr(PyObject *self, char *name)
- {
- PyObject *res;
-
- res = Py_FindMethod(PyTYPEATTR_methods, self, name);
- if (res != NULL)
- return res;
- PyErr_Clear();
- return PyMember_Get((char *)self, memberlist, name);
- }
-
- int PyTYPEATTR::setattr(PyObject *self, char *name, PyObject *v)
- {
- if (v == NULL) {
- PyErr_SetString(PyExc_AttributeError, "can't delete PyTYPEATTR attributes");
- return -1;
- }
- return PyMember_Set((char *)self, memberlist, name, v);
- }
-
/*static*/ void PyTYPEATTR::deallocFunc(PyObject *ob)
{
--- 173,176 ----
Index: PySTGMEDIUM.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PySTGMEDIUM.cpp,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -C2 -d -r1.8 -r1.8.2.1
*** PySTGMEDIUM.cpp 3 Jun 2007 09:40:56 -0000 1.8
--- PySTGMEDIUM.cpp 29 Aug 2008 08:27:37 -0000 1.8.2.1
***************
*** 94,98 ****
// @object PySTGMEDIUM|A STGMEDIUM object represents a COM STGMEDIUM structure.
! static struct PyMethodDef PySTGMEDIUM_methods[] = {
{"set", PySet, 1}, // @pymeth set|Sets the type and data of the object
{NULL}
--- 94,98 ----
// @object PySTGMEDIUM|A STGMEDIUM object represents a COM STGMEDIUM structure.
! struct PyMethodDef PySTGMEDIUM::methods[] = {
{"set", PySet, 1}, // @pymeth set|Sets the type and data of the object
{NULL}
***************
*** 101,121 ****
PyTypeObject PySTGMEDIUM::Type =
{
! PyObject_HEAD_INIT(&PyType_Type)
! 0,
"PySTGMEDIUM",
sizeof(PySTGMEDIUM),
0,
PySTGMEDIUM::deallocFunc, /* tp_dealloc */
! 0, /* tp_print */
! PySTGMEDIUM::getattr, /* tp_getattr */
! 0, /* tp_setattr */
! 0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
! 0, /* tp_as_sequence */
0, /* tp_as_mapping */
! 0,
0, /* tp_call */
! 0, /* tp_str */
};
--- 101,142 ----
PyTypeObject PySTGMEDIUM::Type =
{
! PYWIN_OBJECT_HEAD
"PySTGMEDIUM",
sizeof(PySTGMEDIUM),
0,
PySTGMEDIUM::deallocFunc, /* tp_dealloc */
! 0, /* tp_print */
! 0, /* tp_getattr */
! 0, /* tp_setattr */
! 0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
! 0, /* tp_as_sequence */
0, /* tp_as_mapping */
! 0, /* tp_hash */
0, /* tp_call */
! 0, /* tp_str */
! PySTGMEDIUM::getattro, /* tp_getattro */
! 0, /* tp_setattro */
! 0, /* tp_as_buffer */
! Py_TPFLAGS_DEFAULT, /* tp_flags */
! 0, /* tp_doc */
! 0, /* tp_traverse */
! 0, /* tp_clear */
! 0, /* tp_richcompare */
! 0, /* tp_weaklistoffset */
! 0, /* tp_iter */
! 0, /* tp_iternext */
! PySTGMEDIUM::methods, /* tp_methods */
! 0, /* tp_members */
! 0, /* tp_getset */
! 0, /* tp_base */
! 0, /* tp_dict */
! 0, /* tp_descr_get */
! 0, /* tp_descr_set */
! 0, /* tp_dictoffset */
! 0, /* tp_init */
! 0, /* tp_alloc */
! 0, /* tp_new */
};
***************
*** 205,216 ****
}
! PyObject *PySTGMEDIUM::getattr(PyObject *self, char *name)
{
! PyObject *res;
PySTGMEDIUM *ps = (PySTGMEDIUM *)self;
- res = Py_FindMethod(PySTGMEDIUM_methods, self, name);
- if (res != NULL)
- return res;
- PyErr_Clear();
// @prop int|tymed|An integer indicating the type of data in the stgmedium
if (strcmp(name, "tymed")==0)
--- 226,236 ----
}
! PyObject *PySTGMEDIUM::getattro(PyObject *self, PyObject *obname)
{
! char *name=PYWIN_ATTR_CONVERT(obname);
! if (name==NULL)
! return NULL;
!
PySTGMEDIUM *ps = (PySTGMEDIUM *)self;
// @prop int|tymed|An integer indicating the type of data in the stgmedium
if (strcmp(name, "tymed")==0)
***************
*** 289,293 ****
}
}
! return PyErr_Format(PyExc_AttributeError, "STGMEDIUM objects have no attribute '%s'", name);
}
--- 309,313 ----
}
}
! return PyObject_GenericGetAttr(self, obname);
}
Index: PyIType.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIType.cpp,v
retrieving revision 1.9
retrieving revision 1.9.4.1
diff -C2 -d -r1.9 -r1.9.4.1
*** PyIType.cpp 5 Jul 2001 08:08:13 -0000 1.9
--- PyIType.cpp 29 Aug 2008 08:27:37 -0000 1.9.4.1
***************
*** 404,430 ****
{
// XXX - todo - merge this code with PyIDispatch::GetIDsOfNames
UINT i;
!
! int argc = PyObject_Length(args);
! if ( argc == -1 )
! return NULL;
if ( argc < 1 ) {
PyErr_SetString(PyExc_TypeError, "At least one argument must be supplied");
return NULL;
}
! LCID lcid = LOCALE_SYSTEM_DEFAULT;
UINT offset = 0;
if ( argc > 1 )
{
! PyObject *ob = PySequence_GetItem(args, 0);
! if ( !ob )
! return NULL;
! if ( PyInt_Check(ob) )
! {
! lcid = PyInt_AS_LONG((PyIntObject *)ob);
! if ( lcid == -1 )
! return NULL;
offset = 1;
- }
}
--- 404,427 ----
{
// XXX - todo - merge this code with PyIDispatch::GetIDsOfNames
+ ITypeInfo *pti = PyITypeInfo::GetI(self);
+ if (pti==NULL) return NULL;
UINT i;
! int argc = PyTuple_GET_SIZE(args);
if ( argc < 1 ) {
PyErr_SetString(PyExc_TypeError, "At least one argument must be supplied");
return NULL;
}
! LCID lcid;
UINT offset = 0;
if ( argc > 1 )
{
! PyObject *ob = PyTuple_GET_ITEM(args, 0);
! lcid=PyLong_AsLong(ob);
! if (lcid==-1 && PyErr_Occurred()){
! PyErr_Clear();
! lcid=LOCALE_SYSTEM_DEFAULT;
! }
! else
offset = 1;
}
***************
*** 434,445 ****
for ( i = 0 ; i < cNames; ++i )
{
! PyObject *ob = PySequence_GetItem(args, i + offset);
! if ( !ob )
! {
! for (;i>0;i--)
! PyWinObject_FreeBstr(rgszNames[i-1]);
! delete [] rgszNames;
! return NULL;
! }
if (!PyWinObject_AsBstr(ob, rgszNames+i)) {
for (;i>0;i--)
--- 431,435 ----
for ( i = 0 ; i < cNames; ++i )
{
! PyObject *ob = PyTuple_GET_ITEM(args, i + offset);
if (!PyWinObject_AsBstr(ob, rgszNames+i)) {
for (;i>0;i--)
***************
*** 448,466 ****
return NULL;
}
- Py_DECREF(ob);
}
DISPID FAR* rgdispid = new DISPID[cNames];
- ITypeInfo *pti = PyITypeInfo::GetI(self);
- if (pti==NULL) return NULL;
PY_INTERFACE_PRECALL;
HRESULT hr = pti->GetIDsOfNames(rgszNames, cNames, rgdispid);
PY_INTERFACE_POSTCALL;
delete [] rgszNames;
! if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pti, IID_ITypeInfo);
!
PyObject *result;
--- 438,456 ----
return NULL;
}
}
DISPID FAR* rgdispid = new DISPID[cNames];
PY_INTERFACE_PRECALL;
HRESULT hr = pti->GetIDsOfNames(rgszNames, cNames, rgdispid);
PY_INTERFACE_POSTCALL;
+ for (i=0;i<cNames;i++)
+ PyWinObject_FreeBstr(rgszNames[i]);
delete [] rgszNames;
! if ( FAILED(hr) ){
! delete [] rgdispid;
return PyCom_BuildPyException(hr, pti, IID_ITypeInfo);
! }
PyObject *result;
Index: PyVARDESC.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyVARDESC.cpp,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -d -r1.6 -r1.6.2.1
*** PyVARDESC.cpp 1 Jul 2008 01:22:14 -0000 1.6
--- PyVARDESC.cpp 29 Aug 2008 08:27:37 -0000 1.6.2.1
***************
*** 25,29 ****
// @object VARDESC|A VARDESC object represents a COM VARDESC structure.
! static struct PyMethodDef PyVARDESC_methods[] = {
{NULL}
};
--- 25,29 ----
// @object VARDESC|A VARDESC object represents a COM VARDESC structure.
! struct PyMethodDef PyVARDESC::methods[] = {
{NULL}
};
***************
*** 96,121 ****
PyTypeObject PyVARDESC::Type =
{
! PyObject_HEAD_INIT(&PyType_Type)
! 0,
"PyVARDESC",
sizeof(PyVARDESC),
0,
PyVARDESC::deallocFunc, /* tp_dealloc */
! 0, /* tp_print */
! PyVARDESC::getattr, /* tp_getattr */
! PyVARDESC::setattr, /* tp_setattr */
! 0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
&PyVARDESC_Sequence, /* tp_as_sequence */
0, /* tp_as_mapping */
! 0,
0, /* tp_call */
! 0, /* tp_str */
};
#define OFF(e) offsetof(PyVARDESC, e)
! /*static*/ struct memberlist PyVARDESC::memberlist[] = {
{"memid", T_INT, OFF(memid)}, // @prop int|memid|The dispid of the member
{"value", T_OBJECT,OFF(value)}, // @prop int/object|value|A value for the variant. If PERINSTANCE then an offset into the instance, otherwise a variant converted to a Python object.
--- 96,142 ----
PyTypeObject PyVARDESC::Type =
{
! PYWIN_OBJECT_HEAD
"PyVARDESC",
sizeof(PyVARDESC),
0,
PyVARDESC::deallocFunc, /* tp_dealloc */
! 0, /* tp_print */
! 0, /* tp_getattr */
! 0, /* tp_setattr */
! 0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
&PyVARDESC_Sequence, /* tp_as_sequence */
0, /* tp_as_mapping */
! 0, /* tp_hash */
0, /* tp_call */
! 0, /* tp_str */
! PyObject_GenericGetAttr, /* tp_getattro */
! PyObject_GenericSetAttr, /* tp_setattro */
! 0, /* tp_as_buffer */
! Py_TPFLAGS_DEFAULT, /* tp_flags */
! 0, /* tp_doc */
! 0, /* tp_traverse */
! 0, /* tp_clear */
! 0, /* tp_richcompare */
! 0, /* tp_weaklistoffset */
! 0, /* tp_iter */
! 0, /* tp_iternext */
! PyVARDESC::methods, /* tp_methods */
! PyVARDESC::members, /* tp_members */
! 0, /* tp_getset */
! 0, /* tp_base */
! 0, /* tp_dict */
! 0, /* tp_descr_get */
! 0, /* tp_descr_set */
! 0, /* tp_dictoffset */
! 0, /* tp_init */
! 0, /* tp_alloc */
! 0, /* tp_new */
};
#define OFF(e) offsetof(PyVARDESC, e)
! /*static*/ struct PyMemberDef PyVARDESC::members[] = {
{"memid", T_INT, OFF(memid)}, // @prop int|memid|The dispid of the member
{"value", T_OBJECT,OFF(value)}, // @prop int/object|value|A value for the variant. If PERINSTANCE then an offset into the instance, otherwise a variant converted to a Python object.
***************
*** 196,219 ****
}
- PyObject *PyVARDESC::getattr(PyObject *self, char *name)
- {
- PyObject *res;
-
- res = Py_FindMethod(PyVARDESC_methods, self, name);
- if (res != NULL)
- return res;
- PyErr_Clear();
- return PyMember_Get((char *)self, memberlist, name);
- }
-
- int PyVARDESC::setattr(PyObject *self, char *name, PyObject *v)
- {
- if (v == NULL) {
- PyErr_SetString(PyExc_AttributeError, "can't delete PyVARDESC attributes");
- return -1;
- }
- return PyMember_Set((char *)self, memberlist, name, v);
- }
-
/*static*/ void PyVARDESC::deallocFunc(PyObject *ob)
{
--- 217,220 ----
Index: PyFUNCDESC.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyFUNCDESC.cpp,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** PyFUNCDESC.cpp 24 May 2007 06:01:04 -0000 1.2
--- PyFUNCDESC.cpp 29 Aug 2008 08:27:37 -0000 1.2.2.1
***************
*** 100,104 ****
// The object itself.
! static struct PyMethodDef PyFUNCDESC_methods[] = {
{NULL}
};
--- 100,104 ----
// The object itself.
! struct PyMethodDef PyFUNCDESC::methods[] = {
{NULL}
};
***************
*** 122,147 ****
PyTypeObject PyFUNCDESC::Type =
{
! PyObject_HEAD_INIT(&PyType_Type)
! 0,
"PyFUNCDESC",
sizeof(PyFUNCDESC),
0,
PyFUNCDESC::deallocFunc, /* tp_dealloc */
! 0, /* tp_print */
! PyFUNCDESC::getattr, /* tp_getattr */
! PyFUNCDESC::setattr, /* tp_setattr */
! 0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
&PyFUNCDESC_Sequence, /* tp_as_sequence */
0, /* tp_as_mapping */
! 0,
0, /* tp_call */
! 0, /* tp_str */
};
#define OFF(e) offsetof(PyFUNCDESC, e)
! /*static*/ struct memberlist PyFUNCDESC::memberlist[] = {
{"memid", T_INT, OFF(memid)}, // @prop integer|memid|
{"scodeArray", T_OBJECT,OFF(scodeArray)}, // @prop (int, ...)|scodeArray|
--- 122,168 ----
PyTypeObject PyFUNCDESC::Type =
{
! PYWIN_OBJECT_HEAD
"PyFUNCDESC",
sizeof(PyFUNCDESC),
0,
PyFUNCDESC::deallocFunc, /* tp_dealloc */
! 0, /* tp_print */
! 0, /* tp_getattr */
! 0, /* tp_setattr */
! 0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
&PyFUNCDESC_Sequence, /* tp_as_sequence */
0, /* tp_as_mapping */
! 0, /* tp_hash */
0, /* tp_call */
! 0, /* tp_str */
! PyObject_GenericGetAttr, /* tp_getattro */
! PyObject_GenericSetAttr, /* tp_setattro */
! 0, /* tp_as_buffer */
! Py_TPFLAGS_DEFAULT, /* tp_flags */
! 0, /* tp_doc */
! 0, /* tp_traverse */
! 0, /* tp_clear */
! 0, /* tp_richcompare */
! 0, /* tp_weaklistoffset */
! 0, /* tp_iter */
! 0, /* tp_iternext */
! PyFUNCDESC::methods, /* tp_methods */
! PyFUNCDESC::members, /* tp_members */
! 0, /* tp_getset */
! 0, /* tp_base */
! 0, /* tp_dict */
! 0, /* tp_descr_get */
! 0, /* tp_descr_set */
! 0, /* tp_dictoffset */
! 0, /* tp_init */
! 0, /* tp_alloc */
! 0, /* tp_new */
};
#define OFF(e) offsetof(PyFUNCDESC, e)
! /*static*/ struct PyMemberDef PyFUNCDESC::members[] = {
{"memid", T_INT, OFF(memid)}, // @prop integer|memid|
{"scodeArray", T_OBJECT,OFF(scodeArray)}, // @prop (int, ...)|scodeArray|
***************
*** 194,217 ****
}
- PyObject *PyFUNCDESC::getattr(PyObject *self, char *name)
- {
- PyObject *res;
-
- res = Py_FindMethod(PyFUNCDESC_methods, self, name);
- if (res != NULL)
- return res;
- PyErr_Clear();
- return PyMember_Get((char *)self, memberlist, name);
- }
-
- int PyFUNCDESC::setattr(PyObject *self, char *name, PyObject *v)
- {
- if (v == NULL) {
- PyErr_SetString(PyExc_AttributeError, "can't delete PyFUNCDESC attributes");
- return -1;
- }
- return PyMember_Set((char *)self, memberlist, name, v);
- }
-
/*static*/ void PyFUNCDESC::deallocFunc(PyObject *ob)
{
--- 215,218 ----
|