version 1.235, 2008/09/18 02:42:24
|
version 1.241, 2009/04/20 19:14:46
|
Line 1662 ucols=cols;
|
Line 1662 ucols=cols;
|
|
|
wcwidth ( u -- n ) gforth |
wcwidth ( u -- n ) gforth |
""The number of fixed-width characters per unicode character u"" |
""The number of fixed-width characters per unicode character u"" |
|
#ifdef HAVE_WCWIDTH |
n = wcwidth(u); |
n = wcwidth(u); |
|
#else |
|
n = 1; |
|
#endif |
|
|
flush-icache ( c_addr u -- ) gforth flush_icache |
flush-icache ( c_addr u -- ) gforth flush_icache |
""Make sure that the instruction cache of the processor (if there is |
""Make sure that the instruction cache of the processor (if there is |
Line 1694 c_addr2 = (Char *)getenv(cstr(c_addr1,u1
|
Line 1698 c_addr2 = (Char *)getenv(cstr(c_addr1,u1
|
u2 = (c_addr2 == NULL ? 0 : strlen((char *)c_addr2)); |
u2 = (c_addr2 == NULL ? 0 : strlen((char *)c_addr2)); |
|
|
open-pipe ( c_addr u wfam -- wfileid wior ) gforth open_pipe |
open-pipe ( c_addr u wfam -- wfileid wior ) gforth open_pipe |
|
fflush(stdout); |
wfileid=(Cell)popen(cstr(c_addr,u,1),pfileattr[wfam]); /* ~ expansion of 1st arg? */ |
wfileid=(Cell)popen(cstr(c_addr,u,1),pfileattr[wfam]); /* ~ expansion of 1st arg? */ |
wior = IOR(wfileid==0); /* !! the man page says that errno is not set reliably */ |
wior = IOR(wfileid==0); /* !! the man page says that errno is not set reliably */ |
|
|
Line 1929 Return an error if this is not possible"
|
Line 1934 Return an error if this is not possible"
|
wior = IOR(chdir(tilde_cstr(c_addr, u, 1))); |
wior = IOR(chdir(tilde_cstr(c_addr, u, 1))); |
|
|
get-dir ( c_addr1 u1 -- c_addr2 u2 ) gforth get_dir |
get-dir ( c_addr1 u1 -- c_addr2 u2 ) gforth get_dir |
""Store the current directory in the buffer specified by @{c-addr1, u1}. |
""Store the current directory in the buffer specified by @i{c-addr1, u1}. |
If the buffer size is not sufficient, return 0 0"" |
If the buffer size is not sufficient, return 0 0"" |
c_addr2 = (Char *)getcwd((char *)c_addr1, u1); |
c_addr2 = (Char *)getcwd((char *)c_addr1, u1); |
if(c_addr2 != NULL) { |
if(c_addr2 != NULL) { |
Line 1938 if(c_addr2 != NULL) {
|
Line 1943 if(c_addr2 != NULL) {
|
u2 = 0; |
u2 = 0; |
} |
} |
|
|
|
=mkdir ( c_addr u wmode -- wior ) gforth equals_mkdir |
|
""Create directory @i{c-addr u} with mode @i{wmode}."" |
|
wior = IOR(mkdir(tilde_cstr(c_addr,u,1),wmode)); |
|
|
\+ |
\+ |
|
|
newline ( -- c_addr u ) gforth |
newline ( -- c_addr u ) gforth |
Line 2141 int flag;
|
Line 2150 int flag;
|
int decpt; |
int decpt; |
sig=ecvt(r, u, &decpt, &flag); |
sig=ecvt(r, u, &decpt, &flag); |
n=(r==0. ? 1 : decpt); |
n=(r==0. ? 1 : decpt); |
|
// workaround Mac OS X bug in ecvt |
|
flag=signbit(r); |
f1=FLAG(flag!=0); |
f1=FLAG(flag!=0); |
f2=FLAG(isdigit((unsigned)(sig[0]))!=0); |
f2=FLAG(isdigit((unsigned)(sig[0]))!=0); |
siglen=strlen((char *)sig); |
siglen=strlen((char *)sig); |
Line 2403 r = fp[u];
|
Line 2414 r = fp[u];
|
\g syslib |
\g syslib |
|
|
open-lib ( c_addr1 u1 -- u2 ) gforth open_lib |
open-lib ( c_addr1 u1 -- u2 ) gforth open_lib |
#ifdef HAVE_LIBLTDL |
u2 = gforth_dlopen(c_addr1, u1); |
u2 = (UCell)lt_dlopen(tilde_cstr(c_addr1, u1, 1)); |
|
#elif defined(HAVE_LIBDL) || defined(HAVE_DLOPEN) |
|
#ifndef RTLD_GLOBAL |
|
#define RTLD_GLOBAL 0 |
|
#endif |
|
u2=(UCell) dlopen(tilde_cstr(c_addr1, u1, 1), RTLD_GLOBAL | RTLD_LAZY); |
|
#else |
|
# ifdef _WIN32 |
|
u2 = (Cell) GetModuleHandle(tilde_cstr(c_addr1, u1, 1)); |
|
# else |
|
#warning Define open-lib! |
|
u2 = 0; |
|
# endif |
|
#endif |
|
|
|
lib-sym ( c_addr1 u1 u2 -- u3 ) gforth lib_sym |
lib-sym ( c_addr1 u1 u2 -- u3 ) gforth lib_sym |
#ifdef HAVE_LIBLTDL |
#ifdef HAVE_LIBLTDL |