diff --git a/CMakeLists.txt b/CMakeLists.txt index 0eea7cdc..1f49bfda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ cmake_minimum_required(VERSION 2.8.12) project(octaspire-dern C) set(OCTASPIRE_DERN_CONFIG_VERSION_MAJOR 0) -set(OCTASPIRE_DERN_CONFIG_VERSION_MINOR 134) +set(OCTASPIRE_DERN_CONFIG_VERSION_MINOR 135) set(OCTASPIRE_DERN_CONFIG_VERSION_PATCH 0) message("== Building ${PROJECT_NAME} ${OCTASPIRE_DERN_CONFIG_VERSION_MAJOR}.${OCTASPIRE_DERN_CONFIG_VERSION_MINOR}.${OCTASPIRE_DERN_CONFIG_VERSION_PATCH}") diff --git a/doc/book/Programming_in_Octaspire_Dern.adoc b/doc/book/Programming_in_Octaspire_Dern.adoc index ceefbcfa..efcd6acc 100644 --- a/doc/book/Programming_in_Octaspire_Dern.adoc +++ b/doc/book/Programming_in_Octaspire_Dern.adoc @@ -4,7 +4,7 @@ Programming in Octaspire Dern :lang: en :toc: -Documentation for Octaspire Dern programming language version 0.134.0 +Documentation for Octaspire Dern programming language version 0.135.0 == About diff --git a/doc/book/Programming_in_Octaspire_Dern.html b/doc/book/Programming_in_Octaspire_Dern.html index 9c7f874d..d47deae5 100644 --- a/doc/book/Programming_in_Octaspire_Dern.html +++ b/doc/book/Programming_in_Octaspire_Dern.html @@ -804,7 +804,7 @@

Programming in Octaspire Dern

-

Documentation for Octaspire Dern programming language version 0.134.0

+

Documentation for Octaspire Dern programming language version 0.135.0

@@ -1753,7 +1753,7 @@

Using the amalgamated source

diff --git a/doc/examples/plugins/dern_ncurses/dern-ncurses-example.dern b/doc/examples/plugins/dern_ncurses/dern-ncurses-example.dern index 3d2599d2..58a28888 100644 --- a/doc/examples/plugins/dern_ncurses/dern-ncurses-example.dern +++ b/doc/examples/plugins/dern_ncurses/dern-ncurses-example.dern @@ -43,25 +43,18 @@ (ncurses-print win 'ACS_DARROW) (ncurses-print win 'ACS_DEGREE) (ncurses-print win 'ACS_DIAMOND) -(ncurses-print win 'ACS_GEQUAL) (ncurses-print win 'ACS_HLINE) (ncurses-print win 'ACS_LANTERN) (ncurses-print win 'ACS_LARROW) -(ncurses-print win 'ACS_LEQUAL) (ncurses-print win 'ACS_LLCORNER) (ncurses-print win 'ACS_LRCORNER) (ncurses-print win 'ACS_LTEE) -(ncurses-print win 'ACS_NEQUAL) -(ncurses-print win 'ACS_PI) (ncurses-print win 'ACS_PLMINUS) (ncurses-print win 'ACS_PLUS) (ncurses-print win 'ACS_RARROW) (ncurses-print win 'ACS_RTEE) (ncurses-print win 'ACS_S1) -(ncurses-print win 'ACS_S3) -(ncurses-print win 'ACS_S7) (ncurses-print win 'ACS_S9) -(ncurses-print win 'ACS_STERLING) (ncurses-print win 'ACS_TTEE) (ncurses-print win 'ACS_UARROW) (ncurses-print win 'ACS_ULCORNER) diff --git a/etc/how-to-build/OpenIndiana.sh b/etc/how-to-build/OpenIndiana.sh new file mode 100755 index 00000000..1719fc5a --- /dev/null +++ b/etc/how-to-build/OpenIndiana.sh @@ -0,0 +1,92 @@ +#!/usr/bin/env sh + +echoAndRun() { echo "$@" ; "$@" ; } +echoToDefs() { echo "$(tput setaf 9) $(tput sgr0)" ; } + +CC=gcc + +echo "$(tput setaf 3) $(tput bold)" +cat << EnDoFmEsSaGe +1. Building stand alone unit test runner to test the release +------------------------------------------------------------------------------- +EnDoFmEsSaGe +echoToDefs +echoAndRun $CC -O2 -std=c99 -Wall -Wextra \ + -DOCTASPIRE_DERN_AMALGAMATED_UNIT_TEST_IMPLEMENTATION \ + -DOCTASPIRE_DERN_CONFIG_BINARY_PLUGINS \ + -DGREATEST_ENABLE_ANSI_COLORS \ +-I . octaspire-dern-amalgamated.c -lm \ +-o octaspire-dern-unit-test-runner + + + +echo "$(tput setaf 3) $(tput bold)" +cat << EnDoFmEsSaGe +2. Building the embedding example +------------------------------------------------------------------------------- +EnDoFmEsSaGe +echoToDefs +echoAndRun $CC -O2 -std=c99 -Wall -Wextra \ + -DOCTASPIRE_DERN_CONFIG_BINARY_PLUGINS \ +-I . examples/embedding-example.c -lm \ +-o embedding-example + + + +echo "$(tput setaf 3) $(tput bold)" +cat << EnDoFmEsSaGe +3. Building the binary library example +------------------------------------------------------------------------------- +EnDoFmEsSaGe +echoToDefs +echoAndRun $CC -O2 -std=c99 -Wall -Wextra -fPIC -I . -c examples/mylib.c +echoAndRun $CC -O2 -std=c99 -Wall -Wextra -shared -I . -o libmylib.so mylib.o + + + +echo "$(tput setaf 3) $(tput bold)" +cat << EnDoFmEsSaGe +4. Building the interactive Dern REPL +------------------------------------------------------------------------------- +EnDoFmEsSaGe +echoToDefs +echoAndRun $CC -O2 -std=c99 -Wall -Wextra \ + -DOCTASPIRE_DERN_AMALGAMATED_REPL_IMPLEMENTATION \ + -DOCTASPIRE_DERN_CONFIG_BINARY_PLUGINS \ +-I . octaspire-dern-amalgamated.c -lm \ +-o octaspire-dern-repl + + + +echo "$(tput setaf 3) $(tput bold)" +cat << EnDoFmEsSaGe +5. Building the 'dern_ncurses' (binary) plugin. PLEASE NOTE: This plugin + requires development version of 'ncurses' library (i.e. headers) to be + installed on the system; otherwise compilation will fail. Failure will + not affect other steps, so if this step fails and you don't want to use + binary plugin 'dern_ncurses', you don't have to do anything. Otherwise, + to install development version of library 'ncurses': + + - OpenIndiana: sudo pkg install ncurses +------------------------------------------------------------------------------- +EnDoFmEsSaGe +echoToDefs +echoAndRun $CC -O2 -std=c99 -Wall -Wextra -fPIC -I . -c plugins/dern_ncurses.c +echoAndRun $CC -O2 -std=c99 -Wall -Wextra -shared -I . -o libdern_ncurses.so dern_ncurses.o -lcurses + + + +echo " " +echo "$(tput bold)Done." +echo "$(tput setaf 2) $(tput bold)" +echo "==================================================================" +echo "Run programs and examples like this:" +echo "==================================================================" +echo "$(tput setaf 3)1)$(tput setaf 2) ./octaspire-dern-unit-test-runner" +echo "$(tput setaf 3)2)$(tput setaf 2) ./embedding-example" +echo "$(tput setaf 3)3)$(tput setaf 2) LD_LIBRARY_PATH=. ./octaspire-dern-repl examples/use-mylib.dern" +echo "$(tput setaf 3)4)$(tput setaf 2) ./octaspire-dern-repl -c" +echo "$(tput setaf 3)5)$(tput setaf 2) LD_LIBRARY_PATH=. ./octaspire-dern-repl examples/dern-ncurses-example.dern" +echo "==================================================================" +echoToDefs + diff --git a/etc/octaspire_dern_amalgamated.c b/etc/octaspire_dern_amalgamated.c index 529e3133..ca7d9ec2 100644 --- a/etc/octaspire_dern_amalgamated.c +++ b/etc/octaspire_dern_amalgamated.c @@ -16007,10 +16007,10 @@ limitations under the License. #define OCTASPIRE_DERN_CONFIG_H #define OCTASPIRE_DERN_CONFIG_VERSION_MAJOR "0" -#define OCTASPIRE_DERN_CONFIG_VERSION_MINOR "134" +#define OCTASPIRE_DERN_CONFIG_VERSION_MINOR "135" #define OCTASPIRE_DERN_CONFIG_VERSION_PATCH "0" -#define OCTASPIRE_DERN_CONFIG_VERSION_STR "Octaspire Dern version 0.134.0" +#define OCTASPIRE_DERN_CONFIG_VERSION_STR "Octaspire Dern version 0.135.0" diff --git a/etc/plugins/dern_ncurses.c b/etc/plugins/dern_ncurses.c index 5998ecaf..16e15112 100644 --- a/etc/plugins/dern_ncurses.c +++ b/etc/plugins/dern_ncurses.c @@ -1,6 +1,11 @@ #include "octaspire-dern-amalgamated.c" -#ifdef __NetBSD__ +#if defined(__NetBSD__) +#include +#elif defined(__sun) && defined(__SVR4) +// Solaris, OpenIndiana +#define NCURSES_ENABLE_STDBOOL_H 1 +#undef bool #include #else #include @@ -543,10 +548,6 @@ static int dern_ncurses_private_print_symbol( { result = waddch(window, ACS_DIAMOND); } - else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_GEQUAL")) - { - result = waddch(window, ACS_GEQUAL); - } else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_HLINE")) { result = waddch(window, ACS_HLINE); @@ -559,10 +560,6 @@ static int dern_ncurses_private_print_symbol( { result = waddch(window, ACS_LARROW); } - else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_LEQUAL")) - { - result = waddch(window, ACS_LEQUAL); - } else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_LLCORNER")) { result = waddch(window, ACS_LLCORNER); @@ -575,14 +572,6 @@ static int dern_ncurses_private_print_symbol( { result = waddch(window, ACS_LTEE); } - else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_NEQUAL")) - { - result = waddch(window, ACS_NEQUAL); - } - else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_PI")) - { - result = waddch(window, ACS_PI); - } else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_PLMINUS")) { result = waddch(window, ACS_PLMINUS); @@ -603,22 +592,10 @@ static int dern_ncurses_private_print_symbol( { result = waddch(window, ACS_S1); } - else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_S3")) - { - result = waddch(window, ACS_S3); - } - else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_S7")) - { - result = waddch(window, ACS_S7); - } else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_S9")) { result = waddch(window, ACS_S9); } - else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_STERLING")) - { - result = waddch(window, ACS_STERLING); - } else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_TTEE")) { result = waddch(window, ACS_TTEE); @@ -1465,13 +1442,12 @@ bool dern_ncurses_init( "\twindow Target window, a value returned by some call to ncurses-initscr\n" "\ty optional Y-coordinate (line) to print to\n" "\tx optional X-coordinate (column) to print to\n" - "\tsymbol The symbol's text value to print, or ACS_BLOCK, ACS_BOARD,\n" - "\t ACS_BTEE, ACS_BULLET, ACS_CKBOARD, ACS_DARROW, ACS_DEGREE,\n" - "\t ACS_DIAMOND, ACS_GEQUAL, ACS_HLINE, ACS_LANTERN, ACS_LARROW,\n" - "\t ACS_LEQUAL, ACS_LLCORNER, ACS_LRCORNER, ACS_LTEE, ACS_NEQUAL,\n" - "\t ACS_PI, ACS_PLMINUS, ACS_PLUS, ACS_RARROW, ACS_RTEE,\n" - "\t ACS_S1, ACS_S3, ACS_S7, ACS_S9, ACS_STERLING,\n" - "\t ACS_TTEE, ACS_UARROW, ACS_ULCORNER, ACS_URCORNER, ACS_VLINE \n" + "\tsymbol The symbol's text value to print, or ACS_BLOCK, ACS_BOARD,\n" + "\t ACS_BTEE, ACS_BULLET, ACS_CKBOARD, ACS_DARROW, ACS_DEGREE,\n" + "\t ACS_DIAMOND, ACS_HLINE, ACS_LANTERN, ACS_LARROW, ACS_LLCORNER,\n" + "\t ACS_LRCORNER, ACS_LTEE, ACS_PLMINUS, ACS_PLUS, ACS_RARROW,\n" + "\t ACS_RTEE, ACS_S1, ACS_S9, ACS_TTEE, ACS_UARROW,\n" + "\t ACS_ULCORNER, ACS_URCORNER, ACS_VLINE\n" "\tstring The text to print. To create formatted strings, use 'string-format'\n" "\tcharacter The character to print.\n" "\n" diff --git a/release/README b/release/README index ef104395..5f538a90 100644 --- a/release/README +++ b/release/README @@ -1,12 +1,12 @@ This is amalgamated single file source release for Octaspire Dern programming -language version 0.134.0. File 'octaspire-dern-amalgamated.c' +language version 0.135.0. File 'octaspire-dern-amalgamated.c' is all that is needed; it has no other dependencies than a C compiler and standard library supporting C99. SHA-512 checksums for this and older releases can be found from: https://octaspire.github.io/dern/ -If you want to check this release, download checksums for version 0.134.0 from: -https://octaspire.github.io/dern/checksums-0.134.0 +If you want to check this release, download checksums for version 0.135.0 from: +https://octaspire.github.io/dern/checksums-0.135.0 Building instructions for all supported platforms (and scripts for building automatically) can be found in directory 'how-to-build'. Look for a file that diff --git a/release/documentation/Programming_in_Octaspire_Dern.html b/release/documentation/Programming_in_Octaspire_Dern.html index 9c7f874d..d47deae5 100644 --- a/release/documentation/Programming_in_Octaspire_Dern.html +++ b/release/documentation/Programming_in_Octaspire_Dern.html @@ -804,7 +804,7 @@

Programming in Octaspire Dern

-

Documentation for Octaspire Dern programming language version 0.134.0

+

Documentation for Octaspire Dern programming language version 0.135.0

@@ -1753,7 +1753,7 @@

Using the amalgamated source

diff --git a/release/examples/dern-ncurses-example.dern b/release/examples/dern-ncurses-example.dern index 3d2599d2..58a28888 100644 --- a/release/examples/dern-ncurses-example.dern +++ b/release/examples/dern-ncurses-example.dern @@ -43,25 +43,18 @@ (ncurses-print win 'ACS_DARROW) (ncurses-print win 'ACS_DEGREE) (ncurses-print win 'ACS_DIAMOND) -(ncurses-print win 'ACS_GEQUAL) (ncurses-print win 'ACS_HLINE) (ncurses-print win 'ACS_LANTERN) (ncurses-print win 'ACS_LARROW) -(ncurses-print win 'ACS_LEQUAL) (ncurses-print win 'ACS_LLCORNER) (ncurses-print win 'ACS_LRCORNER) (ncurses-print win 'ACS_LTEE) -(ncurses-print win 'ACS_NEQUAL) -(ncurses-print win 'ACS_PI) (ncurses-print win 'ACS_PLMINUS) (ncurses-print win 'ACS_PLUS) (ncurses-print win 'ACS_RARROW) (ncurses-print win 'ACS_RTEE) (ncurses-print win 'ACS_S1) -(ncurses-print win 'ACS_S3) -(ncurses-print win 'ACS_S7) (ncurses-print win 'ACS_S9) -(ncurses-print win 'ACS_STERLING) (ncurses-print win 'ACS_TTEE) (ncurses-print win 'ACS_UARROW) (ncurses-print win 'ACS_ULCORNER) diff --git a/release/octaspire-dern-amalgamated.c b/release/octaspire-dern-amalgamated.c index 529e3133..ca7d9ec2 100644 --- a/release/octaspire-dern-amalgamated.c +++ b/release/octaspire-dern-amalgamated.c @@ -16007,10 +16007,10 @@ limitations under the License. #define OCTASPIRE_DERN_CONFIG_H #define OCTASPIRE_DERN_CONFIG_VERSION_MAJOR "0" -#define OCTASPIRE_DERN_CONFIG_VERSION_MINOR "134" +#define OCTASPIRE_DERN_CONFIG_VERSION_MINOR "135" #define OCTASPIRE_DERN_CONFIG_VERSION_PATCH "0" -#define OCTASPIRE_DERN_CONFIG_VERSION_STR "Octaspire Dern version 0.134.0" +#define OCTASPIRE_DERN_CONFIG_VERSION_STR "Octaspire Dern version 0.135.0" diff --git a/release/plugins/dern_ncurses.c b/release/plugins/dern_ncurses.c index 5998ecaf..16e15112 100644 --- a/release/plugins/dern_ncurses.c +++ b/release/plugins/dern_ncurses.c @@ -1,6 +1,11 @@ #include "octaspire-dern-amalgamated.c" -#ifdef __NetBSD__ +#if defined(__NetBSD__) +#include +#elif defined(__sun) && defined(__SVR4) +// Solaris, OpenIndiana +#define NCURSES_ENABLE_STDBOOL_H 1 +#undef bool #include #else #include @@ -543,10 +548,6 @@ static int dern_ncurses_private_print_symbol( { result = waddch(window, ACS_DIAMOND); } - else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_GEQUAL")) - { - result = waddch(window, ACS_GEQUAL); - } else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_HLINE")) { result = waddch(window, ACS_HLINE); @@ -559,10 +560,6 @@ static int dern_ncurses_private_print_symbol( { result = waddch(window, ACS_LARROW); } - else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_LEQUAL")) - { - result = waddch(window, ACS_LEQUAL); - } else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_LLCORNER")) { result = waddch(window, ACS_LLCORNER); @@ -575,14 +572,6 @@ static int dern_ncurses_private_print_symbol( { result = waddch(window, ACS_LTEE); } - else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_NEQUAL")) - { - result = waddch(window, ACS_NEQUAL); - } - else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_PI")) - { - result = waddch(window, ACS_PI); - } else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_PLMINUS")) { result = waddch(window, ACS_PLMINUS); @@ -603,22 +592,10 @@ static int dern_ncurses_private_print_symbol( { result = waddch(window, ACS_S1); } - else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_S3")) - { - result = waddch(window, ACS_S3); - } - else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_S7")) - { - result = waddch(window, ACS_S7); - } else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_S9")) { result = waddch(window, ACS_S9); } - else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_STERLING")) - { - result = waddch(window, ACS_STERLING); - } else if (octaspire_dern_value_as_symbol_is_equal_to_c_string(value, "ACS_TTEE")) { result = waddch(window, ACS_TTEE); @@ -1465,13 +1442,12 @@ bool dern_ncurses_init( "\twindow Target window, a value returned by some call to ncurses-initscr\n" "\ty optional Y-coordinate (line) to print to\n" "\tx optional X-coordinate (column) to print to\n" - "\tsymbol The symbol's text value to print, or ACS_BLOCK, ACS_BOARD,\n" - "\t ACS_BTEE, ACS_BULLET, ACS_CKBOARD, ACS_DARROW, ACS_DEGREE,\n" - "\t ACS_DIAMOND, ACS_GEQUAL, ACS_HLINE, ACS_LANTERN, ACS_LARROW,\n" - "\t ACS_LEQUAL, ACS_LLCORNER, ACS_LRCORNER, ACS_LTEE, ACS_NEQUAL,\n" - "\t ACS_PI, ACS_PLMINUS, ACS_PLUS, ACS_RARROW, ACS_RTEE,\n" - "\t ACS_S1, ACS_S3, ACS_S7, ACS_S9, ACS_STERLING,\n" - "\t ACS_TTEE, ACS_UARROW, ACS_ULCORNER, ACS_URCORNER, ACS_VLINE \n" + "\tsymbol The symbol's text value to print, or ACS_BLOCK, ACS_BOARD,\n" + "\t ACS_BTEE, ACS_BULLET, ACS_CKBOARD, ACS_DARROW, ACS_DEGREE,\n" + "\t ACS_DIAMOND, ACS_HLINE, ACS_LANTERN, ACS_LARROW, ACS_LLCORNER,\n" + "\t ACS_LRCORNER, ACS_LTEE, ACS_PLMINUS, ACS_PLUS, ACS_RARROW,\n" + "\t ACS_RTEE, ACS_S1, ACS_S9, ACS_TTEE, ACS_UARROW,\n" + "\t ACS_ULCORNER, ACS_URCORNER, ACS_VLINE\n" "\tstring The text to print. To create formatted strings, use 'string-format'\n" "\tcharacter The character to print.\n" "\n" diff --git a/test/REPL/octaspire-dern-repl.exp b/test/REPL/octaspire-dern-repl.exp index 2d64b5a2..cc7ac2d3 100755 --- a/test/REPL/octaspire-dern-repl.exp +++ b/test/REPL/octaspire-dern-repl.exp @@ -3,7 +3,7 @@ set timeout 4 spawn ../../build/octaspire-dern-repl -v expect { - "Octaspire Dern version 0.134.0" + "Octaspire Dern version 0.135.0" {puts "\n\x1B\[32m---------- TEST PASS ----------\x1B\[0m\n" } default