initial release

This commit is contained in:
vrd
2023-03-01 10:10:39 +02:00
parent b9151efc13
commit 199a8b527c
6 changed files with 71 additions and 52 deletions
+7 -11
View File
@@ -1,10 +1,6 @@
#!/bin/sh
set -e
# cp tft_create /usr/local/bin
cd src
language='
-std=c++17
-fno-rtti
@@ -17,22 +13,22 @@ optimizations='
-Ofast
-flto
-fipa-pta
-fallow-store-data-races
-fgcse-sm
-fgcse-las
-march=native'
warnings='
-Wall
-Wextra
-Wpedantic
-Wmultiple-inheritance
-Wvirtual-inheritance' #-fanalyzer
-Wextra'
# -Wpedantic' #-fanalyzer
other='-fno-fat-lto-objects'
g++ -o tft $language $optimizations $warnings $other -DNDEBUG -pipe -s tft.cpp tree.cpp person.cpp utils.cpp -lncursesw
cd src
g++ -o tft $language $optimizations $warnings $other -DNDEBUG -pipe -s *.cpp -lncursesw
#-static -lncursesw -ltinfo
chmod 775 tft
exec mv tft /usr/local/bin
#-static -lncursesw -ltinfo
View File
+53
View File
@@ -0,0 +1,53 @@
tft - Terminal Family Tree
tft can create and display family trees on the terminal.
HOW TO CREATE:
Trees are created using the tft file format, for example this tft file:
# This is a comment
Adam, M # Adam is a male
Eve, F
s: Adam # Eve's spouse is Adam
Cain, M
p: Adam, Eve # Cain's parents are Adam and Eve
Abel, M
p: - # Abel's parents are the same as the last person's (Cain)
Seth, M
p: -
Will produce:
├──────┬┬─────┐
│ ││ │
│ Adam ││ Eve │
│ ││ │
├──────┘└─────┘
├────────┬────────┐
│ │ │
├──────┐ ├──────┐ ├──────┐
│ │ │ │ │ │
│ Cain │ │ Abel │ │ Seth │
│ │ │ │ │ │
└──────┘ └──────┘ └──────┘
HOW TO INSTALL:
Make sure you have permissons and execute:
git clone https://gitlab.com/venelin98/tft.git
./install.sh
HOW TO USE:
tft ${MY_TFT_FILE}
+11 -11
View File
@@ -1,15 +1,15 @@
#include <ncursesw/ncurses.h>
#include "tree.hpp"
#include "utils.hpp"
/* #include <ncursesw/ncurses.h> */
/* #include "tree.hpp" */
/* #include "utils.hpp" */
#include "user_tree.hpp"
/* #include "user_tree.hpp" */
int main()
{
init();
/* int main() */
/* { */
/* init(); */
create_tree();
/* create_tree(); */
endwin(); /* stop ncursers */
return 0;
}
/* endwin(); /\* stop ncursers *\/ */
/* return 0; */
/* } */
-30
View File
@@ -1,30 +0,0 @@
#!/bin/sh
set -e
if [ "$1" = '' ]
then
echo 'The first argument needs to be the tree file'
exit 1
fi
tree_file="$(realpath "$1")"
start_dir="$PWD"
script_dir="$(dirname $(readlink -f $0))"
cd "$script_dir/src"
language='
-std=c++17
-fno-rtti
-fno-exceptions
-fno-non-call-exceptions
-fno-common'
# force each global variable to be only defined once
warnings='-Wall -Wextra -Wpedantic' #-fanalyzer
cp -f "$tree_file" user_tree.hpp
g++ -o "$start_dir/${1%.*}.tft" $language $warnings -march=native -DNDEBUG -pipe -g create_tree.cpp tree.cpp person.cpp utils.cpp -lncursesw
rm user_tree.hpp
cd "$start_dir"
exec "./${1%.*}.tft"