diff --git a/README.md b/README.md index 40adea18f..a3c1517e2 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,7 @@ typedef struct notcurses_options { bool no_winch_sighandler; // Notcurses typically prints version info in notcurses_init() and // performance info in notcurses_stop(). This inhibits that output. - bool suppress_bannner; + bool suppress_banner; // Notcurses does not clear the screen on startup unless thus requested to. bool clear_screen_start; // If non-NULL, notcurses_render() will write each rendered frame to this diff --git a/doc/man/man3/notcurses.3notcurses.ronn b/doc/man/man3/notcurses.3.ronn similarity index 100% rename from doc/man/man3/notcurses.3notcurses.ronn rename to doc/man/man3/notcurses.3.ronn diff --git a/doc/man/man3/notcurses_init.3.ronn b/doc/man/man3/notcurses_init.3.ronn new file mode 100644 index 000000000..301f5fe80 --- /dev/null +++ b/doc/man/man3/notcurses_init.3.ronn @@ -0,0 +1,51 @@ +notcurses_init(3notcurses) -- initialize a notcurses instance +============================================================= + +## SYNOPSIS + +`#include ` + +
typedef struct notcurses_options {
+  const char* termtype;
+  bool inhibit_alternate_screen;
+  bool retain_cursor;
+  bool no_quit_sighandlers;
+  bool no_winch_sighandler;
+  bool suppress_banner;
+  bool clear_screen_start;
+  FILE* renderfp;
+} notcurses_options;
+ +`struct notcurses* +notcurses_init(const struct notcurses_options* opts, FILE* fp);` + +## DESCRIPTION + +`notcurses_init` prepares the `FILE*` provided as `fp` (which must be attached +to a terminal) for cursor-addressable (multiline) mode. The `struct +notcurses_option` passed as `opts` controls behavior. Only one instance should +be associated with a given terminal at a time, though it is no problem to have +multiple instances in a given process. On success, a pointer to a valid `struct +notcurses` is returned. `NULL` is returned on failure. Before the process exits, +`notcurses_stop(3notcurses)` should be called to reset the terminal and free +up resources. + +An appropriate `terminfo(5)` entry must exist for the terminal. This entry is +usually selected using the value of the `TERM` environment variable (see +`getenv(3)`), but a non-`NULL` value for `termtype` will override this. An +invalid `terminfo` specification will lead to reduced performance, reduced +display capabilities, or display errors. + +## RETURN VALUES + +`NULL` is returned on failure. Otherwise, the return value points at a valid +`struct notcurses`, which can be used until it is provided to `notcurses_stop`. + +## AUTHORS + +Nick Black + +## SEE ALSO + +getenv(3), termios(3), notcurses(3notcurses), notcurses_stop(3notcurses), +terminfo(5) diff --git a/doc/man/man3/notcurses_init.3notcurses.ronn b/doc/man/man3/notcurses_init.3notcurses.ronn deleted file mode 100644 index e6fb190b3..000000000 --- a/doc/man/man3/notcurses_init.3notcurses.ronn +++ /dev/null @@ -1,31 +0,0 @@ -notcurses_init(3notcurses) -- initialize a notcurses instance -============================================================= - -## SYNOPSIS - -`#include ` - -
typedef struct notcurses_options {
-  const char* termtype;
-  bool inhibit_alternate_screen;
-  bool retain_cursor;
-  bool no_quit_sighandlers;
-  bool no_winch_sighandler;
-  bool suppress_bannner;
-  bool clear_screen_start;
-  FILE* renderfp;
-} notcurses_options;
- -`struct notcurses* -notcurses_init(const struct notcurses_options* opts, FILE* fp);` - -## DESCRIPTION - - -## AUTHORS - -Nick Black - -## SEE ALSO - -notcurses(3notcurses), notcurses_stop(3notcurses) diff --git a/doc/man/man3/notcurses_stop.3notcurses.ronn b/doc/man/man3/notcurses_stop.3.ronn similarity index 100% rename from doc/man/man3/notcurses_stop.3notcurses.ronn rename to doc/man/man3/notcurses_stop.3.ronn diff --git a/include/notcurses.h b/include/notcurses.h index efcfe00ed..1d7abf2e0 100644 --- a/include/notcurses.h +++ b/include/notcurses.h @@ -118,7 +118,7 @@ typedef struct notcurses_options { bool no_winch_sighandler; // Notcurses typically prints version info in notcurses_init() and performance // info in notcurses_stop(). This inhibits that output. - bool suppress_bannner; + bool suppress_banner; // Notcurses does not clear the screen on startup unless thus requested to. bool clear_screen_start; // If non-NULL, notcurses_render() will write each rendered frame to this diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 9b29e0695..fc97aa687 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -758,8 +758,8 @@ notcurses* notcurses_init(const notcurses_options* opts, FILE* outfp){ free_plane(ret->top); goto err; } - ret->suppress_banner = opts->suppress_bannner; - if(!opts->suppress_bannner){ + ret->suppress_banner = opts->suppress_banner; + if(!opts->suppress_banner){ char prefixbuf[BPREFIXSTRLEN + 1]; fprintf(ret->ttyfp, "\n" " notcurses %s by nick black\n" diff --git a/src/planereel/main.cpp b/src/planereel/main.cpp index fa239fa7b..055d244e1 100644 --- a/src/planereel/main.cpp +++ b/src/planereel/main.cpp @@ -97,7 +97,7 @@ void parse_args(int argc, char** argv, struct notcurses_options* opts, break; } } - opts->suppress_bannner = true; + opts->suppress_banner = true; opts->clear_screen_start = true; } diff --git a/tests/cell.cpp b/tests/cell.cpp index c882f166d..757ed8506 100644 --- a/tests/cell.cpp +++ b/tests/cell.cpp @@ -12,7 +12,7 @@ TEST_CASE("Cell") { REQUIRE(nullptr != outfp_); notcurses_options nopts{}; nopts.inhibit_alternate_screen = true; - nopts.suppress_bannner = true; + nopts.suppress_banner = true; struct notcurses* nc_ = notcurses_init(&nopts, outfp_); REQUIRE(nullptr != nc_); struct ncplane* n_ = notcurses_stdplane(nc_); diff --git a/tests/input.cpp b/tests/input.cpp index 8809c0d71..f12f43141 100644 --- a/tests/input.cpp +++ b/tests/input.cpp @@ -6,7 +6,7 @@ TEST_CASE("NotcursesInput") { } notcurses_options nopts{}; nopts.inhibit_alternate_screen = true; - nopts.suppress_bannner = true; + nopts.suppress_banner = true; FILE* outfp_ = fopen("/dev/tty", "wb"); REQUIRE(outfp_); struct notcurses* nc_ = notcurses_init(&nopts, outfp_); diff --git a/tests/libav.cpp b/tests/libav.cpp index aee04722e..0741f9657 100644 --- a/tests/libav.cpp +++ b/tests/libav.cpp @@ -13,7 +13,7 @@ TEST_CASE("Multimedia") { } notcurses_options nopts{}; nopts.inhibit_alternate_screen = true; - nopts.suppress_bannner = true; + nopts.suppress_banner = true; FILE* outfp_ = fopen("/dev/tty", "wb"); REQUIRE(outfp_); notcurses* nc_ = notcurses_init(&nopts, outfp_); diff --git a/tests/ncplane.cpp b/tests/ncplane.cpp index 26391839a..29ee6dbf9 100644 --- a/tests/ncplane.cpp +++ b/tests/ncplane.cpp @@ -25,7 +25,7 @@ TEST_CASE("NCPlane") { } notcurses_options nopts{}; nopts.inhibit_alternate_screen = true; - nopts.suppress_bannner = true; + nopts.suppress_banner = true; FILE* outfp_ = fopen("/dev/tty", "wb"); REQUIRE(outfp_); struct notcurses* nc_ = notcurses_init(&nopts, outfp_); diff --git a/tests/notcurses.cpp b/tests/notcurses.cpp index f6aeb470d..144076bd6 100644 --- a/tests/notcurses.cpp +++ b/tests/notcurses.cpp @@ -12,7 +12,7 @@ TEST_CASE("NotcursesBase") { } notcurses_options nopts{}; nopts.inhibit_alternate_screen = true; - nopts.suppress_bannner = true; + nopts.suppress_banner = true; FILE* outfp_ = fopen("/dev/tty", "wb"); REQUIRE(outfp_); struct notcurses* nc_ = notcurses_init(&nopts, outfp_); diff --git a/tests/panelreel.cpp b/tests/panelreel.cpp index 4ca05bdd5..6fb28d872 100644 --- a/tests/panelreel.cpp +++ b/tests/panelreel.cpp @@ -17,7 +17,7 @@ TEST_CASE("PanelReelTest") { } notcurses_options nopts{}; nopts.inhibit_alternate_screen = true; - nopts.suppress_bannner = true; + nopts.suppress_banner = true; FILE* outfp_ = fopen("/dev/tty", "wb"); REQUIRE(outfp_); struct notcurses* nc_ = notcurses_init(&nopts, outfp_); diff --git a/tests/zaxis.cpp b/tests/zaxis.cpp index 91e69db27..5af67095f 100644 --- a/tests/zaxis.cpp +++ b/tests/zaxis.cpp @@ -8,7 +8,7 @@ TEST_CASE("ZAxisTest") { } notcurses_options nopts{}; nopts.inhibit_alternate_screen = true; - nopts.suppress_bannner = true; + nopts.suppress_banner = true; FILE* outfp_ = fopen("/dev/tty", "wb"); REQUIRE(outfp_); struct notcurses* nc_ = notcurses_init(&nopts, outfp_);