simple_env

SCOOP-Compatible Environment Variable Access

v1.0.0 MIT

Overview

simple_env provides SCOOP-compatible environment variable access for Eiffel applications. Unlike the standard EXECUTION_ENVIRONMENT, it uses direct Win32 API calls with inline C for reliable, thread-safe environment manipulation.

Part of the Simple Eiffel ecosystem.

Quick Start

Installation

  1. Set the environment variable:
    export SIMPLE_EIFFEL=/d/prod
  2. Add to your ECF file:
    <library name="simple_env" location="$SIMPLE_EIFFEL/simple_env/simple_env.ecf"/>

Basic Usage

local
    env: SIMPLE_ENV
do
    create env

    -- Get a variable
    if attached env.get ("PATH") as path then
        print (path)
    end

    -- Set a variable
    env.set ("MY_VAR", "my_value")

    -- Expand paths
    print (env.expand ("%USERPROFILE%\Documents"))
end

Key Features

Get & Set

Read, write, and delete environment variables with simple API.

String Expansion

Expand %VAR% references in paths and strings.

Enumeration

List all variables or filter by prefix.

SCOOP Safe

Designed for concurrent programming with no shared state.

API Summary

Access

Modification

Expansion

Enumeration

Why simple_env?

vs. EXECUTION_ENVIRONMENT

Feature EXECUTION_ENVIRONMENT SIMPLE_ENV
SCOOP compatible No (internal caching) Yes (no shared state)
String expansion No Yes (%VAR% support)
Enumerate variables No Yes (all_names, prefix filter)
Operation status No Yes (last_operation_succeeded)

Documentation