scc

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

objstrip.c (281B)


      1 #include <stdio.h>
      2 
      3 #include <scc/mach.h>
      4 
      5 #include "libmach.h"
      6 
      7 extern stripfun_t stripv[];
      8 
      9 int
     10 objstrip(Obj *obj)
     11 {
     12 	int fmt;
     13 	stripfun_t fn;
     14 
     15 	fmt = FORMAT(obj->type);
     16 	if (fmt >= NFORMATS)
     17 		return -1;
     18 	fn = stripv[fmt];
     19 	(*fn)(obj);
     20 
     21 	objfree(obj, GENERICDEL);
     22 
     23 	return 0;
     24 }