Mercurial > hg > Gears > GearsAgda
view src/list/listContext.h @ 118:32773f506410
remove code stack, add continuation of rotateL/totateR
author | ikkun |
---|---|
date | Mon, 26 Sep 2016 19:54:24 +0900 |
parents | 2ff693c5563c |
children |
line wrap: on
line source
/* Context definition for list example */ #define ALLOCATE_SIZE 100 enum Code { Code1, Code2, Code3, Code4, Code5, Code6, Code7, Allocator, Append, Traverse, Delete, Exit, }; enum UniqueData { Allocate, List, }; struct Context { int codeNum; __code (**code) (struct Context *); void* heap_start; void* heap; long dataSize; int dataNum; union Data* head; union Data** data; }; union Data { long count; struct List { struct Element* head; struct Element* tail; struct Element* current; } list; struct Element { int value; struct Element* next; } element; struct Allocate { long size; enum Code next; enum Code after_append; enum Code after_delete; enum Code after_traverse; } allocate; };