shithub: pdffs

ref: 34238e0feb181a0c120561486d4c86b054d112bc
dir: pdffs/eval.c

View raw version
#include <u.h>
#include <libc.h>
#include "pdf.h"

int
pdfeval(Pdf *pdf, Object *o)
{
	Xref *x;
	int i;

	if(o->type != Oindir)
		return 0;

	for(i = 0; i < pdf->nxref; i++){
		x = &pdf->xref[i];
		if(x->id == o->indir.id)
			return 0;
	}

	werrstr("no object id %d in xref", o->indir.id);

	return -1;
}