scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#include <stdio.h>
 2
 3#include <scc/mach.h>
 4
 5#include "libmach.h"
 6
 7#include "elf/fun.h"
 8#include "coff32/fun.h"
 9
10static int (*ops[NFORMATS])(char *) = {
11	[COFF32] = coff32type,
12	[ELF] = elftype,
13};
14
15int
16objtype(char *name)
17{
18	int t;
19	int (**bp)(char *);
20
21	for (bp = ops; bp < &ops[NFORMATS]; ++bp) {
22		if ((t = (**bp)(name)) >= 0)
23			return t;
24	}
25
26	return -1;
27}