File:  [NetBSD Developer Wiki] / wikisrc / curses_in_netbsd.mdwn
Revision 1.2: download - view: text, annotated - select for diffs
Sat Sep 29 15:20:06 2018 UTC (15 months, 2 weeks ago) by kamil
Branches: MAIN
CVS tags: HEAD
Document getnstr(3) behavior mismatch between curses(3) and ncurses(3)

    1: # curses in NetBSD
    2: 
    3: NetBSD is one of the last operating systems (or even the last one?) not using <a href="http://en.wikipedia.org/wiki/Ncurses">ncurses</a>.
    4: As curses is not as specified as you could wish, there are some differences to consider.
    5: 
    6: Note: This article covers curses as well as libform and libmenu, which are bundled together with ncurses.
    7: 
    8: This is meant to be an (naturally incomplete) list of what the programmer has to care for.
    9: 
   10: * [[!template id=man name="new_item" section="3"]] in NetBSD's curses copies the string you pass to him, while ncurses' new_item(3) just sets a pointer.
   11: * [[!template id=man name="post_menu" section="3"]] in NetBSD's curses will return E_NO_ROOM if the names of the items are too long for the menu, while ncurses' post_menu(3) will just cut them.
   12: * [[!template id=man name="getnstr" section="3"]] in NetBSD's curses will read up to N characters including NUL byte, while ncurses' getnstr(3) will read up to N characters not including NUL byte thus assuming buffer of size N+1

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb