summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-01-11 20:49:15 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-01-11 20:49:15 (GMT)
commit18180cdb50fd254b70cb757fef4cfbb394ceaaab (patch)
tree4818a4d1bc3147fefd86094f815cfce97ce0c7f9 /Source
parent333e707d9578f7a98e118c74a8bb513c7babb8ed (diff)
parentdde0c89cfcec22ac75cbadd77e45d2113521f326 (diff)
downloadCMake-18180cdb50fd254b70cb757fef4cfbb394ceaaab.zip
CMake-18180cdb50fd254b70cb757fef4cfbb394ceaaab.tar.gz
CMake-18180cdb50fd254b70cb757fef4cfbb394ceaaab.tar.bz2
Merge topic 'linux-standard-base'
dde0c89 ccmake: Use LSB 4.0 getmaxyx conditionally a3de30e ccmake: Use LSB 4.0 curses API conditionally 7d691ca ccmake: Port for LSB 4.0 (#11648)
Diffstat (limited to 'Source')
-rw-r--r--Source/CursesDialog/form/frm_driver.c18
-rw-r--r--Source/CursesDialog/form/frm_post.c9
2 files changed, 26 insertions, 1 deletions
diff --git a/Source/CursesDialog/form/frm_driver.c b/Source/CursesDialog/form/frm_driver.c
index 0b53b5a..03896c2 100644
--- a/Source/CursesDialog/form/frm_driver.c
+++ b/Source/CursesDialog/form/frm_driver.c
@@ -357,8 +357,12 @@ static void Buffer_To_Window(const FIELD * field, WINDOW * win)
assert(win && field);
+#if defined(__LSB_VERSION__)
+ getmaxyx(win, height, width);
+#else
width = getmaxx(win);
height = getmaxy(win);
+#endif
for(row=0, pBuffer=field->buf;
row < height;
@@ -396,7 +400,11 @@ static void Window_To_Buffer(WINDOW * win, FIELD * field)
pad = field->pad;
p = field->buf;
+#if defined(__LSB_VERSION__)
+ { int width; getmaxyx(win, height, width); }
+#else
height = getmaxy(win);
+#endif
for(row=0; (row < height) && (row < field->drows); row++ )
{
@@ -871,7 +879,17 @@ static int Display_Or_Erase_Field(FIELD * field, bool bEraseFlag)
if (field->opts & O_VISIBLE)
Set_Field_Window_Attributes(field,win);
else
+ {
+#if defined(__LSB_VERSION__)
+ /* getattrs() would be handy, but it is not part of LSB 4.0 */
+ attr_t fwinAttrs;
+ short fwinPair;
+ wattr_get(fwin, &fwinAttrs, &fwinPair, 0);
+ wattr_set(win, fwinAttrs, fwinPair, 0);
+#else
wattrset(win,getattrs(fwin));
+#endif
+ }
werase(win);
}
diff --git a/Source/CursesDialog/form/frm_post.c b/Source/CursesDialog/form/frm_post.c
index 5ead942..3c63de7 100644
--- a/Source/CursesDialog/form/frm_post.c
+++ b/Source/CursesDialog/form/frm_post.c
@@ -51,6 +51,7 @@ int post_form(FORM * form)
WINDOW *formwin;
int err;
int page;
+ int height, width;
if (!form)
RETURN(E_BAD_ARGUMENT);
@@ -62,7 +63,13 @@ int post_form(FORM * form)
RETURN(E_NOT_CONNECTED);
formwin = Get_Form_Window(form);
- if ((form->cols > getmaxx(formwin)) || (form->rows > getmaxy(formwin)))
+#if defined(__LSB_VERSION__)
+ getmaxyx(formwin, height, width);
+#else
+ width = getmaxx(formwin);
+ height = getmaxy(formwin);
+#endif
+ if ((form->cols > width) || (form->rows > height))
RETURN(E_NO_ROOM);
/* reset form->curpage to an invald value. This forces Set_Form_Page