Diff for /gforth/Attic/engine.c between versions 1.26 and 1.29

version 1.26, 1995/04/20 09:42:47 version 1.29, 1995/10/07 17:38:12
Line 15 Line 15
 #include <sys/time.h>  #include <sys/time.h>
 #include <unistd.h>  #include <unistd.h>
 #include <errno.h>  #include <errno.h>
   #include <pwd.h>
 #include "forth.h"  #include "forth.h"
 #include "io.h"  #include "io.h"
Line 160  char *cstr(Char *from, UCell size, int c Line 161  char *cstr(Char *from, UCell size, int c
   return oldnextscratch;    return oldnextscratch;
 }  }
   char *tilde_cstr(Char *from, UCell size, int clear)
   /* like cstr(), but perform tilde expansion on the string */
     char *s1,*s2;
     int s1_len, s2_len;
     struct passwd *getpwnam (), *user_entry;
     if (size<1 || from[0]!='~')
       return cstr(from, size, clear);
     if (size<2 || from[1]=='/') {
       s1 = (char *)getenv ("HOME");
       s2 = from+1;
       s2_len = size-1;
     } else {
       int i;
       for (i=1; i<size && from[i]!='/'; i++)
         char user[i];
       if (user_entry==NULL)
         return cstr(from, size, clear);
       s1 = user_entry->pw_dir;
       s2 = from+i;
       s2_len = size-i;
     s1_len = strlen(s1);
     if (s1_len>1 && s1[s1_len-1]=='/')
       char path[s1_len+s2_len];
       return cstr(path,s1_len+s2_len,clear);
 #define NEWLINE '\n'  #define NEWLINE '\n'
 #ifndef HAVE_RINT  #ifndef HAVE_RINT
Line 219  Label *engine(Xt *ip0, Cell *sp0, Cell * Line 261  Label *engine(Xt *ip0, Cell *sp0, Cell *
     &&dovar,      &&dovar,
     &&douser,      &&douser,
     &&dodefer,      &&dodefer,
     &&dostruc,      &&dofield,
     &&dodoes,      &&dodoes,
     &&dodoes,  /* dummy for does handler address */      &&dodoes,  /* dummy for does handler address */
 #include "prim_labels.i"  #include "prim_labels.i"
Line 239  Label *engine(Xt *ip0, Cell *sp0, Cell * Line 281  Label *engine(Xt *ip0, Cell *sp0, Cell *
   IF_TOS(TOS = sp[0]);    IF_TOS(TOS = sp[0]);
   IF_FTOS(FTOS = fp[0]);    IF_FTOS(FTOS = fp[0]);
   prep_terminal();  /*  prep_terminal(); */
   NEXT_P0;    NEXT_P0;
   NEXT;    NEXT;
Line 315  Label *engine(Xt *ip0, Cell *sp0, Cell * Line 357  Label *engine(Xt *ip0, Cell *sp0, Cell *
   cfa = *(Xt *)PFA1(cfa);    cfa = *(Xt *)PFA1(cfa);
   NEXT1;    NEXT1;
  dostruc:   dofield:
 #ifdef DEBUG  #ifdef DEBUG
   fprintf(stderr,"%08x: struc: %08x\n",(Cell)ip,(Cell)PFA1(cfa));    fprintf(stderr,"%08x: field: %08x\n",(Cell)ip,(Cell)PFA1(cfa));
 #endif  #endif
   TOS += *(Cell*)PFA1(cfa);     TOS += *(Cell*)PFA1(cfa); 
   NEXT_P0;    NEXT_P0;

Removed from v.1.26  
changed lines
  Added in v.1.29

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>