third_party/js/mozmill/shared-modules/prefs.js
function preferences_getPref(prefName, defaultValue, defaultBranch,
                                         interfaceType) {
    try {
      branch = defaultBranch ? this.defaultPrefBranch : this.prefBranch;

      // If interfaceType has been set, handle it differently
      if (interfaceType != undefined) {
        return branch.getComplexValue(prefName, interfaceType);
      }

      switch (typeof defaultValue) {
        case ('boolean'):
          return branch.getBoolPref(prefName);
        case ('string'):
          return branch.getCharPref(prefName);
        case ('number'):
          return branch.getIntPref(prefName);
        default:
          return undefined;
      }
    } catch(e) {
      return defaultValue;
    }
  }
function preferences_getPref(prefName, defaultValue, defaultBranch,
                                         interfaceType) {
    try {
      branch = defaultBranch ? this.defaultPrefBranch : this.prefBranch;

      // If interfaceType has been set, handle it differently
      if (interfaceType != undefined) {
        return branch.getComplexValue(prefName, interfaceType);
      }

      switch (typeof defaultValue) {
        case ('boolean'):
          return branch.getBoolPref(prefName);
        case ('string'):
          return branch.getCharPref(prefName);
        case ('number'):
          return branch.getIntPref(prefName);
        default:
          return undefined;
      }
    } catch(e) {
      return defaultValue;
    }
  }
function preferences_getPref ( prefName , defaultValue , defaultBranch , interfaceType ) { try { branch = defaultBranch ? this . defaultPrefBranch : this . prefBranch ; // If interfaceType has been set, handle it differently if ( interfaceType != undefined ) { return branch . getComplexValue ( prefName , interfaceType ) ; } switch ( typeof defaultValue ) { case ( 'boolean' ) : return branch . getBoolPref ( prefName ) ; case ( 'string' ) : return branch . getCharPref ( prefName ) ; case ( 'number' ) : return branch . getIntPref ( prefName ) ; default : return undefined ; } } catch ( e ) { return defaultValue ; } }
Retrieve the value of an individual preference.

@param {string} prefName
The preference to get the value of.
@param {boolean/number/string} defaultValue
The default value if preference cannot be found.
@param {boolean/number/string} defaultBranch
If true the value will be read from the default branch (optional)
@param {string} interfaceType
Interface to use for the complex value (optional)
(nsILocalFile, nsISupportsString, nsIPrefLocalizedString)

@return The value of the requested preference
@type boolean/int/string/complex
Retrieve the value of an individual preference .