mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-23 15:25:01 +00:00
Unneedful things.
This commit is contained in:
@@ -5,8 +5,6 @@
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*** Functions that are called by both processes ***/
|
||||
|
||||
unsigned char *Xcurscr;
|
||||
|
||||
int XCursesLINES = 24;
|
||||
@@ -19,16 +17,12 @@ void XC_say(const char *msg)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*** Functions that are called by the "curses" process ***/
|
||||
|
||||
static int _setup_curses(void)
|
||||
int XCursesInitscr(int argc, char *argv[])
|
||||
{
|
||||
int wait_value;
|
||||
XC_LOG(("XCursesInitscr() - called\n"));
|
||||
|
||||
XC_LOG(("_setup_curses called\n"));
|
||||
|
||||
/* Set LINES and COLS now so that the size of the shared memory
|
||||
segment can be allocated */
|
||||
if (ERR == XCursesSetupX(argc, argv))
|
||||
return ERR;
|
||||
|
||||
XCursesLINES = SP->lines;
|
||||
LINES = XCursesLINES - SP->linesrippedoff - SP->slklines;
|
||||
@@ -38,22 +32,3 @@ static int _setup_curses(void)
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int XCursesInitscr(int argc, char *argv[])
|
||||
{
|
||||
int pid, rc;
|
||||
|
||||
XC_LOG(("XCursesInitscr() - called\n"));
|
||||
|
||||
rc = XCursesSetupX(argc, argv);
|
||||
rc = _setup_curses();
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
void XCursesExit(void)
|
||||
{
|
||||
XC_LOG(("XCursesExit() - called\n"));
|
||||
|
||||
XC_exit_process(0, 0, "XCursesProcess requested to exit");
|
||||
}
|
||||
|
||||
@@ -125,6 +125,7 @@ unsigned long XCursesMouse(XEvent *);
|
||||
|
||||
int XCursesInitscr(int, char **);
|
||||
int XCursesSetupX(int, char **);
|
||||
void XCursesExit(void);
|
||||
|
||||
void XC_resize(void);
|
||||
void XC_refresh_screen(void);
|
||||
@@ -135,7 +136,6 @@ void XC_set_color(short, XColor);
|
||||
void XC_get_selection(void);
|
||||
int XC_set_selection(const char *, long);
|
||||
void XC_selection_off(void);
|
||||
void XC_exit_process(int, int, const char *);
|
||||
|
||||
#ifdef _HPUX_SOURCE
|
||||
# define FD_SET_CAST int *
|
||||
|
||||
16
x11new/x11.c
16
x11new/x11.c
@@ -956,7 +956,7 @@ static void _handle_nonmaskable(Widget w, XtPointer client_data, XEvent *event,
|
||||
Removed on 3-3-2001. Now only exits on WM_DELETE_WINDOW. */
|
||||
|
||||
if ((Atom)client_event->data.s[0] == wm_atom[0])
|
||||
XC_exit_process(0, SIGKILL, "");
|
||||
XCursesExit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1982,12 +1982,8 @@ static void _thumb_left_right(Widget w, XtPointer client_data,
|
||||
(double)(viewport_x / total_x));
|
||||
}
|
||||
|
||||
void XC_exit_process(int rc, int sig, const char *msg)
|
||||
void XCursesExit(void)
|
||||
{
|
||||
if (rc || sig)
|
||||
fprintf(stderr, "%s:XC_exit_process() - called: rc:%d sig:%d <%s>\n",
|
||||
XCLOGMSG, rc, sig, msg);
|
||||
|
||||
if (icon_pixmap)
|
||||
XFreePixmap(XCURSESDISPLAY, icon_pixmap);
|
||||
if (icon_pixmap_mask)
|
||||
@@ -2000,7 +1996,7 @@ void XC_exit_process(int rc, int sig, const char *msg)
|
||||
XFreeGC(XCURSESDISPLAY, border_gc);
|
||||
XDestroyIC(Xic);
|
||||
|
||||
_exit(rc);
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
void XC_resize(void)
|
||||
@@ -2049,9 +2045,6 @@ XColor XC_get_color(short index)
|
||||
Colormap cmap = DefaultColormap(XCURSESDISPLAY,
|
||||
DefaultScreen(XCURSESDISPLAY));
|
||||
|
||||
if (index < 0 || index >= PDC_MAXCOL)
|
||||
XC_exit_process(4, SIGKILL, "exiting from XC_get_color");
|
||||
|
||||
tmp.pixel = colors[index];
|
||||
XQueryColor(XCURSESDISPLAY, cmap, &tmp);
|
||||
return tmp;
|
||||
@@ -2064,9 +2057,6 @@ void XC_set_color(short index, XColor tmp)
|
||||
Colormap cmap = DefaultColormap(XCURSESDISPLAY,
|
||||
DefaultScreen(XCURSESDISPLAY));
|
||||
|
||||
if (index < 0 || index >= PDC_MAXCOL)
|
||||
XC_exit_process(4, SIGKILL, "exiting from XC_set_color");
|
||||
|
||||
if (XAllocColor(XCURSESDISPLAY, cmap, &tmp))
|
||||
colors[index] = tmp.pixel;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user