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 int14setidx(int type, long nsymbols, char *names[], long offs[], FILE *fp)15{16 return setidx32(BIG_ENDIAN, nsymbols, names, offs, fp);17}1819int20setindex(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] = setidx,35 [ELF] = setidx,36};