"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/cursesinit.cpp" between
bed-3.0.3.src.tar.xz and bed-3.1.0.src.tar.xz

About: bed is an adjustable data format binary editor.

cursesinit.cpp  (bed-3.0.3.src.tar.xz):cursesinit.cpp  (bed-3.1.0.src.tar.xz)
skipping to change at line 72 skipping to change at line 72
#include "shell.h" #include "shell.h"
#endif #endif
#include "win.h" #include "win.h"
extern int margc; extern int margc;
extern char **margv; extern char **margv;
static int beforeinitscr=0; static int beforeinitscr=0;
static void exitinitscr(void) { static void exitinitscr(void) {
static int didexit=0; static int didexit=0;
if(!didexit&&beforeinitscr) { if(!didexit&&beforeinitscr) {
didexit=1; didexit=1;
#ifdef __CYGWIN__
char NBED[BEDSMAXPATH]; char NBED[BEDSMAXPATH];
#else
char *NBED;
#endif
#ifdef SEARCHPATHNAME #ifdef SEARCHPATHNAME
,*thisprog ,*thisprog
#endif #endif
; ;
if(char *bedenv=getenv(NCURSES_BEDENV)) { if(char *bedenv=getenv(NCURSES_BEDENV)) {
#ifdef __CYGWIN__
absunixpath(bedenv,NBED) ; absunixpath(bedenv,NBED) ;
#else
NBED=bedenv;
#endif
} }
else { else {
strcpy(NBED,NCURSES_BED); NBED= const_cast<char *>(NCURSES_BED);
// strcpy(NBED,NCURSES_BED);
} }
fprintf(stderr,"%s failed, execute %s ...\n",margv[0],NBED); fprintf(stderr,"%s failed, execute %s ...\n",margv[0],NBED);
#ifdef SEARCHPATHNAME #ifdef SEARCHPATHNAME
thisprog=margv[0]; thisprog=margv[0];
#endif #endif
margv[0]= NBED; /*ENV+conf*/ margv[0]= NBED; /*ENV+conf*/
if(execvp(margv[0], margv)==-1) { if(execvp(margv[0], margv)==-1) {
#ifndef USE_NBEDPATCH #ifndef USE_NBEDPATCH
perror(NBED); perror(NBED);
skipping to change at line 253 skipping to change at line 261
return 1; /*resized*/ return 1; /*resized*/
} }
return 0; /*not resized*/ return 0; /*not resized*/
#else // TIOCGWINSZ #else // TIOCGWINSZ
#ifdef PDCURSES #ifdef PDCURSES
CONSOLE_SCREEN_BUFFER_INFO csbi; CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(consoleoutputhandle, &csbi); GetConsoleScreenBufferInfo(consoleoutputhandle, &csbi);
int scrHigh= csbi.srWindow.Bottom-csbi.srWindow.Top +1; int scrHigh= csbi.srWindow.Bottom-csbi.srWindow.Top +1;
int scrWidth=csbi.srWindow.Right- csbi.srWindow.Left+1; int scrWidth=csbi.srWindow.Right- csbi.srWindow.Left+1;
//fprintf(stderr,"width=%d, height=%d\n",scrWidth,scrHigh);
if(csbi.srWindow.Top!=0||csbi.srWindow.Left!=0||scrHigh!=thelines||scrWidth!=the cols) { if(csbi.srWindow.Top!=0||csbi.srWindow.Left!=0||scrHigh!=thelines||scrWidth!=the cols) {
return 1; /*resized*/ return 1; /*resized*/
} }
return 0; /*not resized*/ return 0; /*not resized*/
#endif //PDCURSES #endif //PDCURSES
#endif // TIOCGWINSZ #endif // TIOCGWINSZ
return 1; /*resized*/ return 1; /*resized*/
}; };
#ifdef PDCURSES #ifdef PDCURSES
#define PDNOCHANGESCREEN 1 #define PDNOCHANGESCREEN 1
#endif #endif
#ifdef PDCURSES #ifdef PDCURSES
int nocurses_init::setsize(void) { int nocurses_init::setsize(void) {
CONSOLE_SCREEN_BUFFER_INFO csbi; CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(consoleoutputhandle, &csbi); GetConsoleScreenBufferInfo(consoleoutputhandle, &csbi);
int scrHigh= csbi.srWindow.Bottom-csbi.srWindow.Top +1; int scrHigh= csbi.srWindow.Bottom-csbi.srWindow.Top +1;
int scrWidth=csbi.srWindow.Right- csbi.srWindow.Left+1; int scrWidth=csbi.srWindow.Right- csbi.srWindow.Left+1;
//fprintf(stderr,"width=%d, height=%d\n",scrWidth,scrHigh);
return setsize( scrHigh,scrWidth); return setsize( scrHigh,scrWidth);
} }
int nocurses_init::setsize(int scrHigh,int scrWidth) { int nocurses_init::setsize(int scrHigh,int scrWidth) {
resize_term(scrHigh,scrWidth); // resize_term(scrHigh,scrWidth);
resize_term(0,0);
#else #else
int nocurses_init::setsize(void) { int nocurses_init::setsize(void) {
#endif #endif
INCDEST(); INCDEST();
delmenus(); delmenus();
#ifndef NOENDWIN #ifndef NOENDWIN
if(!isendwin()) if(!isendwin())
endwin(); endwin();
#endif #endif
skipping to change at line 359 skipping to change at line 370
!thescreen|| !thescreen||
#endif //GETOTHERTERM #endif //GETOTHERTERM
(ioctl(0, TIOCGWINSZ, &win) == 0 && (thelines != win.ws_row || thecols != win.ws _col))) { (ioctl(0, TIOCGWINSZ, &win) == 0 && (thelines != win.ws_row || thecols != win.ws _col))) {
#else // TIOCGWINSZ #else // TIOCGWINSZ
#ifdef PDCURSES #ifdef PDCURSES
CONSOLE_SCREEN_BUFFER_INFO csbi; CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(consoleoutputhandle, &csbi); GetConsoleScreenBufferInfo(consoleoutputhandle, &csbi);
int scrHigh= csbi.srWindow.Bottom-csbi.srWindow.Top +1; int scrHigh= csbi.srWindow.Bottom-csbi.srWindow.Top +1;
int scrWidth=csbi.srWindow.Right- csbi.srWindow.Left+1; int scrWidth=csbi.srWindow.Right- csbi.srWindow.Left+1;
//fprintf(stderr,"width=%d, height=%d\n",scrWidth,scrHigh);
#ifdef PDNOCHANGESCREEN #ifdef PDNOCHANGESCREEN
if(csbi.srWindow.Top!=0||csbi.srWindow.Left!=0||scrHigh!=thelines||scrWidth!=the cols) { if(csbi.srWindow.Top!=0||csbi.srWindow.Left!=0||scrHigh!=thelines||scrWidth!=the cols) {
#endif #endif
return setsize(scrHigh,scrWidth); return setsize(scrHigh,scrWidth);
#endif //PDCURSES #endif //PDCURSES
#endif // TIOCGWINSZ #endif // TIOCGWINSZ
#ifndef PDCURSES #ifndef PDCURSES
return setsize(); return setsize();
#endif #endif
 End of changes. 9 change blocks. 
3 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)