scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

getindex.c (310B)


      1 #include <errno.h>
      2 #include <stdio.h>
      3 
      4 #include <scc/mach.h>
      5 
      6 #include "libmach.h"
      7 
      8 int
      9 getindex(int type, long *nsyms, char ***names, long **offs, FILE *fp)
     10 {
     11 	int fmt;
     12 
     13 	fmt = FORMAT(type);
     14 	if (fmt >= NFORMATS) {
     15 		errno = ERANGE;
     16 		return -1;
     17 	}
     18 
     19 	return (*objops[fmt]->getidx)(nsyms, names, offs, fp);
     20 }
     21