Пример #1
0
char* vt_env_gnu_nm()
{
  static int read = 1;
  static char* gnu_nm = NULL;
  char* tmp;

  if (read)
    {
      read = 0;
      tmp = getenv("VT_GNU_NM");
      if (tmp != NULL && strlen(tmp) > 0)
        {
          vt_cntl_msg(2, "VT_GNU_NM=%s", tmp);

          gnu_nm = replace_vars(tmp);
        }
      else
        {
#ifdef DEFAULT_NM
          gnu_nm = DEFAULT_NM;
#endif /* DEFAULT_NM */
        }
    }

  return gnu_nm;
}
Пример #2
0
char* vt_env_fprefix()
{
  static char* fprefix = NULL;
  char* tmp;

  if (! fprefix)
    {
      tmp = getenv("VT_FILE_PREFIX");
      if (tmp != NULL && strlen(tmp) > 0)
        {
          vt_cntl_msg(2, "VT_FILE_PREFIX=%s", tmp);

          fprefix = replace_vars(tmp);
        }
      else
        {
          tmp = vt_env_apppath();
          if (tmp != NULL && strlen(tmp) > 0)
            {
              fprefix = strip_dir(tmp);
              if (strlen(fprefix) >= 4 &&
                  (strcmp(fprefix+(strlen(fprefix)-4), ".out") == 0 ||
                   strcmp(fprefix+(strlen(fprefix)-4), ".exe") == 0))
                {
                  fprefix[strlen(fprefix)-4] = '\0';
                }
            }
          else
            {
              fprefix = "a";
            }
        }
    }
  return fprefix;
}
Пример #3
0
char* vt_env_ldir()
{
  static char* ldir = NULL;
  char* tmp;

  if (! ldir)
    {
      tmp = getenv("VT_PFORM_LDIR");
      if (tmp != NULL && strlen(tmp) > 0)
        {
          ldir = replace_vars(tmp);
        }
      else
        {
          ldir = replace_vars(vt_pform_ldir());
        } 
    }
  return ldir;
}
Пример #4
0
char* vt_env_gdir()
{
  static char* gdir = NULL;
  char* tmp;

  if (! gdir)
    {
      tmp = getenv("VT_PFORM_GDIR");
      if (tmp != NULL && strlen(tmp) > 0)
        {
          gdir = replace_vars(tmp);
        }
      else
        {
          gdir = replace_vars(vt_pform_gdir());
        } 
    }
  return gdir;
}
Пример #5
0
char* vt_env_ldir()
{
  static char* ldir = NULL;
  char* tmp;

  if (! ldir)
    {
      tmp = getenv("VT_PFORM_LDIR");

#if defined(VT_IOFSL)
      if (vt_env_iofsl_servers())
        {
          ldir = vt_env_gdir();

          if (tmp != NULL && strlen(tmp) > 0)
            {
              vt_warning("Setting of VT_PFORM_LDIR isn't allowed in IOFSL "
                         "mode; reset it to VT_PFORM_GDIR (=%s)", ldir);
            }
        }
      else
#endif /* VT_IOFSL */
        {
          if (tmp != NULL && strlen(tmp) > 0)
            {
              vt_cntl_msg(2, "VT_PFORM_LDIR=%s", tmp);

              ldir = replace_vars(tmp);
            }
          else
            {
              ldir = replace_vars(vt_pform_ldir());
            }
        }
    }
  return ldir;
}
Пример #6
0
char* vt_env_gdir()
{
  static char* gdir = NULL;
  char* tmp;

  if (! gdir)
    {
      tmp = getenv("VT_PFORM_GDIR");
      if (tmp != NULL && strlen(tmp) > 0)
        {
          vt_cntl_msg(2, "VT_PFORM_GDIR=%s", tmp);

          gdir = replace_vars(tmp);
        }
      else
        {
          gdir = replace_vars(vt_pform_gdir());
        }

#if defined(VT_IOFSL)
      if (vt_env_iofsl_servers())
      {
        char* gdir_abs = realpath(gdir, NULL);
        if (gdir_abs == NULL)
          {
            vt_error_msg("Could not retrieve the absolute path of %s:",
                         gdir, strerror(errno));
          }
        else
          {
            gdir = gdir_abs;
          }
      }
#endif /* VT_IOFSL */
    }
  return gdir;
}
Пример #7
0
char* vt_env_gnu_nmfile()
{
  static int read = 1;
  static char* gnu_nmfile = NULL;
  char* tmp;

  if (read)
  {
    read = 0;
    tmp = getenv("VT_GNU_NMFILE");
    if (tmp != NULL && strlen(tmp) > 0)
      {
        gnu_nmfile = replace_vars(tmp);
      }
  }
  return gnu_nmfile;
}
Пример #8
0
char* vt_env_dyn_shlibs()
{
  static int read = 1;
  static char* dyn_shlibs = NULL;
  char* tmp;

  if (read)
    {
      read = 0;
      tmp = getenv("VT_DYN_SHLIBS");
      if (tmp != NULL && strlen(tmp) > 0)
        {
	  dyn_shlibs = replace_vars(tmp);
	}
    }
  return dyn_shlibs;
}
Пример #9
0
char* vt_env_dyn_blacklist()
{
  static int read = 1;
  static char* dyn_blacklist = NULL;
  char* tmp;

  if (read)
    {
      read = 0;
      tmp = getenv("VT_DYN_BLACKLIST");
      if (tmp != NULL && strlen(tmp) > 0)
        {
	  dyn_blacklist = replace_vars(tmp);
	}
    }
  return dyn_blacklist;
}
Пример #10
0
char* vt_env_groups_spec()
{
  static int read = 1;
  static char* spec = NULL;
  char* tmp;

  if (read)
    {
      read = 0;
      tmp = getenv("VT_GROUPS_SPEC");
      if (tmp != NULL && strlen(tmp) > 0)
        {
	  spec = replace_vars(tmp);
	}
    }
  return spec;
}
Пример #11
0
char* vt_env_java_filter_spec()
{
  static int read = 1;
  static char* spec = NULL;
  char* tmp;

  if (read)
    {
      read = 0;
      tmp = getenv("VT_JAVA_FILTER_SPEC");
      if (tmp != NULL && strlen(tmp) > 0)
      {
        spec = replace_vars(tmp);
      }
    }
  return spec;
}
Пример #12
0
char* vt_env_filter_spec()
{
  static int read = 1;
  static char* spec = NULL;
  char* tmp;

  if (read)
    {
      read = 0;
      tmp = getenv("VT_FILTER_SPEC");
      if (tmp != NULL && strlen(tmp) > 0)
        {
          vt_cntl_msg(2, "VT_FILTER_SPEC=%s", tmp);

          spec = replace_vars(tmp);
        }
    }
  return spec;
}
Пример #13
0
char* vt_env_iolibpathname()
{
  static char* pathname = NULL;
  char* tmp;

  if (! pathname)
    {
      tmp = getenv("VT_IOLIB_PATHNAME");
      if (tmp != NULL && strlen(tmp) > 0)
        {
          pathname = replace_vars(tmp);
        }
      else
        {
          pathname = NULL;
        }
    }
  return pathname;
}
Пример #14
0
char* vt_env_apppath()
{
  static int read = 1;
  static char* apppath = NULL;
  char* tmp;

  if (read)
    {
      read = 0;
      tmp = getenv("VT_APPPATH");
      if (tmp != NULL && strlen(tmp) > 0)
        {
	  apppath = replace_vars(tmp);
	}
      else
        {
	  apppath = vt_pform_exec();
	}
    }
  return apppath;
}
Пример #15
0
//==========================================================================================================
// A returning value version of replace_vars()
//==========================================================================================================
string ScriptReader::get_replaced_str(string line, int call_number)
{
    string result = line;
    replace_vars(result, call_number);
    return result;
}