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#include <scc/coff32.h>
 5
 6#define NAMELEN 8
 7
 8union name {
 9	char name[NAMELEN];  /* name */
10	struct {
11		long zeroes;  /* if name[0-3] == 0 */
12		long offset;  /* offset into string table */
13	} s;
14};
15
16char *
17coff32str(Coff32 *coff, void *hdr)
18{
19	union name *p = hdr;
20
21	if (p->s.zeroes != 0)
22		return p->name;
23	return &coff->strtbl[p->s.offset];
24}