|Anonymous | Login||01-16-2022 22:03 UTC|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Simple Details [ Jump to Notes ]||[ View Advanced ] [ Issue History ] [ Print ]|
|ID||Category||Severity||Reproducibility||Date Submitted||Last Update|
|0002404||[Squeak] VM||feature||N/A||12-23-05 01:34||01-18-06 19:23|
|Summary||0002404: Add VM filename conversion access and endianness access to interpreterProxy for plugin use|
Subject: Plugins and Platforms
Date: November 25, 2005 3:47:42 AM PST (CA)
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?
* I need to know the current platform's endianness
* because the linked library provides 8 bit bitmap data in platform order
* 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?
An interpreterProxy function for ioFilenameFromString is easy enough - we have sqFileNameFromString provided in the base code. It is nominally a macro although several platforms recast it as a function. There is also the slight fiddly bit of the sqFilenameFromStringOpen stuff for OSX to consider.
It looks as if simply making an Interpreter method ioFilenameFromString that points to sqfilenameFromString will do. Add equivalent to InterpreterProxy as well and of course to sqVirtualMachine.[ch]
There isn't any single universal macro or value to indicate endianess so I'll add one. A macro will be most useful since it can be set in a sqPlatformSpecific.h or from a makefile command as a result of autoconf or other OS gymnastics.
Interpreter-isBigEnder-dtl.1.cs.gz [^] (639 bytes) 12-29-05 03:29
EndianPlugin-dtl.1.cs.gz [^] (737 bytes) 12-29-05 03:29
(0003396 - 477 - 523 - 523 - 523 - 523 - 523)
In VMMaker3.8b5-64, a macro is introduced for VMENDIANNESS. This should not be necessary, since endianness can be tested at runtime.
Interpreter-isBigEnder-dtl.1.cs provides the runtime check.
EndianPlugin-dtl.1.cs is a plugin to verify that it works.
This has been tested only on an Intel 32 bit box, so it needs at least a check on a Mac. To test, build the EndianPlugin, then evaluate "EndianPlugin endianness = Smalltalk endianness", which should evaluate to true.
(0003420 - 27 - 27 - 27 - 27 - 27 - 27)
|VMMaker3.8b5-64B has fixes.|
(0003536 - 16 - 16 - 16 - 16 - 16 - 16)
|fixed in vmmaker|
|12-23-05 01:34||tim||New Issue|
|12-23-05 01:37||tim||Status||new => assigned|
|12-23-05 01:37||tim||Assigned To||=> tim|
|12-29-05 03:29||lewis||File Added: Interpreter-isBigEnder-dtl.1.cs.gz|
|12-29-05 03:29||lewis||File Added: EndianPlugin-dtl.1.cs.gz|
|12-29-05 03:30||lewis||Note Added: 0003396|
|12-29-05 03:30||lewis||Issue Monitored: lewis|
|01-02-06 21:04||tim||Status||assigned => resolved|
|01-02-06 21:04||tim||Fixed in Version||=> 3.8|
|01-02-06 21:04||tim||Resolution||open => fixed|
|01-02-06 21:04||tim||Note Added: 0003420|
|01-18-06 19:23||MarcusDenker||Status||resolved => closed|
|01-18-06 19:23||MarcusDenker||Note Added: 0003536|
| Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
53 total queries executed.|
36 unique queries executed.