diff src/llrb/llrbContext.h @ 54:0299b90256e5

syntax suggest
author kkb
date Thu, 11 Jun 2015 17:23:50 +0900
parents 399ed10d1760
children c469c5ed5b4d
line wrap: on
line diff
--- a/src/llrb/llrbContext.h	Thu Jun 11 15:08:38 2015 +0900
+++ b/src/llrb/llrbContext.h	Thu Jun 11 17:23:50 2015 +0900
@@ -33,26 +33,36 @@
 };
 
 struct Context {
+    enum Code *next;
+    int current;
     int codeNum;
     __code (**code) (struct Context*);
-    void* heap_start;
+    void* heapStart;
     void* heap;
-    long dataSize;
+    long heapLimit;
     int dataNum;
     union Data **data;
 };
 
 union Data {
-    long count;
-    enum Code next;
+    struct Comparable { // inteface
+        enum Code compare;
+        union Data* data;
+    }
+    struct Count {
+        enum Code next;
+        long count;
+    } count;
     struct Tree {
+        enum Code next;
         struct Node* root;
         struct Node* current;
         struct Node* prev;
         int result;
     } tree;
     struct Node {
-        int key;
+        enum Code next;
+        int key; // comparable data segment
         int value;
         enum Color {
             Red,
@@ -62,7 +72,7 @@
         struct Node* right;
     } node;
     struct Allocate {
+        enum Code next;
         long size;
-        enum Code next;
     } allocate;
 };