version 1.13, 2004/03/05 08:45:49 |
version 1.15, 2005/03/24 12:46:45 |
|
|
* 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.12 2004/03/05 08:34:43 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/load.c,v 1.14 2004/03/18 01:59:41 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
|
|
#define MALLOC(x) GC_malloc((x)+4) |
#define MALLOC(x) GC_malloc((x)+4) |
#endif |
#endif |
|
|
char *ASIRLOADPATH[32]; |
char **ASIRLOADPATH; |
|
|
#if defined(VISUAL) |
#if defined(VISUAL) |
#define ENVDELIM ';' |
#define ENVDELIM ';' |
Line 121 char *search_executable(char *name) |
|
Line 121 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) |
&& !access(path,X_OK) ) { |
#if !defined(VISUAL) |
|
&& !access(path,X_OK) |
|
#endif |
|
) { |
len = strlen(path)+1; |
len = strlen(path)+1; |
ret = (char *)MALLOC(len); |
ret = (char *)MALLOC(len); |
strcpy(ret,path); |
strcpy(ret,path); |
Line 171 void env_init() { |
|
Line 174 void env_init() { |
|
strcpy(asir_pager,MORE); |
strcpy(asir_pager,MORE); |
} |
} |
} |
} |
if ( e = getenv("ASIRLOADPATH" ) ) |
if ( e = getenv("ASIRLOADPATH" ) ) { |
for ( i = 0; ; i++, e = p+1 ) { |
for ( i = 0; ; i++, e = p+1 ) { |
p = (char *)index(e,ENVDELIM); |
p = (char *)index(e,ENVDELIM); |
|
if ( !p ) |
|
break; |
|
} |
|
i += 2; |
|
ASIRLOADPATH=(char **)MALLOC(sizeof(char *)*i); |
|
for ( l = 0; l<i; l++) ASIRLOADPATH[l] = NULL; |
|
e = getenv("ASIRLOADPATH"); |
|
for ( i = 0; ; i++, e = p+1 ) { |
|
p = (char *)index(e,ENVDELIM); |
l = p ? p-e : strlen(e); q = (char *)MALLOC(l+1); |
l = p ? p-e : strlen(e); q = (char *)MALLOC(l+1); |
if ( l ) { |
if ( l ) { |
strncpy(q,e,l); q[l] = 0; ASIRLOADPATH[i] = q; |
strncpy(q,e,l); q[l] = 0; ASIRLOADPATH[i] = q; |
Line 181 void env_init() { |
|
Line 193 void env_init() { |
|
if ( !p ) |
if ( !p ) |
break; |
break; |
} |
} |
|
} |
for ( i = 0; ASIRLOADPATH[i]; i++ ); |
for ( i = 0; ASIRLOADPATH[i]; i++ ); |
ASIRLOADPATH[i] = asir_libdir; |
ASIRLOADPATH[i] = asir_libdir; |
} |
} |