--- hnb-1.9.18.orig/doc/hnb.1 +++ hnb-1.9.18/doc/hnb.1 @@ -1,4 +1,4 @@ -.TH HNB SECTION "May 15, 2001" +.TH HNB 1 "MAY 15, 2001" .SH NAME hnb \- Hierarchical notebook .SH SYNOPSIS --- hnb-1.9.18.orig/doc/hnbrc.vi +++ hnb-1.9.18/doc/hnbrc.vi @@ -0,0 +1,571 @@ +# Alternative configuration for hnb +# (Vi/Mutt-style) +# +# use a tab-spacing of 4 when editing this file +# or edit it thorugh hnb with "hnb -a ~/.hnbrc" +# to take advantage of the indentation in it. +# +##### Bullet style definition + ##### samples + #bullet_parent " -" + #bullet_parent " -" + #bullet_parent " *" + #bullet_parent " ·" + #bullet_parent_expanded " +" + #bullet_parent_expanded " *" + #bullet_parent_expanded " ·" + #bullet_leaf " *" + #bullet_leaf " -" + bullet_leaf " ·" + bullet_parent " +" + bullet_parent_expanded " -" +##### External command definition + web_command "w3m *" + ##### http:// handler syntax and examples + # + # what command is executed when a + # user wants a action performed on + # a entry containing an URL + # + # * is substituted for the URL + # + # the X ones have their error and + # standard output redirected to + # dev/null and are put into the + # background to keep hnb running + # afterwards + # + # samples + # + #web_command "opera -remote 'openURL(*)' +> /dev/null 2>&1 &" + #web_command "netscape -remote 'openURL(*)' > /dev/ +null 2>&1 &" + #web_command "netscape -remote 'openURL(*,new-window)' > /dev/ +null 2>&1 &" + #web_command "mozilla -remote 'openURL(*)' > /dev/ +null 2>&1 &" + #web_command "mozilla -remote 'openURL(*,new-window)' > /dev/ +null 2>&1 &" + #web_command "konqueror * > /dev/ +null 2>&1 &" + #web_command "galeon -n > /dev/ +null 2>&1 &" + web_command "w3m *" + #web_command "lynx *" + #web_commend "rxvt -fn fixed -rv +sb -e w3m * > /dev/ +null 2>&1 &" + #web_command "opera -remote 'openURL(*,new-window)' > /dev/ +null 2>&1 &" + + mail_command "mutt *" + ##### mail handler syntax and examples + # + # what command is executed when a + # user wants a action performed on + # a entry containing a + # mail-address + # + # * is substituted for the + # mail-address + # + # samples + # + #mail_command "xterm -rv pine * > /dev/ +null 2>&1 &" + #mail_command "xterm -rv +sb -e mutt * > /dev/ +null 2>&1 &" + #mail_command "pine *" + + spell_command "ispell -x" + ##### spell checking handler examples + # + # samples + # + #spell_command "aspell -c" + #spell_command "ispell -x" + #spell_command "ispell -x -damerican" + #spell_command "ispell -x -dbritish" + #spell_command "ispell -x -dbokmål" + #spell_command "ispell -x -dnynorsk" + +##### File saving options + format "hnb" + ##### Default file save format choices + # hnb, opml, xml, ascii are amongst the available formats + + savepos "0" + ##### Save current position in tree. 1=true 0=false + # wheter hnb remembers the current position in a file, (current +ly + # supported by the hnb DTD only, but might easily be extended s +ince + # it fakes it with a XML comment) + + xml_cuddle "0" + ##### XML format cuddling mode. 1=true 0=false + # When loading xml files, should data be allowed on + # the same line as tags? +##### Color/style + # Syntax of color scheme configuration: + # "style " + # legal items are shown below + # colors are: blue, cyan, green, + # red, magenta, yellow, black and + # white + # attributes are: normal, + # reverse, bold, underline + style menuitem default/default reverse + style menutext cyan/default normal + style parentnode default/default bold + style node default/default normal + style bullet cyan/default normal + style selected yellow/red bold + style parentselected yellow/red bold + style background default/default normal +##### key-bindings + ##### syntax + # "bind " + # + # multiple actions can be chained + # together by using the virtual + # key ".." as the following + # key-binding + # + context main + helptext "[Esc]=menu, [Enter]=edit, [Ins]=insert line, s=save, +q=save&quit" + bind f1 'status "Take a look at ~/.hnbrc to check out the confi +guration"' + bind .. 'status "there you will also find details about the ava +ilable keybindings."' + bind .. 'status "please feel free to contribute more useful key +bindings and helptexts..."' + + bind esc menu + bind q 'context quitsave' + + bind : 'commandline' + bind .. 'status --clear' + + bind i 'macro m_spellcheck' + macro define m_spellcheck + context spellcheck + save_state + spell + end + + bind E 'context export' + bind L 'context import' + bind / 'macro m_search' + macro define m_search + context search + save_state + getquery "enter keyword to search for" + search -f "$query" + end + + bind esc menu + bind f10 'context user' + + bind G 'context grab' + bind .. 'save_state' + + bind A 'action' + bind up up + bind down down + bind left left + bind right right + bind npage pagedown + bind ppage pageup + bind home "go root" + + bind k up + bind j down + bind h left + bind l right + bind z pagedown + bind Z pageup + + bind return edit + bind del remove + + bind ins insert_below + bind .. edit + + bind o insert_below + bind .. edit + + bind tab complete + bind T toggle_todo + bind D toggle_done + bind > indent + bind < outdent + bind w save + bind s save + + bind d save_state + bind .. cut + + bind ^X save_state + bind .. cut + + bind y copy + + bind ^C copy + + bind p paste + bind .. down + + bind ^V paste + bind .. down + + bind S save_state + bind .. sort + + bind backspace backspace + bind backspace2 backspace + + bind sleft "movenode left" + bind sright "movenode right" + bind sprevious "movenode up" + bind snext "movenode down" + + bind H "movenode left" + bind L "movenode right" + bind K "movenode up" + bind J "movenode down" + + bind + expand + bind - collapse + + bind u restore_state + + context nodeedit + helptext "Edit node: [Enter]=confirm, [Esc]=cansel, ^S=split, ^ +J=join" + bind up up + bind down down + bind left left + bind right right + + bind return confirm + bind esc cancel + + bind ^S split + bind ^J join + + bind backspace backspace + bind backspace2 backspace + + bind ^A bol + bind home bol + bind ^E eol + bind end eol + + bind del delete + + context lineedit + helptext lineedit + + bind up up + bind down down + bind left left + bind right right + + bind return confirm + bind esc cancel + bind tab complete + + bind backspace backspace + bind backspace2 backspace + bind del delete + + bind ^A bol + bind home bol + bind ^E eol + bind end eol + + context confirm + helptext "Enter: [Enter]=confirm, [Esc]=cancel" + bind y confirm + bind return confirm + bind any cancel + + context quitsave + helptext "Save on exit? [Enter]=confirm, x=exit without saving, + [Esc]=cancel" + bind return save + bind .. quit + bind x quit + bind esc "context main" + bind any unbound + + context spellcheck + helptext "Spellchecking | |Space| next node |ESC| cancel |F6, +Return| confirm changes" + + bind space "go recurse" + bind .. spell + + bind down "go recurse" + bind .. spell + + bind up "go backrecurse" + bind .. spell + + bind return "context main" + bind f6 "context main" + + bind esc restore_state + bind .. "context main" + + bind any unbound + context grab + helptext "Node grabbed | |return| |space| drop here || |ESC| c +ancel" + bind esc restore_state + bind .. "context main" + bind return "context main" + bind space "context main" + bind left "movenode left" + bind right "movenode right" + bind up "movenode up" + bind down "movenode down" + bind any unbound + context export + helptext "Export | | A |scii || | H |tml html| C |ss | P |os +tscript | O |PML |ESC| cancel " + macro define m_export_ascii + save_state + go root + getquery 'what file should I save the ASCII out +put in?' + export_ascii $query + restore_state + context main + end + macro define m_export_html + save_state + go root + getquery 'what file should I save the HTML outp +ut in?' + export_html $query + context main + restore_state + end + macro define m_export_htmlcss + save_state + go root + getquery 'what file should I save the HTML/CSS +output in?' + export_htmlcss $query + context main + restore_state + end + macro define m_export_opml + save_state + go root + getquery 'what file should I save the OPML outp +ut in?' + export_opml $query + context main + restore_state + end + macro define m_export_ps + save_state + go root + getquery 'what file should I save the PostScrip +t output in?' + export_ps $query + context main + restore_state + end + bind esc .. "context main" + bind A "macro m_export_ascii" + bind a "macro m_export_ascii" + bind H "macro m_export_html" + bind h "macro m_export_html" + bind C "macro m_export_htmlcss" + bind c "macro m_export_htmlcss" + bind O "macro m_export_opml" + bind o "macro m_export_opml" + bind P "macro m_export_ps" + bind p "macro m_export_ps" + bind any unbound + context import + helptext "Import type: [A]scii, [O]PML, [H]nb, [Esc]=cancel " + + bind esc .. + bind .. "context main" + bind A .. + bind .. 'getquery "what file should I import ASCII from?"' + bind .. 'import_ascii "$query"' + bind .. 'context main' + bind a .. + bind .. 'getquery "what file should I import ASCII from?"' + bind .. 'import_ascii "$query"' + bind .. 'context main' + bind O .. + bind .. 'getquery "what file should I import OPML from?"' + bind .. 'import_opml "$query"' + bind .. 'context main' + bind o .. + bind .. 'getquery "what file should I import OPML from?"' + bind .. 'import_opml "$query"' + bind .. 'context main' + bind H .. + bind .. 'getquery "what file should I import HNB data from?"' + bind .. 'import_hnb "$query"' + bind .. 'context main' + bind h .. + bind .. 'getquery "what file should I import HNB data from?"' + bind .. 'import_hnb "$query"' + bind .. 'context main' + bind any unbound + context search + helptext "Search: [Space]/[Enter]=go, [N]ext, [P]revious, [Esc] +=cancel" + bind down 'search -f "$query"' + bind n 'search -f "$query"' + bind N 'search -f "$query"' + bind up 'search -b "$query"' + bind P 'search -b "$query"' + bind p 'search -b "$query"' + + bind return "context main" + bind space "context main" + + bind esc "context main" + bind .. restore_state + + bind any unbound + context user + helptext "Usermenu | |ESC| cancel |F1| ispell language |F2| bro +wser command |F3| expand all |F4| collapse all" + bind esc "context main" + + bind f1 "context user_ispell" + bind f2 "context user_browser" + bind f3 "expand --all" + bind .. "context main" + + bind f4 "collapse --all" + bind .. "context main" + + bind any "unbound" + + context user_ispell + helptext "Language for ispell: | |F1| Br.english |F2| Am.engli +sh |F3| Norwegian bokmål |F4| Norwegian nynorsk" + bind f1 'spell_command "ispell -x -damerican"' + bind .. 'context main' + + bind f2 'spell_command "ispell -x -dbritish"' + bind .. 'context main' + + bind f3 'spell_command "ispell -x -dbokmål"' + bind .. 'context main' + + bind f4 'spell_command "ispell -x -dnynorsk"' + bind .. 'context main' + + bind esc 'context main' + bind any unbound + + context user_browser + helptext "Browser action: | |F1| w3m replace hnb |F2| w3m in r +xvt |F3| Opera, new tab |F4| Mozilla new window" + bind f1 'browser_command "w3m *"' + bind .. 'context main' + + bind f2 'web_commend "xterm -T \"w3m spawned from hnb\" -fn fix +ed -rv +sb -e w3m * > /dev/null 2>&1 &"' + bind .. 'context main' + + bind f3 'web_command "opera -remote 'openURL(*,new-window)' > / +dev/null 2>&1 &"' + bind .. 'context main' + + bind f4 'web_command "mozilla -remote 'openURL(*,new-window)' +> /dev/null 2>&1 &"' + bind .. 'context main' + + bind esc 'context main' + bind any unbound + +##### key related options + escdelay 100 + ##### escdelay + # how long the program should wait + # before accepting that ESC(27d) + # is the ESC key and not the start + # of an escape sequence increase + # this number if you are using hnb + # over a slow network link value + # given is in ms (1/1000seconds) +##### file menu + menu "File" "------------" "" + menu "File" "save s" "save" + menu "File" "save as.. " "macro saveas" + macro define saveas + getquery db_file 'fila to save' + save_state + go root + export_$format $db_file + restore_state + end + menu "File" "revert " "revert" + menu "File" "------------" "" + menu "File" "export E" "context export" + menu "File" "import L" "context import" + menu "File" "------------" "" + menu "File" "spell chk i" "macro m_spellcheck" + menu "File" "expand all" "expand --all" + menu "File" "collapse all" "collapse --all" + menu "File" "statistics" "macro stats" + macro define stats + status "file: \"$db_file\" format:$format" + mem + stats + end + menu "File" "------------" "" + menu "File" "exit x" "context quitsave" +##### edit menu + menu "Edit" "---------" "" + menu "Edit" "copy ^C" "copy" + menu "Edit" "cut ^X" "cut" + menu "Edit" "paste ^V" "paste" + menu "Edit" "---------" "" + menu "Edit" "Search /" "macro m_search" +##### node menu + menu "Entry" "--------------" "" + menu "Entry" "edit return" "edit" + menu "Entry" "delete del" "remove" + menu "Entry" "--------------" "" + menu "Entry" "do action :" "action" + menu "Entry" "indent >" "indent" + menu "Entry" "outdent <" "outdent" + menu "Entry" "toggle todo T" "toggle_todo" + menu "Entry" "toggle done D" "toggle_done" + menu "Entry" "expand +" "expand" + menu "Entry" "collapse -" "collapse" +##### level menu + menu "Level" "------------" "" + menu "Level" "sort S" "sort -a" + menu "Level" "sort (desc.)" "sort -d" + menu "Level" "shuffle " "sort -r" +##### MACRO + context main + macro define m_about + status "hnb - hierarchical notebook http://hnb.source +forge.net/" + status "(c) Øyvind Kolås 2001-2003 pippin@users.sour +ceforge.net" + status "Mutt/Vi-like keybind by Osamu Aoki 2004 osamu@d +ebian.org" + end + macro m_about + + --- hnb-1.9.18.orig/doc/Documentation.hnb +++ hnb-1.9.18/doc/Documentation.hnb @@ -329,7 +329,7 @@ - quotes + quotations Peoples Front To Reunite Gondwanaland: "Stop the Laurasian Separatist Movement!" slashdot disbelief --- hnb-1.9.18.orig/doc/Documentation.html +++ hnb-1.9.18/doc/Documentation.html @@ -350,7 +350,7 @@ -
quotes +
quotations
Peoples Front To Reunite Gondwanaland: 'Stop the Laurasian Separatist Movement!'
slashdot
disbelief --- hnb-1.9.18.orig/src/tree.h +++ hnb-1.9.18/src/tree.h @@ -124,6 +124,8 @@ */ Node *node_recurse (Node *node); +Node *node_traverse_right_of (Node *stop, Node *node); + /* returns the previous node, doing a recursive traversal of the tree backwards Returns: next back recursive node or 0 if none --- hnb-1.9.18.orig/src/ui_cli.c +++ hnb-1.9.18/src/ui_cli.c @@ -49,14 +49,14 @@ return path; } -static int add (int argc,char **argv, void *data) +static void* add (int argc, char **argv, void *data) { Node *pos = (Node *) data; Node *tnode; if(argc==1){ cli_outfunf("usage: %s ",argv[0]); - return 0; + return pos; } if (argc==2) { @@ -65,23 +65,23 @@ tnode = node_insert_down (node_bottom (pos)); node_set (tnode, TEXT, argv[1]); - return (int) pos; + return pos; } -static int addc (int argc,char **argv, void *data) +static void* addc (int argc, char **argv, void *data) { Node *pos = (Node *) data; Node *tnode; if(argc==1){ cli_outfunf("usage: %s [new subentry]",argv[0]); - return 0; + return pos; } tnode = node_exact_match (argv[1], pos); if (!tnode) { cli_outfun ("specified parent not found"); - return (int) pos; + return pos; } if (node_right (tnode)) { @@ -95,30 +95,30 @@ else node_set (tnode, TEXT, argv[2]); - return (int) pos; + return pos; } -static int pwd (int argc,char **argv, void *data) +static void* pwd (int argc, char **argv, void *data) { Node *pos = (Node *) data; cli_outfun (path_strip (node2path (pos))); cli_outfun ("\n"); - return (int) pos; + return pos; } -static int cd (int argc, char **argv, void *data) +static void* cd (int argc, char **argv, void *data) { Node *pos = (Node *) data; Node *tnode = pos; if(argc==1){ - return (int)node_root(pos); + return node_root(pos); } if (!strcmp (argv[1], "..")){ if (node_left (tnode) != 0) - return (int) (node_left (tnode)); + return node_left (tnode); } @@ -128,11 +128,9 @@ } if (!tnode) { cli_outfun ("no such node\n"); - return (int) pos; + return pos; } - return (int) tnode; - - return (int) pos; + return tnode; } #include @@ -151,7 +149,7 @@ } } -static int ls (int argc, char **argv, void *data) +static void* ls (int argc, char **argv, void *data) { Node *pos = (Node *) data; @@ -188,7 +186,7 @@ tnode = node_down (tnode); } } - return (int) pos; + return pos; } /* @@ -216,12 +214,12 @@ Node *docmd (Node *pos, const char *commandline) { - int ret; + Node *ret; char *cmdline = strdup (commandline); ret = cli_docmd (cmdline, pos); free (cmdline); - return (Node *) ret; + return ret; } Node *docmdf (Node *pos,char *format, ...){ --- hnb-1.9.18.orig/src/ui_style.c +++ hnb-1.9.18/src/ui_style.c @@ -116,7 +116,7 @@ } } -static int ui_style_cmd (int argc, char **argv, void *data) +static void* ui_style_cmd (int argc, char **argv, void *data) { char *item; char *colors; @@ -124,7 +124,7 @@ if(argc!=4){ cli_outfunf("usage: %i "); - return (int)data; + return data; } item=argv[1]; @@ -137,7 +137,7 @@ if (style_no == -1) { printf ("unknown style 'style [%s] %s %s'\n", item, colors, atts); - return (int) data; + return data; } color2 = strchr (colors, '/'); color2[0] = '\0'; @@ -166,7 +166,7 @@ bkgdset (' ' + COLOR_PAIR (ui_style_background)); } } - return (int) data; + return data; } /* --- hnb-1.9.18.orig/src/evilloop.c +++ hnb-1.9.18/src/evilloop.c @@ -123,10 +123,10 @@ int quit_hnb=0; -static int cmd_quit(int argc,char **argv,void *data){ +static void* cmd_quit(int argc,char **argv,void *data){ Node *pos=(Node *)data; quit_hnb=1; - return (int)pos; + return pos; } /* @@ -146,7 +146,7 @@ while (!quit_hnb) { Tbinding *binding; - ui_draw (pos, inputbuf, 0); + ui_draw (pos, strlen(inputbuf), 0); binding = parsekey (ui_input (), ui_current_scope); do { --- hnb-1.9.18.orig/src/node.c +++ hnb-1.9.18/src/node.c @@ -88,6 +88,9 @@ { Node_AttItem *att; + if (node == NULL) + return; + att = node->attrib; while (att) { if (!strcmp (att->name, name)) { @@ -139,48 +142,48 @@ #include -int cmd_att_set (int argc, char **argv, void *data) +void *cmd_att_set (int argc, char **argv, void *data) { Node *pos = (Node *) data; if(argc!=3){ cli_outfunf("usage: %s ",argv[0]); - return (int) pos; + return pos; } node_set (pos, argv[1], argv[2]); - return (int) pos; + return pos; } -int cmd_att_get (int argc, char **argv, void *data) +void *cmd_att_get (int argc, char **argv, void *data) { Node *pos = (Node *) data; char *cdata; if(argc!=2){ cli_outfunf("usage: %s ",argv[0]); - return (int) pos; + return pos; } cdata = node_get (pos, argv[1]); if (cdata) cli_outfun (cdata); - return (int) pos; + return pos; } -int cmd_att_clear (int argc, char **argv, void *data) +void *cmd_att_clear (int argc, char **argv, void *data) { Node *pos = (Node *) data; if(argc!=2){ cli_outfunf("usage: %s ",argv[0]); - return (int) pos; + return pos; } node_unset (pos, argv[1]); - return (int) pos; + return pos; } -int cmd_att_list (int argc,char **argv, void *data) +void *cmd_att_list (int argc,char **argv, void *data) { Node_AttItem *att; Node *pos = (Node *) data; @@ -190,7 +193,7 @@ cli_outfunf ("%s: [%s]", att->name, att->data); att = att->next; } - return (int) pos; + return pos; } /* --- hnb-1.9.18.orig/src/file_ps.c +++ hnb-1.9.18/src/file_ps.c @@ -51,22 +51,32 @@ /* *INDENT-ON* */ -static void ps_export_node (FILE * file, int level, int flags, char *data) +static void ps_export_node (FILE * file, int level, Node *tnode) { + char *data = fixnullstring (node_get (tnode, TEXT)); + char *type = node_get (tnode, "type"); char *quoted=string_replace(data,psquote); + int done; + indent (level, "\t"); - fprintf (file, "( ) S 10 ss %i LM 0 a (%s ) P\n", level * 22, + if (type && !strcmp (type, "todo")) { + type = node_get (tnode, "done"); + done = type ? type[0] == 'y' : 0; + fprintf (file, "( ) S 10 ss %i LM 0 a ([%s]%s ) P\n", level * 22, + done ? "DONE" : "____", quoted); + } else { + fprintf (file, "( ) S 10 ss %i LM 0 a (%s ) P\n", level * 22, quoted); + } free(quoted); } -static int export_ps (int argc, char **argv, void *data) +static void* export_ps (int argc, char **argv, void *data) { Node *node = (Node *) data; char *filename = argc==2?argv[1]:""; Node *tnode; - int level, flags, startlevel; - char *cdata; + int level, startlevel; FILE *file; if (!strcmp (filename, "-")) @@ -75,7 +85,7 @@ file = fopen (filename, "w"); if (!file) { cli_outfunf ("postscript export, unable to open \"%s\"", filename); - return (int) node; + return node; } startlevel = nodes_left (node); @@ -90,8 +100,8 @@ /_Z { /defaults save def } def\n\ /ZZ { defaults restore } def\n\ /PW { /pw exch def } def 595 PW %% paper width\n\ -/PH { /ph exch def } def 842 PH %% paper height\n\ -%% Defaults: tm = text height: rm = text width\n\ +/PH { /ph exch def } def 842 PH %% paper height\n"); + fprintf (file, "%% Defaults: tm = text height: rm = text width\n\ /FM { /fm exch def } def 72 FM %% footer margin\n\ /TM { /tm exch def } def 680 TM %% top margin\n\ /RM { /rm exch def } def 480 RM %% right margin\n\ @@ -100,53 +110,57 @@ /LG { /lg exch def } def 11 LG %% linespacing\n\ \n\ /PG { /pg exch def } def 1 PG %% first number\n\ -/margins { 680 TM 480 RM 0 BM 0 LM } def\n\ -\n\ -/MF { %% fontname newfontname -> - make a new encoded font \n\ +/margins { 680 TM 480 RM 0 BM 0 LM } def\n\n"); + fprintf (file, +"/MF { %% fontname newfontname -> - make a new encoded font \n\ /newfontname exch def /fontname exch def /fontdict fontname findfont def /newfont fontdict\n\ maxlength dict def fontdict { exch dup /FID eq { pop pop } { exch newfont 3 1\n\ roll put } ifelse } forall newfont /FontName newfontname put encoding_vector\n\ length 256 eq { newfont /Encoding encoding_vector put } if newfontname newfont\n\ -definefont pop } def\n\ -\n\ -/encoding_vector [ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n\ +definefont pop } def\n\n"); + fprintf (file, +"/encoding_vector [ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n\ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n\ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n\ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n\ - /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent\n\ - /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /hyphen\n\ + /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent\n"); + fprintf (file, + "/ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /hyphen\n\ /period /slash /zero /one /two /three /four /five /six /seven /eight /nine\n\ /colon /semicolon /less /equal /greater /question /at /A /B /C /D /E /F /G /H\n\ - /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash\n\ - /bracketright /asciicircum /underscore /quoteleft /a /b /c /d /e /f /g /h /i\n\ + /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash\n"); + fprintf (file, + "/bracketright /asciicircum /underscore /quoteleft /a /b /c /d /e /f /g /h /i\n\ /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar\n\ - /braceright /tilde /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n\ - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n\ + /braceright /tilde /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n"); + fprintf (file, + "/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n\ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n\ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n\ - /.notdef /.notdef /.notdef /space /exclamdown /cent /sterling /currency /yen\n\ - /brokenbar /section /dieresis /copyright /ordfeminine /guillemotleft\n\ + /.notdef /.notdef /.notdef /space /exclamdown /cent /sterling /currency /yen\n"); + fprintf (file, + "/brokenbar /section /dieresis /copyright /ordfeminine /guillemotleft\n\ /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior\n\ /threesuperior /acute /mu /paragraph /bullet /cedilla /onesuperior\n\ - /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown\n\ - /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave\n\ + /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown\n"); + fprintf (file, + "/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave\n\ /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth\n\ /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash\n\ - /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls /agrave\n\ - /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave /eacute\n\ + /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls /agrave\n"); + fprintf (file, + "/aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave /eacute\n\ /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis /eth /ntilde\n\ /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave\n\ /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis \n\ -] def\n\ -\n\ -/Times-Roman /Times-Roman-IL1 MF\n\ +] def\n\n"); + fprintf (file, "/Times-Roman /Times-Roman-IL1 MF\n\ /Times-Italic /Times-Italic-IL1 MF\n\ /Times-Bold /Times-Bold-IL1 MF\n\ /Helvetica /Helvetica-IL1 MF\n\ /Helvetica-Oblique /Helvetica-Oblique-IL1 MF\n\ -/Helvetica-Bold /Helvetica-Bold-IL1 MF\n\ -\n\ -/textbox {\n\ +/Helvetica-Bold /Helvetica-Bold-IL1 MF\n\n"); + fprintf (file, "/textbox {\n\ margins 10 rom 12 LG lm tm moveto } def\n\ /midpage { pw rm sub 2 div fm translate\n\ textbox numbering 10 ss} def\n\ @@ -155,8 +169,8 @@ /jump { bm tm gt { showpage grestore p1 } if\n\ } def } def p1\n\ } def\n\ -/newpage { 10 neg TM tm pop jump } def\n\ -%% close file\n\ +/newpage { 10 neg TM tm pop jump } def\n"); + fprintf (file, "%% close file\n\ /close { showpage grestore clear end ZZ } def\n\ /minidict 90 dict def \n\ minidict begin \n\ @@ -171,13 +185,13 @@ /numbering { gs rm 2 div bm 25 sub moveto\n\ pg pg 1 add PG 4 string cvs 7 ss show gr } def\n\ /find { search { pop 3 -1 roll 1 add 3 1 roll }\n\ -{ pop exit } ifelse } def\n\ -/spacecount { 0 exch ( ) { find } loop } def\n\ +{ pop exit } ifelse } def\n"); + fprintf (file, "/spacecount { 0 exch ( ) { find } loop } def\n\ /toofar? { ( ) search pop dup stringwidth pop\n\ currentpoint pop add rm gt } bind def\n\ /pagejump { jump toofar? { L jump s s }\n\ -{ s s } ifelse } def\n\ -/s /show load def %% \n\ +{ s s } ifelse } def\n"); + fprintf (file, "/s /show load def %% \n\ /n { bm tm gt { jump s L } { s L } ifelse} bind def\n\ /c { centre s L } def \n\ /S { dup spacecount { pagejump } repeat pop } def\n\ @@ -190,13 +204,10 @@ /bol { /Times-Bold-IL1 F } def\n\ /ss { /Helvetica-IL1 F } def\n\ /si { /Helvetica-Oblique-IL1 } def\n\ -/sb { /Helvetica-Bold-IL1 F } def\n\ -\n\ -end %% close minidict: *this is important*\n\ -%%%% EndResource\n\ -\n\ -\n\ -%%%%BeginPageSetup \n\ +/sb { /Helvetica-Bold-IL1 F } def\n\n"); + fprintf (file, "end %% close minidict: *this is important*\n\ +%%%% EndResource\n\n\n"); + fprintf (file, "%%%%BeginPageSetup \n\ 1upA4 %% open the page \n\ %%%%EndPageSetup \n\ 0 a\n\ @@ -208,9 +219,7 @@ while ((tnode != 0) & (nodes_left (tnode) >= startlevel)) { level = nodes_left (tnode) - startlevel; - flags = node_getflags (tnode); - cdata = fixnullstring (node_get (tnode, TEXT)); - ps_export_node (file, level, flags, cdata); + ps_export_node (file, level, tnode); if (node_up (tnode) && node_up (tnode) == node_backrecurse (tnode)) fprintf (file, " H\n"); @@ -225,7 +234,7 @@ cli_outfunf ("postscript export, saved output to \"%s\"", filename); if (file != stdout) fclose (file); - return (int) node; + return node; } /* --- hnb-1.9.18.orig/src/tree_todo.c +++ hnb-1.9.18/src/tree_todo.c @@ -260,7 +260,7 @@ #include "cli.h" -static int toggle_todo_cmd (int argc, char **argv, void *data) +static void* toggle_todo_cmd (int argc, char **argv, void *data) { Node *pos = (Node *) data; @@ -269,17 +269,18 @@ node_set(pos,"done","no"); } else { node_unset(pos,"type"); + node_unset(pos,"done"); } - return (int) pos; + return pos; } -static int toggle_done_cmd (int argc, char **argv, void *data) +static void* toggle_done_cmd (int argc, char **argv, void *data) { Node *pos = (Node *) data; if (strcmp(fixnullstring(node_get(pos,"type")),"todo")) { /* bail out if not todo info set */ - return (int) pos; + return pos; } if (!strcmp(fixnullstring(node_get(pos,"done")),"yes")) { /* bail out if not todo info set */ @@ -288,7 +289,7 @@ node_set(pos,"done","yes"); } - return (int) pos; + return pos; } /* --- hnb-1.9.18.orig/src/ui_draw.h +++ hnb-1.9.18/src/ui_draw.h @@ -6,7 +6,7 @@ is owerwritten with the value input */ -void ui_draw (Node *node, char *input, int edit_mode); +void ui_draw (Node *node, int cursor_pos, int edit_mode); void set_status (char *message); #endif --- hnb-1.9.18.orig/src/cli_macro.c +++ hnb-1.9.18/src/cli_macro.c @@ -80,7 +80,7 @@ return pos; } -static int cmd_macro (int argc, char **argv, void *data) +static void* cmd_macro (int argc, char **argv, void *data) { Node *pos=(Node *)data; if(argc==1){ @@ -88,7 +88,7 @@ } else if(argc==2){ MacroT *tmacro=lookup_macro(argv[1]); if(tmacro){ - return (int)do_macro(tmacro,pos); + return do_macro(tmacro,pos); } else { cli_outfunf("no such macro defined '%s'",argv[1]); } @@ -97,7 +97,7 @@ if(!strcmp(argv[1],"define") ){ if(lookup_macro(argv[2])){ cli_outfunf("error macro %s already exist,.. this might turn out badly,.. " ,argv[2]); - return (int) pos; + return pos; } else { MacroT *tmacro; if(!macro){ @@ -119,7 +119,7 @@ } } - return (int) pos; + return pos; } --- hnb-1.9.18.orig/src/file_binary.c +++ hnb-1.9.18/src/file_binary.c @@ -76,7 +76,7 @@ } } -static int export_binary (int argc, char **argv, void *data) +static void* export_binary (int argc, char **argv, void *data) { Node *node = (Node *) data; char *filename = argc>=2?argv[1]:""; @@ -89,7 +89,7 @@ if (!file) { cli_outfunf ("binary export, unable to open \"%s\"", filename); - return (int) node; + return node; } fwrite (&hnb_binary_header, 4, 1, file); @@ -99,11 +99,11 @@ cli_outfunf ("binary export, wrote data to \"%s\"", filename); - return (int) node; + return node; } -static int import_binary (int argc, char **argv, void *data) +static void* import_binary (int argc, char **argv, void *data) { Node *node = (Node *) data; char *filename = argc==2?argv[1]:""; @@ -117,7 +117,7 @@ file = fopen (filename, "r"); if (!file) { cli_outfunf ("binary import, unable to open \"%s\"", filename); - return (int) node; + return node; } {int header,version; @@ -166,7 +166,7 @@ node=node_remove(node); cli_outfunf("binary import - imported \"%s\"",filename); - return (int) node; + return node; } /* --- hnb-1.9.18.orig/src/tree.c +++ hnb-1.9.18/src/tree.c @@ -47,6 +47,21 @@ return 0; } +Node *node_traverse_right_of (Node *stop, Node *node) +{ + if (node_right (node)) + return node_right (node); + if (node_down (node)) + return node_down (node); + while (node_left (node) && (node_left (node) != stop)) { + if (node_down (node_left (node))) + return node_down (node_left (node)); + node = node_left (node); + } + + return 0; +} + Node *node_backrecurse (Node *node) { if (node_up (node)) { --- hnb-1.9.18.orig/src/file_xml.c +++ hnb-1.9.18/src/file_xml.c @@ -147,7 +147,7 @@ } } -static int export_xml (int argc, char **argv, void *data) +static void* export_xml (int argc, char **argv, void *data) { Node *node = (Node *) data; char *filename = argc==2?argv[1]:""; @@ -159,7 +159,7 @@ file = fopen (filename, "w"); if (!file) { cli_outfunf ("xml export, unable to open \"%s\"", filename); - return (int) node; + return node; } xml_export_nodes (file, node, 0); @@ -170,7 +170,7 @@ cli_outfunf ("xml export, wrote data to \"%s\"", filename); - return (int) node; + return node; } /* joins up tags with data if there is data as the first child @@ -202,7 +202,7 @@ } -static int import_xml (int argc, char **argv, void *data) +static void* import_xml (int argc, char **argv, void *data) { Node *node = (Node *) data; char *filename = argc==2?argv[1]:""; @@ -221,7 +221,7 @@ file = fopen (filename, "r"); if (!file) { cli_outfunf ("xml import, unable to open \"%s\"", filename); - return (int) node; + return node; } s = xml_tok_init (file); init_import (&ist, node); @@ -231,7 +231,7 @@ cli_outfunf ("xml import error, parsing og '%s', line:%i %s", filename, s->line_no,rdata); fclose (file); - return (int) node; + return node; } switch (type) { @@ -328,7 +328,7 @@ cli_outfunf ("xml import - imported \"%s\" %i lines", filename, s->line_no); xml_tok_cleanup (s); - return (int) node; + return node; } /* --- hnb-1.9.18.orig/src/file.c +++ hnb-1.9.18/src/file.c @@ -150,13 +150,13 @@ } -static int cmd_save (int argc,char **argv, void *data) +static void* cmd_save (int argc,char **argv, void *data) { Node *pos = (Node *) data; if(prefs.readonly){ docmd (pos, "status \"readonly mode, not writing to disk\"\n"); - return (int)pos; + return pos; } if (prefs.db_file[0] != (char) 255) { /* magic value of tutorial */ @@ -179,10 +179,10 @@ } else { /* make tutorial users initial database, if initial database dont exist */ } - return (int) pos; + return pos; } -static int cmd_revert (int argc,char **argv, void *data) +static void* cmd_revert (int argc,char **argv, void *data) { Node *pos = (Node *) data; @@ -197,7 +197,7 @@ pos=docmd (pos, buf); } } - return (int) pos; + return pos; } --- hnb-1.9.18.orig/src/libcli/cli.h +++ hnb-1.9.18/src/libcli/cli.h @@ -40,8 +40,8 @@ void cli_add_item (char *name, - int *integer, char *string, - int (*func) (int argc,char **argv, void *data), char *usage); + int *integer, char *string, + void* (*func) (int argc,char **argv, void *data), char *usage); #define cli_add_int(name,integer,usage)\ cli_add_item (name, integer, NULL, NULL, usage) @@ -55,7 +55,7 @@ int cli_load_file(char *filename); char *cli_complete (const char *commandline); /* returns a completed commandline */ -int cli_docmd (char *commandline, void *data); /* run commandline */ +void *cli_docmd (char *commandline, void *data); /* run commandline */ extern void (*cli_outfun) (char *); /* the outputting function --- hnb-1.9.18.orig/src/libcli/Makefile +++ hnb-1.9.18/src/libcli/Makefile @@ -1,4 +1,4 @@ -CFLAGS = -Wall +CFLAGS = -Wall -Werror OBJS = cli.o cli_history.o cli_tokenize.o --- hnb-1.9.18.orig/src/libcli/cli.c +++ hnb-1.9.18/src/libcli/cli.c @@ -113,7 +113,7 @@ typedef struct ItemT { char *name; /* what the user types */ - int (*func) (int argc,char **argv, void *data); /* function that is the command */ + void* (*func) (int argc,char **argv, void *data); /* function that is the command */ int *integer; /* pointer to integer (set to NULL if string) */ char *string; /* pointer to string (set to NULL if integer) */ char *usage; /* helptext for this command */ @@ -129,8 +129,8 @@ void cli_add_item (char *name, - int *integer, char *string, - int (*func) (int argc,char **argv, void *data), char *usage) + int *integer, char *string, + void *(*func) (int argc,char **argv, void *data), char *usage) { ItemT *titem = items; @@ -191,8 +191,8 @@ } -static int help (int argc,char **argv, void *data); -static int vars (int argc,char **argv, void *data); +static void* help (int argc,char **argv, void *data); +static void* vars (int argc,char **argv, void *data); static int inited = 0; @@ -224,13 +224,13 @@ int cli_calllevel=0; -int cli_docmd (char *commandline, void *data) +void *cli_docmd (char *commandline, void *data) { int largc=0; char **largv; ItemT *titem = items; - int ret=(int)data; + void *ret=data; cli_calllevel++; if (cli_precmd) @@ -382,7 +382,7 @@ /* internal commands */ -static int help (int argc,char **argv, void *data) +static void* help (int argc,char **argv, void *data) { if (argc == 1) { /* show all help */ ItemT *titem = items; @@ -410,17 +410,17 @@ cli_outfun (""); cli_outfun(titem->help); } - return(int)data; + return data; } } titem = titem->next; } cli_outfunf ("unknown command '%s'", argv[1]); } - return(int)data; + return data; } -static int vars (int argc, char **argv, void *data) +static void* vars (int argc, char **argv, void *data) { ItemT *titem = items; @@ -446,7 +446,7 @@ cli_outfunf ("----------------"); cli_outfunf ("to change a variable: \"variablename newvalue\""); - return(int)data; + return data; } char *cli_getstring(char *variable){ --- hnb-1.9.18.orig/src/libcli/test.c +++ hnb-1.9.18/src/libcli/test.c @@ -23,7 +23,7 @@ int integer=0; char string[40]="not set"; -int echo(int argc,char **argv, void *data){ +void* echo(int argc,char **argv, void *data){ printf("tokens:%i\n",argc); while(*argv) printf("[%s]\n",*(argv++)); --- hnb-1.9.18.orig/src/libcli/cli_tokenize.c +++ hnb-1.9.18/src/libcli/cli_tokenize.c @@ -182,10 +182,10 @@ #define MAX_VARNAMELENGTH 128 -char **argv_tokenize(char *input_string){ +char **argv_tokenize(char *input_string) { char **argv=NULL; char *output; - unsigned char varname[MAX_VARNAMELENGTH]=""; + char varname[MAX_VARNAMELENGTH]=""; int varname_pos=0; init_state_table(); --- hnb-1.9.18.orig/src/Makefile +++ hnb-1.9.18/src/Makefile @@ -1,5 +1,5 @@ LIBS=-lncurses libcli/libcli.a -CFLAGS=-I.. -Ilibcli -DHAVE_CONFIG_H -Wall -pedantic -g +CFLAGS=-I.. -Ilibcli -DHAVE_CONFIG_H -Wall -Werror -g CFILES=$(wildcard *.c) OBJS=$(patsubst %.c,%.o,$(CFILES)) --- hnb-1.9.18.orig/src/search.c +++ hnb-1.9.18/src/search.c @@ -28,7 +28,7 @@ /************** search ************************/ -static int search(int argc,char **argv,void *data){ +static void* search(int argc,char **argv,void *data){ Node *pos=(Node *)data; if(argc==2){ @@ -37,7 +37,7 @@ if (pos == NULL) { docmdf (pos, "status 'reached bottom of tree and \\'%s\\' not found'", argv[1]); - return (int) data; + return data; } } } else if(argc>2){ @@ -46,20 +46,20 @@ if (pos == NULL) { docmdf (pos, "status 'reached top of tree and \\'%s\\' not found'", argv[2]); - return (int) data; + return data; } } else if(!strcmp(argv[1],"-f")){ pos=node_recursive_match( argv[2],pos); if (pos == NULL) { docmdf (pos, "status 'reached bottom of tree and \\'%s\\' not found'", argv[2]); - return (int) data; + return data; } } - return (int)pos; + return pos; } cli_outfunf("usage: %s [-b|-f] ",argv[0]); - return (int)pos; + return pos; } /* --- hnb-1.9.18.orig/src/expanded.c +++ hnb-1.9.18/src/expanded.c @@ -18,16 +18,15 @@ * Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include "tree.h" #include "cli.h" -#define NULL 0 #include "evilloop.h" #include "ctype.h" #include "ui_binding.h" - -static int cmd_expand (int argc,char **argv, void *data) +static void* cmd_expand (int argc,char **argv, void *data) { Node *pos = (Node *) data; if(argc==1){ @@ -36,7 +35,7 @@ inputbuf[strlen (inputbuf) + 1] = 0; inputbuf[strlen (inputbuf)] = lastbinding->key; } - return (int)pos; + return pos; } node_setflag(pos,F_expanded,1); } else if((!strcmp(argv[1],"-a"))||(!strcmp(argv[1],"--all"))){ @@ -47,11 +46,23 @@ tnode = node_recurse (tnode); } cli_outfun ("expanded all nodes"); + } else if(!strcmp(argv[1],"--subtree")) { + node_setflag(pos,F_expanded,1); + if(node_right(pos)) { + + Node *tnode = node_right(pos); + + while (tnode) { + node_setflag(tnode,F_expanded,1); + tnode = node_traverse_right_of (pos, tnode); + } + } + cli_outfun ("expanded subtree"); } - return (int) pos; + return pos; } -static int cmd_collapse (int argc,char **argv, void *data) +static void* cmd_collapse (int argc,char **argv, void *data) { Node *pos = (Node *) data; if(argc==1){ @@ -60,7 +71,7 @@ inputbuf[strlen (inputbuf) + 1] = 0; inputbuf[strlen (inputbuf)] = lastbinding->key; } - return (int)pos; + return pos; } node_setflag(pos,F_expanded,0); } else if((!strcmp(argv[1],"-a"))||(!strcmp(argv[1],"--all"))){ @@ -71,9 +82,20 @@ tnode = node_recurse (tnode); } cli_outfun ("collapsed all nodes"); + } else if(!strcmp(argv[1],"--subtree")) { + node_setflag(pos,F_expanded,0); + if(node_right(pos)) { + Node *tnode = node_right(pos); + + while (tnode) { + node_setflag(tnode,F_expanded,0); + tnode = node_traverse_right_of (pos, tnode); + } + } + cli_outfun ("collapsed subtree"); } - return (int) pos; + return pos; } /* --- hnb-1.9.18.orig/src/ui_menu.c +++ hnb-1.9.18/src/ui_menu.c @@ -29,7 +29,7 @@ static void draw_menu(Node *pos, int cur_col, int cur_row){ int row,col; - ui_draw(pos,"",0); + ui_draw(pos,0,0); for(col=0;colmenu[col][0].width) menu[col][0].width=menu[col][row].width; } - return(int)pos; + return pos; } /* --- hnb-1.9.18.orig/src/ui_binding.c +++ hnb-1.9.18/src/ui_binding.c @@ -250,14 +250,14 @@ int ui_current_scope = 0; -static int ui_context_cmd (int argc, char **argv, void *data) +static void* ui_context_cmd (int argc, char **argv, void *data) { if(argc<2){ cli_outfunf("usage: %s ",argv[0]); - return(int)data; + return data; } ui_current_scope = string2scope (argv[1]); - return (int) data; + return data; } static void makebinding (int scope_no, int key, int action, char *action_name, @@ -272,7 +272,7 @@ ui_binding_count[scope_no]++; } -static int ui_bind_cmd (int argc, char **argv, void *data) +static void* ui_bind_cmd (int argc, char **argv, void *data) { /* char context[40];*/ char *key; @@ -280,7 +280,7 @@ if(argc<3){ cli_outfunf("error in bindings %s %s %s %s\n",argv[0],argv[1],argv[2],argv[3]); - return (int)data; + return data; } key=argv[1]; action=argv[2]; @@ -293,7 +293,7 @@ ui_action_command, "command", action); } - return (int) data; + return data; } @@ -395,10 +395,12 @@ !init_ui_binding(); */ -static int dummy_cmd (int argc, char **argv, void *data) +#if 0 +static void* dummy_cmd (int argc, char **argv, void *data) { - return (int) data; + return data; } +#endif void init_ui_binding () { @@ -409,8 +411,9 @@ cli_add_help ("context", "Changes context, context may be one of 'main', 'lineedit', 'nodeedit', 'confirm' or any other userdefined context."); +#if 0 /* dummy commands to show the 'builtins' */ -/* cli_add_command ("backspace", dummy_cmd, ""); + cli_add_command ("backspace", dummy_cmd, ""); cli_add_help ("backspace", "erase the preceding character"); cli_add_command ("delete", dummy_cmd, ""); cli_add_help ("delete", "erase the following character"); @@ -477,5 +480,5 @@ cli_add_command ("unbound", dummy_cmd, ""); cli_add_help ("unbound", "give a message indicating that the pressed key is not bound in the current context"); -*/ +#endif } --- hnb-1.9.18.orig/src/file_html.c +++ hnb-1.9.18/src/file_html.c @@ -52,7 +52,7 @@ /* *INDENT-ON* */ -static int export_html (int argc, char **argv, void *data) +static void* export_html (int argc, char **argv, void *data) { Node *node = (Node *) data; char *filename = argc==2?argv[1]:""; @@ -67,7 +67,7 @@ file = fopen (filename, "w"); if (!file) { cli_outfunf ("html export, unable to open \"%s\"", filename); - return (int) node; + return node; } startlevel = nodes_left (node); @@ -130,7 +130,7 @@ fclose (file); cli_outfunf ("html export, saved output in \"%s\"", filename); - return (int) node; + return node; } static void htmlcss_export_nodes (FILE * file, Node *node, int level) @@ -162,7 +162,7 @@ } -static int export_htmlcss (int argc, char **argv, void *data) +static void* export_htmlcss (int argc, char **argv, void *data) { Node *node = (Node *) data; char *filename = argc==2?argv[1]:""; @@ -174,7 +174,7 @@ file = fopen (filename, "w"); if (!file) { cli_outfunf ("html export, unable to open \"%s\"", filename); - return (int) node; + return node; } fprintf (file, "\n\ @@ -182,8 +182,8 @@ \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\ \n\ \n\ -tree exported from hnb\n\ -\n\ -\n\ -\n"); +\n"); + fprintf (file, "\n"); htmlcss_export_nodes (file, node, 0); @@ -224,7 +224,7 @@ fclose (file); cli_outfunf ("html css export, saved output in \"%s\"", filename); - return (int) node; + return node; } /* --- hnb-1.9.18.orig/src/query.c +++ hnb-1.9.18/src/query.c @@ -27,7 +27,7 @@ static char query[100]; -static int getquery_cmd (int argc, char **argv, void *data) +static void* getquery_cmd (int argc, char **argv, void *data) { Node *pos = (Node *) data; @@ -36,7 +36,7 @@ ui_getstr (argv[1], &query[0]); else ui_getstr ("enter string", &query[0]); - return (int) pos; + return pos; } /* --- hnb-1.9.18.orig/src/ui_draw.c +++ hnb-1.9.18/src/ui_draw.c @@ -525,7 +525,7 @@ /* FIXME: make backup?,.. and make sure data is present,.., make possiblity to write back? */ -int display_format_cmd (int argc, char **argv, void *data) +void* display_format_cmd (int argc, char **argv, void *data) { char *p = argv[1]; int width; @@ -533,7 +533,7 @@ int col_no = 0; if(argc<2){ - return (int)data; + return data; } do { @@ -618,7 +618,7 @@ col_def[col_no].type = col_terminate; - return (int) data; + return data; } @@ -691,7 +691,7 @@ #define MAXLINES 512 static int line_nodeno[MAXLINES] = { 0 }; -void ui_draw (Node *node, char *input, int edit_mode) +void ui_draw (Node *node, int cursor_pos, int edit_mode) { int lines; @@ -775,19 +775,19 @@ tnode = 0; } } -/* draw the currently selected item */ + /* draw the currently selected item */ line_nodeno[active_line] = node_no (node); if (edit_mode) { - lines = draw_item (active_line, (int) input, node, drawmode_edit); + lines = draw_item (active_line, cursor_pos, + node, drawmode_edit); } else { - lines = - draw_item (active_line, strlen (input), node, - drawmode_completion); + lines = draw_item (active_line, cursor_pos, node, + drawmode_completion); } -/* draw items below current item */ + /* draw items below current item */ { Node *prev_up = node; /* to aid pgup/pgdn */ Node *tnode = down (node, node); --- hnb-1.9.18.orig/src/file_hnb.c +++ hnb-1.9.18/src/file_hnb.c @@ -105,7 +105,7 @@ } } -static int export_hnb (int argc, char **argv, void *data) +static void* export_hnb (int argc, char **argv, void *data) { Node *node = (Node *) data; char *filename = argc>=2?argv[1]:""; @@ -118,7 +118,7 @@ if (!file) { cli_outfunf ("hnb export, unable to open \"%s\"", filename); - return (int) node; + return node; } fprintf (file, "\n\ @@ -143,11 +143,11 @@ cli_outfunf ("hnb export, wrote data to \"%s\"", filename); - return (int) node; + return node; } -static int import_hnb (int argc, char **argv, void *data) +static void* import_hnb (int argc, char **argv, void *data) { Node *node = (Node *) data; char *filename = argc==2?argv[1]:""; @@ -170,7 +170,7 @@ file = fopen (filename, "r"); if (!file) { cli_outfunf ("hnb import, unable to open \"%s\"", filename); - return (int) node; + return node; } s = xml_tok_init (file); init_import (&ist, node); @@ -180,7 +180,7 @@ cli_outfunf ("hnb import error, parsing og '%s' line:%i, %s", filename, s->line_no, rdata); fclose (file); - return (int) node; + return node; } if (in_tree) { if (type == t_tag && !strcmp (rdata, "node")) { @@ -263,7 +263,7 @@ xml_tok_cleanup (s); - return (int) node; + return node; } /* --- hnb-1.9.18.orig/src/file_opml.c +++ hnb-1.9.18/src/file_opml.c @@ -90,7 +90,7 @@ } } -static int export_opml (int argc, char **argv, void *data) +static void* export_opml (int argc, char **argv, void *data) { Node *node = (Node *) data; char *filename = argc>=2?argv[1]:""; @@ -103,12 +103,15 @@ if (!file) { cli_outfunf ("opml export, unable to open \"%s\"", filename); - return (int) node; + return node; } - fprintf (file, "\n\ -\n\ -\n\ + fprintf (file, + "" + "\n" + " \n", + argc == 3 ? argv[2] : "1", VERSION); + fprintf (file, "\n\ \n\ outline exported from hnb\n\ \n\ @@ -122,8 +125,7 @@ 200\n\ 200\n\ \n\ - \n", argc==3?argv[2]:"1", - VERSION); + \n"); opml_export_nodes (file, node, 0); @@ -133,10 +135,10 @@ cli_outfunf ("opml export, wrote data to \"%s\"", filename); - return (int) node; + return node; } -static int import_opml (int argc, char **argv, void *data) +static void* import_opml (int argc, char **argv, void *data) { Node *node = (Node *) data; char *filename = argc==2?argv[1]:""; @@ -154,7 +156,7 @@ file = fopen (filename, "r"); if (!file) { cli_outfunf ("opml import, unable to open \"%s\"", filename); - return (int) node; + return node; } s = xml_tok_init (file); init_import (&ist, node); @@ -164,7 +166,7 @@ cli_outfunf ("opml import error, parsing og '%s', line:%i %s", filename, s->line_no, rdata); fclose (file); - return (int) node; + return node; } if (in_body) { if (type == t_tag && !strcmp (rdata, "outline")) { @@ -208,7 +210,7 @@ cli_outfunf ("opml import - imported \"%s\" %i lines", filename, s->line_no); xml_tok_cleanup (s); - return (int) node; + return node; } --- hnb-1.9.18.orig/src/actions.c +++ hnb-1.9.18/src/actions.c @@ -32,7 +32,7 @@ static char web_command[255] = "galeon -n *"; static char mail_command[255] = "rxvt -rv +sb -e mutt *"; -static int cmd_system(int argc, char **argv, void *data){ +static void* cmd_system(int argc, char **argv, void *data){ Node *pos=(Node *)data; int ui_was_inited = ui_inited; if (argc>1) { @@ -42,7 +42,7 @@ if (ui_was_inited) ui_init (); } - return (int)pos; + return pos; } static int action_node (Node *node) @@ -76,7 +76,7 @@ strcat (cd, url); strcat (cd, cs + 1); cli_outfunf ("shelling out: %s", cmdline); - //strcat(cd,"> /dev/null 2>&1 &"); + /* strcat(cd,"> /dev/null 2>&1 &"); */ break; } else { *cd = *cs; @@ -109,7 +109,7 @@ strcat (cd, mail_address); strcat (cd, cs + 1); cli_outfunf ("shelling out: %s", cmdline); - //strcat(cd,"> /dev/null 2>&1 &"); + /* strcat(cd,"> /dev/null 2>&1 &"); */ break; } else { *cd = *cs; @@ -136,21 +136,21 @@ * url/email address substring,.. and launches an app based on that? * */ -static int cmd_action (int argc, char **argv, void *data) +static void* cmd_action (int argc, char **argv, void *data) { Node *pos = (Node *) data; Node *node = node_right (pos); while (node) { if (!action_node (node)) - return (int) pos; + return pos; node = node_down (node); } if (!action_node (pos)) { - return (int) pos; + return pos; } else { cli_outfunf ("nothing to do"); - return (int) pos; + return pos; } /*** --- hnb-1.9.18.orig/src/tree_sort.c +++ hnb-1.9.18/src/tree_sort.c @@ -141,7 +141,7 @@ return cmp_todo(b,a); } -static int sort_cmd (int argc, char **argv, void *data) +static void* sort_cmd (int argc, char **argv, void *data) { Node *pos = (Node *) data; int (*cmp) (Node *a, Node *b)=cmp_todo; @@ -155,7 +155,7 @@ node_mergesort (node_top (pos), nodes_down (node_top (pos)) + 1, cmp); if (node_left (pos)) node_left (pos)->right = node_top (pos); - return (int) pos; + return pos; } /* --- hnb-1.9.18.orig/src/spell.c +++ hnb-1.9.18/src/spell.c @@ -72,12 +72,12 @@ } } -static int spell_cmd (int argc, char **argv, void *data) +static void* spell_cmd (int argc, char **argv, void *data) { Node *pos = (Node *) data; if(prefs.readonly){ cli_outfun("readonly flag set, avoiding changes"); - return (int)data; + return data; } if (argc==2 && (!strcmp (argv[1], "-r"))) { int startlevel; @@ -92,7 +92,7 @@ } else { spell_node (pos); } - return (int) pos; + return pos; } /* @@ -102,7 +102,10 @@ { cli_add_command ("spell", spell_cmd, "[-r]"); cli_add_help ("spell", - "Spellchecks the current node, or all children and following siblings recursively (if -r specified), using the command defined in 'spell_command'"); + "Spellchecks the current node, or all children and " + "following siblings recursively (if -r specified), " + "using the command defined in 'spell_command'"); cli_add_string ("spell_command", spell_command, - "Command executed when spell checking a node, a temporary file is written and passed as an argument"); + "Command executed when spell checking a node, a " + "temporary file is written and passed as an argument"); } --- hnb-1.9.18.orig/src/file_help.c +++ hnb-1.9.18/src/file_help.c @@ -42,7 +42,7 @@ /* *INDENT-ON* */ -static int export_help (int argc, char **argv, void *data) +static void* export_help (int argc, char **argv, void *data) { Node *node = (Node *) data; char *filename = argc==2?argv[1]:""; @@ -55,7 +55,7 @@ if (!file) { cli_outfunf ("help export, unable to open \"%s\"", filename); - return (int) node; + return node; } startlevel = nodes_left (node); @@ -86,10 +86,10 @@ fclose (file); cli_outfunf ("help export, wrote data to \"%s\"", filename); - return (int) node; + return node; } -static int import_help (int argc, char **argv, void *data) +static void* import_help (int argc, char **argv, void *data) { Node *node = (Node *) data; import_state_t ist; @@ -100,7 +100,7 @@ if (node_getflag (node, F_temp)) node = node_remove (node); - return (int) (node); + return node; } /* --- hnb-1.9.18.orig/src/tutorial.inc +++ hnb-1.9.18/src/tutorial.inc @@ -189,7 +189,7 @@ i(4,"http://www.vg.no/",0); i(3,"fark.com",0); i(4,"http://www.fark.com/",0); - i(1,"quotes ",0); + i(1,"quotations ",0); i(2,"Peoples Front To Reunite Gondwanaland: \\Stop the Laurasian Separatist Movement!\\ ",0); i(2,"slashdot ",0); i(3,"disbelief ",0); --- hnb-1.9.18.orig/src/ui_overlay.c +++ hnb-1.9.18/src/ui_overlay.c @@ -44,11 +44,11 @@ static char *ui_helptext[MAX_SCOPES] = { 0 }; -static int ui_helptext_cmd (int argc, char **argv, void *data) +static void* ui_helptext_cmd (int argc, char **argv, void *data) { if(argc>1) ui_helptext[ui_current_scope] = strdup (argv[1]); - return (int) data; + return data; } #define MAX_STATUS_LINES 100 @@ -129,7 +129,7 @@ } -static int ui_status_cmd (int argc, char **argv, void *data) +static void* ui_status_cmd (int argc, char **argv, void *data) { if(argc==2 && (!strcmp(argv[1],"-c") || !strcmp(argv[1],"--clear"))){ status_ttl=0; @@ -138,7 +138,7 @@ if(!ui_inited) cli_outfun(argv[1]); } - return (int) data; + return data; } --- hnb-1.9.18.orig/src/clipboard.c +++ hnb-1.9.18/src/clipboard.c @@ -29,7 +29,7 @@ static Node *clipboard = NULL; -static int copy_cmd (int argc,char **argv, void *data) +static void* copy_cmd (int argc,char **argv, void *data) { Node *pos = (Node *) data; @@ -39,15 +39,15 @@ clipboard = node_new (); clipboard = tree_duplicate (pos, clipboard); - return (int) pos; + return pos; } -static int cut_cmd (int argc,char **argv, void *data) +static void* cut_cmd (int argc,char **argv, void *data) { Node *pos = (Node *) data; if(prefs.readonly){ cli_outfun("readonly flag set, avoiding tree change"); - return (int)data; + return data; } if (clipboard != NULL) { @@ -58,10 +58,10 @@ clipboard = tree_duplicate (pos, clipboard); pos = node_remove (pos); docmd(pos,"tree_changed"); - return (int) pos; + return pos; } -static int paste_cmd (int argc,char **argv, void *data) +static void* paste_cmd (int argc,char **argv, void *data) { Node *pos = (Node *) data; @@ -71,14 +71,14 @@ Node *temp; if(prefs.readonly){ cli_outfun("readonly flag set, avoiding insertion"); - return (int)data; + return data; } temp = node_insert_down (pos); tree_duplicate (clipboard, temp); docmd(pos,"tree_changed"); } - return (int) pos; + return pos; } /* --- hnb-1.9.18.orig/src/autosave.c +++ hnb-1.9.18/src/autosave.c @@ -49,17 +49,17 @@ autosave_timer=0; } -static int tree_changed_cmd (int argc, char **argv, void *data) +static void* tree_changed_cmd (int argc, char **argv, void *data) { /* TODO: add increment handling, for "extreme changes" */ Node *pos = (Node *) data; nodes_changed++; if(autosave_threshold<=nodes_changed) autosave_invoke(pos); - return (int) pos; + return pos; } -static int autosave_check_timeout (int argc, char **argv, void *data) +static void* autosave_check_timeout (int argc, char **argv, void *data) { Node *pos = (Node *) data; if(nodes_changed){ @@ -68,7 +68,7 @@ autosave_invoke(pos); } } - return (int) pos; + return pos; } /* --- hnb-1.9.18.orig/src/ui_edit.c +++ hnb-1.9.18/src/ui_edit.c @@ -28,7 +28,7 @@ #include "evilloop.h" #include -static int ui_edit_cmd (int argc, char **argv, void *data) +static void* ui_edit_cmd (int argc, char **argv, void *data) { Tbinding *c; int stop = 0; @@ -48,7 +48,7 @@ if(prefs.readonly){ cli_outfun("readonly flag set, avoiding tree change"); ui_current_scope = tempscope; - return (int)data; + return data; } if (inputbuf[0]) { /* there is data in the inputbuffer,.. @@ -67,7 +67,7 @@ } ui_current_scope = tempscope; docmd(pos,"tree_changed"); - return (int) pos; + return pos; } node_backup = node_duplicate (pos); @@ -81,7 +81,7 @@ while (!stop) { node_set (pos, TEXT, input); - ui_draw (pos, (char *) cursor_pos, 1); + ui_draw (pos, cursor_pos, 1) ; c = parsekey (ui_input (), ui_scope_nodeedit); switch (c->action) { case ui_action_right: @@ -215,7 +215,7 @@ } node_free (node_backup); ui_current_scope = tempscope; - return (int) data; + return data; } int ui_getstr_loc (char *input, int x, int y, int maxlen) --- hnb-1.9.18.orig/src/file_ascii.c +++ hnb-1.9.18/src/file_ascii.c @@ -34,7 +34,7 @@ static int ascii_margin = -1; -static int import_ascii (int argc, char **argv, void *data) +static void* import_ascii (int argc, char **argv, void *data) { Node *node = (Node *) data; char *filename = argc==2?argv[1]:""; @@ -46,7 +46,7 @@ file = fopen (filename, "r"); if (file == NULL) { cli_outfunf ("ascii import, unable to open \"%s\"", filename); - return (int) (node); + return node; } init_import (&ist, node); @@ -73,7 +73,7 @@ cli_outfunf ("ascii import, imported \"%s\"", filename); - return (int) (node); + return node; } static void ascii_export_node (FILE * file, int level, int flags, char *data) @@ -95,7 +95,7 @@ } } -static int export_ascii (int argc, char **argv, void *data) +static void *export_ascii (int argc, char **argv, void *data) { Node *node = (Node *) data; char *filename = argc==2?argv[1]:""; @@ -110,7 +110,7 @@ file = fopen (filename, "w"); if (!file) { cli_outfunf ("ascii export, unable to open \"%s\"", filename); - return (int) node; + return node; } startlevel = nodes_left (node); @@ -130,7 +130,7 @@ cli_outfunf ("ascii export, wrote output to \"%s\"", filename); - return (int) node; + return node; } --- hnb-1.9.18.orig/src/statcmds.c +++ hnb-1.9.18/src/statcmds.c @@ -25,7 +25,7 @@ #ifndef WIN32 -static int mem_cmd (int argc, char **argv, void *data) +static void* mem_cmd (int argc, char **argv, void *data) { Node *pos = (Node *) data; @@ -35,7 +35,7 @@ file = fopen ("/proc/self/stat", "r"); if (!file) - return (int) pos; + return pos; fscanf (file, "%*i %*s %*s %*i %*i %*i %*i %*i %*i %*i %*i %*i %*i %*i %*i %*i %*i %*i %*i %*i %*i %*i %i", @@ -53,7 +53,7 @@ file = fopen ("/proc/meminfo", "r"); if (!file) - return (int) pos; + return pos; fscanf (file, "%*s %*s %*s %*s %*s %*s %*s %*i %*i %i %i %i", &free, &buffers, &cached); @@ -64,7 +64,7 @@ (float) ((free + buffers + cached) / 1024.0 / 1024.0)); } - return (int) pos; + return pos; } #endif /* @@ -97,7 +97,7 @@ return words; } -static int stats_cmd (int argc, char **argv, void *data) +static void* stats_cmd (int argc, char **argv, void *data) { int words = 0, leaves = 0, nodes = 0; Node *pos = (Node *) data; @@ -114,7 +114,7 @@ cli_outfunf ("nodes:%i, leaves:%i words:%i", nodes, leaves, words); - return (int) pos; + return pos; } /* --- hnb-1.9.18.orig/src/cal.c +++ hnb-1.9.18/src/cal.c @@ -36,7 +36,7 @@ "", "January", "February", "March", "April", "May" ,"June", "July", "August", "September", "October", "November" , "December"}; -static int insert_cal(int argc, char **argv, void *data){ +static void* insert_cal(int argc, char **argv, void *data){ Node *pos=(void *)data; int year; @@ -45,7 +45,7 @@ if( (argc!=3) || (atoi(argv[1])>12 )){ cli_outfunf("usage: %s ", argv[0]); - return (int)data; + return data; } month=atoi(argv[1]); @@ -53,7 +53,7 @@ if(prefs.readonly){ cli_outfun("readonly flag set, avoiding insertion"); - return (int)data; + return data; } @@ -102,8 +102,8 @@ } } - docmd(pos,"tree_changed"); - return (int)pos; + docmd(pos, "tree_changed"); + return pos; } /* --- hnb-1.9.18.orig/src/hnbrc.inc +++ hnb-1.9.18/src/hnbrc.inc @@ -238,6 +238,8 @@ \n\ bind + expand\n\ bind - collapse\n\ + bind ] \"expand --subtree\"\n\ + bind [ \"collapse --subtree\"\n\ \n\ bind ^Z restore_state\n\ \n\ @@ -540,16 +542,18 @@ menu \"Entry\" \"--------------\" \"\"\n\ menu \"Entry\" \"edit return\" \"edit\"\n\ menu \"Entry\" \"delete del\" \"remove\"\n\ - menu \"Entry\" \"--------------\" \"\"\n\ - menu \"Entry\" \"do action ^A\" \"action\"\n\ - menu \"Entry\" \"indent >\" \"indent\"\n\ - menu \"Entry\" \"outdent <\" \"outdent\"\n\ - menu \"Entry\" \"toggle todo ^T\" \"toggle_todo\"\n\ - menu \"Entry\" \"toggle done ^D\" \"toggle_done\"\n\ - menu \"Entry\" \"expand +\" \"expand\"\n\ - menu \"Entry\" \"collapse -\" \"collapse\"\n\ + menu \"Entry\" \"------------------\" \"\"\n\ + menu \"Entry\" \"do action ^A\" \"action\"\n\ + menu \"Entry\" \"indent >\" \"indent\"\n\ + menu \"Entry\" \"outdent <\" \"outdent\"\n\ + menu \"Entry\" \"toggle todo ^T\" \"toggle_todo\"\n\ + menu \"Entry\" \"toggle done ^D\" \"toggle_done\"\n\ + menu \"Entry\" \"expand +\" \"expand\"\n\ + menu \"Entry\" \"expand subtree ]\" \"expand --subtree\"\n\ + menu \"Entry\" \"collapse -\" \"collapse\"\n\ + menu \"Entry\" \"collapse subtree [\" \"collapse --subtree\"\n\ ##### level\n\ - menu \"Level\" \"------------\" \"\"\n\ + menu \"Level\" \"------------------\" \"\"\n\ menu \"Level\" \"sort ^S\" \"sort -a\"\n\ menu \"Level\" \"sort (desc.)\" \"sort -d\"\n\ menu \"Level\" \"shuffle \" \"sort -r\"\n\ --- hnb-1.9.18.orig/src/tree_misc.c +++ hnb-1.9.18/src/tree_misc.c @@ -27,16 +27,16 @@ #include "ui_cli.h" #include "evilloop.h" -static int cmd_movenode (int argc, char **argv, void *data) +static void* cmd_movenode (int argc, char **argv, void *data) { Node *pos = (Node *) data; if(argc<2){ cli_outfunf("usage: %s ",argv[0]); - return (int)pos; + return pos; } if(prefs.readonly){ cli_outfun("readonly flag set, avoiding tree change"); - return (int)data; + return data; } if (!strcmp (argv[1], "left")) { if (node_left (pos)) { @@ -68,8 +68,8 @@ node_swap (pos, node_down (pos)); } } - docmd(pos,"tree_changed"); - return (int) pos; + docmd(pos, "tree_changed"); + return pos; } /* @@ -80,12 +80,12 @@ cli_add_command ("movenode", cmd_movenode, ""); } -static int cmd_go(int argc, char **argv, void *data){ +static void* cmd_go(int argc, char **argv, void *data){ Node *pos=(Node *)data; if(argc!=2){ cli_outfunf("usage: %s "); - return (int)pos; + return pos; } if(!strcmp(argv[1],"up")){ @@ -115,7 +115,7 @@ } - return (int)pos; + return pos; } /* @@ -131,7 +131,7 @@ #include "ctype.h" #include "ui_binding.h" -static int cmd_outdent (int argc, char **argv, void *data) +static void* cmd_outdent (int argc, char **argv, void *data) { Node *pos = (Node *) data; @@ -140,11 +140,11 @@ inputbuf[strlen (inputbuf) + 1] = 0; inputbuf[strlen (inputbuf)] = lastbinding->key; } - return (int)pos; + return pos; } if(prefs.readonly){ cli_outfun("readonly flag set, avoiding tree change"); - return (int)data; + return data; } if (node_left (pos)) { @@ -174,14 +174,14 @@ } else { target_node->right = NULL; } - docmd(pos,"tree_changed"); + docmd(pos, "tree_changed"); } - return (int) pos; + return pos; } /* FIXME: no real need for a temporary node */ -static int cmd_indent (int argc, char **argv, void *data) +static void* cmd_indent (int argc, char **argv, void *data) { Node *pos = (Node *) data; @@ -190,11 +190,11 @@ inputbuf[strlen (inputbuf) + 1] = 0; inputbuf[strlen (inputbuf)] = lastbinding->key; } - return (int)pos; + return pos; } if(prefs.readonly){ cli_outfun("readonly flag set, avoiding tree change"); - return (int)data; + return data; } if (node_up (pos)) { @@ -218,9 +218,9 @@ snode = node_down (snode); } node_remove (node_down (pos)); - docmd(pos,"tree_changed"); + docmd(pos, "tree_changed"); } - return (int) pos; + return pos; } /* @@ -236,13 +236,13 @@ "moves the active item and the following siblings one level to the right"); } -static int remove_cmd (int argc, char **argv, void *data) +static void* remove_cmd (int argc, char **argv, void *data) { Node *pos = (Node *) data; if(prefs.readonly){ cli_outfun("readonly flag set, avoiding tree change"); - return (int)data; + return data; } if (node_right (pos)) { Tbinding *c; @@ -250,7 +250,7 @@ ui_current_scope = ui_scope_confirm; docmdf (pos, "status 'node has children, really remove?'"); - ui_draw (pos, "", 0); + ui_draw (pos, 0, 0); ui_current_scope = tempscope; c = parsekey (ui_input (), ui_scope_confirm); if (c->action == ui_action_confirm) { @@ -263,7 +263,7 @@ pos = node_remove (pos); docmd(pos,"tree_changed"); } - return (int) pos; + return pos; } /* @@ -277,7 +277,7 @@ } -static int commandline_cmd (int argc, char **argv, void *data) +static void* commandline_cmd (int argc, char **argv, void *data) { Node *pos = (Node *) data; @@ -285,14 +285,14 @@ do { strcpy (commandline, ""); - ui_draw (pos, "", 0); + ui_draw (pos, 0, 0); ui_getstr ("commandline interface, enter blank command to cancel", commandline); if (commandline[0]) pos = docmd (pos, commandline); } while (commandline[0] && strcmp(commandline,"q") && strcmp(commandline,"quit")); - return (int) pos; + return pos; } /* @@ -305,12 +305,12 @@ "Invokes the interactive commandline in curses mode."); } -static int insert_below_cmd (int argc, char **argv, void *data) +static void* insert_below_cmd (int argc, char **argv, void *data) { Node *pos = (Node *) data; if(prefs.readonly){ cli_outfun("readonly flag set, avoiding tree change"); - return (int)data; + return data; } if (node_getflag (pos, F_temp)) { @@ -325,7 +325,7 @@ } inputbuf[0] = 0; docmd(pos,"tree_changed"); - return (int) pos; + return pos; } /* --- hnb-1.9.18.orig/src/state.c +++ hnb-1.9.18/src/state.c @@ -29,7 +29,7 @@ static Node *savedtree = NULL; -static int save_state_cmd (int argc, char **argv, void *data) +static void* save_state_cmd (int argc, char **argv, void *data) { Node *pos = (Node *) data; Node *i; @@ -58,10 +58,10 @@ savedtree = node_recurse (savedtree); } - return (int) pos; + return pos; } -static int restore_state_cmd (int argc, char **argv, void *data) +static void* restore_state_cmd (int argc, char **argv, void *data) { Node *pos = (Node *) data; @@ -74,7 +74,7 @@ tree_free (savedtree); savedtree = NULL; } - return (int) pos; + return pos; } /* @@ -84,8 +84,9 @@ { cli_add_command ("save_state", save_state_cmd, ""); cli_add_help ("save_state", - "Saves a copy of the current tree and selected node in memory"); + "Saves a copy of the current tree and selected node in " + "memory"); cli_add_command ("restore_state", restore_state_cmd, ""); cli_add_help ("restore_state", - "Restores the copy of the tree saved with save_state"); + "Restores the copy of the tree saved with save_state"); } --- hnb-1.9.18.orig/debian/watch +++ hnb-1.9.18/debian/watch @@ -0,0 +1 @@ +http://hnb.sourceforge.net /.files/ hnb-([0-9](\.[0-9]+)+)\.tar\.gz debian uupdate --- hnb-1.9.18.orig/debian/hnb.examples +++ hnb-1.9.18/debian/hnb.examples @@ -0,0 +1,2 @@ +doc/hnbrc +doc/hnbrc.vi --- hnb-1.9.18.orig/debian/hnb.dirs +++ hnb-1.9.18/debian/hnb.dirs @@ -0,0 +1 @@ +usr/bin --- hnb-1.9.18.orig/debian/changelog +++ hnb-1.9.18/debian/changelog @@ -0,0 +1,142 @@ +hnb (1.9.18-3ubuntu2) hardy; urgency=low + + * Remove the broken patch from -3ubuntu1 and fix LP: #49618 properly. + Moving the cursor in edit mode is now visible again. + * debian/control: + + Modify Maintainer value to match DebianMaintainerField spec. + + -- Michael Bienia Thu, 31 Jan 2008 14:41:46 +0100 + +hnb (1.9.18-3ubuntu1) gutsy; urgency=low + + * Patch to fix cursor at end of line regression. (Closes LP: #49618) + * Thanks to frogzoo for the patch. + + -- Barry deFreese Tue, 8 May 2007 22:46:35 -0400 + +hnb (1.9.18-3) unstable; urgency=low + + * Make all callbacks return void*. (Closes: #325645, #267438) + + -- James Morrison Sun, 18 Sep 2005 14:02:09 -0700 + +hnb (1.9.18-2) unstable; urgency=low + + * Fix implicitly converted pointer. (Closes: #325352) + + -- James Morrison Sun, 28 Aug 2005 11:31:24 -0700 + +hnb (1.9.18-1) unstable; urgency=low + + * New upstream version. (Closes: #291961) + * Add todo markup to postscript output. (Closes: #268968) + + -- James Morrison Mon, 21 Mar 2005 00:08:48 -0400 + +hnb (1.9.17-4) unstable; urgency=low + + * Add recursive expand/collapse. (Closes: #248798) + * Update maintainer, properly this time! + * Unset 'done' flag when toggling off a todo item. (Closes: #231256) + * Return NULL if node is NULL in node_get. (Closes: #245875) + * Provide an alternate hnbrc file. (Closes: #228413) + + -- James Morrison Wed, 26 May 2004 00:08:48 -0400 + +hnb (1.9.17-3) unstable; urgency=low + + * New debian maintainer. (Closes: #236689) + * Quote menu items. + * Use quotations instead of quotes. + * Convert to non-native package. + + -- James Morrison Fri, 23 Apr 2004 10:28:58 -0400 + +hnb (1.9.17-2) unstable; urgency=low + + * Orphaning the package. + + -- Tore Anderson Sun, 7 Mar 2004 20:18:51 +0100 + +hnb (1.9.17-1) unstable; urgency=low + + * New upstream release, closes: #186963. + - No longer crashes when writing to a read-only database, closes: #146494. + * debian/hnb.dirs, debian/hnb.docs, debian/hnb.examples, debian/rules, + debian/hnb.manpages (new): + - Adapted to the new upstream release. + * debian/control, debian/copyright: + - New maintainer. + * debian/control: + - Up Standards-Version to 3.6.1.0, no changes required. + - Correct spelling errors, closes: #124738. + - Up debhelper dependency to version 4.0.0 or greater. + * debian/rules, debian/compat (new): + - Declare the debhelper compatibility from debian/compat, and increase + it to 4 while I'm at it. + * debian/changelog: + - Remove magic markers for Emacs. + + -- Tore Anderson Sun, 26 Oct 2003 18:48:10 +0100 + +hnb (1.8.1-1) unstable; urgency=low + + * New upstream release. + * Libxml2 support seems to be working now, enabled at configure + (and added libxml2 dependency). + + -- Andras Bali Thu, 6 Sep 2001 21:56:29 +0200 + +hnb (1.7-1) unstable; urgency=low + + * New upstream release. + + -- Andras Bali Mon, 9 Jul 2001 21:26:52 +0200 + +hnb (1.6.4-1) unstable; urgency=low + + * New upstream release. + + -- Andras Bali Thu, 7 Jun 2001 19:37:57 +0200 + +hnb (1.6.2-1) unstable; urgency=low + + * New upstream release. + + -- Andras Bali Sun, 27 May 2001 19:59:27 +0200 + +hnb (1.5-1) unstable; urgency=low + + * New upstream release. + + -- Andras Bali Thu, 24 May 2001 17:18:51 +0200 + +hnb (1.4-1) unstable; urgency=low + + * New upstream release. + + -- Andras Bali Wed, 16 May 2001 01:14:19 +0200 + +hnb (1.3-1) unstable; urgency=low + + * New upstream release. + + -- Andras Bali Mon, 14 May 2001 23:13:40 +0200 + +hnb (1.2-1) unstable; urgency=low + + * New upstream release. + + -- Andras Bali Sat, 12 May 2001 22:36:13 +0200 + +hnb (1.1b-1) unstable; urgency=low + + * New upstream release. + + -- Andras Bali Thu, 10 May 2001 18:48:36 +0200 + +hnb (1.0-1) unstable; urgency=low + + * Initial Release (Closes: #95245). + + -- Andras Bali Wed, 25 Apr 2001 20:00:16 +0200 --- hnb-1.9.18.orig/debian/control +++ hnb-1.9.18/debian/control @@ -0,0 +1,17 @@ +Source: hnb +Section: misc +Priority: optional +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: James Morrison +Build-Depends: debhelper (>> 4.0.0), libncurses5-dev, libxml2-dev +Standards-Version: 3.6.2.1 + +Package: hnb +Architecture: any +Depends: ${shlibs:Depends} +Description: Hierarchical notebook + Hnb is an ncurses program to organize many kinds of data in one place, for + example addresses, todo lists, ideas, book reviews or to store snippets of + brainstorming, to make a structured packing list or just to take random notes. + It can export ascii, html and xml, supports todo checkboxes, checkbox trees + with percentages, priorities, preferences, searching and more. --- hnb-1.9.18.orig/debian/hnb.docs +++ hnb-1.9.18/debian/hnb.docs @@ -0,0 +1,3 @@ +README +doc/Documentation.hnb +doc/Documentation.html --- hnb-1.9.18.orig/debian/copyright +++ hnb-1.9.18/debian/copyright @@ -0,0 +1,17 @@ +This package was debianized by Andras Bali on +Wed, 25 Apr 2001 20:00:16 +0200. +It was then adopted by Tore Anderson on Oct 26th 2003. + +It was downloaded from http://hnb.sourceforge.net/.files/. + +Upstream Author: Øyvind Kolås + +Copyright: + +This software is written by Øyvind Kolås. + +You are free to distribute this software under the terms of +the GNU General Public License. + +On Debian systems, the complete text of the GNU General Public +License can be found in /usr/share/common-licenses/GPL file. --- hnb-1.9.18.orig/debian/compat +++ hnb-1.9.18/debian/compat @@ -0,0 +1 @@ +4 --- hnb-1.9.18.orig/debian/hnb.menu +++ hnb-1.9.18/debian/hnb.menu @@ -0,0 +1,5 @@ +?package(hnb):\ + needs="text" \ + section="Apps/Tools" \ + title="Hierarchical notebook"\ + command="/usr/bin/hnb" --- hnb-1.9.18.orig/debian/hnb.manpages +++ hnb-1.9.18/debian/hnb.manpages @@ -0,0 +1 @@ +doc/hnb.1 --- hnb-1.9.18.orig/debian/rules +++ hnb-1.9.18/debian/rules @@ -0,0 +1,44 @@ +#!/usr/bin/make -f + +build: build-stamp +build-stamp: + dh_testdir + $(MAKE) + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + -$(MAKE) clean + dh_clean + +install: build + dh_testdir + dh_testroot + dh_installdirs + install -m0755 src/hnb $(CURDIR)/debian/hnb/usr/bin + +binary-indep: + +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installexamples + dh_installmenu + dh_installman + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-arch + +.PHONY: build clean binary-indep binary-arch binary install