Mon Apr 18 21:49:08 2005 Michael Jennings (mej)

Re-indent code.
----------------------------------------------------------------------


SVN revision: 14229
eterm-0.10
Michael Jennings 18 years ago
parent 05469ad9f0
commit 6657911db3
  1. 7
      .cvsignore
  2. 4
      ChangeLog
  3. 4
      reformat-code
  4. 55
      src/actions.c
  5. 251
      src/buttons.c
  6. 316
      src/command.c
  7. 102
      src/draw.c
  8. 6
      src/e.c
  9. 242
      src/events.c
  10. 154
      src/font.c
  11. 11
      src/grkelot.c
  12. 344
      src/libscream.c
  13. 232
      src/menus.c
  14. 118
      src/misc.c
  15. 3
      src/netdisp.c
  16. 304
      src/options.c
  17. 442
      src/pixmap.c
  18. 556
      src/screen.c
  19. 126
      src/scrollbar.c
  20. 11
      src/startup.c
  21. 2977
      src/term.c
  22. 3
      src/timer.c
  23. 10
      src/utmp.c
  24. 132
      src/windows.c
  25. 23
      utils/Esetroot.c

@ -11,7 +11,7 @@ aclocal.m4
config.status
config.h
libtool
stamp-h
stamp-h*
move-themes
*.spec
config.h.in
@ -20,3 +20,8 @@ mkinstalldirs
install-sh
Eterm*.tar.gz
*.sddf
autom4te*
depcomp
build.mezz
iconv_test*
utf8*

@ -5325,3 +5325,7 @@ test scripts into utils/, and in playing around with them, I found and
fixed an X server resource leak. Use Etpalette to view the 256-color
palette.
----------------------------------------------------------------------
Mon Apr 18 21:49:08 2005 Michael Jennings (mej)
Re-indent code.
----------------------------------------------------------------------

@ -2,14 +2,14 @@
TYPENAMES=""
for i in button_t buttonbar_t menu_t menuitem_t ; do
for i in eterm_action_t button_t buttonbar_t menu_t menuitem_t ; do
TYPENAMES="$TYPENAMES -T $i"
done
for i in *.c src/*.c utils/*.c ; do
if test -f $i; then
echo Reformatting $i
indent -bad -bap -bbo -br -brs -cdw -ce -ci4 -cli2 -cs -di1 -i4 -l180 \
indent -bad -bap -bbo -br -brs -cdw -ce -ci4 -cli4 -cs -di1 -i4 -l132 \
-lp -lps -nbc -nbfda -npcs -nprs -nsob -nss -nut -psl -saf -sai -saw $TYPENAMES $i
fi
done

@ -97,7 +97,8 @@ action_t *action_find_match(unsigned short mod, unsigned char button, KeySym key
D_ACTIONS(("mod == 0x%08x, button == %d, keysym == 0x%08x\n", mod, button, keysym));
for (action = action_list; action; action = action->next) {
D_ACTIONS(("Checking action. mod == 0x%08x, button == %d, keysym == 0x%08x\n", action->mod, action->button, action->keysym));
D_ACTIONS(("Checking action. mod == 0x%08x, button == %d, keysym == 0x%08x\n", action->mod, action->button,
action->keysym));
if ((action->mod == mod) && (action->button == button) && (action->keysym == keysym)) {
D_ACTIONS(("Match found at %8p\n", action));
return action;
@ -146,7 +147,8 @@ action_check_modifiers(unsigned short mod, int x_mod)
/* When we do have to check the modifiers, we do so in this order to eliminate the
most popular choices first. If any test fails, we return FALSE. */
D_ACTIONS(("Checking modifier set 0x%08x (" MOD_FMT ") vs. X modifier set 0x%08x (" MOD_FMT ")\n", mod, SHOW_MODS(mod), x_mod, SHOW_X_MODS(x_mod)));
D_ACTIONS(("Checking modifier set 0x%08x (" MOD_FMT ") vs. X modifier set 0x%08x (" MOD_FMT ")\n", mod, SHOW_MODS(mod), x_mod,
SHOW_X_MODS(x_mod)));
if (mod != MOD_ANY) {
/* LOGICAL_XOR() returns true if either the first parameter or the second parameter
is true, but not both...just like XOR. If the mask we're looking for is set in
@ -202,7 +204,8 @@ action_dispatch(event_t *ev, KeySym keysym)
ASSERT_RVAL(ev != NULL, 0);
ASSERT_RVAL(ev->xany.type == ButtonPress || ev->xany.type == KeyPress, 0);
D_ACTIONS(("Event %8p: Button %d, Keysym 0x%08x, Key State 0x%08x (modifiers " MOD_FMT ")\n", ev, ev->xbutton.button, keysym, ev->xkey.state, SHOW_X_MODS(ev->xkey.state)));
D_ACTIONS(("Event %8p: Button %d, Keysym 0x%08x, Key State 0x%08x (modifiers " MOD_FMT ")\n", ev, ev->xbutton.button, keysym,
ev->xkey.state, SHOW_X_MODS(ev->xkey.state)));
for (action = action_list; action; action = action->next) {
/* The very first thing we do is match the event type to the type
of the current action. This means that we'll only run through
@ -241,29 +244,29 @@ action_add(unsigned short mod, unsigned char button, KeySym keysym, action_type_
action->type = type;
action->keysym = keysym;
switch (type) {
case ACTION_STRING:
action->handler = (action_handler_t) action_handle_string;
action->param.string = (char *) MALLOC(strlen((char *) param) + 2);
strcpy(action->param.string, (char *) param);
parse_escaped_string(action->param.string);
break;
case ACTION_ECHO:
action->handler = (action_handler_t) action_handle_echo;
action->param.string = (char *) MALLOC(strlen((char *) param) + 2);
strcpy(action->param.string, (char *) param);
parse_escaped_string(action->param.string);
break;
case ACTION_SCRIPT:
action->handler = (action_handler_t) action_handle_script;
action->param.script = (char *) MALLOC(strlen((char *) param) + 2);
strcpy(action->param.script, (char *) param);
break;
case ACTION_MENU:
action->handler = (action_handler_t) action_handle_menu;
action->param.menu = (menu_t *) param;
break;
default:
break;
case ACTION_STRING:
action->handler = (action_handler_t) action_handle_string;
action->param.string = (char *) MALLOC(strlen((char *) param) + 2);
strcpy(action->param.string, (char *) param);
parse_escaped_string(action->param.string);
break;
case ACTION_ECHO:
action->handler = (action_handler_t) action_handle_echo;
action->param.string = (char *) MALLOC(strlen((char *) param) + 2);
strcpy(action->param.string, (char *) param);
parse_escaped_string(action->param.string);
break;
case ACTION_SCRIPT:
action->handler = (action_handler_t) action_handle_script;
action->param.script = (char *) MALLOC(strlen((char *) param) + 2);
strcpy(action->param.script, (char *) param);
break;
case ACTION_MENU:
action->handler = (action_handler_t) action_handle_menu;
action->param.menu = (menu_t *) param;
break;
default:
break;
}
D_ACTIONS(("Added action. mod == 0x%08x, button == %d, keysym == 0x%08x\n", action->mod, action->button, action->keysym));
}

@ -60,7 +60,8 @@ static inline void
draw_string(buttonbar_t *bbar, Drawable d, GC gc, int x, int y, char *str, size_t len)
{
D_BBAR(("Writing string \"%s\" (length %lu) using font 0x%08x onto drawable 0x%08x at %d, %d\n", str, len, bbar->font, d, x, y));
D_BBAR(("Writing string \"%s\" (length %lu) using font 0x%08x onto drawable 0x%08x at %d, %d\n",
str, len, bbar->font, d, x, y));
REQUIRE(bbar != NULL);
REQUIRE(d != None);
REQUIRE(gc != None);
@ -91,7 +92,8 @@ buttonbar_t *bbar_create(void)
xattr.colormap = cmap;
cursor = XCreateFontCursor(Xdisplay, XC_left_ptr);
mask = KeyPressMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
mask = KeyPressMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask
| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
gcvalue.foreground = xattr.border_pixel;
bbar->font = load_font(etfonts[def_font_idx], "fixed", FONT_TYPE_X);
@ -195,7 +197,8 @@ bbar_handle_enter_notify(event_t *ev)
return 0;
}
bbar_draw(bbar, IMAGE_STATE_SELECTED, 0);
XQueryPointer(Xdisplay, bbar->win, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->xbutton.x), &(ev->xbutton.y), &unused_mask);
XQueryPointer(Xdisplay, bbar->win, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->xbutton.x),
&(ev->xbutton.y), &unused_mask);
b = find_button_by_coords(bbar, ev->xbutton.x, ev->xbutton.y);
if (b) {
bbar_select_button(bbar, b);
@ -299,7 +302,9 @@ bbar_handle_button_release(event_t *ev)
size_t l = strlen(orig_argv0) + strlen(u) + 7;
if ((c = MALLOC(l))) {
snprintf(c, l, "%s%s -U %s", ((orig_argv0[0] == '/') || ((orig_argv0[0] == '.') && (orig_argv0[1] == '/'))) ? "" : "./", orig_argv0, u);
snprintf(c, l, "%s%s -U %s", ((orig_argv0[0] == '/')
|| ((orig_argv0[0] == '.')
&& (orig_argv0[1] == '/'))) ? "" : "./", orig_argv0, u);
D_ESCREEN(("(experimental) creating other frame using \"%s\"\n", c));
(void) ns_run(TermWin.screen->efuns, c);
FREE(c);
@ -326,13 +331,15 @@ bbar_handle_button_release(event_t *ev)
return 0;
}
XQueryPointer(Xdisplay, bbar->win, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->xbutton.x), &(ev->xbutton.y), &unused_mask);
XQueryPointer(Xdisplay, bbar->win, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->xbutton.x),
&(ev->xbutton.y), &unused_mask);
b = find_button_by_coords(bbar, ev->xbutton.x, ev->xbutton.y);
if (b) {
D_EVENTS(("Event in buttonbar %8p, button %8p (%s)\n", bbar, b, NONULL(b->text)));
if (bbar->current && (b != bbar->current)) {
D_EVENTS(("Current button %8p (%s) doesn't match event button %8p (%s)\n", bbar->current, NONULL(bbar->current->text), b, NONULL(b->text)));
D_EVENTS(("Current button %8p (%s) doesn't match event button %8p (%s)\n", bbar->current, NONULL(bbar->current->text),
b, NONULL(b->text)));
bbar_deselect_button(bbar, bbar->current);
} else {
bbar_select_button(bbar, b);
@ -361,7 +368,8 @@ bbar_handle_motion_notify(event_t *ev)
return 0;
}
while (XCheckTypedWindowEvent(Xdisplay, ev->xany.window, MotionNotify, ev));
XQueryPointer(Xdisplay, bbar->win, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->xbutton.x), &(ev->xbutton.y), &mask);
XQueryPointer(Xdisplay, bbar->win, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->xbutton.x),
&(ev->xbutton.y), &mask);
D_BBAR((" -> Pointer is at %d, %d with mask 0x%08x\n", ev->xbutton.x, ev->xbutton.y, mask));
b = find_button_by_coords(bbar, ev->xbutton.x, ev->xbutton.y);
@ -576,7 +584,8 @@ button_calc_size(buttonbar_t *bbar, button_t *button)
D_BBAR((" -> Final icon dimensions are %hux%hu\n", button->icon_w, button->icon_h));
}
#endif
D_BBAR((" -> Set button to %dx%d at %d, %d and icon to %dx%d\n", button->w, button->h, button->x, button->y, button->icon_w, button->icon_h));
D_BBAR((" -> Set button to %dx%d at %d, %d and icon to %dx%d\n", button->w, button->h, button->x, button->y, button->icon_w,
button->icon_h));
}
void
@ -654,7 +663,8 @@ bbar_set_font(buttonbar_t *bbar, const char *fontname)
ASSERT_RVAL(fontname != NULL, 0);
D_BBAR(("bbar_set_font(%8p, \"%s\"): Current font is %8p, dimensions %d/%d/%d\n", bbar, fontname, bbar->font, bbar->fwidth, bbar->fheight, bbar->h));
D_BBAR(("bbar_set_font(%8p, \"%s\"): Current font is %8p, dimensions %d/%d/%d\n", bbar, fontname, bbar->font, bbar->fwidth,
bbar->fheight, bbar->h));
if (bbar->font) {
free_font(bbar->font);
}
@ -674,7 +684,8 @@ bbar_set_font(buttonbar_t *bbar, const char *fontname)
bbar->fheight = font->ascent + font->descent;
XSetFont(Xdisplay, bbar->gc, font->fid);
bbar_reset_total_height();
D_BBAR(("Font is \"%s\" (0x%08x). New dimensions are %d/%d/%d\n", NONULL(fontname), font, bbar->fwidth, bbar->fheight, bbar->h));
D_BBAR(("Font is \"%s\" (0x%08x). New dimensions are %d/%d/%d\n", NONULL(fontname), font, bbar->fwidth, bbar->fheight,
bbar->h));
bbar_calc_height(bbar);
return 1;
@ -803,24 +814,24 @@ button_set_action(button_t *button, action_type_t type, char *action)
button->type = type;
switch (type) {
case ACTION_MENU:
button->action.menu = find_menu_by_title(menu_list, action);
return ((button->action.menu == NULL) ? (0) : (1));
break;
case ACTION_STRING:
case ACTION_ECHO:
button->action.string = (char *) MALLOC(strlen(action) + 2);
strcpy(button->action.string, action);
parse_escaped_string(button->action.string);
return ((button->action.string == NULL) ? (0) : (1));
break;
case ACTION_SCRIPT:
button->action.script = (char *) MALLOC(strlen(action) + 2);
strcpy(button->action.script, action);
return ((button->action.script == NULL) ? (0) : (1));
break;
default:
break;
case ACTION_MENU:
button->action.menu = find_menu_by_title(menu_list, action);
return ((button->action.menu == NULL) ? (0) : (1));
break;
case ACTION_STRING:
case ACTION_ECHO:
button->action.string = (char *) MALLOC(strlen(action) + 2);
strcpy(button->action.string, action);
parse_escaped_string(button->action.string);
return ((button->action.string == NULL) ? (0) : (1));
break;
case ACTION_SCRIPT:
button->action.script = (char *) MALLOC(strlen(action) + 2);
strcpy(button->action.script, action);
return ((button->action.script == NULL) ? (0) : (1));
break;
default:
break;
}
return 0;
}
@ -871,7 +882,8 @@ bbar_click_button(buttonbar_t *bbar, button_t *button)
if (image_mode_is(image_button, MODE_MASK)) {
paste_simage(images[image_button].clicked, image_button, bbar->win, bbar->win, button->x, button->y, button->w, button->h);
} else {
draw_shadow_from_colors(bbar->win, PixColors[menuBottomShadowColor], PixColors[menuTopShadowColor], button->x, button->y, button->w, button->h, 2);
draw_shadow_from_colors(bbar->win, PixColors[menuBottomShadowColor], PixColors[menuTopShadowColor], button->x, button->y,
button->w, button->h, 2);
}
if (image_mode_is(image_button, MODE_AUTO)) {
enl_ipc_sync();
@ -893,99 +905,100 @@ button_check_action(buttonbar_t *bbar, button_t *button, unsigned char press, Ti
REQUIRE(button != NULL);
D_BBAR(("Checking action for button %8p (%s) on buttonbar %8p, press %d, prvs %d, time %lu\n", button, NONULL(button->text), bbar, (int) press, (int) prvs, (unsigned long) t));
D_BBAR(("Checking action for button %8p (%s) on buttonbar %8p, press %d, prvs %d, time %lu\n", button, NONULL(button->text),
bbar, (int) press, (int) prvs, (unsigned long) t));
switch (button->type) {
case ACTION_MENU:
D_BBAR((" -> Menu button found.\n"));
if (press) {
menu_invoke(button->x, button->y + button->h, bbar->win, button->action.menu, t);
}
break;
case ACTION_STRING:
D_BBAR((" -> String button found.\n"));
if (!press) {
size_t len;
len = strlen(button->action.string);
D_BBAR(("Writing \"%s\" to command buffer.\n", safe_print_string(button->action.string, len)));
cmd_write((unsigned char *) button->action.string, strlen(button->action.string));
}
break;
case ACTION_ECHO:
D_BBAR((" -> Echo button found.\n"));
if (!press) {
size_t len;
case ACTION_MENU:
D_BBAR((" -> Menu button found.\n"));
if (press) {
menu_invoke(button->x, button->y + button->h, bbar->win, button->action.menu, t);
}
break;
case ACTION_STRING:
D_BBAR((" -> String button found.\n"));
if (!press) {
size_t len;
len = strlen(button->action.string);
D_BBAR(("Writing \"%s\" to command buffer.\n", safe_print_string(button->action.string, len)));
cmd_write((unsigned char *) button->action.string, strlen(button->action.string));
}
break;
case ACTION_ECHO:
D_BBAR((" -> Echo button found.\n"));
if (!press) {
size_t len;
#ifdef ESCREEN
if (TermWin.screen && TermWin.screen->backend) { /* translate escapes */
button_t *b = bbar->buttons;
_ns_disp *d2 = TermWin.screen->dsps;
int n = (button->action.string)[1] - '0';
if (b && (b->flags & NS_SCREAM_BUTTON)) {
D_ESCREEN(("Looking for active display, n == %d, press == %d, prvs == %d\n", n, (int) press, (int) prvs));
if (prvs != 1) {
/* find active disp */
for (; b && !(b->flags & NS_SCREAM_CURR); b = b->next);
if (b && b != button) {
D_ESCREEN((" -> Found button %8p (%s) for current display.\n", b, NONULL(b->text)));
/* when trying to change name of non- */
/* active display, make that disp active */
button->flags |= NS_SCREAM_CURR;
b->flags &= ~NS_SCREAM_CURR;
bbar_draw(bbar, IMAGE_STATE_CURRENT, MODE_MASK);
button->flags &= ~NS_SCREAM_CURR;
b->flags |= NS_SCREAM_CURR;
for (; d2 && d2->index != n; d2 = d2->next);
if (d2) {
/* pre-adjust curr ptr */
TermWin.screen->curr = d2;
} else {
D_ESCREEN(("no display %d in this session : (\n", n));
}
ns_go2_disp(TermWin.screen, n);
}
if (prvs == 2) {
/* middle button -- kill */
D_ESCREEN((" -> Remove display %d\n", n));
ns_rem_disp(TermWin.screen, n, TRUE);
} else {
/* right button -- rename */
D_ESCREEN((" -> Rename display %d\n", n));
ns_ren_disp(TermWin.screen, n, NULL);
}
} else {
/* left button -- select */
D_ESCREEN((" -> Go to display %d\n", n));
ns_go2_disp(TermWin.screen, n);
}
break;
} else {
D_ESCREEN(("Non-screen button, handling normally.\n"));
}
}
if (TermWin.screen && TermWin.screen->backend) { /* translate escapes */
button_t *b = bbar->buttons;
_ns_disp *d2 = TermWin.screen->dsps;
int n = (button->action.string)[1] - '0';
if (b && (b->flags & NS_SCREAM_BUTTON)) {
D_ESCREEN(("Looking for active display, n == %d, press == %d, prvs == %d\n", n, (int) press, (int) prvs));
if (prvs != 1) {
/* find active disp */
for (; b && !(b->flags & NS_SCREAM_CURR); b = b->next);
if (b && b != button) {
D_ESCREEN((" -> Found button %8p (%s) for current display.\n", b, NONULL(b->text)));
/* when trying to change name of non- */
/* active display, make that disp active */
button->flags |= NS_SCREAM_CURR;
b->flags &= ~NS_SCREAM_CURR;
bbar_draw(bbar, IMAGE_STATE_CURRENT, MODE_MASK);
button->flags &= ~NS_SCREAM_CURR;
b->flags |= NS_SCREAM_CURR;
for (; d2 && d2->index != n; d2 = d2->next);
if (d2) {
/* pre-adjust curr ptr */
TermWin.screen->curr = d2;
} else {
D_ESCREEN(("no display %d in this session : (\n", n));
}
ns_go2_disp(TermWin.screen, n);
}
if (prvs == 2) {
/* middle button -- kill */
D_ESCREEN((" -> Remove display %d\n", n));
ns_rem_disp(TermWin.screen, n, TRUE);
} else {
/* right button -- rename */
D_ESCREEN((" -> Rename display %d\n", n));
ns_ren_disp(TermWin.screen, n, NULL);
}
} else {
/* left button -- select */
D_ESCREEN((" -> Go to display %d\n", n));
ns_go2_disp(TermWin.screen, n);
}
break;
} else {
D_ESCREEN(("Non-screen button, handling normally.\n"));
}
}
#endif
/* not in screen-mode, use normal facilities */
len = strlen(button->action.string);
D_BBAR(("Writing \"%s\" to subprocess.\n", safe_print_string(button->action.string, len)));
tt_write((unsigned char *) button->action.string, len);
}
break;
case ACTION_SCRIPT:
D_BBAR((" -> Script button found.\n"));
if (!press) {
script_parse((char *) button->action.script);
}
break;
default:
D_BBAR((" -> Unknown button type 0x%08x?!\n", button->type));
break;
/* not in screen-mode, use normal facilities */
len = strlen(button->action.string);
D_BBAR(("Writing \"%s\" to subprocess.\n", safe_print_string(button->action.string, len)));
tt_write((unsigned char *) button->action.string, len);
}
break;
case ACTION_SCRIPT:
D_BBAR((" -> Script button found.\n"));
if (!press) {
script_parse((char *) button->action.script);
}
break;
default:
D_BBAR((" -> Unknown button type 0x%08x?!\n", button->type));
break;
}
prvs = press;
}
@ -1092,7 +1105,8 @@ bbar_draw(buttonbar_t *bbar, unsigned char image_state, unsigned char force_mode
XSetForeground(Xdisplay, bbar->gc, images[image_bbar].current->fg);
for (button = bbar->buttons; button; button = button->next) {
if (button->icon) {
paste_simage(button->icon, image_max, bbar->win, bbar->bg, button->icon_x, button->icon_y, button->icon_w, button->icon_h);
paste_simage(button->icon, image_max, bbar->win, bbar->bg, button->icon_x, button->icon_y, button->icon_w,
button->icon_h);
}
if (button->len) {
#ifdef ESCREEN
@ -1124,7 +1138,8 @@ bbar_draw(buttonbar_t *bbar, unsigned char image_state, unsigned char force_mode
}
for (button = bbar->rbuttons; button; button = button->next) {
if (button->icon) {
paste_simage(button->icon, image_max, bbar->win, bbar->bg, button->icon_x, button->icon_y, button->icon_w, button->icon_h);
paste_simage(button->icon, image_max, bbar->win, bbar->bg, button->icon_x, button->icon_y, button->icon_w,
button->icon_h);
}
if (button->len) {
draw_string(bbar, bbar->bg, bbar->gc, button->text_x, button->text_y, button->text, button->len);

@ -201,57 +201,61 @@ privileges(int mode)
#endif
switch (mode) {
case IGNORE:
/* Revoke suid/sgid privs and return to normal uid/gid -- mej */
D_UTMP(("[%ld]: Before privileges(REVERT): [ %ld, %ld ] [ %ld, %ld ]\n", getpid(), getuid(), getgid(), geteuid(), getegid()));
case IGNORE:
/* Revoke suid/sgid privs and return to normal uid/gid -- mej */
D_UTMP(("[%ld]: Before privileges(REVERT): [ %ld, %ld ] [ %ld, %ld ]\n", getpid(), getuid(), getgid(), geteuid(),
getegid()));
#ifdef HAVE_SETRESGID
setresgid(my_rgid, my_rgid, my_egid);
setresgid(my_rgid, my_rgid, my_egid);
#elif defined(HAVE_SAVED_UIDS)
setregid(my_rgid, my_rgid);
setregid(my_rgid, my_rgid);
#else
setregid(my_egid, -1);
setregid(-1, my_rgid);
setregid(my_egid, -1);
setregid(-1, my_rgid);
#endif
#ifdef HAVE_SETRESUID
setresuid(my_ruid, my_ruid, my_euid);
setresuid(my_ruid, my_ruid, my_euid);
#elif defined(HAVE_SAVED_UIDS)
setreuid(my_ruid, my_ruid);
setreuid(my_ruid, my_ruid);
#else
setreuid(my_euid, -1);
setreuid(-1, my_ruid);
setreuid(my_euid, -1);
setreuid(-1, my_ruid);
#endif
D_UTMP(("[%ld]: After privileges(REVERT): [ %ld, %ld ] [ %ld, %ld ]\n", getpid(), getuid(), getgid(), geteuid(), getegid()));
break;
D_UTMP(("[%ld]: After privileges(REVERT): [ %ld, %ld ] [ %ld, %ld ]\n", getpid(), getuid(), getgid(), geteuid(),
getegid()));
break;
case SAVE:
break;
case SAVE:
break;
case RESTORE:
D_UTMP(("[%ld]: Before privileges(INVOKE): [ %ld, %ld ] [ %ld, %ld ]\n", getpid(), getuid(), getgid(), geteuid(), getegid()));
case RESTORE:
D_UTMP(("[%ld]: Before privileges(INVOKE): [ %ld, %ld ] [ %ld, %ld ]\n", getpid(), getuid(), getgid(), geteuid(),
getegid()));
#ifdef HAVE_SETRESUID
setresuid(my_ruid, my_euid, my_euid);
setresuid(my_ruid, my_euid, my_euid);
#elif defined(HAVE_SAVED_UIDS)
setreuid(my_ruid, my_euid);
setreuid(my_ruid, my_euid);
#else
setreuid(-1, my_euid);
setreuid(my_ruid, -1);
setreuid(-1, my_euid);
setreuid(my_ruid, -1);
#endif
#ifdef HAVE_SETRESGID
setresgid(my_rgid, my_egid, my_egid);
setresgid(my_rgid, my_egid, my_egid);
#elif defined(HAVE_SAVED_UIDS)
setregid(my_rgid, my_egid);
setregid(my_rgid, my_egid);
#else
setregid(-1, my_egid);
setregid(my_rgid, -1);
setregid(-1, my_egid);
setregid(my_rgid, -1);
#endif
D_UTMP(("[%ld]: After privileges(INVOKE): [ %ld, %ld ] [ %ld, %ld ]\n", getpid(), getuid(), getgid(), geteuid(), getegid()));
break;
D_UTMP(("[%ld]: After privileges(INVOKE): [ %ld, %ld ] [ %ld, %ld ]\n", getpid(), getuid(), getgid(), geteuid(),
getegid()));
break;
}
}
@ -1172,7 +1176,8 @@ clean_exit(void)
#ifndef __CYGWIN32__
if (ttydev) {
D_CMD(("Restoring \"%s\" to mode %03o, uid %d, gid %d\n", ttydev, ttyfd_stat.st_mode, ttyfd_stat.st_uid, ttyfd_stat.st_gid));
D_CMD(("Restoring \"%s\" to mode %03o, uid %d, gid %d\n", ttydev, ttyfd_stat.st_mode, ttyfd_stat.st_uid,
ttyfd_stat.st_gid));
if (chmod(ttydev, ttyfd_stat.st_mode) != 0) {
D_UTMP(("chmod(\"%s\", %03o) failed: %s\n", ttydev, ttyfd_stat.st_mode, strerror(errno)));
}
@ -1856,14 +1861,18 @@ xim_send_spot(void)
static void
xim_get_area(XRectangle * preedit_rect, XRectangle * status_rect, XRectangle * needed_rect)
{
preedit_rect->x = needed_rect->width + (scrollbar_is_visible() && !(BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR_RIGHT))
preedit_rect->x = needed_rect->width + (scrollbar_is_visible()
&& !(BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR_RIGHT))
? (scrollbar_trough_width()) : (0));
preedit_rect->y = Height2Pixel(TERM_WINDOW_GET_ROWS() - 1);
preedit_rect->width = Width2Pixel(TERM_WINDOW_GET_COLS() + 1) - needed_rect->width + (!(BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR_RIGHT)) ? (scrollbar_trough_width()) : 0);
preedit_rect->width =
Width2Pixel(TERM_WINDOW_GET_COLS() + 1) - needed_rect->width +
(!(BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR_RIGHT)) ? (scrollbar_trough_width()) : 0);
preedit_rect->height = Height2Pixel(1);
status_rect->x = (scrollbar_is_visible() && !(BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR_RIGHT))) ? (scrollbar_trough_width()) : 0;
status_rect->x = (scrollbar_is_visible()
&& !(BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR_RIGHT))) ? (scrollbar_trough_width()) : 0;
status_rect->y = Height2Pixel(TERM_WINDOW_GET_ROWS() - 1);
status_rect->width = needed_rect->width ? needed_rect->width : Width2Pixel(TERM_WINDOW_GET_COLS() + 1);
@ -1922,7 +1931,8 @@ xim_real_init(void)
*(end + 1) = '\0';
if (*s) {
snprintf(buf, sizeof(buf), "@im=%s", s);
if (((p = XSetLocaleModifiers(buf)) != NULL) && (*p) && ((xim_input_method = XOpenIM(Xdisplay, NULL, NULL, NULL)) != NULL)) {
if (((p = XSetLocaleModifiers(buf)) != NULL) && (*p)
&& ((xim_input_method = XOpenIM(Xdisplay, NULL, NULL, NULL)) != NULL)) {
break;
}
}
@ -2011,18 +2021,22 @@ xim_real_init(void)
xim_set_size(&rect);
xim_get_position(&spot);
xim_set_color(&fg, &bg);
preedit_attr = XVaCreateNestedList(0, XNArea, &rect, XNSpotLocation, &spot, XNForeground, fg, XNBackground, bg, XNFontSet, TermWin.fontset, NULL);
preedit_attr =
XVaCreateNestedList(0, XNArea, &rect, XNSpotLocation, &spot, XNForeground, fg, XNBackground, bg, XNFontSet,
TermWin.fontset, NULL);
} else if (xim_input_style & XIMPreeditArea) {
xim_set_color(&fg, &bg);
/* The necessary width of preedit area is unknown until create input context. */
needed_rect.width = 0;
xim_get_area(&rect, &status_rect, &needed_rect);
preedit_attr = XVaCreateNestedList(0, XNArea, &rect, XNForeground, fg, XNBackground, bg, XNFontSet, TermWin.fontset, NULL);
status_attr = XVaCreateNestedList(0, XNArea, &status_rect, XNForeground, fg, XNBackground, bg, XNFontSet, TermWin.fontset, NULL);
status_attr =
XVaCreateNestedList(0, XNArea, &status_rect, XNForeground, fg, XNBackground, bg, XNFontSet, TermWin.fontset, NULL);
}
xim_input_context =
XCreateIC(xim_input_method, XNInputStyle, xim_input_style, XNClientWindow, TermWin.parent, XNFocusWindow, TermWin.parent,
preedit_attr ? XNPreeditAttributes : NULL, preedit_attr, status_attr ? XNStatusAttributes : NULL, status_attr, NULL);
preedit_attr ? XNPreeditAttributes : NULL, preedit_attr, status_attr ? XNStatusAttributes : NULL, status_attr,
NULL);
if (preedit_attr) {
XFree(preedit_attr);
}
@ -2126,7 +2140,8 @@ run_command(char **argv)
/* store original tty status for restoration clean_exit() -- rgg 04/12/95 */
lstat(ttydev, &ttyfd_stat);
D_CMD(("Original settings of %s are mode %o, uid %d, gid %d\n", ttydev, ttyfd_stat.st_mode, ttyfd_stat.st_uid, ttyfd_stat.st_gid));
D_CMD(("Original settings of %s are mode %o, uid %d, gid %d\n", ttydev, ttyfd_stat.st_mode, ttyfd_stat.st_uid,
ttyfd_stat.st_gid));
/* install exit handler for cleanup */
#ifdef HAVE_ATEXIT
@ -2572,12 +2587,12 @@ static int
input_dialog(void *xd, char *prompt, int maxlen, char **retstr, int (*inp_tab) (void *, char *, size_t, size_t))
{
switch (menu_dialog(xd, prompt, maxlen, retstr, inp_tab)) {
case 0:
return NS_SUCC;
case -2:
return NS_USER_CXL;
default:
return NS_FAIL;
case 0:
return NS_SUCC;
case -2:
return NS_USER_CXL;
default:
return NS_FAIL;
}
}
@ -2702,45 +2717,45 @@ matrix(int n)
r = screen.rend[ys + y];
switch (w) {
case 0: /* restart */
if (s[x]) {
r[x] = MATRIX_LO;
s[x] = 0;
t = screen.text[ys];
r = screen.rend[ys];
}
r[x] = MATRIX_HI;
t[x] = random() & 0xff;
s[x]++;
/* fall-through */
case 1: /* continue */
case 2:
case 3:
for (f = random() & 7; f != 0; f--) {
if (y < TERM_WINDOW_GET_ROWS() - 1) {
t2 = screen.text[ys + y + 1];
r2 = screen.rend[ys + y + 1];
t2[x] = t[x];
r2[x] = r[x];
s[x]++;
y++;
} else {
s[x] = 0;
f = 0;
}
r[x] = MATRIX_LO;
t[x] = random() & 0xff;
if (f) {
scr_refresh(FAST_REFRESH);
t = screen.text[ys + y];
r = screen.rend[ys + y];
}
}
break;
default:
t[x] = random() & 0xff; /* hold */
case 0: /* restart */
if (s[x]) {
r[x] = MATRIX_LO;
s[x] = 0;
t = screen.text[ys];
r = screen.rend[ys];
}
r[x] = MATRIX_HI;
t[x] = random() & 0xff;
s[x]++;
/* fall-through */
case 1: /* continue */
case 2:
case 3:
for (f = random() & 7; f != 0; f--) {
if (y < TERM_WINDOW_GET_ROWS() - 1) {
t2 = screen.text[ys + y + 1];
r2 = screen.rend[ys + y + 1];
t2[x] = t[x];
r2[x] = r[x];
s[x]++;
y++;
} else {
s[x] = 0;
f = 0;
}
r[x] = MATRIX_LO;
t[x] = random() & 0xff;
if (f) {
scr_refresh(FAST_REFRESH);
t = screen.text[ys + y];
r = screen.rend[ys + y];
}
}
break;
default:
t[x] = random() & 0xff; /* hold */
}
}
}
@ -2825,6 +2840,7 @@ make_escreen_menu(buttonbar_t *bbar)
{
static int been_here = 0;
button_t *button;
#if 0
menu_t *m;
menuitem_t *i;
@ -3040,8 +3056,7 @@ tt_winsize(int fd)
ws.ws_xpixel = (unsigned short) TERM_WINDOW_GET_WIDTH();
ws.ws_ypixel = (unsigned short) TERM_WINDOW_GET_HEIGHT();
#endif
D_CMD(("Sending TIOCSWINSZ to fd %d: %hdx%hd (%hdx%hd)\n",
fd, ws.ws_row, ws.ws_col, ws.ws_xpixel, ws.ws_ypixel));
D_CMD(("Sending TIOCSWINSZ to fd %d: %hdx%hd (%hdx%hd)\n", fd, ws.ws_row, ws.ws_col, ws.ws_xpixel, ws.ws_ypixel));
ioctl(fd, TIOCSWINSZ, &ws);
}
@ -3117,7 +3132,8 @@ check_pixmap_change(int sig)
SIG_RETURN(0);
}
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));
if (now >= last_update + rs_anim_delay || 1) {
D_PIXMAP(("Time to update pixmap. now == %lu\n", now));
imlib_context_set_image(images[image_bg].current->iml->im);
@ -3177,42 +3193,43 @@ cmd_getc(void)
#ifdef ESCREEN
if (TermWin.screen) {
switch (TermWin.screen->backend) {
case NS_MODE_NONE:
break;
case NS_MODE_NEGOTIATE:
case NS_MODE_NONE:
break;
case NS_MODE_NEGOTIATE:
# ifdef NS_HAVE_SCREEN
case NS_MODE_SCREEN:
parse_screen_status_if_necessary();
break;
case NS_MODE_SCREEN:
parse_screen_status_if_necessary();
break;
# endif
# ifdef NS_HAVE_SCREAM
case NS_MODE_SCREAM:
break;
case NS_MODE_SCREAM:
break;
# endif
# ifdef NS_HAVE_TWIN
case NS_MODE_TWIN:
if (!TermWin.screen->twin) {
if (!TermWin.screen->timestamp) {
TermWin.screen->timestamp = time(NULL);
} else if (TermWin.screen->timestamp < time(NULL)) {
if (!Tw_CheckMagic(libscream_magic)) {
D_ESCREEN(("ns_attach_by_sess: Tw_CheckMagic failed\n"));
TermWin.screen->backend = TermWin.screen_mode = NS_MODE_NONE;
} else {
if (!(TermWin.screen->twin = Tw_Open(TermWin.screen->twin_str))) {
ns_desc_twin(TermWin.screen, "cmd_getc->Tw_Open");
TermWin.screen->backend = TermWin.screen_mode = NS_MODE_NONE;
} else {
D_ESCREEN(("ns_attach_by_sess: Tw_Open(%s) succeeded: handle @ %p\n", TermWin.screen->twin_str, TermWin.screen->twin));
}
}
}
}
break;
case NS_MODE_TWIN:
if (!TermWin.screen->twin) {
if (!TermWin.screen->timestamp) {
TermWin.screen->timestamp = time(NULL);
} else if (TermWin.screen->timestamp < time(NULL)) {
if (!Tw_CheckMagic(libscream_magic)) {
D_ESCREEN(("ns_attach_by_sess: Tw_CheckMagic failed\n"));
TermWin.screen->backend = TermWin.screen_mode = NS_MODE_NONE;
} else {
if (!(TermWin.screen->twin = Tw_Open(TermWin.screen->twin_str))) {
ns_desc_twin(TermWin.screen, "cmd_getc->Tw_Open");
TermWin.screen->backend = TermWin.screen_mode = NS_MODE_NONE;
} else {
D_ESCREEN(("ns_attach_by_sess: Tw_Open(%s) succeeded: handle @ %p\n", TermWin.screen->twin_str,
TermWin.screen->twin));
}
}
}
}
break;
# endif
default:
D_ESCREEN(("mode %d not supported...\n", TermWin.screen->backend));
TermWin.screen->backend = TermWin.screen_mode = NS_MODE_NONE;
default:
D_ESCREEN(("mode %d not supported...\n", TermWin.screen->backend));
TermWin.screen->backend = TermWin.screen_mode = NS_MODE_NONE;
}
}
#endif
@ -3521,7 +3538,7 @@ main_loop(void)
set_multichar_encoding("utf8");
}
handle = iconv_open("WCHAR_T", "UTF-8");
if (handle == SPIF_CAST_C(iconv_t) -1) {
if (handle == SPIF_CAST_C(iconv_t) - 1) {
print_error("Unable to decode UTF-8 locale %s to WCHAR_T. Defaulting to portable C locale.\n",
setlocale(LC_ALL, ""));
setlocale(LC_ALL, "C");
@ -3536,24 +3553,26 @@ main_loop(void)
bufflen = cmdbuf_ptr - str;
outlen = bufflen * 6;
poutbuff = outbuff = SPIF_CAST_C(char *) MALLOC(outlen);
errno = 0;
D_VT(("Allocated output buffer of %lu chars at %010p against input buffer of %lu\n", bufflen * 6, outbuff, bufflen));
D_VT(("Allocated output buffer of %lu chars at %010p against input buffer of %lu\n", bufflen * 6, outbuff,
bufflen));
print_warning("Moo: %s\n", safe_print_string(str, bufflen));
retval = iconv(handle, &pinbuff, &bufflen, &poutbuff, &outlen);
outlen = (size_t) (poutbuff - outbuff);
if (retval != (size_t) -1) {
if (retval != (size_t) - 1) {
errno = 0;
}
if (errno == E2BIG) {
print_error("My UTF-8 decode buffer was too small by %lu bytes?!\n", bufflen);
} else if (errno == EILSEQ) {
print_error("Illegal multibyte sequence encountered at \'%c\' (0x%02x); skipping.\n",
*pinbuff, *pinbuff);
print_error("Illegal multibyte sequence encountered at \'%c\' (0x%02x); skipping.\n", *pinbuff, *pinbuff);
*pinbuff = ' ';
pinbuff++;
} else if (errno == EINVAL) {
D_VT(("Incomplete multibyte sequence encountered.\n"));
print_warning("Converted %lu input chars to %lu output chars before incomplete sequence.\n", (cmdbuf_ptr - str), outlen);
print_warning("Converted %lu input chars to %lu output chars before incomplete sequence.\n",
(cmdbuf_ptr - str), outlen);
} else {
print_warning("Converted %lu input chars to %lu output chars.\n", (cmdbuf_ptr - str), outlen);
}
@ -3565,19 +3584,22 @@ main_loop(void)
outlen = wcsrtombs(NULL, &wcbuff, 0, &mbs) + 1;
if (outlen > 0) {
outbuff = SPIF_CAST_C(char *) MALLOC(outlen);
outlen = wcsrtombs(outbuff, &wcbuff, outlen, &mbs);
if ((long)outlen >= 0) {
if ((long) outlen >= 0) {
FREE(wcbuff);
print_error("I win!\n");
} else {
print_error("wcsrtombs() returned %ld (errno is %d (%s))\n", (unsigned long) outlen, errno, strerror(errno));
print_error("wcsrtombs() returned %ld (errno is %d (%s))\n", (unsigned long) outlen, errno,
strerror(errno));
}
if (pinbuff > (char *) str) {
cmdbuf_ptr = (unsigned char *) pinbuff;
scr_add_lines(outbuff, nlines, outlen);
}
} else {
print_error("wcsrtombs(NULL, %10p, 0) returned %ld (errno is %d (%s))\n", wcbuff, (unsigned long) outlen, errno, strerror(errno));
print_error("wcsrtombs(NULL, %10p, 0) returned %ld (errno is %d (%s))\n", wcbuff, (unsigned long) outlen,
errno, strerror(errno));
}
FREE(outbuff);
}
@ -3587,32 +3609,32 @@ main_loop(void)
} else {
switch (ch) {
# ifdef NO_ENQ_ANS
case 005:
break;
case 005:
break;
# else
case 005: /* ^E (ENQ) terminal status enquiry */
tt_printf(VT100_ANS);
break;
case 005: /* ^E (ENQ) terminal status enquiry */
tt_printf(VT100_ANS);
break;
# endif
case 007: /* ^G (BEL) */
scr_bell();
break;
case '\b':
scr_backspace();
break;
case 013: /* ^K (VT) */
case 014: /* ^L (FF) */
scr_index(UP);
break;
case 016: /* ^N (SO) shift out (enter ACS mode) */
scr_charset_choose(1);
break;
case 017: /* ^O (SI) shift in (leave ACS mode) */
scr_charset_choose(0);
break;
case 033:
process_escape_seq();
break;
case 007: /* ^G (BEL) */
scr_bell();
break;
case '\b':
scr_backspace();
break;
case 013: /* ^K (VT) */
case 014: /* ^L (FF) */
scr_index(UP);
break;
case 016: /* ^N (SO) shift out (enter ACS mode) */
scr_charset_choose(1);
break;
case 017: /* ^O (SI) shift in (leave ACS mode) */
scr_charset_choose(0);
break;
case 033:
process_escape_seq();
break;
}
}
} while (ch != EOF);

@ -71,36 +71,36 @@ draw_arrow(Drawable d, GC gc_top, GC gc_bottom, int x, int y, int w, int shadow,
BOUND(shadow, 1, 2);
switch (type) {
case DRAW_ARROW_UP:
for (; shadow > 0; shadow--, x++, y++, w--) {
XDrawLine(Xdisplay, d, gc_top, x, y + w, x + w / 2, y);
XDrawLine(Xdisplay, d, gc_bottom, x + w, y + w, x + w / 2, y);
XDrawLine(Xdisplay, d, gc_bottom, x + w, y + w, x, y + w);
}
break;
case DRAW_ARROW_DOWN:
for (; shadow > 0; shadow--, x++, y++, w--) {
XDrawLine(Xdisplay, d, gc_top, x, y, x + w / 2, y + w);
XDrawLine(Xdisplay, d, gc_top, x, y, x + w, y);
XDrawLine(Xdisplay, d, gc_bottom, x + w, y, x + w / 2, y + w);
}
break;
case DRAW_ARROW_LEFT:
for (; shadow > 0; shadow--, x++, y++, w--) {
XDrawLine(Xdisplay, d, gc_bottom, x + w, y + w, x + w, y);
XDrawLine(Xdisplay, d, gc_bottom, x + w, y + w, x, y + w / 2);
XDrawLine(Xdisplay, d, gc_top, x, y + w / 2, x + w, y);
}
break;
case DRAW_ARROW_RIGHT:
for (; shadow > 0; shadow--, x++, y++, w--) {
XDrawLine(Xdisplay, d, gc_top, x, y, x, y + w);
XDrawLine(Xdisplay, d, gc_top, x, y, x + w, y + w / 2);
XDrawLine(Xdisplay, d, gc_bottom, x, y + w, x + w, y + w / 2);
}
break;
default:
break;
case DRAW_ARROW_UP:
for (; shadow > 0; shadow--, x++, y++, w--) {
XDrawLine(Xdisplay, d, gc_top, x, y + w, x + w / 2, y);
XDrawLine(Xdisplay, d, gc_bottom, x + w, y + w, x + w / 2, y);
XDrawLine(Xdisplay, d, gc_bottom, x + w, y + w, x, y + w);
}
break;
case DRAW_ARROW_DOWN:
for (; shadow > 0; shadow--, x++, y++, w--) {
XDrawLine(Xdisplay, d, gc_top, x, y, x + w / 2, y + w);
XDrawLine(Xdisplay, d, gc_top, x, y, x + w, y);
XDrawLine(Xdisplay, d, gc_bottom, x + w, y, x + w / 2, y + w);
}
break;
case DRAW_ARROW_LEFT:
for (; shadow > 0; shadow--, x++, y++, w--) {
XDrawLine(Xdisplay, d, gc_bottom, x + w, y + w, x + w, y);
XDrawLine(Xdisplay, d, gc_bottom, x + w, y + w, x, y + w / 2);
XDrawLine(Xdisplay, d, gc_top, x, y + w / 2, x + w, y);
}
break;
case DRAW_ARROW_RIGHT:
for (; shadow > 0; shadow--, x++, y++, w--) {
XDrawLine(Xdisplay, d, gc_top, x, y, x, y + w);
XDrawLine(Xdisplay, d, gc_top, x, y, x + w, y + w / 2);
XDrawLine(Xdisplay, d, gc_bottom, x, y + w, x + w, y + w / 2);
}
break;
default:
break;
}
}
@ -173,27 +173,27 @@ bevel_pixmap(Pixmap p, int w, int h, Imlib_Border * bord, unsigned char up)
}
/* Determine bitshift and bitmask values */
switch (real_depth) {
case 15:
br = 7;
bg = 2;
bb = 3;
mr = mg = mb = 0xf8;
break;
case 16:
br = 8;
bg = bb = 3;
mr = mb = 0xf8;
mg = 0xfc;
break;
case 24:
case 32:
br = 16;
bg = 8;
bb = 0;
mr = mg = mb = 0xff;
break;
default:
return;
case 15:
br = 7;
bg = 2;
bb = 3;
mr = mg = mb = 0xf8;
break;
case 16:
br = 8;
bg = bb = 3;
mr = mb = 0xf8;
mg = 0xfc;
break;
case 24:
case 32:
br = 16;
bg = 8;
bb = 0;
mr = mg = mb = 0xff;
break;
default:
return;
}
/* Left edge */

@ -85,13 +85,15 @@ enl_ipc_get_win(void)
XFree(str);
}
if (ipc_win != None) {
if (!XGetGeometry(Xdisplay, ipc_win, &dummy_win, &dummy_int, &dummy_int, &dummy_uint, &dummy_uint, &dummy_uint, &dummy_uint)) {
if (!XGetGeometry
(Xdisplay, ipc_win, &dummy_win, &dummy_int, &dummy_int, &dummy_uint, &dummy_uint, &dummy_uint, &dummy_uint)) {
D_ENL((" -> IPC Window property is valid, but the window doesn't exist. I give up!\n"));
ipc_win = None;
}
str = NULL;
if (ipc_win != None) {
XGetWindowProperty(Xdisplay, ipc_win, props[PROP_ENL_COMMS], 0, 14, False, AnyPropertyType, &prop, &format, &num, &after, &str);
XGetWindowProperty(Xdisplay, ipc_win, props[PROP_ENL_COMMS], 0, 14, False, AnyPropertyType, &prop, &format, &num,
&after, &str);
if (str) {
XFree(str);
} else {

<
@ -73,7 +73,8 @@ event_register_dispatcher(event_dispatcher_t func, event_dispatcher_init_t init)
/* Add a secondary event dispatcher */
event_master.num_dispatchers++;
event_master.dispatchers = (event_dispatcher_t *) REALLOC(event_master.dispatchers, sizeof(event_dispatcher_t) * event_master.num_dispatchers);
event_master.dispatchers =
(event_dispatcher_t *) REALLOC(event_master.dispatchers, sizeof(event_dispatcher_t) * event_master.num_dispatchers);
event_master.dispatchers[event_master.num_dispatchers - 1] = (event_dispatcher_t) func;
(init) (); /* Initialize the dispatcher's data */