shithub: scc

ref: 0da5637da083a7e827d63fac3701de2e768aea54
dir: /src/libmach/forsym.c/

View raw version
#include <stdio.h>

#include <scc/mach.h>

#include "libmach.h"

int
forsym(Obj *obj, int (*fn)(Objsym *, void *), void *data)
{
	int r;
	Objsym *sym;

	for (sym = obj->head; sym; sym = sym->next) {
		r = (*fn)(sym, data);
		if (r <= 0)
			return r;
	}
	return 1;
}