scc

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

objtype.c (248B)


      1 #include <stdio.h>
      2 
      3 #include <scc/mach.h>
      4 
      5 #include "libmach.h"
      6 
      7 int
      8 objtype(char *name)
      9 {
     10 	int t;
     11 	Objops **opsp, *ops;
     12 
     13 	for (opsp = objops; ops = *opsp; ++opsp) {
     14 		t = (*ops->type)(name);
     15 		if (t < 0)
     16 			continue;
     17 		return t;
     18 	}
     19 
     20 	return -1;
     21 }