summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2020-11-27 14:38:36 +0100
committerpgen <p.gen.progs@gmail.com>2020-11-27 14:38:36 +0100
commit7126ac1e61c04f400b8178b2090a0a2de2c96637 (patch)
treef905a9bfa48143784855b1474be81af90284fb5a
parent975d1b899c0df617375fa4cfb41fbe299378a686 (diff)
Improve comments
-rw-r--r--index.c10
-rw-r--r--smenu.c3
-rw-r--r--utf8.c1
-rw-r--r--utils.c1
4 files changed, 11 insertions, 4 deletions
diff --git a/index.c b/index.c
index 817671f..c1e3f1e 100644
--- a/index.c
+++ b/index.c
@@ -3,9 +3,13 @@
/* please read http://www.gnu.org/copyleft/gpl.html. */
/* ########################################################### */
-/* Ternary Search Tree and sorted array creation functions */
-/* Inspired by: https://www.cs.princeton.edu/~rs/strings/tstdemo.c. */
-/* **************************************************************** */
+/* Ternary Search Tree and sorted array creation functions. */
+/* Inspired by a code described in "Ternary Search Trees" by Jon */
+/* Bentley and Robert Sedgewick in the April, 1998, Dr. Dobb's Journal. */
+/* Links: */
+/* https://www.drdobbs.com/database/ternary-search-trees/184410528?pgno=1 */
+/* https://www.cs.princeton.edu/~rs/strings/tstdemo.c. */
+/* ************************************************************************ */
#include <stdlib.h>
#include <stdint.h>
diff --git a/smenu.c b/smenu.c
index f28b90b..e75d2d7 100644
--- a/smenu.c
+++ b/smenu.c
@@ -156,8 +156,9 @@ help(win_t * win, term_t * term, long last_line, toggle_t * toggle)
int len; /* length of one of these objects. */
};
- char * arrows = concat(left_arrow, up_arrow, right_arrow, down_arrow,
+ char * arrows = concat(left_arrow, up_arrow, right_arrow, down_arrow,
(char *)0);
+
struct entry_s entries[] = {
{ 'n', "Move:", 5 }, { 'b', arrows, 4 }, { 'n', "|", 1 },
{ 'b', "h", 1 }, { 'b', "j", 1 }, { 'b', "k", 1 },
diff --git a/utf8.c b/utf8.c
index b72d449..6193bde 100644
--- a/utf8.c
+++ b/utf8.c
@@ -531,6 +531,7 @@ utf8_strprefix(char * d, char * s, long n, long * pos)
/* ================================================== */
/* Converts a UTF-8 glyph string to a wchar_t string. */
+/* The returned string must be freed by the caller. */
/* ================================================== */
wchar_t *
utf8_strtowcs(char * s)
diff --git a/utils.c b/utils.c
index 199fcf9..add1346 100644
--- a/utils.c
+++ b/utils.c
@@ -186,6 +186,7 @@ concat(const char * s1, ...)
/* =============================================== */
/* Is the string str2 a prefix of the string str1? */
+/* Returns 1 if true, else 0. */
/* =============================================== */
int
strprefix(char * str1, char * str2)