scc

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

elftype.c (284B)


      1 #include <stdio.h>
      2 #include <string.h>
      3 
      4 #include <scc/mach.h>
      5 #include <scc/elf.h>
      6 
      7 #include "../libmach.h"
      8 #include "fun.h"
      9 
     10 int
     11 elftype(char *name)
     12 {
     13 	struct arch *ap;
     14 
     15 	for (ap = elfarchs; ap ->name; ap++) {
     16 		if (strcmp(ap->name, name) == 0)
     17 			return ap->type;
     18 	}
     19 
     20 	return -1;
     21 }