Annotation of 3BSD/cmd/lisp/eval2.c, revision 1.1.1.1

1.1       root        1: #include "global.h"
                      2: lispval
                      3: Iarray(fun,args)
                      4: register lispval fun,args;
                      5: {
                      6:        register lispval reg, temp;
                      7:        register struct argent *lbot, *np;
                      8:        snpand(2);
                      9:        
                     10:        lbot = np;
                     11:        if(np + 3 > nplim)
                     12:                namerr();
                     13:        np++->val = fun->accfun;
                     14:        np++->val = args;
                     15:        np++->val = fun;
                     16:        return(vtemp = Lfuncal());
                     17: 
                     18: }
                     19: #define FINTF 1
                     20: #define FDOUBF 2
                     21: #define FORTSUB 0
                     22: 
                     23: lispval
                     24: Ifcall(a)
                     25: register lispval a;
                     26: {
                     27:        int *alloca();
                     28:        register int *arglist;
                     29:        register int index;
                     30:        register struct argent *mynp;
                     31:        register lispval ltemp;
                     32:        register struct argent *lbot;
                     33:        register struct argent *np;
                     34:        int nargs = np - lbot;
                     35: 
                     36:        arglist = alloca((nargs + 1) * sizeof(int));
                     37:        mynp = lbot;
                     38:        *arglist = nargs;
                     39:        for(index = 1; index <=  nargs; index++) {
                     40:                switch(TYPE(mynp->val)) {
                     41:                case INT:
                     42:                        arglist[index] = sp();
                     43:                        stack(0);
                     44:                        *(int *) arglist[index] = mynp->val->i;
                     45:                        break;
                     46:                case DOUB:
                     47:                        stack(0);
                     48:                        arglist[index] = sp();
                     49:                        stack(0);
                     50:                        *(double *) arglist[index] = mynp->val->r;
                     51:                        break;
                     52:                case ARRAY:
                     53:                        arglist[index] = (int) mynp->val->data;
                     54:                }
                     55:                mynp++;
                     56:        }
                     57:        switch(a->discipline->i) {
                     58:                case FINTF:
                     59:                        ltemp = inewint(callg(a->entry,arglist));
                     60:                        break;
                     61: 
                     62:                case FDOUBF:
                     63:                        ltemp = newdoub();
                     64:                        ltemp->r = (* ((double (*)()) callg))(a->entry,arglist);
                     65:                        break;
                     66: 
                     67:                default:
                     68:                case FORTSUB:
                     69:                        callg(a->entry,arglist);
                     70:                        ltemp = tatom;
                     71:        }
                     72: }
                     73: callg(funct,arglist)
                     74: lispval (*funct)();
                     75: int *arglist;
                     76: {
                     77:        asm("   callg   *8(ap),*4(ap)");
                     78: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.