Annotation of researchv9/jerq/sgs/libld/freeldptr.c, revision 1.1

1.1     ! root        1: #include       <stdio.h>
        !             2: #include       "filehdr.h"
        !             3: #include       "ldfcn.h"
        !             4: #include       "lddef.h"
        !             5: 
        !             6: int
        !             7: freeldptr(ldptr)
        !             8: 
        !             9: LDFILE *ldptr;
        !            10: 
        !            11: {
        !            12:     extern             free( );
        !            13: 
        !            14:     extern LDLIST      *_ldhead;
        !            15: 
        !            16:     LDLIST             *ldindx;
        !            17: 
        !            18:     if (ldptr != NULL) {
        !            19:        if (_ldhead == (LDLIST *) ldptr) {
        !            20:            _ldhead = _ldhead->ld_next;
        !            21:            free(ldptr);
        !            22:            return(SUCCESS);
        !            23:        } else {
        !            24:            for (ldindx = _ldhead; ldindx != NULL; ldindx = ldindx->ld_next) {
        !            25:                if (ldindx->ld_next == (LDLIST *) ldptr) {
        !            26:                    ldindx->ld_next = ((LDLIST *) ldptr)->ld_next;
        !            27:                    free(ldptr);
        !            28:                    return(SUCCESS);
        !            29:                }
        !            30:            }
        !            31:        }
        !            32:     }
        !            33: 
        !            34:     return(FAILURE);
        !            35: }
        !            36: 
        !            37: static char ID[ ] = "@(#) freeldptr.c: 1.1 1/7/82";

unix.superglobalmegacorp.com

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