[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Configuration environment variables should be dialect specific yet backward compatible. (#314)
Eliot Miranda
notifications at github.com
Mon Dec 3 17:39:30 UTC 2018
In the unix variant (& hence the Mac variant), there are many environment variables that can specify such things as
SQUEAK_PLUGINS
SQUEAK_ENCODING
SQUEAK_PATHENC
SQUEAK_TEXTENC
SQUEAK_VM
First these should be dialect-specific (PHARO_PLUGINS CUIS_PLUGINS NEWSPEAK_PLUGINS etc), and for backward-compatibility the Squeak specific names should remain functional. So all VM environment variable access should be though a routine, somewhat like
if ((ev = getvmenvvar("PLUGINS"))) squeakPlugins = strdup(ev);
where getvmenvvar is something like
char *
getvmenvvar(const char *var)
{
char varname[64];
char *value;
#if PHARO_VM
# define VM_VAR_PREFIX "PHARO_"
#elif CUIS_VM
# define VM_VAR_PREFIX "CUIS_"
#elif NEWSPEAK_VM
# define VM_VAR_PREFIX "NEWSPEAK_"
#endif
#if defined(VM_VAR_PREFIX)
strcpy(varname,VM_VAR_PREFIX);
strcat(varname,var);
if ((value = getenv(varname))
return value;
#endif
/* now the default prefix */
strcpy(varname,"SQUEAK_");
strcat(varname,var);
return getenv(varname);
}
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/314
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20181203/cafc9ae1/attachment.html>
More information about the Vm-dev
mailing list