12 #ifndef _CEPTR_MTREE_H
13 #define _CEPTR_MTREE_H
17 #include "ceptr_error.h"
19 #include "ceptr_types.h"
29 H __m_new(
H parent,
Symbol symbol,
void *surface,
size_t size,uint32_t flags);
30 #define _m_new(parent,symbol,surface,size) __m_new(parent,symbol,surface,size,0)
31 #define _m_newt(parent,symbol,h) __m_new(parent,symbol,&(h),sizeof(H),TFLAG_SURFACE_IS_TREE)
38 #define _m_free(h) __m_free(h,1)
57 #define maddreq(x,y) ((x).i == (y).i && (x).l == (y).l)
62 #define DO_KIDSM(h,x) {int i,_c=_m_children(h);for(i=1;i<=_c;i++){x;}}
64 #define _GET_LEVEL(h,l) (&(h).m->lP[l])
65 #define _GET_NODE(h,l,i) (&(l)->nP[i])
66 #define GET_LEVEL(h) _GET_LEVEL(h,(h).a.l)
67 #define GET_NODE(h,l) _GET_NODE(h,l,(h).a.i)
69 #define spec_is_maddr_equal(got, expected) spec_total++; if (maddreq(expected,got)){putchar('.');} else {putchar('F');sprintf(failures[spec_failures++],"%s:%d expected %s to be %d.%d but was %d.%d",__FUNCTION__,__LINE__,#got,expected.l,expected.i,got.l,got.i);}
void __m_free(H h, int free_surface)
H __m_new(H parent, Symbol symbol, void *surface, size_t size, uint32_t flags)
Maddr _m_child(H h, Mindex i)
H _m_newr(H parent, Symbol s)
Maddr _m_next_sibling(H h)
H _m_newi(H h, Symbol symbol, int surface)
void _m_walk(H h, void(*walkfn)(H, N *, void *, MwalkState *, Maddr), void *user_data)
Defines types and vars for system defined semantics.