1 |
#include "defaultpaths.h" |
2 |
|
3 |
#include <utilities/config.h> |
4 |
|
5 |
#ifdef WIN32 |
6 |
#include <windows.h> |
7 |
#endif |
8 |
|
9 |
const char *get_default_solvers_path(){ |
10 |
#ifdef WIN32 |
11 |
# define MAXLEN 3000 |
12 |
HKEY key; |
13 |
DWORD datatype, len = MAXLEN; |
14 |
long res; |
15 |
static char value[MAXLEN]; |
16 |
res = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\ASCEND", 0L, KEY_QUERY_VALUE, &key); |
17 |
if(res==ERROR_SUCCESS){ |
18 |
res = RegQueryValueEx(key, ASC_ENV_SOLVERS, NULL, &datatype, value, &len); |
19 |
if(res==ERROR_SUCCESS){ |
20 |
RegCloseKey(key); |
21 |
return value; |
22 |
} |
23 |
} |
24 |
#endif |
25 |
return ASC_DEFAULT_ASCENDSOLVERS; |
26 |
} |
27 |
|
28 |
const char *get_default_library_path(){ |
29 |
#ifdef WIN32 |
30 |
# define MAXLEN 3000 |
31 |
HKEY key; |
32 |
DWORD datatype, len = MAXLEN; |
33 |
long res; |
34 |
static char value[MAXLEN]; |
35 |
res = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\ASCEND", 0L, KEY_QUERY_VALUE, &key); |
36 |
if(res==ERROR_SUCCESS){ |
37 |
res = RegQueryValueEx(key, ASC_ENV_LIBRARY, NULL, &datatype, value, &len); |
38 |
if(res==ERROR_SUCCESS){ |
39 |
RegCloseKey(key); |
40 |
return value; |
41 |
} |
42 |
} |
43 |
#endif |
44 |
return ASC_DEFAULT_ASCENDLIBRARY; |
45 |
} |