Plugins and Platforms

Bert Freudenberg bert at
Fri Nov 25 11:47:42 UTC 2005

Hi folks,

when writing a plugin in Slang I encountered two problems wrt  
platform specifics:

1) convert a squeak pathname to a platform pathname:

	* my plugin links to a library that expects a platform file path
	* must convert from Squeak path (char encoding etc.)
	* sqFilenameFromString() should do this

	* PROBLEM: this does not work in an external plugin
	* because it is just a macro pointing to some platform-code function  
that would have to be linked to the external plugin

	* PROPOSAL: provide an ioFilenameFromString() function exported from  
the VM
	* looked up by plugin via interpreterProxy->ioLoadFunctionFrom 
("ioFilenameFromString", "")
	* could trivially be implemented by using sqFilenameFromString macro?

2) endianness:

	* I need to know the current platform's endianness
	* because the linked library provides 8 bit bitmap data in platform  
	* and I want to adjust the Squeak form from the plugin (set depth to  
-8 on little-endian machine)

	* PROBLEM: which function/macro to use?

	* there seem to be several:
	- LSB_FIRST used in B3DAcceleratorPlugin.c
	- MSB_FIRST used in sqWin32Window.c
	- WORDS_BIGENDIAN defined on Mac OS and Unix -  is this the one?


- Bert -

More information about the Vm-dev mailing list