Mac VM 3.2.X

Alain Fischer alain.fischer at bluewin.ch
Sun Apr 7 22:22:38 UTC 2002


Le Dimanche 7 avril 2002, à 08:12 , John M McIntosh a écrit :

> Contributions to the mac VM are always welcome. All the source code is 
> on sourceforge.
>
>
>> Some propositions of enhancement for the Carbon Mac VM 3.2.X
>>
>> 1) VM version
>>
>> The VM version returned by "Smalltalk getSystemAttribute: 1004" or
>> written in SqueakDebug.log is not up-to-date:
>> ('Squeak3.1alpha of 7 March 2001 [latest update: #4347]').
>> Perhaps we can use the function CFBundleGetValueForInfoDictionaryKey
>> with one of the following key: CFBundleGetInfoString, 
>> CFBundleShortVersionString
>> or CFBundleVersion for the main bundle.
>
> You should pull the current information, plus append the 
> CFBundleGetInfoString
> nice to do the same for the classic version, get vers resource.


Here is my contribution for the Carbon VM (sqMacMain.c, function 
GetAttributeString)

#if TARGET_API_MAC_CARBON
         if (id == 1004) {
             CFBundleRef mainBundle;
             CFStringRef versionString;

             mainBundle = CFBundleGetMainBundle ();
             versionString = CFBundleGetValueForInfoDictionaryKey 
(mainBundle, CFSTR("CFBundleShortVersionString"));
             return CFStringGetCStringPtr (versionString, 
kCFStringEncodingMacRoman);
         }
#else
         if (id == 1004) return (char *) interpreterVersion;
#endif

This return the following string: 'Squeak VM 3.2.3b2' which seem enough 
to identify the VM.
Note: I am not entirely sure to use the correct #if

>> 2) Embeding in the resource bundle.
>>
>> It could be fine if squeak.image is searched first in the resource 
>> path of the bundle
>> with the function CFBundleCopyRessourceURL.
>> The candidates files that could be included in resource could be:
>> Squeak.image
>> Squeak.changes (only for development)
>> SqueakV3.sources (only for development)
>> mpeg3Plugin.bundle
>> SqueakFFIPrims.bundle
>> Like that we could have a one file Squeak application .
>
> This could be done too, but also consider hunting down the range of 
> folders (app,app directory,user,network,system) for bundles. Note There 
> is a bit of concern here because at startup time it takes time to 
> resolve all this searching for bundles as we hunt for possible 
> plugins/bundles. So beware you're not increasing startup time.

The more usefull first will be search in the bundle resource path. This 
will be my next contribution

>> 3) headless squeak
>>
>> There seem that the Mac VM has no headless mode. This could be usefull 
>> for
>> Squeak server applications like Swiki or Seaside. If we have this 
>> possibility,
>> we could start Squeak with a script in /library/StartupItems.
>>
>> How many of you are interested in these changes ?
>
> There is an old HEADLESS ifdef. But I might suggest what if you used 
> the Unix version as headless?

I have not found any reference for HEADLESS ifdef in the sourceforge Mac 
VM code perhaps it was removed
some time ago. It seem very easy with the Cocoa VM to have headless VM. 
With the Carbon VM I am afraid
that this would not be as easy.




More information about the Squeak-dev mailing list