#include #include #include #include #include char* setError(char*format, ...) { char buf[1024]; int l; va_list arglist; va_start(arglist, format); vsnprintf(buf, sizeof(buf)-1, format, arglist); va_end(arglist); l = strlen(buf); while(l && buf[l-1]=='\n') { buf[l-1] = 0; l--; } return strdup(buf); } static int verbose = 0; void mylog(char*format, ...) { char buf[1024]; int l; va_list arglist; if(!verbose) return; va_start(arglist, format); vsnprintf(buf, sizeof(buf)-1, format, arglist); va_end(arglist); l = strlen(buf); while(l && buf[l-1]=='\n') { buf[l-1] = 0; l--; } fprintf(stderr, "[SWF] %s\n", buf); fflush(stderr); } #define PY_NONE Py_BuildValue("s", 0) PyObject* FindMethodMore(PyObject*ret, PyMethodDef f[], PyObject*self, char* a) { if(ret==NULL) { ret = Py_FindMethod(f, self, a); } else { if(!strcmp(a, "__methods__")) { /* we are being dir()ed. Complete the function table */ PyObject* add = Py_FindMethod(f, self, a); int t; mylog("taglist_getattr: append common funtions %08x %08x\n", ret, add); for(t=0;t