Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | /** |
michael@0 | 9 | * Scriptable access to the current process environment. |
michael@0 | 10 | * |
michael@0 | 11 | */ |
michael@0 | 12 | [scriptable, uuid(101d5941-d820-4e85-a266-9a3469940807)] |
michael@0 | 13 | interface nsIEnvironment : nsISupports |
michael@0 | 14 | { |
michael@0 | 15 | /** |
michael@0 | 16 | * Set the value of an environment variable. |
michael@0 | 17 | * |
michael@0 | 18 | * @param aName the variable name to set. |
michael@0 | 19 | * @param aValue the value to set. |
michael@0 | 20 | */ |
michael@0 | 21 | void set(in AString aName, in AString aValue); |
michael@0 | 22 | |
michael@0 | 23 | /** |
michael@0 | 24 | * Get the value of an environment variable. |
michael@0 | 25 | * |
michael@0 | 26 | * @param aName the variable name to retrieve. |
michael@0 | 27 | * @return returns the value of the env variable. An empty string |
michael@0 | 28 | * will be returned when the env variable does not exist or |
michael@0 | 29 | * when the value itself is an empty string - please use |
michael@0 | 30 | * |exists()| to probe whether the env variable exists |
michael@0 | 31 | * or not. |
michael@0 | 32 | */ |
michael@0 | 33 | AString get(in AString aName); |
michael@0 | 34 | |
michael@0 | 35 | /** |
michael@0 | 36 | * Check the existence of an environment variable. |
michael@0 | 37 | * This method checks whether an environment variable is present in |
michael@0 | 38 | * the environment or not. |
michael@0 | 39 | * |
michael@0 | 40 | * - For Unix/Linux platforms we follow the Unix definition: |
michael@0 | 41 | * An environment variable exists when |getenv()| returns a non-NULL value. |
michael@0 | 42 | * An environment variable does not exist when |getenv()| returns NULL. |
michael@0 | 43 | * - For non-Unix/Linux platforms we have to fall back to a |
michael@0 | 44 | * "portable" definition (which is incorrect for Unix/Linux!!!!) |
michael@0 | 45 | * which simply checks whether the string returned by |Get()| is empty |
michael@0 | 46 | * or not. |
michael@0 | 47 | * |
michael@0 | 48 | * @param aName the variable name to probe. |
michael@0 | 49 | * @return if the variable has been set, the value returned is |
michael@0 | 50 | * PR_TRUE. If the variable was not defined in the |
michael@0 | 51 | * environment PR_FALSE will be returned. |
michael@0 | 52 | */ |
michael@0 | 53 | boolean exists(in AString aName); |
michael@0 | 54 | }; |
michael@0 | 55 |