Martin Liddle wrote:
We have some software written in gpc that uses ncurses and panel for screen output. Mainly for historical reasons we have our own GPC to C interface unit. All this worked at RedHat Linux 6.1. We have recently upgraded to RedHat 6.2 and it no longer works. The cursor sits somewhere in the bottom line of the screen (which is defined as a panel of height 1 line).
The change that I suspect is significant between RedHat 6.1 and RedHat 6.2 is that 6.1 used ncurses 4.2 and 6.2 uses ncurses 5.0. I am afraid my knowledge of C is pretty much zero. However by using diff on the header files I only see one change that looks as though it might matter. In panel.h from ncurses 4.2 the definition is:
extern PANEL *new_panel(WINDOW *)
the corresponding ncurses 5.0 definition is
extern PANEL* new_panel(WINDOW *)
That's the same, except for spacing.
Is this correct for ncurses 5.0? Has anybody else had any problems with ncurses 5.0?
GPC's CRT unit is based on ncurses, but it uses C wrapper functions which use the actual ncurses headers, so there were no such problems. That's why I'm always preaching;-) this...
If your unit contains manually converted constants and types from the C code, and those changed in the ncurses versions, you're likely to have problems. E.g., the WINDOW and PANEL structures have changed, so if you translated them, it will be a problem. OTOH, I think the interface only uses pointers to them (WINDOW *, PANEL *), so you don't need to know the actual contents of the structures. You could try `type WINDOW_PTR = Pointer; PANEL_PTR = Pointer;'. This way, you'll get compile errors if the Pascal code tries to access any fields of them. If it does, this looks like the reason for a problem, and you should probably get rid of it (and use the interface functions instead).
Apart from this, you're choices are to translate the new header (and give up compatibility to older ncurses versions), to ifdef the changes (then you'll have to explicitly specify the ncurses version used), to stick with ncurses 4.2 (not recommended if you use panels because it has a bad bug), to write C wrappers, to convert to CRT (probably not easy since the interface is quite different)...
Frank