syntaxncursespdcurses

Does PDCurses and ncurses have the same syntax?


I'm building a game with ncurses in Linux.

Can I "copy/paste" the code into Microsoft Visual Studio (properly set for PDCurses) and everything will run OK?

Thanks!


Solution

  • The syntax is the same, but the question doesn't deal with syntax

    They are "largely compatible", but each has features not found in the other. Offhand (no one's made a complete comparison):

        #define CTL_LEFT      0x1bb  /* Control-Left-Arrow */
        #define CTL_RIGHT     0x1bc
        #define CTL_PGUP      0x1bd
        #define CTL_PGDN      0x1be
        #define CTL_HOME      0x1bf
        #define CTL_END       0x1c0
    

    With ncurses, those would be user-defined capabilities. The terminal description would have capabilities for the control cursor keys such as **kDN5 (control down-arrow) and the application find these at runtime using tigetstr (to get the values) and key_defined to find the coding used by ncurses. The names are based on xterm, but could include other terminals (most of the ones aside from rxvt that you'll find copy xterm). Sounds cumbersome, but both ncurses/PDCurses took their own path in extending X/Open Curses.