Annotation of researchv10no/ipc/mgrs/svcmgr/request.c, revision 1.1

1.1     ! root        1: #include "mgr.h"
        !             2: 
        !             3: /*
        !             4:  *  create a new request.  the request is staticly allocated since
        !             5:  *  only one exists per process.
        !             6:  */
        !             7: Request *
        !             8: newrequest(ip, sp)
        !             9:        ipcinfo *ip;
        !            10:        Service *sp;
        !            11: {
        !            12:        static Request r;
        !            13: 
        !            14:        r.i = ip;
        !            15:        r.s = sp;
        !            16:        r.line = r.args = r.term = NULL;
        !            17:        r.errfd = -1;
        !            18:        return &r;
        !            19: }
        !            20: 
        !            21: freerequest(rp)
        !            22:        Request *rp;
        !            23: {
        !            24:        if(rp->line)
        !            25:                free(rp->line);
        !            26:        if(rp->args)
        !            27:                free(rp->args);
        !            28: }
        !            29: 
        !            30: /*
        !            31:  *  execute a request
        !            32:  */
        !            33: doreq(rp)
        !            34:        Request *rp;
        !            35: {
        !            36:        Action *ap;
        !            37: 
        !            38:        for(ap=rp->s->ap; ap; ap=ap->next) {
        !            39:                if((*ap->func)(rp, ap)<0){
        !            40:                        logstatus("in", rp->i);
        !            41:                        return;
        !            42:                }
        !            43:        }
        !            44: }

unix.superglobalmegacorp.com

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