Annotation of researchv9/jtools/src/pi/srcdir.c, revision 1.1.1.1

1.1       root        1: #include "srcdir.h"
                      2: #include "process.pri"
                      3: #include "symbol.h"
                      4: #include "srctext.pri"
                      5: #include "symtab.pub"
                      6: SRCFILE("srcdir.c")
                      7: 
                      8: SrcDir::SrcDir(Process *p)
                      9: {
                     10:        trace( "%d.SrcDir(%d)", this, p );      VOK;
                     11:        process = p;
                     12: }
                     13: 
                     14: void SrcDir::banner()
                     15: {
                     16:        trace( "%d.banner()", this );   VOK;
                     17:        if( pad ){
                     18:                pad->name( "Src Files" );
                     19:                pad->banner( "Source Files: %s", process->procpath );
                     20:        }
                     21: }
                     22: 
                     23: void SrcDir::hostclose()
                     24: {
                     25:        trace( "%d.hostclose()", this );        VOK;
                     26:        if( pad ) delete pad;
                     27:        pad = 0;
                     28: }
                     29: 
                     30: char *SrcDir::help()
                     31: {
                     32:        trace( "%d.help()", this );     OK("SrcDir::help");
                     33:        return "<path> {set source path prefix}";
                     34: }
                     35: 
                     36: char *SrcDir::kbd(char *s)
                     37: {
                     38:        trace( "%d.kbd(%s)", this, s ); OK("kbd");
                     39:        process->_prefix = sf("%s",s);
                     40:        pad->insert( 1, SELECTLINE|DONT_CUT, "    prefix: %s", s );
                     41:        return 0;
                     42: }
                     43: 
                     44: void SrcDir::open()
                     45: {
                     46:        Menu    m;
                     47:        long    k = 2;
                     48:        Source  *r;
                     49: 
                     50:        trace( "%d.open()", this );     VOK;
                     51:        if( !pad ){
                     52:                r = process->symtab()->root();
                     53:                if( !r ) return;
                     54:                if( !(Symbol*)r->rsib ){
                     55:                        r->srctext->open();
                     56:                        return;
                     57:                }
                     58:                pad = new Pad( this );
                     59:                banner();
                     60:                pad->options(SORTED);
                     61:                pad->makecurrent();
                     62:                m.last( "open source file", (Action)&SrcText::open);
                     63: // wait for complaints...
                     64: //             m.last( "file statics", (Action)&SrcText::promote);
                     65:                for( ; r; r = (Source*)((Symbol*)r->rsib) )
                     66:                    pad->insert( k++, DONT_CUT, (PadRcv*)r->srctext, m, r->_text );
                     67:        }
                     68:        pad->makecurrent();
                     69: }

unix.superglobalmegacorp.com

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