Wed Oct 27 18:46:04 PDT 1999 Michael Jennings <mej@eterm.org>
Fixed lots of issues revealed by the -ansi -pedantic flags. The only warnings you get with those flags now are implicit declaration warnings for non-ANSI functions and warnings specific to certain OS's and their non-ANSI implementations of ANSI functions, neither of which I can do much about. :-) SVN revision: 1010
This commit is contained in:
parent
9ce25b6ae7
commit
5c930667ec
|
@ -2642,3 +2642,12 @@ Wed Oct 27 17:36:35 PDT 1999 Michael Jennings <mej@eterm.org>
|
||||||
Modified libtool flags per recommendation of HJ Lu <hjl@gnu.org>.
|
Modified libtool flags per recommendation of HJ Lu <hjl@gnu.org>.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
Wed Oct 27 18:46:04 PDT 1999 Michael Jennings <mej@eterm.org>
|
||||||
|
|
||||||
|
Fixed lots of issues revealed by the -ansi -pedantic flags. The only
|
||||||
|
warnings you get with those flags now are implicit declaration
|
||||||
|
warnings for non-ANSI functions and warnings specific to certain OS's
|
||||||
|
and their non-ANSI implementations of ANSI functions, neither of
|
||||||
|
which I can do much about. :-)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
11
libmej/mem.c
11
libmej/mem.c
|
@ -353,17 +353,6 @@ void
|
||||||
HandleSigSegv(int sig)
|
HandleSigSegv(int sig)
|
||||||
{
|
{
|
||||||
|
|
||||||
static unsigned char segv_again = 0;
|
|
||||||
|
|
||||||
/* Reinstate ourselves as the SIGSEGV handler if we're replaced */
|
|
||||||
(void) signal(SIGSEGV, HandleSigSegv);
|
|
||||||
|
|
||||||
/* Recursive seg faults are not cool.... */
|
|
||||||
if (segv_again) {
|
|
||||||
printf("Recursive segmentation fault detected!\n");
|
|
||||||
_exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
segv_again = 1;
|
|
||||||
#if DEBUG >= DEBUG_MALLOC
|
#if DEBUG >= DEBUG_MALLOC
|
||||||
fprintf(stderr, "Fatal memory fault (%d)! Dumping memory table.\n", sig);
|
fprintf(stderr, "Fatal memory fault (%d)! Dumping memory table.\n", sig);
|
||||||
memrec_dump();
|
memrec_dump();
|
||||||
|
|
|
@ -323,8 +323,9 @@ LowerStr(char *str)
|
||||||
|
|
||||||
register char *tmp;
|
register char *tmp;
|
||||||
|
|
||||||
for (tmp = str; *tmp; tmp++)
|
for (tmp = str; *tmp; tmp++) {
|
||||||
*tmp = tolower(*tmp);
|
*tmp = tolower(*tmp);
|
||||||
|
}
|
||||||
D_STRINGS(("LowerStr() returning %s\n", str));
|
D_STRINGS(("LowerStr() returning %s\n", str));
|
||||||
return (str);
|
return (str);
|
||||||
}
|
}
|
||||||
|
@ -335,8 +336,9 @@ UpStr(char *str)
|
||||||
|
|
||||||
register char *tmp;
|
register char *tmp;
|
||||||
|
|
||||||
for (tmp = str; *tmp; tmp++)
|
for (tmp = str; *tmp; tmp++) {
|
||||||
*tmp = toupper(*tmp);
|
*tmp = toupper(*tmp);
|
||||||
|
}
|
||||||
D_STRINGS(("UpStr() returning %s\n", str));
|
D_STRINGS(("UpStr() returning %s\n", str));
|
||||||
return (str);
|
return (str);
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,6 +97,13 @@ extern void *memmem(void *, size_t, void *, size_t);
|
||||||
#ifndef HAVE_USLEEP
|
#ifndef HAVE_USLEEP
|
||||||
extern void usleep(unsigned long);
|
extern void usleep(unsigned long);
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef HAVE_SNPRINTF
|
||||||
|
# ifdef HAVE_STDARG_H
|
||||||
|
# include <stdarg.h>
|
||||||
|
# endif
|
||||||
|
extern int vsnprintf(char *str, size_t count, const char *fmt, va_list args);
|
||||||
|
extern int snprintf(char *str, size_t count, const char *fmt, ...);
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
#ifndef HAVE_NANOSLEEP
|
#ifndef HAVE_NANOSLEEP
|
||||||
extern void nanosleep(unsigned long);
|
extern void nanosleep(unsigned long);
|
||||||
|
|
|
@ -58,7 +58,7 @@ unsigned char
|
||||||
action_handle_string(event_t *ev, action_t *action) {
|
action_handle_string(event_t *ev, action_t *action) {
|
||||||
|
|
||||||
REQUIRE_RVAL(action->param.string != NULL, 0);
|
REQUIRE_RVAL(action->param.string != NULL, 0);
|
||||||
cmd_write(action->param.string, strlen(action->param.string));
|
cmd_write((unsigned char *) action->param.string, strlen(action->param.string));
|
||||||
return 1;
|
return 1;
|
||||||
ev = NULL;
|
ev = NULL;
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ unsigned char
|
||||||
action_handle_echo(event_t *ev, action_t *action) {
|
action_handle_echo(event_t *ev, action_t *action) {
|
||||||
|
|
||||||
REQUIRE_RVAL(action->param.string != NULL, 0);
|
REQUIRE_RVAL(action->param.string != NULL, 0);
|
||||||
tt_write(action->param.string, strlen(action->param.string));
|
tt_write((unsigned char *) action->param.string, strlen(action->param.string));
|
||||||
return 1;
|
return 1;
|
||||||
ev = NULL;
|
ev = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1031,7 +1031,7 @@ Child_signal(int sig)
|
||||||
const char *message = "\r\nPress any key to exit " APL_NAME "....";
|
const char *message = "\r\nPress any key to exit " APL_NAME "....";
|
||||||
|
|
||||||
scr_refresh(DEFAULT_REFRESH);
|
scr_refresh(DEFAULT_REFRESH);
|
||||||
scr_add_lines(message, 1, strlen(message));
|
scr_add_lines((unsigned char *) message, 1, strlen(message));
|
||||||
scr_refresh(DEFAULT_REFRESH);
|
scr_refresh(DEFAULT_REFRESH);
|
||||||
keypress_exit = 1;
|
keypress_exit = 1;
|
||||||
return;
|
return;
|
||||||
|
@ -1043,7 +1043,7 @@ Child_signal(int sig)
|
||||||
D_CMD(("Child_signal: installing signal handler\n"));
|
D_CMD(("Child_signal: installing signal handler\n"));
|
||||||
signal(SIGCHLD, Child_signal);
|
signal(SIGCHLD, Child_signal);
|
||||||
|
|
||||||
return ((RETSIGTYPE) 0);
|
SIG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handles signals usually sent by a user, like HUP, TERM, INT. */
|
/* Handles signals usually sent by a user, like HUP, TERM, INT. */
|
||||||
|
@ -1062,6 +1062,7 @@ Exit_signal(int sig)
|
||||||
|
|
||||||
D_CMD(("Exit_signal(): exit(%s)\n", sig_to_str(sig)));
|
D_CMD(("Exit_signal(): exit(%s)\n", sig_to_str(sig)));
|
||||||
exit(sig);
|
exit(sig);
|
||||||
|
SIG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handles abnormal termination signals -- mej */
|
/* Handles abnormal termination signals -- mej */
|
||||||
|
@ -1081,6 +1082,7 @@ SegvHandler(int sig)
|
||||||
|
|
||||||
/* Exit */
|
/* Exit */
|
||||||
exit(sig);
|
exit(sig);
|
||||||
|
SIG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1122,6 +1124,8 @@ clean_exit(void)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __sgi
|
#ifdef __sgi
|
||||||
|
inline int sgi_get_pty(void);
|
||||||
|
|
||||||
inline int
|
inline int
|
||||||
sgi_get_pty(void)
|
sgi_get_pty(void)
|
||||||
{
|
{
|
||||||
|
@ -1135,6 +1139,8 @@ sgi_get_pty(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_DEV_PTC
|
#ifdef HAVE_DEV_PTC
|
||||||
|
inline int aix_get_pty(void);
|
||||||
|
|
||||||
inline int
|
inline int
|
||||||
aix_get_pty(void)
|
aix_get_pty(void)
|
||||||
{
|
{
|
||||||
|
@ -1150,6 +1156,8 @@ aix_get_pty(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SCO_PTYS
|
#ifdef HAVE_SCO_PTYS
|
||||||
|
inline int sco_get_pty(void);
|
||||||
|
|
||||||
inline int
|
inline int
|
||||||
sco_get_pty(void)
|
sco_get_pty(void)
|
||||||
{
|
{
|
||||||
|
@ -1183,6 +1191,7 @@ sco_get_pty(void)
|
||||||
|
|
||||||
#ifdef HAVE_DEV_PTMX
|
#ifdef HAVE_DEV_PTMX
|
||||||
inline int svr_get_pty(void);
|
inline int svr_get_pty(void);
|
||||||
|
|
||||||
inline int
|
inline int
|
||||||
svr_get_pty(void)
|
svr_get_pty(void)
|
||||||
{
|
{
|
||||||
|
@ -1215,6 +1224,7 @@ svr_get_pty(void)
|
||||||
#define PTYCHAR2 "0123456789abcdefghijklmnopqrstuvwxyz"
|
#define PTYCHAR2 "0123456789abcdefghijklmnopqrstuvwxyz"
|
||||||
|
|
||||||
inline int gen_get_pty(void);
|
inline int gen_get_pty(void);
|
||||||
|
|
||||||
inline int
|
inline int
|
||||||
gen_get_pty(void)
|
gen_get_pty(void)
|
||||||
{
|
{
|
||||||
|
@ -2308,17 +2318,17 @@ check_pixmap_change(int sig)
|
||||||
static unsigned char in_cpc = 0;
|
static unsigned char in_cpc = 0;
|
||||||
|
|
||||||
if (in_cpc)
|
if (in_cpc)
|
||||||
CPC_RETURN(0);
|
SIG_RETURN(0);
|
||||||
in_cpc = 1;
|
in_cpc = 1;
|
||||||
D_PIXMAP(("check_pixmap_change(%d): rs_anim_delay == %lu seconds, last_update == %lu\n", sig, rs_anim_delay, last_update));
|
D_PIXMAP(("check_pixmap_change(%d): rs_anim_delay == %lu seconds, last_update == %lu\n", sig, rs_anim_delay, last_update));
|
||||||
if (!rs_anim_delay)
|
if (!rs_anim_delay)
|
||||||
CPC_RETURN(0);
|
SIG_RETURN(0);
|
||||||
if (last_update == 0) {
|
if (last_update == 0) {
|
||||||
last_update = time(NULL);
|
last_update = time(NULL);
|
||||||
old_handler = signal(SIGALRM, check_pixmap_change);
|
old_handler = signal(SIGALRM, check_pixmap_change);
|
||||||
alarm(rs_anim_delay);
|
alarm(rs_anim_delay);
|
||||||
in_cpc = 0;
|
in_cpc = 0;
|
||||||
CPC_RETURN(0);
|
SIG_RETURN(0);
|
||||||
}
|
}
|
||||||
now = time(NULL);
|
now = time(NULL);
|
||||||
D_PIXMAP(("now %lu >= %lu (last_update %lu + rs_anim_delay %lu) ?\n", now, last_update + rs_anim_delay, last_update, rs_anim_delay));
|
D_PIXMAP(("now %lu >= %lu (last_update %lu + rs_anim_delay %lu) ?\n", now, last_update + rs_anim_delay, last_update, rs_anim_delay));
|
||||||
|
@ -2336,9 +2346,9 @@ check_pixmap_change(int sig)
|
||||||
}
|
}
|
||||||
in_cpc = 0;
|
in_cpc = 0;
|
||||||
if (old_handler) {
|
if (old_handler) {
|
||||||
CPC_RETURN((*old_handler) (sig));
|
SIG_RETURN((*old_handler) (sig));
|
||||||
} else {
|
} else {
|
||||||
CPC_RETURN(sig);
|
SIG_RETURN(sig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* BACKGROUND_CYCLING_SUPPORT */
|
#endif /* BACKGROUND_CYCLING_SUPPORT */
|
||||||
|
@ -2517,9 +2527,9 @@ tt_printf(const unsigned char *fmt,...)
|
||||||
va_list arg_ptr;
|
va_list arg_ptr;
|
||||||
|
|
||||||
va_start(arg_ptr, fmt);
|
va_start(arg_ptr, fmt);
|
||||||
vsprintf(buf, fmt, arg_ptr);
|
vsprintf((char *) buf, (char *) fmt, arg_ptr);
|
||||||
va_end(arg_ptr);
|
va_end(arg_ptr);
|
||||||
tt_write(buf, strlen(buf));
|
tt_write(buf, strlen((char *) buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read and process output from the application */
|
/* Read and process output from the application */
|
||||||
|
|
|
@ -261,12 +261,10 @@ if (test) PrivateModes |= (bit); else PrivateModes &= ~(bit);} while (0)
|
||||||
#define PTYCHAR1 "pqrstuvwxyz"
|
#define PTYCHAR1 "pqrstuvwxyz"
|
||||||
#define PTYCHAR2 "0123456789abcdefghijklmnopqrstuvwxyz"
|
#define PTYCHAR2 "0123456789abcdefghijklmnopqrstuvwxyz"
|
||||||
|
|
||||||
#ifdef BACKGROUND_CYCLING_SUPPORT
|
#if RETSIGTYPE != void
|
||||||
# if RETSIGTYPE != void
|
# define SIG_RETURN(x) return ((RETSIGTYPE) x)
|
||||||
# define CPC_RETURN(x) return ((RETSIGTYPE) x)
|
#else
|
||||||
# else
|
# define SIG_RETURN(x) return
|
||||||
# define CPC_RETURN(x) return
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CHARS_READ() (cmdbuf_ptr < cmdbuf_endp)
|
#define CHARS_READ() (cmdbuf_ptr < cmdbuf_endp)
|
||||||
|
|
13
src/e.c
13
src/e.c
|
@ -183,7 +183,8 @@ static RETSIGTYPE
|
||||||
enl_ipc_timeout(int sig)
|
enl_ipc_timeout(int sig)
|
||||||
{
|
{
|
||||||
timeout = 1;
|
timeout = 1;
|
||||||
return ((RETSIGTYPE) sig);
|
SIG_RETURN(sig);
|
||||||
|
sig = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
@ -285,13 +286,13 @@ eterm_ipc_parse(char *str)
|
||||||
}
|
}
|
||||||
if (!strcasecmp(str, "echo") || !strcasecmp(str, "tty_write")) {
|
if (!strcasecmp(str, "echo") || !strcasecmp(str, "tty_write")) {
|
||||||
if (params) {
|
if (params) {
|
||||||
tt_write(params, strlen(params));
|
tt_write((unsigned char *) params, strlen(params));
|
||||||
} else {
|
} else {
|
||||||
print_error("IPC Error: Invalid syntax in command \"%s\"", str);
|
print_error("IPC Error: Invalid syntax in command \"%s\"", str);
|
||||||
}
|
}
|
||||||
} else if (!strcasecmp(str, "parse")) {
|
} else if (!strcasecmp(str, "parse")) {
|
||||||
if (params) {
|
if (params) {
|
||||||
cmd_write(params, strlen(params));
|
cmd_write((unsigned char *) params, strlen(params));
|
||||||
} else {
|
} else {
|
||||||
print_error("IPC Error: Invalid syntax in command \"%s\"", str);
|
print_error("IPC Error: Invalid syntax in command \"%s\"", str);
|
||||||
}
|
}
|
||||||
|
@ -307,9 +308,9 @@ eterm_ipc_parse(char *str)
|
||||||
|
|
||||||
reply = enl_send_and_wait(params);
|
reply = enl_send_and_wait(params);
|
||||||
snprintf(header, sizeof(header), "Enlightenment IPC Reply to \"%s\":\n\n", params);
|
snprintf(header, sizeof(header), "Enlightenment IPC Reply to \"%s\":\n\n", params);
|
||||||
tt_write(header, strlen(header));
|
tt_write((unsigned char *) header, strlen(header));
|
||||||
tt_write(reply, strlen(reply));
|
tt_write((unsigned char *) reply, strlen(reply));
|
||||||
tt_write("\n", 1);
|
tt_write((unsigned char *) "\n", 1);
|
||||||
FREE(reply);
|
FREE(reply);
|
||||||
} else {
|
} else {
|
||||||
print_error("IPC Error: Invalid syntax in command \"%s\"", str);
|
print_error("IPC Error: Invalid syntax in command \"%s\"", str);
|
||||||
|
|
|
@ -1003,10 +1003,10 @@ menu_action(menuitem_t * item)
|
||||||
D_MENU(("Internal Program Error: menu_action() called for a submenu.\n"));
|
D_MENU(("Internal Program Error: menu_action() called for a submenu.\n"));
|
||||||
break;
|
break;
|
||||||
case MENUITEM_STRING:
|
case MENUITEM_STRING:
|
||||||
cmd_write(item->action.string, strlen(item->action.string));
|
cmd_write((unsigned char *) item->action.string, strlen(item->action.string));
|
||||||
break;
|
break;
|
||||||
case MENUITEM_ECHO:
|
case MENUITEM_ECHO:
|
||||||
tt_write(item->action.string, strlen(item->action.string));
|
tt_write((unsigned char *) item->action.string, strlen(item->action.string));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fatal_error("Internal Program Error: Unknown menuitem type: %u\n", item->type);
|
fatal_error("Internal Program Error: Unknown menuitem type: %u\n", item->type);
|
||||||
|
|
|
@ -251,7 +251,7 @@ parse_escaped_string(char *str)
|
||||||
if (!BEG_STRCASECMP(str, "\033x") && *(pnew - 1) != '\r') {
|
if (!BEG_STRCASECMP(str, "\033x") && *(pnew - 1) != '\r') {
|
||||||
D_STRINGS(("Adding carriage return\n"));
|
D_STRINGS(("Adding carriage return\n"));
|
||||||
*(pnew++) = '\r';
|
*(pnew++) = '\r';
|
||||||
} else if (!BEG_STRCASECMP(str, "\e]") && *(pnew - 1) != '\a') {
|
} else if (!BEG_STRCASECMP(str, "\033]") && *(pnew - 1) != '\a') {
|
||||||
D_STRINGS(("Adding bell character\n"));
|
D_STRINGS(("Adding bell character\n"));
|
||||||
*(pnew++) = '\a';
|
*(pnew++) = '\a';
|
||||||
}
|
}
|
||||||
|
|
|
@ -2077,7 +2077,7 @@ parse_keyboard(char *buff)
|
||||||
|
|
||||||
*p = len;
|
*p = len;
|
||||||
strncpy(p + 1, str, len);
|
strncpy(p + 1, str, len);
|
||||||
KeySym_map[sym] = p;
|
KeySym_map[sym] = (unsigned char *) p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -2364,7 +2364,7 @@ parse_image(char *buff)
|
||||||
if (allow_list) {
|
if (allow_list) {
|
||||||
char *allow;
|
char *allow;
|
||||||
|
|
||||||
for (; (allow = strsep(&allow_list, " ")) != NULL;) {
|
for (; (allow = (char *) strsep(&allow_list, " ")) != NULL;) {
|
||||||
if (!BEG_STRCASECMP("image", allow)) {
|
if (!BEG_STRCASECMP("image", allow)) {
|
||||||
images[idx].mode |= ALLOW_IMAGE;
|
images[idx].mode |= ALLOW_IMAGE;
|
||||||
} else if (!BEG_STRCASECMP("transparent", allow)) {
|
} else if (!BEG_STRCASECMP("transparent", allow)) {
|
||||||
|
|
15
src/pixmap.c
15
src/pixmap.c
|
@ -130,7 +130,7 @@ parse_pixmap_ops(char *str)
|
||||||
REQUIRE_RVAL(str && *str, OP_NONE);
|
REQUIRE_RVAL(str && *str, OP_NONE);
|
||||||
D_PIXMAP(("parse_pixmap_ops(str [%s]) called.\n", str));
|
D_PIXMAP(("parse_pixmap_ops(str [%s]) called.\n", str));
|
||||||
|
|
||||||
for (; (token = strsep(&str, ":"));) {
|
for (; (token = (char *) strsep(&str, ":"));) {
|
||||||
if (!BEG_STRCASECMP("tiled", token)) {
|
if (!BEG_STRCASECMP("tiled", token)) {
|
||||||
op |= OP_TILE;
|
op |= OP_TILE;
|
||||||
} else if (!BEG_STRCASECMP("hscaled", token)) {
|
} else if (!BEG_STRCASECMP("hscaled", token)) {
|
||||||
|
@ -152,7 +152,8 @@ set_pixmap_scale(const char *geom, pixmap_t *pmap)
|
||||||
|
|
||||||
static char str[GEOM_LEN + 1] =
|
static char str[GEOM_LEN + 1] =
|
||||||
{'\0'};
|
{'\0'};
|
||||||
int w = 0, h = 0, x = 0, y = 0;
|
unsigned int w = 0, h = 0;
|
||||||
|
int x = 0, y = 0;
|
||||||
unsigned short op = OP_NONE;
|
unsigned short op = OP_NONE;
|
||||||
int flags;
|
int flags;
|
||||||
unsigned short changed = 0;
|
unsigned short changed = 0;
|
||||||
|
@ -216,12 +217,12 @@ set_pixmap_scale(const char *geom, pixmap_t *pmap)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pmap->w != w) {
|
if (pmap->w != (int) w) {
|
||||||
pmap->w = w;
|
pmap->w = (int) w;
|
||||||
changed++;
|
changed++;
|
||||||
}
|
}
|
||||||
if (pmap->h != h) {
|
if (pmap->h != (int) h) {
|
||||||
pmap->h = h;
|
pmap->h = (int) h;
|
||||||
changed++;
|
changed++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1005,7 +1006,7 @@ colormod_trans(Pixmap p, GC gc, unsigned short w, unsigned short h)
|
||||||
XImage *ximg;
|
XImage *ximg;
|
||||||
register unsigned long v, i;
|
register unsigned long v, i;
|
||||||
unsigned long x, y;
|
unsigned long x, y;
|
||||||
unsigned int r, g, b;
|
int r, g, b;
|
||||||
unsigned short rm, gm, bm, shade;
|
unsigned short rm, gm, bm, shade;
|
||||||
ImlibColor ctab[256];
|
ImlibColor ctab[256];
|
||||||
int real_depth = 0;
|
int real_depth = 0;
|
||||||
|
|
14
src/screen.c
14
src/screen.c
|
@ -1384,7 +1384,7 @@ scr_rvideo_mode(int mode)
|
||||||
void
|
void
|
||||||
scr_report_position(void)
|
scr_report_position(void)
|
||||||
{
|
{
|
||||||
tt_printf("\033[%d;%dR", screen.row + 1, screen.col + 1);
|
tt_printf((unsigned char *) "\033[%d;%dR", screen.row + 1, screen.col + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- *
|
/* ------------------------------------------------------------------------- *
|
||||||
|
@ -2227,7 +2227,8 @@ PasteIt(unsigned char *data, unsigned int nitems)
|
||||||
void
|
void
|
||||||
selection_paste(Window win, unsigned prop, int Delete)
|
selection_paste(Window win, unsigned prop, int Delete)
|
||||||
{
|
{
|
||||||
long nread, bytes_after, nitems;
|
long nread;
|
||||||
|
unsigned long bytes_after, nitems;
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
Atom actual_type;
|
Atom actual_type;
|
||||||
int actual_fmt;
|
int actual_fmt;
|
||||||
|
@ -2444,7 +2445,8 @@ selection_make(Time tm)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
i = (selection.end.row - selection.beg.row + 1) * (TermWin.ncol + 1) + 1;
|
i = (selection.end.row - selection.beg.row + 1) * (TermWin.ncol + 1) + 1;
|
||||||
new_selection_text = str = MALLOC(i * sizeof(char));
|
str = MALLOC(i * sizeof(char));
|
||||||
|
new_selection_text = (unsigned char *) str;
|
||||||
|
|
||||||
col = max(selection.beg.col, 0);
|
col = max(selection.beg.col, 0);
|
||||||
row = selection.beg.row + TermWin.saveLines;
|
row = selection.beg.row + TermWin.saveLines;
|
||||||
|
@ -2487,7 +2489,7 @@ selection_make(Time tm)
|
||||||
if (i)
|
if (i)
|
||||||
*str++ = '\n';
|
*str++ = '\n';
|
||||||
*str = '\0';
|
*str = '\0';
|
||||||
if ((i = strlen(new_selection_text)) == 0) {
|
if ((i = strlen((char *) new_selection_text)) == 0) {
|
||||||
FREE(new_selection_text);
|
FREE(new_selection_text);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3039,7 +3041,7 @@ selection_send(XSelectionRequestEvent * rq)
|
||||||
target_list[1] = (Atom32) XA_STRING;
|
target_list[1] = (Atom32) XA_STRING;
|
||||||
XChangeProperty(Xdisplay, rq->requestor, rq->property, rq->target,
|
XChangeProperty(Xdisplay, rq->requestor, rq->property, rq->target,
|
||||||
(8 * sizeof(target_list[0])), PropModeReplace,
|
(8 * sizeof(target_list[0])), PropModeReplace,
|
||||||
(char *) target_list,
|
(unsigned char *) target_list,
|
||||||
(sizeof(target_list) / sizeof(target_list[0])));
|
(sizeof(target_list) / sizeof(target_list[0])));
|
||||||
ev.xselection.property = rq->property;
|
ev.xselection.property = rq->property;
|
||||||
} else if (rq->target == XA_STRING) {
|
} else if (rq->target == XA_STRING) {
|
||||||
|
@ -3062,7 +3064,7 @@ mouse_report(XButtonEvent * ev)
|
||||||
button_number = ((ev->button == AnyButton) ? 3 : (ev->button - Button1));
|
button_number = ((ev->button == AnyButton) ? 3 : (ev->button - Button1));
|
||||||
key_state = ((ev->state & (ShiftMask | ControlMask))
|
key_state = ((ev->state & (ShiftMask | ControlMask))
|
||||||
+ ((ev->state & Mod1Mask) ? 2 : 0));
|
+ ((ev->state & Mod1Mask) ? 2 : 0));
|
||||||
tt_printf("\033[M%c%c%c",
|
tt_printf((unsigned char *) "\033[M%c%c%c",
|
||||||
(32 + button_number + (key_state << 2)),
|
(32 + button_number + (key_state << 2)),
|
||||||
(32 + Pixel2Col(ev->x) + 1),
|
(32 + Pixel2Col(ev->x) + 1),
|
||||||
(32 + Pixel2Row(ev->y) + 1));
|
(32 + Pixel2Row(ev->y) + 1));
|
||||||
|
|
|
@ -60,7 +60,7 @@ static GC scrollbarGC;
|
||||||
static short last_top = 0, last_bot = 0; /* old (drawn) values */
|
static short last_top = 0, last_bot = 0; /* old (drawn) values */
|
||||||
#ifdef XTERM_SCROLLBAR /* bitmap scrollbar */
|
#ifdef XTERM_SCROLLBAR /* bitmap scrollbar */
|
||||||
static GC shadowGC;
|
static GC shadowGC;
|
||||||
static char xterm_sb_bits[] =
|
static unsigned char xterm_sb_bits[] =
|
||||||
{0xaa, 0x0a, 0x55, 0x05}; /* 12x2 bitmap */
|
{0xaa, 0x0a, 0x55, 0x05}; /* 12x2 bitmap */
|
||||||
#endif
|
#endif
|
||||||
#if defined(MOTIF_SCROLLBAR) || defined(NEXT_SCROLLBAR)
|
#if defined(MOTIF_SCROLLBAR) || defined(NEXT_SCROLLBAR)
|
||||||
|
@ -390,19 +390,19 @@ sb_handle_button_press(event_t * ev)
|
||||||
if (button_state.report_mode) {
|
if (button_state.report_mode) {
|
||||||
/* Mouse report disabled scrollbar. Arrows send cursor key up/down, trough sends pageup/pagedown */
|
/* Mouse report disabled scrollbar. Arrows send cursor key up/down, trough sends pageup/pagedown */
|
||||||
if (scrollbar_upButton(ev->xany.window, ev->xbutton.y))
|
if (scrollbar_upButton(ev->xany.window, ev->xbutton.y))
|
||||||
tt_printf("\033[A");
|
tt_printf((unsigned char *) "\033[A");
|
||||||
else if (scrollbar_dnButton(ev->xany.window, ev->xbutton.y))
|
else if (scrollbar_dnButton(ev->xany.window, ev->xbutton.y))
|
||||||
tt_printf("\033[B");
|
tt_printf((unsigned char *) "\033[B");
|
||||||
else
|
else
|
||||||
switch (ev->xbutton.button) {
|
switch (ev->xbutton.button) {
|
||||||
case Button2:
|
case Button2:
|
||||||
tt_printf("\014");
|
tt_printf((unsigned char *) "\014");
|
||||||
break;
|
break;
|
||||||
case Button1:
|
case Button1:
|
||||||
tt_printf("\033[6~");
|
tt_printf((unsigned char *) "\033[6~");
|
||||||
break;
|
break;
|
||||||
case Button3:
|
case Button3:
|
||||||
tt_printf("\033[5~");
|
tt_printf((unsigned char *) "\033[5~");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
@ -498,7 +498,8 @@ sb_handle_button_release(event_t * ev)
|
||||||
{
|
{
|
||||||
|
|
||||||
Window root, child;
|
Window root, child;
|
||||||
int root_x, root_y, win_x, win_y, mask;
|
int root_x, root_y, win_x, win_y;
|
||||||
|
unsigned int mask;
|
||||||
|
|
||||||
D_EVENTS(("sb_handle_button_release(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
D_EVENTS(("sb_handle_button_release(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
||||||
|
|
||||||
|
@ -719,7 +720,7 @@ scrollbar_show(short mouseoffset)
|
||||||
|
|
||||||
#ifdef XTERM_SCROLLBAR
|
#ifdef XTERM_SCROLLBAR
|
||||||
if (scrollBar.type == SCROLLBAR_XTERM) {
|
if (scrollBar.type == SCROLLBAR_XTERM) {
|
||||||
gcvalue.stipple = XCreateBitmapFromData(Xdisplay, scrollBar.win, xterm_sb_bits, 12, 2);
|
gcvalue.stipple = XCreateBitmapFromData(Xdisplay, scrollBar.win, (char *) xterm_sb_bits, 12, 2);
|
||||||
if (!gcvalue.stipple) {
|
if (!gcvalue.stipple) {
|
||||||
print_error("Unable to create xterm scrollbar bitmap. Reverting to default scrollbar.");
|
print_error("Unable to create xterm scrollbar bitmap. Reverting to default scrollbar.");
|
||||||
scrollBar.type = SCROLLBAR_MOTIF;
|
scrollBar.type = SCROLLBAR_MOTIF;
|
||||||
|
|
|
@ -115,9 +115,9 @@ typedef struct {
|
||||||
short beg, end; /* beg/end of slider sub-window */
|
short beg, end; /* beg/end of slider sub-window */
|
||||||
short top, bot; /* top/bot of slider */
|
short top, bot; /* top/bot of slider */
|
||||||
unsigned char state; /* scrollbar state */
|
unsigned char state; /* scrollbar state */
|
||||||
unsigned char type:2; /* scrollbar type (see above) */
|
unsigned int type:2; /* scrollbar type (see above) */
|
||||||
unsigned char init:1; /* has scrollbar been drawn? */
|
unsigned int init:1; /* has scrollbar been drawn? */
|
||||||
unsigned char shadow:5; /* shadow width */
|
unsigned int shadow:5; /* shadow width */
|
||||||
unsigned short width, height; /* scrollbar width and height, without the shadow */
|
unsigned short width, height; /* scrollbar width and height, without the shadow */
|
||||||
unsigned short win_width, win_height; /* scrollbar window dimensions */
|
unsigned short win_width, win_height; /* scrollbar window dimensions */
|
||||||
short up_arrow_loc, down_arrow_loc; /* y coordinates for arrows */
|
short up_arrow_loc, down_arrow_loc; /* y coordinates for arrows */
|
||||||
|
|
116
src/term.c
116
src/term.c
|
@ -141,19 +141,19 @@ lookup_key(XEvent * ev)
|
||||||
Status status_return;
|
Status status_return;
|
||||||
|
|
||||||
kbuf[0] = '\0';
|
kbuf[0] = '\0';
|
||||||
len = XmbLookupString(Input_Context, &ev->xkey, (char *)kbuf,
|
len = XmbLookupString(Input_Context, &ev->xkey, (char *) kbuf,
|
||||||
sizeof(short_buf), &keysym, &status_return);
|
sizeof(short_buf), &keysym, &status_return);
|
||||||
if (status_return == XBufferOverflow) {
|
if (status_return == XBufferOverflow) {
|
||||||
kbuf = (unsigned char *) MALLOC(len + 1);
|
kbuf = (unsigned char *) MALLOC(len + 1);
|
||||||
kbuf_alloced = 1;
|
kbuf_alloced = 1;
|
||||||
len = XmbLookupString(Input_Context, &ev->xkey, (char *)kbuf, len, &keysym, &status_return);
|
len = XmbLookupString(Input_Context, &ev->xkey, (char *) kbuf, len, &keysym, &status_return);
|
||||||
}
|
}
|
||||||
valid_keysym = (status_return == XLookupKeySym) || (status_return == XLookupBoth);
|
valid_keysym = (status_return == XLookupKeySym) || (status_return == XLookupBoth);
|
||||||
} else {
|
} else {
|
||||||
len = XLookupString(&ev->xkey, kbuf, sizeof(short_buf), &keysym, NULL);
|
len = XLookupString(&ev->xkey, (char *) kbuf, sizeof(short_buf), &keysym, NULL);
|
||||||
}
|
}
|
||||||
#else /* USE_XIM */
|
#else /* USE_XIM */
|
||||||
len = XLookupString(&ev->xkey, kbuf, sizeof(kbuf), &keysym, NULL);
|
len = XLookupString(&ev->xkey, (char *) kbuf, sizeof(kbuf), &keysym, NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* have unmapped Latin[2-4] entries -> Latin1
|
* have unmapped Latin[2-4] entries -> Latin1
|
||||||
|
@ -181,7 +181,7 @@ lookup_key(XEvent * ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Options & Opt_report_as_keysyms) && (keysym >= 0xff00)) {
|
if ((Options & Opt_report_as_keysyms) && (keysym >= 0xff00)) {
|
||||||
len = sprintf(kbuf, "\e[k%X;%X~", (unsigned int) (ev->xkey.state & 0xff), (unsigned int) (keysym & 0xff));
|
len = sprintf((char *) kbuf, "\033[k%X;%X~", (unsigned int) (ev->xkey.state & 0xff), (unsigned int) (keysym & 0xff));
|
||||||
tt_write(kbuf, len);
|
tt_write(kbuf, len);
|
||||||
LK_RET();
|
LK_RET();
|
||||||
}
|
}
|
||||||
|
@ -523,7 +523,7 @@ lookup_key(XEvent * ev)
|
||||||
|
|
||||||
#define FKEY(n,fkey) do { \
|
#define FKEY(n,fkey) do { \
|
||||||
len = 5; \
|
len = 5; \
|
||||||
sprintf(kbuf,"\033[%02d~", (int)((n) + (keysym - fkey))); \
|
sprintf((char *) kbuf,"\033[%02d~", (int)((n) + (keysym - fkey))); \
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
case XK_F1: /* "\033[11~" */
|
case XK_F1: /* "\033[11~" */
|
||||||
|
@ -647,7 +647,7 @@ sprintf(kbuf,"\033[%02d~", (int)((n) + (keysym - fkey))); \
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
fprintf(stderr, "key 0x%04X[%d]: `", (unsigned int) keysym, len);
|
fprintf(stderr, "key 0x%04X[%d]: `", (unsigned int) keysym, len);
|
||||||
for (i = 0, p = kbuf; i < len; i++, p++)
|
for (i = 0, p = (char *) kbuf; i < len; i++, p++)
|
||||||
fprintf(stderr, (*p >= ' ' && *p < '\177' ? "%c" : "\\%03o"), *p);
|
fprintf(stderr, (*p >= ' ' && *p < '\177' ? "%c" : "\\%03o"), *p);
|
||||||
fprintf(stderr, "'\n");
|
fprintf(stderr, "'\n");
|
||||||
}
|
}
|
||||||
|
@ -662,7 +662,7 @@ sprintf(kbuf,"\033[%02d~", (int)((n) + (keysym - fkey))); \
|
||||||
FILE *
|
FILE *
|
||||||
popen_printer(void)
|
popen_printer(void)
|
||||||
{
|
{
|
||||||
FILE *stream = popen(rs_print_pipe, "w");
|
FILE *stream = (FILE *) popen(rs_print_pipe, "w");
|
||||||
|
|
||||||
if (stream == NULL)
|
if (stream == NULL)
|
||||||
print_error("can't open printer pipe \"%s\" -- %s", rs_print_pipe, strerror(errno));
|
print_error("can't open printer pipe \"%s\" -- %s", rs_print_pipe, strerror(errno));
|
||||||
|
@ -749,11 +749,11 @@ process_escape_seq(void)
|
||||||
scr_index(UP);
|
scr_index(UP);
|
||||||
break;
|
break;
|
||||||
case 'E':
|
case 'E':
|
||||||
scr_add_lines("\n\r", 1, 2);
|
scr_add_lines((unsigned char *) "\n\r", 1, 2);
|
||||||
break;
|
break;
|
||||||
case 'G':
|
case 'G':
|
||||||
if ((ch = cmd_getc()) == 'Q') { /* query graphics */
|
if ((ch = cmd_getc()) == 'Q') { /* query graphics */
|
||||||
tt_printf("\033G0\n"); /* no graphics */
|
tt_printf((unsigned char *) "\033G0\n"); /* no graphics */
|
||||||
} else {
|
} else {
|
||||||
do {
|
do {
|
||||||
ch = cmd_getc();
|
ch = cmd_getc();
|
||||||
|
@ -769,7 +769,7 @@ process_escape_seq(void)
|
||||||
/*case 'N': scr_single_shift (2); break; */
|
/*case 'N': scr_single_shift (2); break; */
|
||||||
/*case 'O': scr_single_shift (3); break; */
|
/*case 'O': scr_single_shift (3); break; */
|
||||||
case 'Z':
|
case 'Z':
|
||||||
tt_printf(ESCZ_ANSWER);
|
tt_printf((unsigned char *) ESCZ_ANSWER);
|
||||||
break; /* steal obsolete ESC [ c */
|
break; /* steal obsolete ESC [ c */
|
||||||
case '[':
|
case '[':
|
||||||
process_csi_seq();
|
process_csi_seq();
|
||||||
|
@ -929,14 +929,14 @@ process_csi_seq(void)
|
||||||
case 'n': /* request for information */
|
case 'n': /* request for information */
|
||||||
switch (arg[0]) {
|
switch (arg[0]) {
|
||||||
case 5:
|
case 5:
|
||||||
tt_printf("\033[0n");
|
tt_printf((unsigned char *) "\033[0n");
|
||||||
break; /* ready */
|
break; /* ready */
|
||||||
case 6:
|
case 6:
|
||||||
scr_report_position();
|
scr_report_position();
|
||||||
break;
|
break;
|
||||||
#if defined (ENABLE_DISPLAY_ANSWER)
|
#if defined (ENABLE_DISPLAY_ANSWER)
|
||||||
case 7:
|
case 7:
|
||||||
tt_printf("%s\n", display_name);
|
tt_printf((unsigned char *) "%s\n", display_name);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case 8:
|
case 8:
|
||||||
|
@ -1076,12 +1076,12 @@ process_xterm_seq(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string[n] = '\0';
|
string[n] = '\0';
|
||||||
xterm_seq(arg, string);
|
xterm_seq(arg, (char *) string);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
unsigned long n = 0;
|
unsigned long n = 0;
|
||||||
|
|
||||||
for (; ch != '\e'; ch = cmd_getc()) {
|
for (; ch != '\033'; ch = cmd_getc()) {
|
||||||
if (ch) {
|
if (ch) {
|
||||||
if (ch == '\t')
|
if (ch == '\t')
|
||||||
ch = ' '; /* translate '\t' to space */
|
ch = ' '; /* translate '\t' to space */
|
||||||
|
@ -1099,13 +1099,13 @@ process_xterm_seq(void)
|
||||||
}
|
}
|
||||||
switch (arg) {
|
switch (arg) {
|
||||||
case 'l':
|
case 'l':
|
||||||
xterm_seq(XTerm_title, string);
|
xterm_seq(XTerm_title, (char *) string);
|
||||||
break;
|
break;
|
||||||
case 'L':
|
case 'L':
|
||||||
xterm_seq(XTerm_iconName, string);
|
xterm_seq(XTerm_iconName, (char *) string);
|
||||||
break;
|
break;
|
||||||
case 'I':
|
case 'I':
|
||||||
set_icon_pixmap(string, NULL);
|
set_icon_pixmap((char *) string, NULL);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -1119,7 +1119,7 @@ process_window_mode(unsigned int nargs, int args[])
|
||||||
{
|
{
|
||||||
|
|
||||||
register unsigned int i;
|
register unsigned int i;
|
||||||
unsigned int x, y;
|
int x, y;
|
||||||
Screen *scr;
|
Screen *scr;
|
||||||
Window dummy_child;
|
Window dummy_child;
|
||||||
char buff[128], *name;
|
char buff[128], *name;
|
||||||
|
@ -1136,7 +1136,7 @@ process_window_mode(unsigned int nargs, int args[])
|
||||||
unsigned int dummy_border, dummy_depth;
|
unsigned int dummy_border, dummy_depth;
|
||||||
|
|
||||||
/* Store current width and height in x and y */
|
/* Store current width and height in x and y */
|
||||||
XGetGeometry(Xdisplay, TermWin.parent, &dummy_child, &dummy_x, &dummy_y, &x, &y, &dummy_border, &dummy_depth);
|
XGetGeometry(Xdisplay, TermWin.parent, &dummy_child, &dummy_x, &dummy_y, (unsigned int *) (&x), (unsigned int *) (&y), &dummy_border, &dummy_depth);
|
||||||
}
|
}
|
||||||
switch (args[i]) {
|
switch (args[i]) {
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -1150,7 +1150,7 @@ process_window_mode(unsigned int nargs, int args[])
|
||||||
return; /* Make sure there are 2 args left */
|
return; /* Make sure there are 2 args left */
|
||||||
x = args[++i];
|
x = args[++i];
|
||||||
y = args[++i];
|
y = args[++i];
|
||||||
if (x > (unsigned long) scr->width || y > (unsigned long) scr->height)
|
if (((unsigned int) x > (unsigned int) scr->width) || ((unsigned int) y > (unsigned int) scr->height))
|
||||||
return; /* Don't move off-screen */
|
return; /* Don't move off-screen */
|
||||||
XMoveWindow(Xdisplay, TermWin.parent, x, y);
|
XMoveWindow(Xdisplay, TermWin.parent, x, y);
|
||||||
break;
|
break;
|
||||||
|
@ -1189,27 +1189,27 @@ process_window_mode(unsigned int nargs, int args[])
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
XTranslateCoordinates(Xdisplay, TermWin.parent, Xroot, 0, 0, &x, &y, &dummy_child);
|
XTranslateCoordinates(Xdisplay, TermWin.parent, Xroot, 0, 0, &x, &y, &dummy_child);
|
||||||
snprintf(buff, sizeof(buff), "\e[3;%d;%dt", x, y);
|
snprintf(buff, sizeof(buff), "\033[3;%d;%dt", x, y);
|
||||||
tt_write(buff, strlen(buff));
|
tt_write((unsigned char *) buff, strlen(buff));
|
||||||
break;
|
break;
|
||||||
case 14:
|
case 14:
|
||||||
snprintf(buff, sizeof(buff), "\e[4;%d;%dt", y, x);
|
snprintf(buff, sizeof(buff), "\033[4;%d;%dt", y, x);
|
||||||
tt_write(buff, strlen(buff));
|
tt_write((unsigned char *) buff, strlen(buff));
|
||||||
break;
|
break;
|
||||||
case 18:
|
case 18:
|
||||||
snprintf(buff, sizeof(buff), "\e[8;%d;%dt", TermWin.nrow, TermWin.ncol);
|
snprintf(buff, sizeof(buff), "\033[8;%d;%dt", TermWin.nrow, TermWin.ncol);
|
||||||
tt_write(buff, strlen(buff));
|
tt_write((unsigned char *) buff, strlen(buff));
|
||||||
break;
|
break;
|
||||||
case 20:
|
case 20:
|
||||||
XGetIconName(Xdisplay, TermWin.parent, &name);
|
XGetIconName(Xdisplay, TermWin.parent, &name);
|
||||||
snprintf(buff, sizeof(buff), "\e]L%s\e\\", name);
|
snprintf(buff, sizeof(buff), "\033]L%s\033\\", name);
|
||||||
tt_write(buff, strlen(buff));
|
tt_write((unsigned char *) buff, strlen(buff));
|
||||||
XFree(name);
|
XFree(name);
|
||||||
break;
|
break;
|
||||||
case 21:
|
case 21:
|
||||||
XFetchName(Xdisplay, TermWin.parent, &name);
|
XFetchName(Xdisplay, TermWin.parent, &name);
|
||||||
snprintf(buff, sizeof(buff), "\e]l%s\e\\", name);
|
snprintf(buff, sizeof(buff), "\033]l%s\033\\", name);
|
||||||
tt_write(buff, strlen(buff));
|
tt_write((unsigned char *) buff, strlen(buff));
|
||||||
XFree(name);
|
XFree(name);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1599,7 +1599,7 @@ xterm_seq(int op, const char *str)
|
||||||
set_title(str);
|
set_title(str);
|
||||||
break;
|
break;
|
||||||
case XTerm_prop:
|
case XTerm_prop:
|
||||||
if ((nstr = strsep(&tnstr, ";")) == NULL) {
|
if ((nstr = (char *) strsep(&tnstr, ";")) == NULL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((valptr = strchr(nstr, '=')) != NULL) {
|
if ((valptr = strchr(nstr, '=')) != NULL) {
|
||||||
|
@ -1648,7 +1648,7 @@ xterm_seq(int op, const char *str)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
D_CMD(("Got XTerm_EtermSeq sequence\n"));
|
D_CMD(("Got XTerm_EtermSeq sequence\n"));
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
eterm_seq_op = (unsigned char) strtol(nstr, (char **) NULL, 10);
|
eterm_seq_op = (unsigned char) strtol(nstr, (char **) NULL, 10);
|
||||||
D_CMD((" XTerm_EtermSeq operation is %d\n", eterm_seq_op));
|
D_CMD((" XTerm_EtermSeq operation is %d\n", eterm_seq_op));
|
||||||
/* Yes, there is order to the numbers for this stuff. And here it is:
|
/* Yes, there is order to the numbers for this stuff. And here it is:
|
||||||
|
@ -1664,7 +1664,7 @@ xterm_seq(int op, const char *str)
|
||||||
switch (eterm_seq_op) {
|
switch (eterm_seq_op) {
|
||||||
#ifdef PIXMAP_OFFSET
|
#ifdef PIXMAP_OFFSET
|
||||||
case 0:
|
case 0:
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
if (nstr) {
|
if (nstr) {
|
||||||
if (BOOL_OPT_ISTRUE(nstr)) {
|
if (BOOL_OPT_ISTRUE(nstr)) {
|
||||||
D_CMD((" Request to enable transparency.\n"));
|
D_CMD((" Request to enable transparency.\n"));
|
||||||
|
@ -1695,7 +1695,7 @@ xterm_seq(int op, const char *str)
|
||||||
redraw_all_images();
|
redraw_all_images();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if ((color = strsep(&tnstr, ";")) == NULL) {
|
if ((color = (char *) strsep(&tnstr, ";")) == NULL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((strlen(color) == 2) || (!strcasecmp(color, "down"))) {
|
if ((strlen(color) == 2) || (!strcasecmp(color, "down"))) {
|
||||||
|
@ -1713,16 +1713,16 @@ xterm_seq(int op, const char *str)
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((color = strsep(&tnstr, ";")) == NULL) {
|
if ((color = (char *) strsep(&tnstr, ";")) == NULL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
which = image_bg;
|
which = image_bg;
|
||||||
}
|
}
|
||||||
if ((mod = strsep(&tnstr, ";")) == NULL) {
|
if ((mod = (char *) strsep(&tnstr, ";")) == NULL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((valptr = strsep(&tnstr, ";")) == NULL) {
|
if ((valptr = (char *) strsep(&tnstr, ";")) == NULL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
D_CMD(("Modifying the %s attribute of the %s color modifier of the %s image to be %s\n", mod, color, get_image_type(which), valptr));
|
D_CMD(("Modifying the %s attribute of the %s color modifier of the %s image to be %s\n", mod, color, get_image_type(which), valptr));
|
||||||
|
@ -1809,7 +1809,7 @@ xterm_seq(int op, const char *str)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case 10:
|
case 10:
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
if (nstr && *nstr) {
|
if (nstr && *nstr) {
|
||||||
if (!strcasecmp(nstr, "xterm")) {
|
if (!strcasecmp(nstr, "xterm")) {
|
||||||
#ifdef XTERM_SCROLLBAR
|
#ifdef XTERM_SCROLLBAR
|
||||||
|
@ -1837,7 +1837,7 @@ xterm_seq(int op, const char *str)
|
||||||
map_scrollbar(1);
|
map_scrollbar(1);
|
||||||
scrollbar_show(0);
|
scrollbar_show(0);
|
||||||
}
|
}
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
if (nstr && *nstr) {
|
if (nstr && *nstr) {
|
||||||
scrollBar.width = strtoul(nstr, (char **) NULL, 0);
|
scrollBar.width = strtoul(nstr, (char **) NULL, 0);
|
||||||
if (scrollBar.width == 0) {
|
if (scrollBar.width == 0) {
|
||||||
|
@ -1851,7 +1851,7 @@ xterm_seq(int op, const char *str)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollBar_right);
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollBar_right);
|
||||||
scrollbar_reset();
|
scrollbar_reset();
|
||||||
map_scrollbar(0);
|
map_scrollbar(0);
|
||||||
|
@ -1859,7 +1859,7 @@ xterm_seq(int op, const char *str)
|
||||||
scrollbar_show(0);
|
scrollbar_show(0);
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollBar_floating);
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollBar_floating);
|
||||||
scrollbar_reset();
|
scrollbar_reset();
|
||||||
map_scrollbar(0);
|
map_scrollbar(0);
|
||||||
|
@ -1867,42 +1867,42 @@ xterm_seq(int op, const char *str)
|
||||||
scrollbar_show(0);
|
scrollbar_show(0);
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollbar_popup);
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollbar_popup);
|
||||||
break;
|
break;
|
||||||
case 20:
|
case 20:
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_visualBell);
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_visualBell);
|
||||||
break;
|
break;
|
||||||
#ifdef MAPALERT_OPTION
|
#ifdef MAPALERT_OPTION
|
||||||
case 21:
|
case 21:
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_mapAlert);
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_mapAlert);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case 22:
|
case 22:
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_xterm_select);
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_xterm_select);
|
||||||
break;
|
break;
|
||||||
case 23:
|
case 23:
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_select_whole_line);
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_select_whole_line);
|
||||||
break;
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
FOREACH_IMAGE(if (!image_mode_is(idx, MODE_VIEWPORT) && image_mode_is(idx, ALLOW_VIEWPORT)) {image_set_mode(idx, MODE_VIEWPORT);});
|
FOREACH_IMAGE(if (!image_mode_is(idx, MODE_VIEWPORT) && image_mode_is(idx, ALLOW_VIEWPORT)) {image_set_mode(idx, MODE_VIEWPORT);});
|
||||||
redraw_all_images();
|
redraw_all_images();
|
||||||
break;
|
break;
|
||||||
case 25:
|
case 25:
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_select_trailing_spaces);
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_select_trailing_spaces);
|
||||||
break;
|
break;
|
||||||
case 26:
|
case 26:
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_report_as_keysyms);
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_report_as_keysyms);
|
||||||
break;
|
break;
|
||||||
case 30:
|
case 30:
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
if (nstr) {
|
if (nstr) {
|
||||||
if (XParseColor(Xdisplay, cmap, nstr, &xcol) && XAllocColor(Xdisplay, cmap, &xcol)) {
|
if (XParseColor(Xdisplay, cmap, nstr, &xcol) && XAllocColor(Xdisplay, cmap, &xcol)) {
|
||||||
PixColors[fgColor] = xcol.pixel;
|
PixColors[fgColor] = xcol.pixel;
|
||||||
|
@ -1911,7 +1911,7 @@ xterm_seq(int op, const char *str)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 40:
|
case 40:
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
if (nstr) {
|
if (nstr) {
|
||||||
if (XParseColor(Xdisplay, cmap, nstr, &xcol) && XAllocColor(Xdisplay, cmap, &xcol)) {
|
if (XParseColor(Xdisplay, cmap, nstr, &xcol) && XAllocColor(Xdisplay, cmap, &xcol)) {
|
||||||
PixColors[bgColor] = xcol.pixel;
|
PixColors[bgColor] = xcol.pixel;
|
||||||
|
@ -1921,7 +1921,7 @@ xterm_seq(int op, const char *str)
|
||||||
break;
|
break;
|
||||||
case 50:
|
case 50:
|
||||||
/* Change desktops */
|
/* Change desktops */
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
if (nstr && *nstr) {
|
if (nstr && *nstr) {
|
||||||
XClientMessageEvent xev;
|
XClientMessageEvent xev;
|
||||||
|
|
||||||
|
@ -1941,7 +1941,7 @@ xterm_seq(int op, const char *str)
|
||||||
break;
|
break;
|
||||||
case 71:
|
case 71:
|
||||||
/* Save current config */
|
/* Save current config */
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
if (nstr && *nstr) {
|
if (nstr && *nstr) {
|
||||||
save_config(nstr);
|
save_config(nstr);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1950,7 +1950,7 @@ xterm_seq(int op, const char *str)
|
||||||
break;
|
break;
|
||||||
case 80:
|
case 80:
|
||||||
/* Set debugging level */
|
/* Set debugging level */
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
if (nstr && *nstr) {
|
if (nstr && *nstr) {
|
||||||
debug_level = (unsigned int) strtoul(nstr, (char **) NULL, 0);
|
debug_level = (unsigned int) strtoul(nstr, (char **) NULL, 0);
|
||||||
}
|
}
|
||||||
|
@ -1968,14 +1968,14 @@ xterm_seq(int op, const char *str)
|
||||||
load_image("", image_bg);
|
load_image("", image_bg);
|
||||||
bg_needs_update = 1;
|
bg_needs_update = 1;
|
||||||
} else {
|
} else {
|
||||||
nstr = strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
if (nstr) {
|
if (nstr) {
|
||||||
if (*nstr) {
|
if (*nstr) {
|
||||||
set_pixmap_scale("", images[image_bg].current->pmap);
|
set_pixmap_scale("", images[image_bg].current->pmap);
|
||||||
bg_needs_update = 1;
|
bg_needs_update = 1;
|
||||||
load_image(nstr, image_bg);
|
load_image(nstr, image_bg);
|
||||||
}
|
}
|
||||||
while ((nstr = strsep(&tnstr, ";")) && *nstr) {
|
while ((nstr = (char *) strsep(&tnstr, ";")) && *nstr) {
|
||||||
changed += set_pixmap_scale(nstr, images[image_bg].current->pmap);
|
changed += set_pixmap_scale(nstr, images[image_bg].current->pmap);
|
||||||
scaled = 1;
|
scaled = 1;
|
||||||
}
|
}
|
||||||
|
@ -1991,7 +1991,7 @@ xterm_seq(int op, const char *str)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XTerm_EtermIPC:
|
case XTerm_EtermIPC:
|
||||||
for (; (nstr = strsep(&tnstr, ";"));) {
|
for (; (nstr = (char *) strsep(&tnstr, ";"));) {
|
||||||
eterm_ipc_parse(nstr);
|
eterm_ipc_parse(nstr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -83,7 +83,7 @@ set_text_property(Window win, char *propname, char *value)
|
||||||
XDeleteProperty(Xdisplay, win, atom);
|
XDeleteProperty(Xdisplay, win, atom);
|
||||||
} else {
|
} else {
|
||||||
atom = XInternAtom(Xdisplay, propname, False);
|
atom = XInternAtom(Xdisplay, propname, False);
|
||||||
prop.value = value;
|
prop.value = (unsigned char *) value;
|
||||||
prop.encoding = XA_STRING;
|
prop.encoding = XA_STRING;
|
||||||
prop.format = 8;
|
prop.format = 8;
|
||||||
prop.nitems = strlen(value);
|
prop.nitems = strlen(value);
|
||||||
|
@ -96,7 +96,7 @@ get_bottom_shadow_color(Pixel norm_color, const char *type)
|
||||||
{
|
{
|
||||||
|
|
||||||
XColor xcol;
|
XColor xcol;
|
||||||
unsigned int r, g, b;
|
int r, g, b;
|
||||||
|
|
||||||
xcol.pixel = norm_color;
|
xcol.pixel = norm_color;
|
||||||
XQueryColor(Xdisplay, cmap, &xcol);
|
XQueryColor(Xdisplay, cmap, &xcol);
|
||||||
|
@ -121,7 +121,7 @@ get_top_shadow_color(Pixel norm_color, const char *type)
|
||||||
{
|
{
|
||||||
|
|
||||||
XColor xcol, white;
|
XColor xcol, white;
|
||||||
unsigned int r, g, b;
|
int r, g, b;
|
||||||
|
|
||||||
# ifdef PREFER_24BIT
|
# ifdef PREFER_24BIT
|
||||||
white.red = white.green = white.blue = r = g = b = ~0;
|
white.red = white.green = white.blue = r = g = b = ~0;
|
||||||
|
@ -166,7 +166,7 @@ Create_Windows(int argc, char *argv[])
|
||||||
CARD32 val;
|
CARD32 val;
|
||||||
int i, x = 0, y = 0, flags;
|
int i, x = 0, y = 0, flags;
|
||||||
unsigned int width = 0, height = 0;
|
unsigned int width = 0, height = 0;
|
||||||
unsigned int r, g, b;
|
int r, g, b;
|
||||||
MWMHints mwmhints;
|
MWMHints mwmhints;
|
||||||
|
|
||||||
if (Options & Opt_borderless) {
|
if (Options & Opt_borderless) {
|
||||||
|
|
Loading…
Reference in New Issue