// Note; (1) This file will be called each time 
//           when ch is invoked as a safe shell.
//################################################################
//  DO NOT MODIFY THIS PART OF CODE
string_t chhome_, tmp_;
chhome_ = getenv("CHHOME");
//  DO NOT MODIFY THE CODE ABOVE

//if(_prompt != NULL) { // interactive mode 
//  printf("Message from your system administrator goes here\n"); 
//  license 
//}

/***** OS dependent stuff goes here *****/
#if defined(_LINUX_)
  putenv(stradd("LD_LIBRARY_PATH=", chhome_, "/extern/lib:"));
#elif defined(_DARWIN_)
  putenv(stradd("DYLD_LIBRARY_PATH=", chhome_, "/extern/lib:"));
  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=","/usr/openwin/lib:");
  tmp_ = stradd(tmp_,"/opt/SUNWmotif/lib:/usr/lib:");
  putenv(tmp_);
#elif defined(_HPUX_)
  tmp_ = stradd("SHLIB_PATH=", chhome_, "/extern/lib:");
  //tmp_ = stradd(tmp_,"/usr/lib:/usr/lib/X11R6:");
  putenv(tmp_);
#elif defined(_LYNX_)
  tmp_ = stradd("LIBPATH=", chhome_, "/extern/lib:");
  tmp_ = stradd(tmp_,"/lib:/usr/lib:");
  putenv(tmp_);
#endif


/* modify and uncomment the line below to use locale wide characters
setlocale(0, "Chinese-Simplified);
*/

#if strlen(_home)==1 /* root / */
#if !access(stradd(_home, ".chsrc"), 4)
#pragma import stradd(_home, ".chsrc");
#endif
#else
#if !access(stradd(_home, "/.chsrc"), 4)
#pragma import stradd(_home, "/.chsrc");
#endif
#endif
