scc

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

objsect.c (279B)


      1 #include <stdio.h>
      2 
      3 #include <scc/mach.h>
      4 
      5 #include "libmach.h"
      6 
      7 extern getsectfun_t getsectv[];
      8 
      9 int
     10 objsect(Obj *obj, Objsect **secp)
     11 {
     12 	int fmt;
     13 	getsectfun_t fn;
     14 
     15 	fmt = FORMAT(obj->type);
     16 	if (fmt >= NFORMATS)
     17 		return -1;
     18 
     19 	fn = getsectv[fmt];
     20 	return  (*fn)(obj, secp);
     21 }