changeset 2:9815b09dc853

Sample which uses llrb library in Gears
author Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
date Fri, 11 Mar 2016 19:24:34 +0900
parents a13620720e35
children c80e44ac8f5e
files README src/CMakeLists.txt src/insert_verification/CMakeLists.txt src/insert_verification/main.c
diffstat 4 files changed, 59 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README	Fri Mar 11 19:24:34 2016 +0900
@@ -0,0 +1,20 @@
+# Akasha
+
+Akasha aims verification of data structures in Gears.
+
+
+# How to Compile
+Akasha has dependencies for Gears.
+Please set environment variable GEARS_PATH and CBC_COMPILER like to follow as:
+  export CBC_COMPILER=/usr/local/Cellar/cbc/HEAD/bin/clang
+  export GEARS_PATH=/Users/home/hg/Gears
+Akasha uses CMake for build.
+Please type commands in ``src`` directory.
+  $ cmake .
+  $ make
+
+
+# Coding Rules
+naming rule: camelCase.
+tab: soft tab (4 spaces)
+
--- a/src/CMakeLists.txt	Fri Mar 11 18:26:52 2016 +0900
+++ b/src/CMakeLists.txt	Fri Mar 11 19:24:34 2016 +0900
@@ -7,6 +7,7 @@
 set(CMAKE_C_COMPILER $ENV{CBC_COMPILER})
 add_definitions("-Wall -g -O0")
 
+
 include_directories(include)
 add_subdirectory(insert_verification)
 
--- a/src/insert_verification/CMakeLists.txt	Fri Mar 11 18:26:52 2016 +0900
+++ b/src/insert_verification/CMakeLists.txt	Fri Mar 11 19:24:34 2016 +0900
@@ -1,4 +1,18 @@
 cmake_minimum_required(VERSION 3.3)
 
+# import LLRB from Gears
+set(llrb_path $ENV{GEARS_PATH}/src/llrb)
+
+include_directories(include)
+include_directories($ENV{GEARS_PATH}/src/include)
+include_directories(${llrb_path}/include)
 add_executable(insert_verification
-               main.c)
+               main.c
+               ${llrb_path}/llrb.c
+               ${llrb_path}/llrbContext.c # TODO: create file in akasha
+               ${llrb_path}/allocate.c    # TODO: create file in akasha
+               ${llrb_path}/compare.c     # TODO: create file in akasha
+               ${llrb_path}/origin_cs.c   # TODO: create file in akasha
+               ${llrb_path}/stack.c       # TODO: create file in akasha
+              )
+
--- a/src/insert_verification/main.c	Fri Mar 11 18:26:52 2016 +0900
+++ b/src/insert_verification/main.c	Fri Mar 11 19:24:34 2016 +0900
@@ -1,7 +1,29 @@
 #include <stdio.h>
 
+struct Context;
+struct Tree;
+struct Node;
+struct Allocate;
+
+
+/* FIXME: temporal definition for compile */
+__code code1() { }
+__code code2() { }
+__code code3() { }
+__code code4() { }
+__code code5() { }
+__code code6() { }
+__code code1_stub() { }
+__code code2_stub() { }
+__code code3_stub() { }
+__code code4_stub() { }
+__code find() { }
+__code not_find() { }
+
+
+extern __code put(struct Context*, struct Tree*, struct Node*, struct Allocate*);
 __code hello() {
-    printf("hello\n");
+    printf("access to llrb library: %p\n", put);
 }
 
 int main(int argc, char const* argv[]) {