Macintosh Advice Sought: Squeak VM as NS Plugin

Lawson English english at primenet.com
Sat Feb 5 08:09:41 UTC 2000


John, take a look at this
URL.


<http://developer.apple.com/techpubs/mac/PPCSoftware/PPCSoftware-42.html#HEADING42-28>

My recollection is that you must lock and unlock the handle to the fragment
yourself if you bypass the normal API. If the plug-in isn't referenced via
a handle, this might be the problem right there.





On Fri, Feb 4, 2000 4:30 PM, John.Maloney at disney.com  wrote:
>Folks:
>
>This is a plea for help from any good Macintosh programmers in Squeakland.
>
>I have been working on a version of the Squeak VM to be run as a
>Netscape Plugin on the Mac. (Yes, running Squeaklets in the browser
>will soon be possible.)
>
>However, I've run into a snag with the CodeFragmentManager that
>a good Macintosh hacker might be able to help me with.
>
>Background:
>
>The Squeak VM supports named primitives. These primitives often
>live in independent shared library files, but they can also
>reside in the VM executable itself. Such "built-in" named
>primitives are called from Squeak using the form:
>
>	<primitive: 'myBuiltInPrimitive'>
>
>The absence of a module name means that the primitive is expected
>to have been linked into the VM. Examples of such primitives include
>the FloatArray and FFT primitives.
>
>To call a named primitive, you must first locate the library
>containing the primitive, then look up the primitive name within
>that fragment. The result is a pointer to a function that can be
>invoked to run that primitive. In the normal VM, the library
>for the builtin primitives is found on the Mac by searching for
>a fragment named "SqueakVMPrims", which is the name of the VM
>executable fragment.
>
>The Problem:
>
>Unfortunately, the above technique doesn't work when the VM is
>running as a Netscape plugin. I'm not why not, but I suspect it is
>because Netscape does not load the plugin as an ordinary shared
>library. So my problem is, how can I get a "connection id" for
>the VM code fragment when running as a NS plugin? I have not found
>an API call that allows me to map from a function pointer to to
>fragment that contains that function, although it seems like there
>*should* be such a function.
>
>One approach I've tried that has not worked (so far) is to use
>the GetDiskFragment() call to look up the code fragment of the
>Squeak Plugin VM as a file in the Netscape Plug-ins directory.
>I can load this file by force, but the application crashes when
>I try to look up a function within it.
>
>Any help would be VERY much appreciated... Thanks.



-------------------------------------------------------------------------
Lawson English. Squeak, snore, etc.
Check out <http://www.squeak.org>
-------------------------------------------------------------------------







More information about the Squeak-dev mailing list