diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2009-10-23 10:00:17 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2009-10-23 10:00:17 -0230 |
commit | 278f7856b4b906aea4199eda8294b46064ec4ce8 (patch) | |
tree | 6ac95560911cad6acb3253b5d5d258dbea993edc /py/modules/IcePy/Endpoint.cpp | |
parent | PHP fixes for 5.3 (diff) | |
download | ice-278f7856b4b906aea4199eda8294b46064ec4ce8.tar.bz2 ice-278f7856b4b906aea4199eda8294b46064ec4ce8.tar.xz ice-278f7856b4b906aea4199eda8294b46064ec4ce8.zip |
Port latest Endpoint/ConnectionInfo changes to python/ruby
Added Ice/info test to python/ruby
Modified allTest to not run info test for compress or ipv6
Added Endpoint comparison methods to python/ruby
Diffstat (limited to 'py/modules/IcePy/Endpoint.cpp')
-rw-r--r-- | py/modules/IcePy/Endpoint.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/py/modules/IcePy/Endpoint.cpp b/py/modules/IcePy/Endpoint.cpp index 1c9eefd52ad..9a7e6c44618 100644 --- a/py/modules/IcePy/Endpoint.cpp +++ b/py/modules/IcePy/Endpoint.cpp @@ -51,6 +51,26 @@ endpointDealloc(EndpointObject* self) #ifdef WIN32 extern "C" #endif +static int +endpointCompare(EndpointObject* p1, EndpointObject* p2) +{ + if(*p1->endpoint < *p2->endpoint) + { + return -1; + } + else if(*p1->endpoint == *p2->endpoint) + { + return 0; + } + else + { + return 1; + } +} + +#ifdef WIN32 +extern "C" +#endif static PyObject* endpointToString(EndpointObject* self) { @@ -121,7 +141,7 @@ PyTypeObject EndpointType = 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + (cmpfunc)endpointCompare, /* tp_compare */ (reprfunc)endpointRepr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ |