1#include <errno.h>2#include <stdio.h>34#include <scc/mach.h>56#include "libmach.h"78#include "elf/fun.h"9#include "coff32/fun.h"1011static int (*ops[NFORMATS])(int, long *, char ***, long **, FILE *);1213static int14getidx(int type, long *nsyms, char ***namep, long **offsp, FILE *fp)15{16 return getidx32(BIG_ENDIAN, nsyms, namep, offsp, fp);17}1819int20getindex(int type, long *nsyms, char ***names, long **offs, FILE *fp)21{22 int fmt;2324 fmt = FORMAT(type);25 if (fmt >= NFORMATS) {26 errno = ERANGE;27 return -1;28 }2930 return (*ops[fmt])(type, nsyms, names, offs, fp);31}3233static int (*ops[NFORMATS])(int, long *, char ***, long **, FILE *) = {34 [COFF32] = getidx,35 [ELF] = getidx,36};37