/[ascend]/trunk/ascend/compiler/defaultpaths.c
ViewVC logotype

Annotation of /trunk/ascend/compiler/defaultpaths.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2018 - (hide annotations) (download) (as text)
Wed Apr 29 03:38:10 2009 UTC (11 years, 3 months ago) by jpye
File MIME type: text/x-csrc
File size: 1073 byte(s)
Fixed compile for new header file locations <ascend/compiler/xxx.h> etc.
1 jpye 1616 #include "defaultpaths.h"
2    
3 jpye 2018 #include <ascend/utilities/config.h>
4 jpye 1616
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     }

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22