This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: perl 5.14 ncursesw: calling getbegyx() crashes


I got it working! And it's no issue with cygwin.

I had to build the Curses library by hand and edit the testsym.c and
list.syms. I suppose that the original version will compile fine on
Linux, but the compiler in cygwin complains about the "LINES" constant
in list.syms.

So here's what i've done. Maybe it will be usefull for someone:

~ $  export CURSES_LDFLAGS="-L/usr/lib/ncursesw -lncursesw"
~ $  export CURSES_CFLAGS="-I/usr/include/ncursesw"
~/Curses-1.28 $ perl Makefile.PL PANELS MENUS FORMS
GEN    function:  not applicable
PANELS functions: enabled
MENUS  functions: enabled
FORMS  functions: enabled

WARNING: Your Curses form.h file appears to be in the default
system search path, which will not work for us because of
the conflicting Perl form.h file.  This means your 'make' will
probably fail unless you fix this, as described in the INSTALL
file.
Writing Makefile for Curses
Writing MYMETA.yml

### Then i edited the files testsym.c and list.syms

~/Curses-1.28 $ make
### Now nearly every function will be found and compiled in.

~/Curses-1.28 $ make install
### Now the curses.dll should be insalled in /usr/lib/perl5/...

Here are the files i've edited:

testsym.c
==========8<==========
#include "c-config.h"

main() {
  int x,y; /*Add this line*/
  SYM;
}
==========>8==========

diff of list.syms
==========8<==========
--- Curses-1.28/list.syms       2001-07-25 20:09:34.000000000 +0200
+++ Curses-1.28_new/list.syms   2013-04-10 17:52:38.871052800 +0200
@@ -16,7 +16,7 @@
 E  wattrset(stdscr,0)
 E  wstandend(stdscr)
 E  wstandout(stdscr)
-E  wattr_get(stdscr,&LINES,&LINES,0)
+E  wattr_get(stdscr,&y,&x,0)
 E  wattr_off(stdscr,0,0)
 E  wattr_on(stdscr,0,0)
 E  wattr_set(stdscr,0,0,0)
@@ -41,8 +41,8 @@
 E  init_color(0,0,0,0)
 E  has_colors()
 E  can_change_color()
-E  color_content(0,&LINES,&LINES,&LINES)
-E  pair_content(0,&LINES,&LINES)
+E  color_content(0,&y,&x,&x)
+E  pair_content(0,&y,&x)
 E  wdelch(stdscr)
 E  wdeleteln(stdscr)
 E  winsdelln(stdscr,0)
@@ -53,10 +53,10 @@
 E  KEY_F(0)
 E  wgetstr(stdscr,0)
 E  wgetnstr(stdscr,0,0)
-E  getyx(stdscr,LINES,LINES)
-E  getparyx(stdscr,LINES,LINES)
-E  getbegyx(stdscr,LINES,LINES)
-E  getmaxyx(stdscr,LINES,LINES)
+E  getyx(stdscr,y,x)
+E  getparyx(stdscr,y,x)
+E  getbegyx(stdscr,y,x)
+E  getmaxyx(stdscr,y,x)
 E  winch(stdscr)
 E  winchstr(stdscr,0)
 E  winchnstr(stdscr,0,0)
@@ -99,8 +99,8 @@
 E  reset_shell_mode()
 E  resetty()
 E  savetty()
-E  getsyx(LINES,LINES)
-I  getsyx(LINES,LINES)
+E  getsyx(y,x)
+I  getsyx(y,x)
 E  setsyx(0,0)
 I  setsyx(0,0)
 E  curs_set(0)
@@ -186,7 +186,7 @@
 E  ungetmouse(0)
 E  mousemask(0,&LINES)
 E  wenclose(stdscr,0,0)
-E  wmouse_trafo(stdscr,&LINES,&LINES,0)
+E  wmouse_trafo(stdscr,&y,&x,0)
 E  mouseinterval(0)
 E  BUTTON_RELEASE(0,0)
 E  BUTTON_PRESS(0,0)
@@ -232,7 +232,7 @@
 E  pos_menu_cursor(0)
 E  menu_driver(0,0)
 E  set_menu_format(0,0,0)
-E  menu_format(0,&LINES,&LINES)
+E  menu_format(0,&y,&x)
 E  set_menu_items(0,0)
 E  menu_items(0)
 E  item_count(0)
@@ -254,7 +254,7 @@
 E  menu_win(0)
 E  set_menu_sub(0,stdscr)
 E  menu_sub(0)
-E  scale_menu(0,&LINES,&LINES)
+E  scale_menu(0,&y,&x)
 E  set_current_item(0,0)
 E  current_item(0)
 E  set_top_row(0,0)
@@ -276,7 +276,7 @@
 E  menu_request_name(0)
 E  menu_request_by_name(0)
 E  set_menu_spacing(0,0,0,0)
-E  menu_spacing(0,&LINES,&LINES,&LINES)
+E  menu_spacing(0,&y,&x,&x)
 E  pos_form_cursor(0)
 E  data_ahead(0)
 E  data_behind(0)
@@ -306,7 +306,7 @@
 E  form_win(0)
 E  set_form_sub(0,stdscr)
 E  form_sub(0)
-E  scale_form(0,&LINES,&LINES)
+E  scale_form(0,&y,&x)
 E  set_field_fore(0,0)
 E  field_fore(0)
 E  set_field_back(0,0)
@@ -318,8 +318,8 @@
 E  set_field_status(0,0)
 E  field_status(0)
 E  set_max_field(0,0)
-E  field_info(0,&LINES,&LINES,&LINES,&LINES,&LINES,&LINES)
-E  dynamic_field_info(0,&LINES,&LINES,&LINES)
+E  field_info(0,&y,&x,&y,&x,&y,&x)
+E  dynamic_field_info(0,&y,&x,&y,&x)
 E  set_field_just(0,0)
 E  field_just(0)
 E  new_field(0,0,0,0,0,0)
==========>8==========


Regards,
	David

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]