6. Initialization

The main struct is called gestvm.

<<typedefs>>=
typedef struct gestvm gestvm;
<<main_struct>>=
struct gestvm {
<<gestvm>>
};

It is initialized with gestvm_init. An instance of Uxn set up to work with gestvm is passed in.

<<funcdefs>>=
void gestvm_init(gestvm *gvm, gestvm_uxn *u);
<<funcs>>=
void gestvm_init(gestvm *gvm, gestvm_uxn *u)
{
<<init>>
}

The gestvm_sizeof function is required because gestvm is used opaquely.

<<funcdefs>>=
size_t gestvm_sizeof(void);
<<funcs>>=
size_t gestvm_sizeof(void)
{
    return sizeof(gestvm);
}



prev | home | next