From 3d233444503ba7342397a9c97fb38d67a74ce059 Mon Sep 17 00:00:00 2001 From: seleznevae Date: Sat, 21 Sep 2019 11:05:16 +0300 Subject: [PATCH] [A] Added math example --- CMakeLists.txt | 2 +- ChangeLog.md | 6 ++++++ example/CMakeLists.txt | 6 ++++++ example/main.c | 18 ------------------ lib/fort.h | 4 ++-- src/fort.h | 4 ++-- 6 files changed, 17 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2de8f1f..3c2d0b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0) -project(libfort VERSION 0.2.2) +project(libfort VERSION 0.2.3) string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1.\\2" libfort_SOVERSION diff --git a/ChangeLog.md b/ChangeLog.md index d8e754e..82d8554 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,9 @@ +## v0.2.3 + +### Internal + +- Refactoring of examples. + ## v0.2.2 ### Bug fixes diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 5db268b..3d86db4 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -9,6 +9,11 @@ add_executable(${PROJECT_NAME}_print_styles target_link_libraries(${PROJECT_NAME}_print_styles fort) +add_executable(${PROJECT_NAME}_math_table + math_table.c) +target_link_libraries(${PROJECT_NAME}_math_table + fort) + add_executable(${PROJECT_NAME}_ex_cpp main.cpp) target_link_libraries(${PROJECT_NAME}_ex_cpp @@ -17,6 +22,7 @@ target_link_libraries(${PROJECT_NAME}_ex_cpp set(${PROJECT_NAME}_examples ${PROJECT_NAME}_ex ${PROJECT_NAME}_print_styles + ${PROJECT_NAME}_math_table ${PROJECT_NAME}_ex_cpp PARENT_SCOPE) diff --git a/example/main.c b/example/main.c index 46a5a3c..5181fc1 100644 --- a/example/main.c +++ b/example/main.c @@ -36,23 +36,6 @@ void base_example(void) ft_destroy_table(table); } -void math_example(void) -{ -#ifdef FT_HAVE_UTF8 - ft_table_t *table = ft_create_table(); - ft_set_border_style(table, FT_DOUBLE2_STYLE); - ft_set_cell_prop(table, 0, FT_ANY_COLUMN, FT_CPROP_ROW_TYPE, FT_ROW_HEADER); - - ft_u8write_ln(table, "N", "Figure", "Volume, cm³", "Accuracy"); - - ft_u8write_ln(table, "1", "○", "3.145", "±0.3"); - ft_u8write_ln(table, "2", "◸", "4.95", "±0.25"); - - printf("%s\n", (const char *)ft_to_u8string(table)); - ft_destroy_table(table); -#endif /* FT_HAVE_UTF8 */ - -} void complex_layout_example(void) { @@ -284,7 +267,6 @@ int main(void) different_cell_properties_example(); fill_table_with_data_example(); complex_layout_example(); - math_example(); custom_border_style_example(); colorfull_table(); diff --git a/lib/fort.h b/lib/fort.h index f363479..2190080 100644 --- a/lib/fort.h +++ b/lib/fort.h @@ -46,8 +46,8 @@ SOFTWARE. #define LIBFORT_MAJOR_VERSION 0 #define LIBFORT_MINOR_VERSION 2 -#define LIBFORT_REVISION 2 -#define LIBFORT_VERSION_STR "0.2.2" +#define LIBFORT_REVISION 3 +#define LIBFORT_VERSION_STR "0.2.3" /***************************************************************************** diff --git a/src/fort.h b/src/fort.h index f363479..2190080 100644 --- a/src/fort.h +++ b/src/fort.h @@ -46,8 +46,8 @@ SOFTWARE. #define LIBFORT_MAJOR_VERSION 0 #define LIBFORT_MINOR_VERSION 2 -#define LIBFORT_REVISION 2 -#define LIBFORT_VERSION_STR "0.2.2" +#define LIBFORT_REVISION 3 +#define LIBFORT_VERSION_STR "0.2.3" /*****************************************************************************