Trying to fix curses.

This commit is contained in:
Berk Geveci 2001-11-09 16:05:33 -05:00
parent 722283804b
commit 23f0b7760f
5 changed files with 40 additions and 18 deletions

View File

@ -49,7 +49,9 @@ ENDIF (WIN32)
IF (UNIX)
INCLUDE (${CMAKE_ROOT}/Modules/FindCurses.cmake)
IF (CURSES_LIBRARY)
SUBDIRS(CursesDialog/form)
SUBDIRS(CursesDialog)
SUBDIR_DEPENDS(CursesDialog CursesDialog/form)
ENDIF (CURSES_LIBRARY)
ENDIF (UNIX)

View File

@ -1,4 +1,3 @@
SUBDIRS(form)
SOURCE_FILES( CURSES_SRCS
cmCursesBoolWidget

View File

@ -2,10 +2,20 @@
#define _MSE_INT_H
#endif
#define _BOOL_DEFINED
#include <sys/time.h>
#define _XOPEN_SOURCE_EXTENDED
#include <curses.h>
#include <form.h>
#undef _XOPEN_SOURCE_EXTENDED
#if defined(__hpux)
#define _BOOL_DEFINED
#include <sys/time.h>
#define _XOPEN_SOURCE_EXTENDED
#include <curses.h>
#include <form.h>
#undef _XOPEN_SOURCE_EXTENDED
#else
#include <curses.h>
#include <form.h>
#endif
#ifndef getmaxyx
#define getmaxyx(w,y,x) ((y) = getmaxy(w), (x) = getmaxx(w))
#endif

View File

@ -29,12 +29,13 @@
/****************************************************************************
* Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1995,1997 *
****************************************************************************/
#define _XOPEN_SOURCE_EXTENDED
#ifdef __FreeBSD__
#define _WCHAR_T
#endif /* __FreeBSD__ */
#if defined(__hpux)
#define _XOPEN_SOURCE_EXTENDED
#endif
#include "form.priv.h"
#undef _XOPEN_SOURCE_EXTENDED
#if defined(__hpux)
#undef _XOPEN_SOURCE_EXTENDED
#endif
MODULE_ID("$Id$")
@ -1994,7 +1995,10 @@ static int Insert_String(FORM *form, int row, char *txt, int len)
int requiredlen = len+1;
char *split;
int result = E_REQUEST_DENIED;
const char *Space = " ";
char *Space;
Space = (char*)malloc(2*sizeof(char));
strcpy(Space, " ");
if (freelen >= requiredlen)
{
@ -2002,6 +2006,7 @@ static int Insert_String(FORM *form, int row, char *txt, int len)
winsnstr(form->w,txt,len);
wmove(form->w,row,len);
winsnstr(form->w,Space,1);
free(Space);
return E_OK;
}
else
@ -2010,7 +2015,10 @@ static int Insert_String(FORM *form, int row, char *txt, int len)
if ((row == (field->drows - 1)) && Growable(field))
{
if (!Field_Grown(field,1))
{
free(Space);
return(E_SYSTEM_ERROR);
}
/* !!!Side-Effect : might be changed due to growth!!! */
bp = Address_Of_Row_In_Buffer(field,row);
}
@ -2033,9 +2041,11 @@ static int Insert_String(FORM *form, int row, char *txt, int len)
winsnstr(form->w,txt,len);
wmove(form->w,row,len);
winsnstr(form->w,Space,1);
free(Space);
return E_OK;
}
}
free(Space);
return(result);
}
}

View File

@ -35,12 +35,13 @@
* Routines to handle external names of menu requests *
***************************************************************************/
#define _XOPEN_SOURCE_EXTENDED
#ifdef __FreeBSD__
#define _WCHAR_T
#endif /* __FreeBSD__ */
#if defined(__hpux)
#define _XOPEN_SOURCE_EXTENDED
#endif
#include "form.priv.h"
#undef _XOPEN_SOURCE_EXTENDED
#if defined(__hpux)
#undef _XOPEN_SOURCE_EXTENDED
#endif
MODULE_ID("$Id$")