shithub: scc

ref: e6a90cd2d996bc93d89c52d6cc0b1b222105568a
dir: /src/libmach/forsect.c/

View raw version
#include <stdio.h>

#include <scc/mach.h>

#include "libmach.h"

int
forsect(Obj *obj, int (*fn)(Objsect *, void *), void *data)
{
	int i;

	for (i = 0; i < obj->nsecs; i++) {
		if ((*fn)(&obj->sections[i], data))
			return 0;
	}

	return 1;
}