diff options
author | Berk Geveci <berk.geveci@kitware.com> | 2001-11-09 21:05:33 (GMT) |
---|---|---|
committer | Berk Geveci <berk.geveci@kitware.com> | 2001-11-09 21:05:33 (GMT) |
commit | 23f0b7760f862c1befa2c7b327acec9910abbcee (patch) | |
tree | 34ff122ad9a0c092a5eea4ceb3eefaf3e44e6302 | |
parent | 722283804b7d3b04e90daac84465c53130748ee0 (diff) | |
download | CMake-23f0b7760f862c1befa2c7b327acec9910abbcee.zip CMake-23f0b7760f862c1befa2c7b327acec9910abbcee.tar.gz CMake-23f0b7760f862c1befa2c7b327acec9910abbcee.tar.bz2 |
Trying to fix curses.
-rw-r--r-- | Source/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Source/CursesDialog/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesStandardIncludes.h | 22 | ||||
-rw-r--r-- | Source/CursesDialog/form/frm_driver.c | 22 | ||||
-rw-r--r-- | Source/CursesDialog/form/frm_req_name.c | 11 |
5 files changed, 40 insertions, 18 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 164df10..191646f 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -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) diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt index 1382ace..391c9e2 100644 --- a/Source/CursesDialog/CMakeLists.txt +++ b/Source/CursesDialog/CMakeLists.txt @@ -1,4 +1,3 @@ -SUBDIRS(form) SOURCE_FILES( CURSES_SRCS cmCursesBoolWidget diff --git a/Source/CursesDialog/cmCursesStandardIncludes.h b/Source/CursesDialog/cmCursesStandardIncludes.h index caa2216..b932d16 100644 --- a/Source/CursesDialog/cmCursesStandardIncludes.h +++ b/Source/CursesDialog/cmCursesStandardIncludes.h @@ -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 + diff --git a/Source/CursesDialog/form/frm_driver.c b/Source/CursesDialog/form/frm_driver.c index f80b9a4..cc07b65 100644 --- a/Source/CursesDialog/form/frm_driver.c +++ b/Source/CursesDialog/form/frm_driver.c @@ -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); } } diff --git a/Source/CursesDialog/form/frm_req_name.c b/Source/CursesDialog/form/frm_req_name.c index 6190c4b..0c0755b 100644 --- a/Source/CursesDialog/form/frm_req_name.c +++ b/Source/CursesDialog/form/frm_req_name.c @@ -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$") |