scc

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

setindex.c (333B)


      1 #include <stdio.h>
      2 
      3 #include <scc/mach.h>
      4 
      5 #include "libmach.h"
      6 
      7 static long (*funv[])(int, long, Objsymdef *, FILE *) = {
      8 	[COFF32] = coff32setidx,
      9 };
     10 
     11 long
     12 setindex(int type, long nsyms, Objsymdef *head, FILE *fp)
     13 {
     14 	int fmt;
     15 
     16 	fmt = FORMAT(type);
     17 	if (fmt >= NFORMATS)
     18 		return -1;
     19 
     20 	return (*funv[fmt])(type, nsyms, head, fp);
     21 }