FreeBSD/usr.bin/gprof/aout.c
/*
     * Set up string and symbol tables from a.out.
     *	and optionally the text space.
     * On return symbol table is sorted by value.
     *
     * Returns 0 on success, -1 on failure.
     */
Set up string and symbol tables from a.out.
and optionally the text space.
On return symbol table is sorted by value.

Returns 0 on success, -1 on failure.
Set up string and symbol tables from a . out . and optionally the text space . On return symbol table is sorted by value . Returns 0 on success - 1 on failure .
int
aout_getnfile(const char *filename, char ***defaultEs)
{
    FILE	*nfile;
    nfile = fopen( filename ,"r");
    if (nfile == NULL)
	err( 1 , "%s", filename );
    fread(&xbuf, 1, sizeof(xbuf), nfile);
    if (N_BADMAG(xbuf)) {
	fclose(nfile);
	return -1;
    }
    getstrtab(nfile, filename);
    getsymtab(nfile, filename);
    gettextspace( nfile );
    fclose(nfile);
#   ifdef DEBUG
	if ( debug & AOUTDEBUG ) {
	    register int j;
	    for (j = 0; j < nname; j++){
		printf("[getnfile] 0X%08lx\t%s\n", nl[j].value, nl[j].name);
	    }
	}
#   endif 
    *defaultEs = excludes;
    return 0;
}
int aout_getnfile ( const char * filename , char * * * defaultEs ) { FILE * nfile ; nfile = fopen ( filename , " " ) ; if ( nfile == NULL ) err ( 1 , " " , filename ) ; fread ( & xbuf , 1 , sizeof ( xbuf ) , nfile ) ; if ( N_BADMAG ( xbuf ) ) { fclose ( nfile ) ; return -1 ; } getstrtab ( nfile , filename ) ; getsymtab ( nfile , filename ) ; gettextspace ( nfile ) ; fclose ( nfile ) ; #   ifdef DEBUG if ( debug & AOUTDEBUG ) { register int j ; for ( j = 0 ; j < nname ; j ++ ) { printf ( " \t \n " , nl [ j ] . value , nl [ j ] . name ) ; } } #   endif * defaultEs = excludes ; return 0 ; }
Set up string and symbol tables from a.out.
Set up string and symbol tables from a . out .
/* DEBUG */