|
From: David B. <dav...@us...> - 2004-11-23 01:54:49
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24201 Modified Files: Tag: sidewinder-branch langpython.c Log Message: detabbed Index: langpython.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langpython.c,v retrieving revision 1.2.4.3 retrieving revision 1.2.4.4 diff -C2 -d -r1.2.4.3 -r1.2.4.4 *** langpython.c 22 Nov 2004 07:19:49 -0000 1.2.4.3 --- langpython.c 23 Nov 2004 01:54:39 -0000 1.2.4.4 *************** *** 268,272 **** switch (tvr->valuetype) { ! case stringvaluetype: { int len = gethandlesize(tvr->data.stringvalue); char *val = malloc(len + 1); --- 268,272 ---- switch (tvr->valuetype) { ! case stringvaluetype: { int len = gethandlesize(tvr->data.stringvalue); char *val = malloc(len + 1); *************** *** 281,285 **** } ! case novaluetype: Py_INCREF(Py_None); *pptr = Py_None; --- 281,285 ---- } ! case novaluetype: Py_INCREF(Py_None); *pptr = Py_None; *************** *** 307,311 **** */ ! case booleanvaluetype: { int val = 0; if (tvr->data.flvalue) --- 307,311 ---- */ ! case booleanvaluetype: { int val = 0; if (tvr->data.flvalue) *************** *** 317,351 **** } ! case intvaluetype: *pptr = Py_BuildValue("i", tvr->data.intvalue); break; ! case longvaluetype: *pptr = Py_BuildValue("i", tvr->data.longvalue); break; ! case fixedvaluetype: { ! double x = (double)(((*tvr).data.longvalue) / 65536); ! *pptr = Py_BuildValue("d", x); ! break; } ! case singlevaluetype: *pptr = Py_BuildValue("f", tvr->data.singlevalue); break; ! case doublevaluetype: *pptr = Py_BuildValue("d", **(tvr->data.doublevalue)); break; ! case pointvaluetype: *pptr = Py_BuildValue("(ii)", tvr->data.pointvalue.v, tvr->data.pointvalue.h); break; ! case rectvaluetype: *pptr = Py_BuildValue("(iiii)", (**(tvr->data.rectvalue)).top, (**(tvr->data.rectvalue)).left, (**(tvr->data.rectvalue)).bottom, (**(tvr->data.rectvalue)).right); break; ! case rgbvaluetype: *pptr = Py_BuildValue("(iii)", (**(tvr->data.rgbvalue)).red, (**(tvr->data.rgbvalue)).green, (**(tvr->data.rgbvalue)).blue); break; --- 317,351 ---- } ! case intvaluetype: *pptr = Py_BuildValue("i", tvr->data.intvalue); break; ! case longvaluetype: *pptr = Py_BuildValue("i", tvr->data.longvalue); break; ! case fixedvaluetype: { ! double x = (double)(((*tvr).data.longvalue) / 65536); ! *pptr = Py_BuildValue("d", x); ! break; } ! case singlevaluetype: *pptr = Py_BuildValue("f", tvr->data.singlevalue); break; ! case doublevaluetype: *pptr = Py_BuildValue("d", **(tvr->data.doublevalue)); break; ! case pointvaluetype: *pptr = Py_BuildValue("(ii)", tvr->data.pointvalue.v, tvr->data.pointvalue.h); break; ! case rectvaluetype: *pptr = Py_BuildValue("(iiii)", (**(tvr->data.rectvalue)).top, (**(tvr->data.rectvalue)).left, (**(tvr->data.rectvalue)).bottom, (**(tvr->data.rectvalue)).right); break; ! case rgbvaluetype: *pptr = Py_BuildValue("(iii)", (**(tvr->data.rgbvalue)).red, (**(tvr->data.rgbvalue)).green, (**(tvr->data.rgbvalue)).blue); break; *************** *** 1068,1076 **** tyvaluerecord adrOutput; tyvaluerecord adrError; ! // first param: handle to python code string // if (!gettextvalue (hp1, 1, &pythonCode)) ! return (false); // second param: pointer to var to store output --- 1068,1076 ---- tyvaluerecord adrOutput; tyvaluerecord adrError; ! // first param: handle to python code string // if (!gettextvalue (hp1, 1, &pythonCode)) ! return (false); // second param: pointer to var to store output *************** *** 1152,1156 **** } ! // get the output // PyObject *foutput = PyDict_GetItemString(locals, "_f_output"); --- 1152,1156 ---- } ! // get the output // PyObject *foutput = PyDict_GetItemString(locals, "_f_output"); *************** *** 1190,1200 **** static boolean pythonfunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { hdltreenode hp1 = hparam1; ! tyvaluerecord *v = vreturned; ! ! setbooleanvalue (false, v); /*by default, string functions return false*/ ! ! switch (token) { ! case startinterpreterfunc: return startInterpreter(); --- 1190,1200 ---- static boolean pythonfunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { hdltreenode hp1 = hparam1; ! tyvaluerecord *v = vreturned; ! ! setbooleanvalue (false, v); /*by default, string functions return false*/ ! ! switch (token) { ! case startinterpreterfunc: return startInterpreter(); *************** *** 1205,1211 **** return runstringverb(hp1, v); ! default: ! getstringlist (langerrorlist, unimplementedverberror, bserror); ! return (false); } /*switch*/ } /*htmlfunctionvalue*/ --- 1205,1211 ---- return runstringverb(hp1, v); ! default: ! getstringlist (langerrorlist, unimplementedverberror, bserror); ! return (false); } /*switch*/ } /*htmlfunctionvalue*/ |