Annotation of researchv9/jtools/src/pi/master.c, revision 1.1

1.1     ! root        1: #include "master.pri"
        !             2: #include "process.pri"
        !             3: SRCFILE("master.c")
        !             4: 
        !             5: char *Master::kbd(char*s)              { return PadRcv::kbd(s); }
        !             6: char *Master::help()                   { return PadRcv::help(); }
        !             7: 
        !             8: Master::Master()
        !             9: {
        !            10:        trace( "%d.Master()", this );
        !            11:        child = 0;
        !            12:        core = 0;
        !            13: }
        !            14: 
        !            15: Process *Master::makeproc(char* proc, char *stab, char *comment)
        !            16: {
        !            17:        Process *p;
        !            18: 
        !            19:        for( p = child; p; p = p->sibling )
        !            20:                if( !p->isdead
        !            21:                 && eqstr(proc,p->procpath)
        !            22:                 && eqstr(stab,p->stabpath) ){
        !            23:                        p->comment = comment?sf("%s", comment):(char *)0;
        !            24:                        insert(p);
        !            25:                        return p;
        !            26:                }
        !            27:        child = domakeproc(proc, stab, comment);
        !            28:        child->master = this;
        !            29:        insert(child);
        !            30:        return child;
        !            31: }
        !            32: 
        !            33: void Master::insert(Process *p)
        !            34: {
        !            35:        trace( "%d.insert(%d)", this, p ); VOK;
        !            36:        IF_LIVE( !p || p->disc()!=U_PROCESS ) return;
        !            37:        if( p->isdead ){
        !            38:                pad->removeline( (long)p );
        !            39:                return;
        !            40:        }
        !            41:        char *pp = p->procpath;
        !            42:        char *sp = p->stabpath;
        !            43:        char *ct = p->comment;
        !            44:        pad->insert( (long)p, SELECTLINE, (PadRcv*)p, p->carte(),
        !            45:                "%s %s %s", pp?pp:"", sp?sp:"", ct?ct:"");
        !            46: }
        !            47: 
        !            48: Process *Master::search(char *path)
        !            49: {
        !            50:        Process *p;
        !            51:        OK(0);
        !            52:        for( p = child; p; p = p->sibling )
        !            53:                if( eqstr(path, p->procpath) && p->core ) return p;
        !            54:        return 0;
        !            55: }

unix.superglobalmegacorp.com

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