version 1.25, 2014/04/02 22:08:29 |
version 1.29, 2015/08/14 13:51:56 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/parse/load.c,v 1.24 2014/03/30 10:48:16 ohara Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/load.c,v 1.28 2015/08/06 10:01:53 fujimoto Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
|
|
#if defined(VISUAL) |
#if defined(VISUAL) || defined(__MINGW32__) |
#include <string.h> |
#include <string.h> |
#include <fcntl.h> |
#include <fcntl.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
|
|
#include <unistd.h> |
#include <unistd.h> |
#endif |
#endif |
|
|
#if defined(VISUAL) |
#if defined(VISUAL) || defined(__MINGW32__) |
#include <io.h> |
#include <io.h> |
#endif |
#endif |
|
|
|
|
#endif |
#endif |
|
|
char **ASIRLOADPATH; |
char **ASIRLOADPATH; |
|
int ASIRLOADPATH_LEN; |
|
|
#if defined(VISUAL) |
#if defined(VISUAL) || defined(__MINGW32__) |
#define ENVDELIM ';' |
#define ENVDELIM ';' |
#define MORE "more < " |
#define MORE "more < " |
#else |
#else |
Line 125 char *search_executable(char *name) |
|
Line 126 char *search_executable(char *name) |
|
if ( len+nlen+1 >= BUFSIZ ) continue; |
if ( len+nlen+1 >= BUFSIZ ) continue; |
sprintf(path,"%s/%s",dir,name); |
sprintf(path,"%s/%s",dir,name); |
if ( !stat(path,&buf) && !(buf.st_mode & S_IFDIR) |
if ( !stat(path,&buf) && !(buf.st_mode & S_IFDIR) |
#if !defined(VISUAL) |
#if !defined(VISUAL) && !defined(__MINGW32__) |
&& !access(path,X_OK) |
&& !access(path,X_OK) |
#endif |
#endif |
) { |
) { |
Line 149 void env_init() { |
|
Line 150 void env_init() { |
|
if ( oxhome = getenv("OpenXM_HOME") ) { |
if ( oxhome = getenv("OpenXM_HOME") ) { |
len = strlen(oxhome); |
len = strlen(oxhome); |
}else { |
}else { |
#if defined(VISUAL) |
#if defined(VISUAL) || defined(__MINGW32__) |
get_rootdir(rootname,sizeof(rootname)); |
get_rootdir(rootname,sizeof(rootname)); |
len = strlen(rootname); |
len = strlen(rootname); |
oxhome = rootname; |
oxhome = rootname; |
Line 177 void env_init() { |
|
Line 178 void env_init() { |
|
} |
} |
|
|
asir_private_dir = NULL; |
asir_private_dir = NULL; |
#if defined(VISUAL) |
#if defined(VISUAL) || defined(__MINGW32__) |
if ( e = getenv("APPDATA") ) { |
if ( e = getenv("APPDATA") ) { |
asir_private_dir = (char *)malloc(strlen(e)+strlen("/asir/lib/asir-contrib")+1); |
asir_private_dir = (char *)malloc(strlen(e)+strlen("/OpenXM/lib/asir-contrib")+1); |
sprintf(asir_private_dir,"%s/asir/lib/asir-contrib",e); |
sprintf(asir_private_dir,"%s/OpenXM/lib/asir-contrib",e); |
} |
} |
#endif |
#endif |
|
|
Line 208 void env_init() { |
|
Line 209 void env_init() { |
|
if ( !p ) |
if ( !p ) |
break; |
break; |
} |
} |
i += 4; |
i += 5; |
|
ASIRLOADPATH_LEN=i; |
ASIRLOADPATH=(char **)MALLOC(sizeof(char *)*i); |
ASIRLOADPATH=(char **)MALLOC(sizeof(char *)*i); |
for ( l = 0; l<i; l++) ASIRLOADPATH[l] = NULL; |
for ( l = 0; l<i; l++) ASIRLOADPATH[l] = NULL; |
e = getenv("ASIRLOADPATH"); |
e = getenv("ASIRLOADPATH"); |
Line 230 void env_init() { |
|
Line 232 void env_init() { |
|
if (asir_private_dir) ASIRLOADPATH[i++] = asir_private_dir; |
if (asir_private_dir) ASIRLOADPATH[i++] = asir_private_dir; |
if (asir_contrib_dir) ASIRLOADPATH[i++] = asir_contrib_dir; |
if (asir_contrib_dir) ASIRLOADPATH[i++] = asir_contrib_dir; |
if (asir_libdir) ASIRLOADPATH[i++] = asir_libdir; |
if (asir_libdir) ASIRLOADPATH[i++] = asir_libdir; |
|
ASIRLOADPATH[i++] = "."; |
ASIRLOADPATH[i] = NULL; |
ASIRLOADPATH[i] = NULL; |
} |
} |
|
|
#if defined(VISUAL) |
#if defined(VISUAL) || defined(__MINGW32__) |
#define R_OK 4 |
#define R_OK 4 |
#endif |
#endif |
|
|
Line 278 void loadasirfile(char *name0) |
|
Line 281 void loadasirfile(char *name0) |
|
FILE *in; |
FILE *in; |
INFILE t; |
INFILE t; |
extern char cppname[]; |
extern char cppname[]; |
#if defined(VISUAL) |
#if defined(VISUAL) || defined(__MINGW32__) |
char ibuf1[BUFSIZ],ibuf2[BUFSIZ]; |
char ibuf1[BUFSIZ],ibuf2[BUFSIZ]; |
int ac; |
int ac; |
char *av[BUFSIZ]; |
char *av[BUFSIZ]; |