Annotation of researchv9/jerq/sgs/libsdp/pop_id.c, revision 1.1.1.1

1.1       root        1: static char ID[] = "@(#) pop_id.c: 1.1 3/16/82";
                      2: #include <stdio.h>
                      3: #include "sdp.h"
                      4: #include "define3.h"
                      5: 
                      6: #ifdef SHORT
                      7: #define PO01   "PO01 "
                      8: #else
                      9: #define PO01   "%s","PO01 -- error return from framesearch\n"
                     10: #endif
                     11: 
                     12: extern FATAL() ;
                     13: extern struct LIBFILE *Glib_file ;
                     14: extern fault() ;
                     15: extern framesearch() ;
                     16: extern stk1search() ;
                     17: 
                     18: ITEMID                                 /* itemid, IDNOTFOUND, IDERROR */
                     19: pop_id(sp,howmuch)
                     20: register struct SPACE  *sp ;
                     21: unsigned               howmuch ;
                     22: {
                     23:        register int            frame ;
                     24:        int                     offset ;
                     25:        register int            stack ;
                     26:        struct MANAGER          *manager ;
                     27:        struct STAXINFO         *pntr ;
                     28:        register ITEMID         id ;
                     29: 
                     30: 
                     31:        if( (stack = stk1search(sp,howmuch)) == NOTFOUND)
                     32:                return(IDNOTFOUND) ;
                     33: 
                     34:        if( (id = sp->staxinfo[stack].top) == IDNULL )
                     35:                return(IDNOTFOUND) ;
                     36: 
                     37:        manager = (sp->environ)->manp ;
                     38: 
                     39:        if( (frame=framesearch(sp,id)) == NOTFOUND )
                     40:                frame = fault(sp,id) ;
                     41: 
                     42:        if(frame == ERROR)
                     43:                ERR_RET(PO01,IDERROR)
                     44: 
                     45:        offset = id % (sp->environ)->frame_size ;
                     46:        pntr = (struct STAXINFO *)(manager[frame].frame_pntr + offset) ;
                     47:        sp->staxinfo[stack].top = pntr->top ;
                     48:        sp->staxinfo[stack].depth-- ;
                     49:        pntr->top = IDNULL ;
                     50:        return(id) ;
                     51: }

unix.superglobalmegacorp.com

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