diff options
author | pgen <p.gen.progs@gmail.com> | 2020-11-27 14:38:36 +0100 |
---|---|---|
committer | pgen <p.gen.progs@gmail.com> | 2020-11-27 14:38:36 +0100 |
commit | 7126ac1e61c04f400b8178b2090a0a2de2c96637 (patch) | |
tree | f905a9bfa48143784855b1474be81af90284fb5a | |
parent | 975d1b899c0df617375fa4cfb41fbe299378a686 (diff) |
Improve comments
-rw-r--r-- | index.c | 10 | ||||
-rw-r--r-- | smenu.c | 3 | ||||
-rw-r--r-- | utf8.c | 1 | ||||
-rw-r--r-- | utils.c | 1 |
4 files changed, 11 insertions, 4 deletions
@@ -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> @@ -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 }, @@ -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) @@ -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) |