Mercurial > hg > Members > innparusu > Gears
changeset 105:12d8e3c8976d
Move headers into include directory
author | Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 15 Mar 2016 11:43:58 +0900 |
parents | 6402a33250a6 |
children | 870453d5b096 |
files | src/llrb/CMakeLists.txt src/llrb/include/llrbContext.h src/llrb/include/stack.h src/llrb/llrbContext.h src/llrb/stack.h src/llrb/verifier/llrbContextWithVerifier.h |
diffstat | 6 files changed, 126 insertions(+), 125 deletions(-) [+] |
line wrap: on
line diff
--- a/src/llrb/CMakeLists.txt Wed Mar 02 21:19:01 2016 +0900 +++ b/src/llrb/CMakeLists.txt Tue Mar 15 11:43:58 2016 +0900 @@ -4,6 +4,7 @@ set(CMAKE_C_COMPILER $ENV{CbC_Clang}/clang) +include_directories(include) add_executable(llrb main.c llrb.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/llrb/include/llrbContext.h Tue Mar 15 11:43:58 2016 +0900 @@ -0,0 +1,108 @@ +/* Context definition for llrb example */ +#include "stack.h" + +#define ALLOCATE_SIZE 1000 + +enum Code { + Code1, + Code2, + Code3, + Code4, + Code5, + Find, + Not_find, + Code6, + Allocator, + Put, + Replace, + Insert, + Compare, + RotateL, + RotateR, + SetTree, + InsertCase1, + InsertCase2, + InsertCase3, + InsertCase4, + InsertCase4_1, + InsertCase4_2, + InsertCase5, + StackClear, + Get, + Search, + Delete, + Delete1, + Delete2, + Delete3, + Replace_d1, + Replace_d2, + FindMax1, + FindMax2, + DeleteCase1, + DeleteCase2, + DeleteCase3, + DeleteCase4, + DeleteCase5, + DeleteCase6, + Exit, +}; + +enum Relational { + EQ, + GT, + LT, +}; + +enum UniqueData { + Allocate, + Tree, + Node, +}; + +struct Context { + enum Code next; + int codeNum; + __code (**code) (struct Context*); + void* heapStart; + void* heap; + long heapLimit; + int dataNum; + stack_ptr code_stack; + stack_ptr node_stack; + union Data **data; +}; + +union Data { + struct Comparable { // inteface + enum Code compare; + union Data* data; + } compare; + struct Count { + enum Code next; + long i; + } count; + struct Tree { + enum Code next; + struct Node* root; + struct Node* current; + struct Node* deleted; + int result; + } tree; + struct Node { + // need to tree + enum Code next; + int key; // comparable data segment + int value; + struct Node* left; + struct Node* right; + // need to balancing + enum Color { + Red, + Black, + } color; + } node; + struct Allocate { + enum Code next; + long size; + } allocate; +};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/llrb/include/stack.h Tue Mar 15 11:43:58 2016 +0900 @@ -0,0 +1,16 @@ +#include <stdlib.h> + +typedef struct { + size_t size; + int max; + int num; + void* data; +} stack, *stack_ptr; + +extern stack_ptr stack_init(); +extern stack_ptr stack_realloc(); +extern void stack_free(); +extern int stack_push(); +extern int stack_pop(); +extern int isMax(); +extern int isEmpty();
--- a/src/llrb/llrbContext.h Wed Mar 02 21:19:01 2016 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* Context definition for llrb example */ -#include "stack.h" - -#define ALLOCATE_SIZE 1000 - -enum Code { - Code1, - Code2, - Code3, - Code4, - Code5, - Find, - Not_find, - Code6, - Allocator, - Put, - Replace, - Insert, - Compare, - RotateL, - RotateR, - SetTree, - InsertCase1, - InsertCase2, - InsertCase3, - InsertCase4, - InsertCase4_1, - InsertCase4_2, - InsertCase5, - StackClear, - Get, - Search, - Delete, - Delete1, - Delete2, - Delete3, - Replace_d1, - Replace_d2, - FindMax1, - FindMax2, - DeleteCase1, - DeleteCase2, - DeleteCase3, - DeleteCase4, - DeleteCase5, - DeleteCase6, - Exit, -}; - -enum Relational { - EQ, - GT, - LT, -}; - -enum UniqueData { - Allocate, - Tree, - Node, -}; - -struct Context { - enum Code next; - int codeNum; - __code (**code) (struct Context*); - void* heapStart; - void* heap; - long heapLimit; - int dataNum; - stack_ptr code_stack; - stack_ptr node_stack; - union Data **data; -}; - -union Data { - struct Comparable { // inteface - enum Code compare; - union Data* data; - } compare; - struct Count { - enum Code next; - long i; - } count; - struct Tree { - enum Code next; - struct Node* root; - struct Node* current; - struct Node* deleted; - int result; - } tree; - struct Node { - // need to tree - enum Code next; - int key; // comparable data segment - int value; - struct Node* left; - struct Node* right; - // need to balancing - enum Color { - Red, - Black, - } color; - } node; - struct Allocate { - enum Code next; - long size; - } allocate; -};
--- a/src/llrb/stack.h Wed Mar 02 21:19:01 2016 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -#include <stdlib.h> - -typedef struct { - size_t size; - int max; - int num; - void* data; -} stack, *stack_ptr; - -extern stack_ptr stack_init(); -extern stack_ptr stack_realloc(); -extern void stack_free(); -extern int stack_push(); -extern int stack_pop(); -extern int isMax(); -extern int isEmpty();
--- a/src/llrb/verifier/llrbContextWithVerifier.h Wed Mar 02 21:19:01 2016 +0900 +++ b/src/llrb/verifier/llrbContextWithVerifier.h Tue Mar 15 11:43:58 2016 +0900 @@ -1,4 +1,4 @@ -#include "../llrbContext.h" +#include "llrbContext.h" unsigned int min_height(struct Node* node, unsigned int height); unsigned int max_height(struct Node* node, unsigned int height);