view pirollback/treewalk.c @ 361:5d1c186cc3cf

fluid-mnf/target-bin/cmd39.m0: hand-crafted by copying cmd.m0 and manually patching the S3 record that contains the 16-bit word at 0x1140, the literal pool DPLL init constant used by hardware_init_calypso()
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 14 Mar 2020 19:33:52 +0000
parents 9f4469766c74
children
line wrap: on
line source

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include "types.h"
#include "struct.h"

extern struct inode_info inode[];
extern int last_inode;

static void
walk_level(curlev)
{
	int child;

	for (child = inode[curlev].descend; child;
	     child = inode[child].sibling) {
		inode[child].parent = curlev;
		walk_level(child);
	}
}

walk_tree()
{
	if (inode[1].type != 0xF2 || *(inode[1].dataptr) != '/' ||
	    inode[1].sibling) {
		fprintf(stderr, "error: inode #1 is not the active root\n");
		exit(1);
	}
	walk_level(1);
}