// Note: This file will be called each time when ch is invoked 
//############################################################
//  DO NOT MODIFY THIS PART OF CODE
string_t chhome_, tmp_;
chhome_ = getenv("CHHOME");
/* set system aliases */
if(_prompt != NULL) { // interactive mode 
  __declspec(global) char *g_dirstack;   
}
alias("dirs", ". dirs"); 
alias("pushd", ". pushd"); 
alias("popd", ". popd");
alias("alias", ". alias_.ch");
alias("unalias", ". unalias_.ch");
alias("which", ". which.ch");
alias("FILE", "_FILE"); 
alias("logout", "exit");
//  DO NOT MODIFY THE CODE ABOVE

/***** OS dependent stuff goes here *****/
#if defined(_LINUX_)
  putenv(stradd("LD_LIBRARY_PATH=", chhome_, "/extern/lib:/usr/lib:/usr/local/lib:"));
#elif defined(_DARWIN_)
  putenv(stradd("DYLD_LIBRARY_PATH=", chhome_, "/extern/lib:"));
  /* not 10.1.X */
  if(atof(`uname -r`) < 5.0 || /* 10.0.X */
     atof(`uname -r`) > 6.0)   /* 10.2.X */
  {
    putenv("DYLD_FORCE_FLAT_NAMESPACE=1");
    putenv("DYLD_INSERT_LIBRARIES=/usr/lib/libncurses.dylib");
  }
#elif defined(_SUN_) || defined(_SOLARIS_)
  tmp_ = stradd("LIBPATH=", chhome_, "/extern/lib:");
  tmp_ = stradd(tmp_,"/usr/openwin/lib:");
  putenv(tmp_);
  tmp_ = stradd("LD_LIBRARY_PATH=", chhome_, "/extern/lib:");
  tmp_ = stradd(tmp_,"/usr/openwin/lib:/opt/SUNWmotif/lib:/usr/lib:/usr/ccs/lib:/opt/SUNWspro/lib:/usr/local/lib:");
  putenv(tmp_);
  tmp_ = stradd("NPX_PLUGIN_PATH=", chhome_, "/www/plugins:");
  putenv(tmp_);
#elif defined(_HPUX_)
  tmp_ = stradd("SHLIB_PATH=", chhome_, "/extern/lib:");
  //tmp_ = stradd(tmp_,"/usr/lib:/usr/lib/X11R6:");
  putenv(tmp_);
#elif defined(_QNX_)
  _path = stradd(_path,"/usr/photon/bin;/usr/photon/appbuilder;/opt/X11R6/bin;/opt/bin;");
  _path = stradd(_path,"/usr/qnx630/host/qnx6/x86/usr/qde/eclipse/jre/bin;/usr/qnx630/host/qnx6/x86/usr/bin;/usr/qnx630/host/qnx6/x86/usr/sbin;/usr/qnx630/host/qnx6/x86/sbin;/usr/qnx630/host/qnx6/x86/bin;/usr/qnx630/host/qnx6/x86/usr/photon/appbuilder;");
#elif defined(_LYNX_)
  tmp_ = stradd("LIBPATH=", chhome_, "/extern/lib:", "/lib:/usr/lib:");
  putenv(tmp_);
#endif

/* Add current path  */
_fpath = stradd(_fpath, ".;");
_ipath = stradd(_ipath, ".;");

/* Add local path below by the system administrator */
_path = stradd(_path,"/usr/bin/X11;/usr/X11R6/bin;");
_path = stradd(_path,"/etc;/usr/sbin;/usr/dt/bin;/usr/local/bin;");
//_path = stradd(_path,"/usr/local/gnu/bin;/usr/ccs/bin;");

/* include .chrc from user's home directory */
#if strlen(_home)==1 /* root / */
#pragma import stradd(_home, ".chrc");
#else
#pragma import stradd(_home, "/.chrc");
#endif
