VAPOR3 3.9.4
SetHDF5PluginPath.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdlib.h>
4#include "vapor/MyBase.h"
6
7namespace VAPoR {
9 char *existing = getenv("HDF5_PLUGIN_PATH");
10 if (existing) {
11 printf("Using custom HDF5_PLUGIN_PATH: '%s'\n", existing);
12 return;
13 }
14
15 int rc=0;
16 std::string plugins = "HDF5_PLUGIN_PATH=" + Wasp::GetSharePath("plugins");
17 #ifdef WIN32
18 rc=_putenv(plugins.c_str());
19 #else
20 rc = setenv("HDF5_PLUGIN_PATH", Wasp::GetSharePath("plugins").c_str(), 1);
21 #endif
22
23 if (rc != 0) Wasp::MyBase::SetErrMsg("Unable to set environtment variable s", plugins.c_str());
24}
25}; // namespace VAPoR
static void SetErrMsg(const char *format,...)
Record a formatted error message.
void SetHDF5PluginPath()
COMMON_API std::string GetSharePath(const std::string &name)