7 char* setError(char*format, ...)
12 va_start(arglist, format);
13 vsprintf(buf, format, arglist);
16 while(l && buf[l-1]=='\n') {
24 void mylog(char*format, ...)
31 va_start(arglist, format);
32 vsprintf(buf, format, arglist);
35 while(l && buf[l-1]=='\n') {
39 fprintf(stderr, "[SWF] %s\n", buf);
43 #define PY_NONE Py_BuildValue("s", 0)
45 PyObject* FindMethodMore(PyObject*ret, PyMethodDef f[], PyObject*self, char* a)
48 ret = Py_FindMethod(f, self, a);
50 if(!strcmp(a, "__methods__")) {
51 /* we are being dir()ed. Complete the function table */
52 PyObject* add = Py_FindMethod(f, self, a);
54 mylog("taglist_getattr: append common funtions %08x %08x\n", ret, add);
55 for(t=0;t<PyList_Size(add);t++)
56 PyList_Append(ret, PyList_GetItem(add, t));
62 void dummy_dealloc(PyObject* self)
67 PyMethodDef* addMethods(PyMethodDef*obj1, PyMethodDef*obj2)
70 if(obj1) for(num1=0;obj1[num1].ml_name;num1++);
71 if(obj2) for(num2=0;obj2[num2].ml_name;num2++);
72 PyMethodDef* result = malloc(sizeof(PyMethodDef)*(num1+num2+1));
73 memcpy(result, obj1, num1*sizeof(PyMethodDef));
74 memcpy(&result[num1], obj2, (num2+1)*sizeof(PyMethodDef));
78 void setVerbosity(int _verbose)
81 mylog("setting verbosity to %d", verbose);