ccmake: Port for LSB 4.0 (#11648)

Use getmaxyx instead of getmax[xy].  Avoid using getattrs.
This commit is contained in:
Craig Scott authored and Brad King committed 2011-01-03 12:15:41 -05:00
1 parent a67fd72659
commit 7d691cab9b
2 files changed
+14 -6

No files matched your search

+11 -5
View File
@@ -357,8 +357,7 @@ static void Buffer_To_Window(const FIELD * field, WINDOW * win)
assert(win && field);
width = getmaxx(win);
height = getmaxy(win);
getmaxyx(win, height, width);
for(row=0, pBuffer=field->buf;
row < height;
@@ -390,13 +389,13 @@ static void Window_To_Buffer(WINDOW * win, FIELD * field)
int pad;
int len = 0;
char *p;
int row, height;
int row, height, width;
assert(win && field && field->buf );
pad = field->pad;
p = field->buf;
height = getmaxy(win);
getmaxyx(win, height, width);
for(row=0; (row < height) && (row < field->drows); row++ )
{
@@ -856,6 +855,8 @@ static int Display_Or_Erase_Field(FIELD * field, bool bEraseFlag)
{
WINDOW *win;
WINDOW *fwin;
attr_t fwinAttrs;
short fwinPair;
if (!field)
return E_SYSTEM_ERROR;
@@ -871,7 +872,12 @@ static int Display_Or_Erase_Field(FIELD * field, bool bEraseFlag)
if (field->opts & O_VISIBLE)
Set_Field_Window_Attributes(field,win);
else
wattrset(win,getattrs(fwin));
{
/* getattrs() would be handy, but it is not part of LSB 4.0 */
/* wattrset(win,getattrs(fwin)); */
wattr_get(fwin, &fwinAttrs, &fwinPair, 0);
wattr_set(win, fwinAttrs, fwinPair, 0);
}
werase(win);
}
+3 -1
View File
@@ -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,8 @@ int post_form(FORM * form)
RETURN(E_NOT_CONNECTED);
formwin = Get_Form_Window(form);
if ((form->cols > getmaxx(formwin)) || (form->rows > getmaxy(formwin)))
getmaxyx(formwin, height, width);
if ((form->cols > width) || (form->rows > height))
RETURN(E_NO_ROOM);
/* reset form->curpage to an invald value. This forces Set_Form_Page