How to access plugin name from VMPluginCodeGenerator

PhiHo Hoang phiho.hoang at rogers.com
Sun Jul 13 16:36:44 UTC 2003


It turns out that there is a simpler solution:

"Change Set:  RefactorModuleName-hph
Date:   13 July 2003
Author:   hph

This CS changes:

static const char *moduleName =
#ifdef SQUEAK_BUILTIN_PLUGIN
  "MiscPrimitivePlugin 21 June 2003 (i)"
#else
  "MiscPrimitivePlugin 21 June 2003 (e)"
#endif
;

into

#ifdef SQUEAK_BUILTIN_PLUGIN
#define iORe    "(i)"
#else
#define iORe    "(e)"
#endif

static const char *moduleName = "MiscPrimitivePlugin 13 July 2003 " iORe ;
"

Someone please verify if this works as expected on all platforms.

Cheers,

PhiHo.

----- Original Message ----- 
From: "PhiHo Hoang" <phiho.hoang at rogers.com>
To: "The general-purpose Squeak developers list" <squeak-dev at lists.squeakfoundation.org>
Sent: Saturday, July 12, 2003 9:52 PM
Subject: Re: How to access plugin name from VMPluginCodeGenerator


> Maybe a bit of rational behind this RFH would help.
> 
> >From the latest source for MiscPrimitivePlugin :
> 
> /********  generated by VMMaker   **********'/
> static const char *moduleName =
> #ifdef SQUEAK_BUILTIN_PLUGIN
>   "MiscPrimitivePlugin 21 June 2003 (i)"
> #else
>   "MiscPrimitivePlugin 21 June 2003 (e)"
> #endif
> ;        // Note how the semicolon on this line is refactored !
> /*** isn't a bit hard to read ? does it make you itchy ?  ***/
> 
> 
> /********    is this one better ?  **********'/
> #ifdef SQUEAK_BUILTIN_PLUGIN
> #define IE    "(i)"
> #else
> #define IE    "(e)"
> #endif
> 
> #define MODULENAME(ie)          "MiscPrimitivePlugin 12 July 2003"##ie
> 
> static const char *moduleName = MODULENAME(IE) ;
> /***** if yes, can VMMaker generate it ?  ***/
> 
> 
> /**** MobVM plugins (processed by Notepad) ****/
> static const char *moduleName =  "MiscPrimitivePlugin 12 July 2003" ;
> /*** The "(i)", "(e)" bits are generated at runtime.  ***/
> 
> What do you think ?
> 
> 
> Cheers,
> 
> PhiHo.
> 
> ----- Original Message ----- 
> From: "PhiHo Hoang" <phiho.hoang at rogers.com>
> To: <squeak-dev at lists.squeakfoundation.org>
> Sent: Saturday, July 12, 2003 4:24 PM
> Subject: How to access plugin name from VMPluginCodeGenerator
> 
> 
> > Hi,
> > 
> >     I need to generate a macro like:
> > 
> >     #define MODULENAME(ie)  "MiscPrimitivePlugin 12 July 2003"##ie
> > 
> >     How can I access 'nameString' (plugin name) from within 
> >     'VMPluginCodeGenerator>>emitCHeaderOn: aStream' ?
> > 
> >     I am sure there is a more gooder way to do it.
> >     
> >     Thanks for your help.
> > 
> >     PhiHo.
> > 
> > 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RefactorModuleName-hph.zip
Type: application/x-zip-compressed
Size: 1059 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030713/e448637d/RefactorModuleName-hph.bin


More information about the Squeak-dev mailing list