Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17983 Modified Files: Tag: sidewinder-branch OpenTransportNetEvents.c base64.c cancoon.c fileloop.c fileops.c font.c langdll.c langhtml.c langpython.c langscan.c langverbs.c langwinipc.c langxml.c oppack.c shell.c wpengine.c wpverbs.c Log Message: sync with HEAD Index: langscan.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langscan.c,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** langscan.c 17 Jan 2005 01:19:28 -0000 1.3.4.1 --- langscan.c 29 Jan 2005 19:12:19 -0000 1.3.4.2 *************** *** 1161,1165 **** if ((token2 == '}') || (ctscanlines > line2)) { /*we got a return, go ahead & strip it*/ ! short len = ix2 - ix1; pullfromhandle (htext, ix1, len, nil); /*get rid of the token source*/ --- 1161,1170 ---- if ((token2 == '}') || (ctscanlines > line2)) { /*we got a return, go ahead & strip it*/ ! short len; ! ! if (token2 == '}') /* 2005-01-15 creedon - fix suggested by JES w/caveats < http://sourceforge.net/tracker/index.php?func=detail&aid=1093595&group_id=120666&atid=687798 > */ ! ix1 = ix2 - 1; ! ! len = ix2 - ix1; pullfromhandle (htext, ix1, len, nil); /*get rid of the token source*/ Index: wpverbs.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/wpverbs.c,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** wpverbs.c 17 Jan 2005 01:19:48 -0000 1.3.4.1 --- wpverbs.c 29 Jan 2005 19:12:20 -0000 1.3.4.2 *************** *** 29,33 **** #include "standard.h" ! #include "Paige.h" #include "frontierconfig.h" --- 29,33 ---- #include "standard.h" ! #include "PAIGE.H" #include "frontierconfig.h" Index: cancoon.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/cancoon.c,v retrieving revision 1.4.4.1 retrieving revision 1.4.4.2 diff -C2 -d -r1.4.4.1 -r1.4.4.2 *** cancoon.c 17 Jan 2005 01:19:23 -0000 1.4.4.1 --- cancoon.c 29 Jan 2005 19:12:19 -0000 1.4.4.2 *************** *** 65,69 **** #include "serialnumber.h" ! #include "winsocknetevents.h" /*6.2a14 AR*/ --- 65,69 ---- #include "serialnumber.h" ! #include "WinSockNetEvents.h" /*6.2a14 AR*/ Index: wpengine.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/wpengine.c,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.3 diff -C2 -d -r1.4.4.2 -r1.4.4.3 *** wpengine.c 17 Jan 2005 01:19:48 -0000 1.4.4.2 --- wpengine.c 29 Jan 2005 19:12:20 -0000 1.4.4.3 *************** *** 28,36 **** #include "frontier.h" ! #include "Paige.h" ! #include "pgTraps.h" ! #include "PgExceps.h" ! #include "defprocs.h" ! #include "machine.h" #include "pgHLevel.h" --- 28,36 ---- #include "frontier.h" ! #include "PAIGE.H" ! #include "PGTRAPS.H" ! #include "PGEXCEPS.H" ! #include "DEFPROCS.H" ! #include "MACHINE.H" #include "pgHLevel.h" *************** *** 2039,2043 **** #ifdef MACVERSION ! #include <wse.h> #endif --- 2039,2043 ---- #ifdef MACVERSION ! #include <WSE.h> #endif *************** *** 2045,2049 **** typedef void * UniversalProcPtr; #define FixRound(x) (x.whole) ! #include "wse.h" #endif --- 2045,2049 ---- typedef void * UniversalProcPtr; #define FixRound(x) (x.whole) ! #include "WSE.h" #endif Index: langwinipc.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langwinipc.c,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** langwinipc.c 17 Jan 2005 01:19:29 -0000 1.3.4.1 --- langwinipc.c 29 Jan 2005 19:12:19 -0000 1.3.4.2 *************** *** 58,62 **** #include "langtokens.h" #include "langwinipc.h" ! #include "base64.h" #include "tablestructure.h" #include "tableverbs.h" --- 58,62 ---- #include "langtokens.h" #include "langwinipc.h" ! #include "BASE64.H" #include "tablestructure.h" #include "tableverbs.h" *************** *** 64,68 **** #include "processinternal.h" #include "kernelverbdefs.h" ! #include "winsocknetevents.h" #include "notify.h" #include "timedate.h" --- 64,68 ---- #include "processinternal.h" #include "kernelverbdefs.h" ! #include "WinSockNetEvents.h" #include "notify.h" #include "timedate.h" Index: OpenTransportNetEvents.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/OpenTransportNetEvents.c,v retrieving revision 1.6.4.1 retrieving revision 1.6.4.2 diff -C2 -d -r1.6.4.1 -r1.6.4.2 *** OpenTransportNetEvents.c 17 Jan 2005 01:19:22 -0000 1.6.4.1 --- OpenTransportNetEvents.c 29 Jan 2005 19:12:19 -0000 1.6.4.2 *************** *** 292,296 **** #include "shellhooks.h" #include "timedate.h" ! #include "winsocknetevents.h" #include "frontierdebug.h" #include "file.h" --- 292,296 ---- #include "shellhooks.h" #include "timedate.h" ! #include "WinSockNetEvents.h" #include "frontierdebug.h" #include "file.h" Index: base64.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/base64.c,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** base64.c 17 Jan 2005 01:19:23 -0000 1.2.4.1 --- base64.c 29 Jan 2005 19:12:19 -0000 1.2.4.2 *************** *** 31,35 **** #include "memory.h" #include "lang.h" ! #include "base64.h" --- 31,35 ---- #include "memory.h" #include "lang.h" ! #include "BASE64.H" Index: font.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/font.c,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** font.c 17 Jan 2005 01:19:25 -0000 1.3.4.1 --- font.c 29 Jan 2005 19:12:19 -0000 1.3.4.2 *************** *** 29,34 **** #include "standard.h" ! #include "Paige.h" ! #include "pgdeftbl.h" #include "strings.h" --- 29,34 ---- #include "standard.h" ! #include "PAIGE.H" ! #include "PGDEFTBL.H" #include "strings.h" Index: langverbs.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langverbs.c,v retrieving revision 1.5.4.2 retrieving revision 1.5.4.3 diff -C2 -d -r1.5.4.2 -r1.5.4.3 *** langverbs.c 17 Jan 2005 01:19:29 -0000 1.5.4.2 --- langverbs.c 29 Jan 2005 19:12:19 -0000 1.5.4.3 *************** *** 62,66 **** #include "langsystem7.h" #include "langtokens.h" ! #include "base64.h" #include "tablestructure.h" #include "tableverbs.h" --- 62,66 ---- #include "langsystem7.h" #include "langtokens.h" ! #include "BASE64.H" #include "tablestructure.h" #include "tableverbs.h" *************** *** 68,72 **** #include "processinternal.h" #include "kernelverbdefs.h" ! #include "winsocknetevents.h" #include "notify.h" #include "timedate.h" --- 68,72 ---- #include "processinternal.h" #include "kernelverbdefs.h" ! #include "WinSockNetEvents.h" #include "notify.h" #include "timedate.h" Index: langdll.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langdll.c,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** langdll.c 17 Jan 2005 01:19:26 -0000 1.3.4.1 --- langdll.c 29 Jan 2005 19:12:19 -0000 1.3.4.2 *************** *** 62,66 **** #include "langtokens.h" #include "oplist.h" ! #include "base64.h" #include "tablestructure.h" #include "tableverbs.h" --- 62,66 ---- #include "langtokens.h" #include "oplist.h" ! #include "BASE64.H" #include "tablestructure.h" #include "tableverbs.h" *************** *** 71,75 **** #if defined(MACVERSION) && TARGET_RT_MAC_MACHO ! #include "CallMachOFramework.h" #endif --- 71,75 ---- #if defined(MACVERSION) && TARGET_RT_MAC_MACHO ! #include "CallMachOFrameWork.h" #endif Index: langpython.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langpython.c,v retrieving revision 1.2.4.38 retrieving revision 1.2.4.39 diff -C2 -d -r1.2.4.38 -r1.2.4.39 *** langpython.c 21 Jan 2005 07:23:07 -0000 1.2.4.38 --- langpython.c 29 Jan 2005 19:12:19 -0000 1.2.4.39 *************** *** 1084,1087 **** --- 1084,1088 ---- PyObject *returned; bigstring funcname; + langerrormessagecallback savecallback; //printf("__call__\n"); *************** *** 1112,1115 **** --- 1113,1118 ---- // call the script + + savecallback = langcallbacks.errormessagecallback; if (!langexternalgetquotedpath(self->parent, self->name, funcname)) { *************** *** 1121,1124 **** --- 1124,1129 ---- } + langcallbacks.errormessagecallback = savecallback; + // convert result to python if (!convertfrontiervalue(nil, zerostring, &retval, &returned)) *************** *** 1132,1136 **** exitnone: ! releasethreadglobals(); releasepythonlock(); Py_XINCREF(Py_None); --- 1137,1142 ---- exitnone: ! langcallbacks.errormessagecallback = savecallback; ! releasethreadglobals(); releasepythonlock(); Py_XINCREF(Py_None); *************** *** 2096,2099 **** --- 2102,2107 ---- if (!addModuleVars(frontierModule)) return false; + + // TODO: execute the python boot code, passing in the "frontier" module currentCookie = time(NULL); *************** *** 2345,2348 **** --- 2353,2357 ---- #define PYTHONBUILTINS "\x1c" "system.verbs.builtins.python" #define RENDERPYTHON "\x0c" "renderpython" + #define BOOTPYTHON "\x0a" "bootpython" boolean *************** *** 2384,2386 **** --- 2393,2466 ---- } + boolean executePython(hdloutlinerecord houtline, PyObject *env) { + Handle htext; + PyObject *result; + + getpythonlock(); + + if (!pythonrendercode(houtline, &htext)) { + releasepythonlock(); + return false; + } + + // execute the python + + // convert the text to a C string + // + if (!enlargehandle(htext, gethandlesize(htext) + 1, "\0")) { + releasepythonlock(); + return false; + } + + // lock the text + lockhandle(htext); + + // run it + PySys_SetArgv(1, defArgv); + + releasethreadglobals(); + result = PyRun_String(*htext, Py_file_input, globals, globals); + grabthreadglobals(); + + if (result) Py_DECREF(result); + + // unlock the text + unlockhandle(htext); + + // handle errors + if (PyErr_Occurred()) { + handlePythonError(); + releasepythonlock(); + return false; + } + + releasepythonlock(); + + return true; + } + + boolean bootpython(PyObject *module) { + hdlhashtable table; + tyvaluerecord val, retval; + boolean fl; + bigstring outlinename; + boolean pushed = false; + + fl = langfastaddresstotable (roottable, PYTHONBUILTINS, &table) && + langexternalgetquotedpath (table, BOOTPYTHON, outlinename); + + if (!fl) { + return false; + } + + // get the outline from the bootpython script + // execute the outline + + if (!langrunscript(outlinename, &val, roottable, &retval)) { + return false; + } + + return true; + } + #endif Index: shell.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/shell.c,v retrieving revision 1.4.4.4 retrieving revision 1.4.4.5 diff -C2 -d -r1.4.4.4 -r1.4.4.5 *** shell.c 17 Jan 2005 02:23:44 -0000 1.4.4.4 --- shell.c 29 Jan 2005 19:12:19 -0000 1.4.4.5 *************** *** 1338,1341 **** --- 1338,1345 ---- dllinitverbs (); /*2004-11-29 aradke: langdll.c*/ + mathinitverbs (); /*2004-12-30 smd: langmath.c*/ + + dllinitverbs (); /*2004-11-29 aradke: langdll.c*/ + if (keyboardescape ()) /*check again before landinit; after this, must do shellquit*/ exittooperatingsystem (); Index: fileops.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/fileops.c,v retrieving revision 1.4.4.1 retrieving revision 1.4.4.2 diff -C2 -d -r1.4.4.1 -r1.4.4.2 *** fileops.c 17 Jan 2005 01:19:24 -0000 1.4.4.1 --- fileops.c 29 Jan 2005 19:12:19 -0000 1.4.4.2 *************** *** 2092,2099 **** #ifdef MACVERSION #if TARGET_API_MAC_CARBON ! errnum = FSGetVInfo (fs->vRefNum, nil, &ui64totalbytes, &ui64freebytes); #else ! errnum = XGetVInfo (fs->vRefNum, nil, &vrefnum, &ui64totalbytes, &ui64freebytes); #endif --- 2092,2100 ---- #ifdef MACVERSION + /* 2005-01-24 creedon - reversed free and total parameters to match FSGetVInfo and XGetVInfo functions < http://groups.yahoo.com/group/frontierkernel/message/846 > */ #if TARGET_API_MAC_CARBON ! errnum = FSGetVInfo (fs->vRefNum, nil, &ui64freebytes, &ui64totalbytes); #else ! errnum = XGetVInfo (fs->vRefNum, nil, &vrefnum, &ui64freebytes, &ui64totalbytes); #endif Index: langxml.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langxml.c,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** langxml.c 17 Jan 2005 01:19:29 -0000 1.3.4.1 --- langxml.c 29 Jan 2005 19:12:19 -0000 1.3.4.2 *************** *** 45,49 **** #include "kernelverbdefs.h" #include "oplist.h" ! #include "base64.h" //for xmlvaltostring #include "langxml.h" /*7.0b21 PBS*/ #include "process.h" --- 45,49 ---- #include "kernelverbdefs.h" #include "oplist.h" ! #include "BASE64.H" //for xmlvaltostring #include "langxml.h" /*7.0b21 PBS*/ #include "process.h" Index: oppack.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/oppack.c,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** oppack.c 17 Jan 2005 01:19:30 -0000 1.3.4.1 --- oppack.c 29 Jan 2005 19:12:19 -0000 1.3.4.2 *************** *** 1225,1230 **** } ! if (gethandlesize (hlinetext) == 0) // 5.0a4 dmb: empty lines don't dictate structure ! level = lastlevel; if (level > lastlevel) { --- 1225,1231 ---- } ! /* 2005-01-21 creedon, aradke, JES - empty lines DO dictate structure < http://sourceforge.net/tracker/index.php?func=detail&aid=1093595&group_id=120666&atid=687798 > */ ! /* if (gethandlesize (hlinetext) == 0) // 5.0a4 dmb: empty lines don't dictate structure ! level = lastlevel; */ if (level > lastlevel) { Index: langhtml.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langhtml.c,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** langhtml.c 17 Jan 2005 01:19:27 -0000 1.3.4.1 --- langhtml.c 29 Jan 2005 19:12:19 -0000 1.3.4.2 *************** *** 60,64 **** #include "shell.rsrc.h" #include "timedate.h" ! #include "winsocknetevents.h" #ifdef flcomponent #include "osacomponent.h" --- 60,64 ---- #include "shell.rsrc.h" #include "timedate.h" ! #include "WinSockNetEvents.h" #ifdef flcomponent #include "osacomponent.h" Index: fileloop.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/fileloop.c,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** fileloop.c 17 Jan 2005 01:19:24 -0000 1.3.4.1 --- fileloop.c 29 Jan 2005 19:12:19 -0000 1.3.4.2 *************** *** 270,274 **** if (errcode == dirNFErr) /*On OS X, this is what's returned for a read permission error. Weird.*/ return (true); ! #endif --- 270,277 ---- if (errcode == dirNFErr) /*On OS X, this is what's returned for a read permission error. Weird.*/ return (true); ! ! if (errcode == afpAccessDenied) /* 2005-01-05 creedon - don't bail when user does not have the correct permissions < http://sourceforge.net/tracker/index.php?func=detail&aid=1096641&group_id=120666&atid=687798 > */ ! return (true); ! #endif |