Annotation of 42BSD/ucb/gprof/printlist.c, revision 1.1

1.1     ! root        1: #ifndef lint
        !             2:     static     char *sccsid = "@(#)printlist.c 1.2 (Berkeley) 6/18/82";
        !             3: #endif lint
        !             4: 
        !             5: #include "gprof.h"
        !             6: 
        !             7:     /*
        !             8:      * these are the lists of names:
        !             9:      * there is the list head and then the listname
        !            10:      * is a pointer to the list head
        !            11:      * (for ease of passing to stringlist functions).
        !            12:      */
        !            13: struct stringlist      fhead = { 0 , 0 };
        !            14: struct stringlist      *flist = &fhead;
        !            15: struct stringlist      Fhead = { 0 , 0 };
        !            16: struct stringlist      *Flist = &Fhead;
        !            17: struct stringlist      ehead = { 0 , 0 };
        !            18: struct stringlist      *elist = &ehead;
        !            19: struct stringlist      Ehead = { 0 , 0 };
        !            20: struct stringlist      *Elist = &Ehead;
        !            21: 
        !            22: addlist( listp , funcname )
        !            23:     struct stringlist  *listp;
        !            24:     char               *funcname;
        !            25: {
        !            26:     struct stringlist  *slp;
        !            27: 
        !            28:     slp = (struct stringlist *) malloc( sizeof(struct stringlist));
        !            29:     if ( slp == (struct stringlist *) 0 ) {
        !            30:        fprintf( stderr, "gprof: ran out room for printlist\n" );
        !            31:        done();
        !            32:     }
        !            33:     slp -> next = listp -> next;
        !            34:     slp -> string = funcname;
        !            35:     listp -> next = slp;
        !            36: }
        !            37: 
        !            38: bool
        !            39: onlist( listp , funcname )
        !            40:     struct stringlist  *listp;
        !            41:     char               *funcname;
        !            42: {
        !            43:     struct stringlist  *slp;
        !            44: 
        !            45:     for ( slp = listp -> next ; slp ; slp = slp -> next ) {
        !            46:        if ( ! strcmp( slp -> string , funcname ) ) {
        !            47:            return TRUE;
        !            48:        }
        !            49:        if ( funcname[0] == '_' && ! strcmp( slp -> string , &funcname[1] ) ) {
        !            50:            return TRUE;
        !            51:        }
        !            52:     }
        !            53:     return FALSE;
        !            54: }

unix.superglobalmegacorp.com

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