[OpenSmalltalk/opensmalltalk-vm] Configuration environment variables should be dialect specific yet backward compatible. (#314)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OpenSmalltalk/opensmalltalk-vm] Configuration environment variables should be dialect specific yet backward compatible. (#314)

David T Lewis
 

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, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Configuration environment variables should be dialect specific yet backward compatible. (#314)"}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/314"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/314", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/314", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } }, { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Configuration environment variables should be dialect specific yet backward compatible. (#314)", "sections": [ { "text": "", "activityTitle": "**Eliot Miranda**", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@eliotmiranda", "facts": [ { "name": "Repository: ", "value": "OpenSmalltalk/opensmalltalk-vm" }, { "name": "Issue #: ", "value": 314 } ] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"OpenSmalltalk/opensmalltalk-vm\",\n\"issueId\": 314,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"OpenSmalltalk/opensmalltalk-vm\",\n\"issueId\": 314\n}" }, { "targets": [ { "os": "default", "uri": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/314" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 419187843\n}" } ], "themeColor": "26292E" } ]</script>