version 1.12, 1999/05/12 19:30:30
|
version 1.18, 2000/06/14 20:31:47
|
Line 38
|
Line 38
|
#include <sys/time.h> |
#include <sys/time.h> |
#include <unistd.h> |
#include <unistd.h> |
#include <pwd.h> |
#include <pwd.h> |
|
#include <dirent.h> |
|
#include <fnmatch.h> |
#else |
#else |
#include "systypes.h" |
#include "systypes.h" |
#endif |
#endif |
Line 80 int emitcounter;
|
Line 82 int emitcounter;
|
#endif |
#endif |
#define NULLC '\0' |
#define NULLC '\0' |
|
|
|
#ifdef MEMCMP_AS_SUBROUTINE |
|
extern int gforth_memcmp(const char * s1, const char * s2, size_t n); |
|
#define memcmp(s1,s2,n) gforth_memcmp(s1,s2,n) |
|
#endif |
|
|
#ifdef HAS_FILE |
#ifdef HAS_FILE |
char *cstr(Char *from, UCell size, int clear) |
char *cstr(Char *from, UCell size, int clear) |
/* return a C-string corresponding to the Forth string ( FROM SIZE ). |
/* return a C-string corresponding to the Forth string ( FROM SIZE ). |
Line 132 char *tilde_cstr(Char *from, UCell size,
|
Line 139 char *tilde_cstr(Char *from, UCell size,
|
UCell i; |
UCell i; |
for (i=1; i<size && from[i]!='/'; i++) |
for (i=1; i<size && from[i]!='/'; i++) |
; |
; |
|
if (i==2 && from[1]=='+') /* deal with "~+", i.e., the wd */ |
|
return cstr(from+3, size<3?0:size-3,clear); |
{ |
{ |
char user[i]; |
char user[i]; |
memcpy(user,from+1,i-1); |
memcpy(user,from+1,i-1); |
Line 163 char *tilde_cstr(Char *from, UCell size,
|
Line 172 char *tilde_cstr(Char *from, UCell size,
|
#endif |
#endif |
|
|
#ifdef HAS_FILE |
#ifdef HAS_FILE |
static char* fileattr[6]={"r","rb","r+","r+b","w","wb"}; |
static char* fileattr[6]={"rb","rb","r+b","r+b","wb","wb"}; |
|
|
#ifndef O_BINARY |
#ifndef O_BINARY |
#define O_BINARY 0 |
#define O_BINARY 0 |
Line 173 static char* fileattr[6]={"r","rb","r+",
|
Line 182 static char* fileattr[6]={"r","rb","r+",
|
#endif |
#endif |
|
|
static int ufileattr[6]= { |
static int ufileattr[6]= { |
O_RDONLY|O_TEXT, O_RDONLY|O_BINARY, |
O_RDONLY|O_BINARY, O_RDONLY|O_BINARY, |
O_RDWR |O_TEXT, O_RDWR |O_BINARY, |
O_RDWR |O_BINARY, O_RDWR |O_BINARY, |
O_WRONLY|O_TEXT, O_WRONLY|O_BINARY }; |
O_WRONLY|O_BINARY, O_WRONLY|O_BINARY }; |
#endif |
#endif |
|
|
/* if machine.h has not defined explicit registers, define them as implicit */ |
/* if machine.h has not defined explicit registers, define them as implicit */ |