#include <lib/base/eerror.h>
#include <lib/base/estring.h>
+#include <lib/python/python.h>
#include <lib/service/service.h>
#include <lib/base/init_num.h>
#include <lib/base/init.h>
+#include <Python.h>
eServiceReference::eServiceReference(const std::string &string)
{
const char *c=string.c_str();
int pathl=0;
- if ( sscanf(c, "%d:%d:%x:%x:%x:%x:%x:%x:%x:%x:%n", &type, &flags, &data[0], &data[1], &data[2], &data[3], &data[4], &data[5], &data[6], &data[7], &pathl) < 8 )
+ if (!string.length())
+ type = idInvalid;
+ else if ( sscanf(c, "%d:%d:%x:%x:%x:%x:%x:%x:%x:%x:%n", &type, &flags, &data[0], &data[1], &data[2], &data[3], &data[4], &data[5], &data[6], &data[7], &pathl) < 8 )
{
memset( data, 0, sizeof(data) );
eDebug("find old format eServiceReference string");
- sscanf(c, "%d:%d:%x:%x:%x:%x:%n", &type, &flags, &data[0], &data[1], &data[2], &data[3], &pathl);
+ if ( sscanf(c, "%d:%d:%x:%x:%x:%x:%n", &type, &flags, &data[0], &data[1], &data[2], &data[3], &pathl) < 2 )
+ type = idInvalid;
}
if (pathl)
return ret;
}
+std::string eServiceReference::toCompareString() const
+{
+ std::string ret;
+ ret += getNum(type);
+ ret += ":0";
+ for (unsigned int i=0; i<sizeof(data)/sizeof(*data); ++i)
+ ret+=":"+getNum(data[i], 0x10);
+ ret+=":"+path;
+ return ret;
+}
eServiceCenter *eServiceCenter::instance;
return "";
}
+PyObject* iServiceInformation::getInfoObject(int w)
+{
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+int iStaticServiceInformation::setInfo(const eServiceReference &ref, int w, int v)
+{
+ return -1;
+}
+
+int iStaticServiceInformation::setInfoString(const eServiceReference &ref, int w, const char *v)
+{
+ return -1;
+}
+
+int iServiceInformation::setInfo(int w, int v)
+{
+ return -1;
+}
+
+int iServiceInformation::setInfoString(int w, const char *v)
+{
+ return -1;
+}
+
eAutoInitPtr<eServiceCenter> init_eServiceCenter(eAutoInitNumbers::service, "eServiceCenter");