[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pads limitation of 32767 rows
From: |
Phil Dibowitz |
Subject: |
pads limitation of 32767 rows |
Date: |
Wed, 28 Feb 2007 21:21:56 -0800 |
User-agent: |
Icedove 1.5.0.9 (X11/20061220) |
ncurses folks,
I seem to have found a limitation with ncurses' pad feature - pads can't be
larger than 32767 lines. At 32768, ncurses fails to allocate the window.
It's not clear why.
Here's a small test program that illustrates the problem:
-------------------------------------------------
#include <ncurses.h>
#include <signal.h>
#include <stdlib.h>
#define SIZE 32768
void kill_handler(int sig)
{
curs_set(1);
nocbreak();
endwin();
exit(0);
}
int main(int argc, char *argv[])
{
int x;
int y;
initscr();
cbreak();
noecho();
halfdelay(1);
getmaxyx(stdscr,y,x);
WINDOW* pad = newpad(SIZE,x);
prefresh(pad,0,0,0,0,y-1,x-1);
signal(2,kill_handler);
signal(15,kill_handler);
while(1) {
}
}
-------------------------------------------------
Setting SIZE to 32767 will work, but setting it to 32768 fails. I can
reproduce this with ncurses 5.4 and 5.5.
--
Phil Dibowitz address@hidden
Open Source software and tech docs Insanity Palace of Metallica
http://www.phildev.net/ http://www.ipom.com/
"Never write it in C if you can do it in 'awk';
Never do it in 'awk' if 'sed' can handle it;
Never use 'sed' when 'tr' can do the job;
Never invoke 'tr' when 'cat' is sufficient;
Avoid using 'cat' whenever possible" -- Taylor's Laws of Programming
signature.asc
Description: OpenPGP digital signature
- pads limitation of 32767 rows,
Phil Dibowitz <=