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

1.1     ! root        1: #include       <stdio.h>
        !             2: #include       "filehdr.h"
        !             3: #include       "scnhdr.h"
        !             4: #include       "ldfcn.h"
        !             5: 
        !             6: int
        !             7: ldnshread(ldptr, sectname, secthdr)
        !             8: 
        !             9: LDFILE *ldptr;
        !            10: char   *sectname;
        !            11: SCNHDR *secthdr; 
        !            12: 
        !            13: {
        !            14:     extern int         fseek( );
        !            15:     extern int         fread( );
        !            16: 
        !            17:     extern int         vldldptr( );
        !            18: 
        !            19:     unsigned short     i;
        !            20:     int                        j;
        !            21:     unsigned short     numsects;
        !            22: 
        !            23:     if (vldldptr(ldptr) == SUCCESS) {
        !            24:        if (FSEEK(ldptr, (long) FILHSZ + HEADER(ldptr).f_opthdr,
        !            25:             BEGINNING) == OKFSEEK) {
        !            26:            numsects = (HEADER(ldptr)).f_nscns;
        !            27:            for (i=0;
        !            28:                (i < numsects) && (FREAD(secthdr,SCNHSZ,1,ldptr) == 1);
        !            29:                 ++i) {
        !            30:                    for (j = 0;
        !            31:                        (j < 8) && (secthdr->s_name[j] == sectname[j]);
        !            32:                        ++j) {
        !            33:                            if (secthdr->s_name[j] == '\0') {
        !            34:                                return(SUCCESS);
        !            35:                            }
        !            36:                    }
        !            37:                    if (j == 8) {
        !            38:                        return(SUCCESS);
        !            39:                    }
        !            40:            }
        !            41:        }
        !            42:     }
        !            43: 
        !            44:     return(FAILURE);
        !            45: }
        !            46: 
        !            47: static char ID[ ] = "@(#) ldnshread.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.