--- build/src/shiori/py_shiori.cpp.dist 2004-10-09 23:35:00.000000000 +0900 +++ build/src/shiori/py_shiori.cpp 2004-10-10 00:04:23.000000000 +0900 @@ -11,7 +11,6 @@ //--------------------------------------------------------------------------- using namespace std; //--------------------------------------------------------------------------- -static unsigned int shiori_handle = 0; extern "C" PyObject *saori_exist; extern "C" PyObject *saori_load; @@ -33,32 +32,32 @@ static PyObject *wrap_load(PyObject *self, PyObject *args) { char *datapath; + unsigned int shiori_handle = 0; if(!PyArg_ParseTuple(args, "s", &datapath)) return NULL; shiori_handle = TKawariShioriFactory::GetFactory().CreateInstance( string(datapath)); - if (shiori_handle == 0) { - Py_INCREF(Py_False); - return Py_False; - } - Py_INCREF(Py_True); - return Py_True; + return Py_BuildValue("d", shiori_handle); } static PyObject *wrap_unload(PyObject *self, PyObject *args) { - if(!PyArg_ParseTuple(args, "")) + unsigned int shiori_handle = 0; + + if(!PyArg_ParseTuple(args, "d", &shiori_handle)) return NULL; if (!TKawariShioriFactory::GetFactory().DisposeInstance(shiori_handle)){ Py_INCREF(Py_False); return Py_False; } - shiori_handle=0; - TKawariShioriFactory::DisposeFactory(); + + // For multi-ghost/single-process system, it's important not to + //dispose TKawariShioriFactory. + //TKawariShioriFactory::DisposeFactory(); Py_XDECREF(saori_exist); Py_XDECREF(saori_load); @@ -74,8 +73,9 @@ { char *requeststr; string aistr; + unsigned int shiori_handle = 0; - if(!PyArg_ParseTuple(args, "s", &requeststr)) + if(!PyArg_ParseTuple(args, "ds", &shiori_handle, &requeststr)) return NULL; aistr = TKawariShioriFactory::GetFactory().RequestInstance(