Mon Feb 13 14:51:56 2006 Michael Jennings (mej)
Update to libast 0.6+ API. ---------------------------------------------------------------------- SVN revision: 20440
This commit is contained in:
parent
fccdc9bb52
commit
7537403997
|
@ -5472,3 +5472,7 @@ DragonFly BSD fixes from Joerg Sonnenberger <joerg@britannica.bec.de>.
|
|||
|
||||
Also some type mismatch fixes.
|
||||
----------------------------------------------------------------------
|
||||
Mon Feb 13 14:51:56 2006 Michael Jennings (mej)
|
||||
|
||||
Update to libast 0.6+ API.
|
||||
----------------------------------------------------------------------
|
||||
|
|
|
@ -1011,7 +1011,7 @@ dump_stack_trace(void)
|
|||
return;
|
||||
#endif
|
||||
|
||||
print_error("Attempting to dump a stack trace....\n");
|
||||
libast_print_error("Attempting to dump a stack trace....\n");
|
||||
signal(SIGTSTP, exit); /* Don't block on tty output, just die */
|
||||
|
||||
#ifdef HAVE_U_STACK_TRACE
|
||||
|
@ -1033,7 +1033,7 @@ dump_stack_trace(void)
|
|||
snprintf(cmd, sizeof(cmd), "/bin/echo 'where\ndetach' | " DBX " %s %d", orig_argv0, getpid());
|
||||
# endif
|
||||
#else
|
||||
print_error("Your system does not support any of the methods Eterm uses. Exiting.\n");
|
||||
libast_print_error("Your system does not support any of the methods Eterm uses. Exiting.\n");
|
||||
return;
|
||||
#endif
|
||||
signal(SIGALRM, (eterm_sighandler_t) hard_exit);
|
||||
|
@ -1086,7 +1086,7 @@ static RETSIGTYPE
|
|||
handle_exit_signal(int sig)
|
||||
{
|
||||
|
||||
print_error("Received terminal signal %s (%d)\n", sig_to_str(sig), sig);
|
||||
libast_print_error("Received terminal signal %s (%d)\n", sig_to_str(sig), sig);
|
||||
signal(sig, SIG_DFL);
|
||||
|
||||
#ifdef UTMP_SUPPORT
|
||||
|
@ -1105,7 +1105,7 @@ static RETSIGTYPE
|
|||
handle_crash(int sig)
|
||||
{
|
||||
|
||||
print_error("Received terminal signal %s (%d)\n", sig_to_str(sig), sig);
|
||||
libast_print_error("Received terminal signal %s (%d)\n", sig_to_str(sig), sig);
|
||||
signal(sig, SIG_DFL); /* Let the OS handle recursive seg faults */
|
||||
|
||||
/* Lock down security so we don't write any core files as root. */
|
||||
|
@ -1279,7 +1279,7 @@ clean_exit(void)
|
|||
FREE(rs_color[i]);
|
||||
}
|
||||
}
|
||||
conf_free_subsystem();
|
||||
spifconf_free_subsystem();
|
||||
# ifdef USE_XIM
|
||||
if (xim_input_context) {
|
||||
XUnsetICFocus(xim_input_context);
|
||||
|
@ -1413,15 +1413,15 @@ svr_get_pty(void)
|
|||
return (-1);
|
||||
} else {
|
||||
if (grantpt(fd) != 0) {
|
||||
print_error("grantpt(%d) failed: %s\n", fd, strerror(errno));
|
||||
libast_print_error("grantpt(%d) failed: %s\n", fd, strerror(errno));
|
||||
return (-1);
|
||||
} else if (unlockpt(fd) != 0) {
|
||||
print_error("unlockpt(%d) failed: %s\n", fd, strerror(errno));
|
||||
libast_print_error("unlockpt(%d) failed: %s\n", fd, strerror(errno));
|
||||
return (-1);
|
||||
} else {
|
||||
ptydev = ttydev = ptsname(fd);
|
||||
if (ttydev == NULL) {
|
||||
print_error("ptsname(%d) failed: %s\n", fd, strerror(errno));
|
||||
libast_print_error("ptsname(%d) failed: %s\n", fd, strerror(errno));
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
@ -1486,7 +1486,7 @@ get_pty(void)
|
|||
fcntl(fd, F_SETFL, O_NDELAY);
|
||||
return (fd);
|
||||
} else {
|
||||
print_error("Can't open pseudo-tty -- %s\n", strerror(errno));
|
||||
libast_print_error("Can't open pseudo-tty -- %s\n", strerror(errno));
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
@ -1519,10 +1519,10 @@ get_tty(void)
|
|||
|
||||
privileges(INVOKE);
|
||||
if (ttydev == NULL) {
|
||||
print_error("Slave tty device name is NULL. Failed to open slave pty.\n");
|
||||
libast_print_error("Slave tty device name is NULL. Failed to open slave pty.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
} else if ((fd = open(ttydev, O_RDWR)) < 0) {
|
||||
print_error("Can't open slave tty %s -- %s\n", ttydev, strerror(errno));
|
||||
libast_print_error("Can't open slave tty %s -- %s\n", ttydev, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
} else {
|
||||
D_TTY(("Opened slave tty %s\n", ttydev));
|
||||
|
@ -1917,7 +1917,7 @@ init_locale(void)
|
|||
XSetLocaleModifiers("");
|
||||
TermWin.fontset = (XFontSet) 0;
|
||||
if ((locale == NULL) || (!XSupportsLocale())) {
|
||||
print_warning("Locale not supported; defaulting to portable \"C\" locale.\n");
|
||||
libast_print_warning("Locale not supported; defaulting to portable \"C\" locale.\n");
|
||||
locale = setlocale(LC_ALL, "C");
|
||||
XSetLocaleModifiers("");
|
||||
REQUIRE(locale);
|
||||
|
@ -2088,13 +2088,13 @@ xim_real_init(void)
|
|||
destroy_cb.callback = xim_destroy_cb;
|
||||
destroy_cb.client_data = NULL;
|
||||
if (XSetIMValues(xim_input_method, XNDestroyCallback, &destroy_cb, NULL)) {
|
||||
print_error("Could not set destroy callback to IM\n");
|
||||
libast_print_error("Could not set destroy callback to IM\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((XGetIMValues(xim_input_method, XNQueryInputStyle, &xim_styles, NULL)) || (!xim_styles)) {
|
||||
print_error("input method doesn't support any style\n");
|
||||
libast_print_error("input method doesn't support any style\n");
|
||||
XCloseIM(xim_input_method);
|
||||
return -1;
|
||||
}
|
||||
|
@ -2128,14 +2128,14 @@ xim_real_init(void)
|
|||
XFree(xim_styles);
|
||||
|
||||
if (found == 0) {
|
||||
print_error("input method doesn't support my preedit type\n");
|
||||
libast_print_error("input method doesn't support my preedit type\n");
|
||||
XCloseIM(xim_input_method);
|
||||
return -1;
|
||||
}
|
||||
if ((xim_input_style != (XIMPreeditNothing | XIMStatusNothing))
|
||||
&& (xim_input_style != (XIMPreeditArea | XIMStatusArea))
|
||||
&& (xim_input_style != (XIMPreeditPosition | XIMStatusNothing))) {
|
||||
print_error("This program does not support the preedit type\n");
|
||||
libast_print_error("This program does not support the preedit type\n");
|
||||
XCloseIM(xim_input_method);
|
||||
return -1;
|
||||
}
|
||||
|
@ -2166,7 +2166,7 @@ xim_real_init(void)
|
|||
XFree(status_attr);
|
||||
}
|
||||
if (xim_input_context == NULL) {
|
||||
print_error("Failed to create input context\n");
|
||||
libast_print_error("Failed to create input context\n");
|
||||
XCloseIM(xim_input_method);
|
||||
return -1;
|
||||
}
|
||||
|
@ -2272,7 +2272,7 @@ run_command(char **argv)
|
|||
# if defined (__sun__)
|
||||
on_exit(clean_exit, NULL); /* non-ANSI exit handler */
|
||||
# else
|
||||
print_error("no atexit(), UTMP entries can't be cleaned\n");
|
||||
libast_print_error("no atexit(), UTMP entries can't be cleaned\n");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
@ -2300,7 +2300,7 @@ run_command(char **argv)
|
|||
cmd_pid = fork();
|
||||
D_CMD(("After fork(), cmd_pid == %d\n", cmd_pid));
|
||||
if (cmd_pid < 0) {
|
||||
print_error("fork(): %s\n", strerror(errno));
|
||||
libast_print_error("fork(): %s\n", strerror(errno));
|
||||
return (-1);
|
||||
}
|
||||
if (cmd_pid == 0) {
|
||||
|
@ -2377,7 +2377,7 @@ run_command(char **argv)
|
|||
#endif
|
||||
D_CMD(("[%d] About to spawn shell\n", getpid()));
|
||||
if (chdir(initial_dir)) {
|
||||
print_warning("Unable to chdir to \"%s\" -- %s\n", initial_dir, strerror(errno));
|
||||
libast_print_warning("Unable to chdir to \"%s\" -- %s\n", initial_dir, strerror(errno));
|
||||
}
|
||||
if (argv != NULL) {
|
||||
#if DEBUG >= DEBUG_CMD
|
||||
|
@ -2391,7 +2391,7 @@ run_command(char **argv)
|
|||
#endif
|
||||
D_CMD(("[%d] execvp(\"%s\", %8p) is next. I'm outta here!\n", getpid(), NONULL(argv[0]), argv));
|
||||
execvp(argv[0], argv);
|
||||
print_error("execvp() failed, cannot execute \"%s\": %s\n", argv[0], strerror(errno));
|
||||
libast_print_error("execvp() failed, cannot execute \"%s\": %s\n", argv[0], strerror(errno));
|
||||
} else {
|
||||
|
||||
const char *argv0, *shell;
|
||||
|
@ -2408,7 +2408,7 @@ run_command(char **argv)
|
|||
argv0 = p;
|
||||
}
|
||||
execlp(shell, argv0, NULL);
|
||||
print_error("execlp() failed, cannot execute \"%s\": %s\n", shell, strerror(errno));
|
||||
libast_print_error("execlp() failed, cannot execute \"%s\": %s\n", shell, strerror(errno));
|
||||
}
|
||||
sleep(3); /* Sleep to make sure fork() returns in the parent, and so user can read error message */
|
||||
exit(EXIT_FAILURE);
|
||||
|
@ -3151,7 +3151,7 @@ init_command(char **argv)
|
|||
AT_LEAST(num_fds, ((unsigned int) (pipe_fd + 1)));
|
||||
}
|
||||
if ((cmd_fd = command_func(argv)) < 0) {
|
||||
print_error("Unable to run sub-command.\n");
|
||||
libast_print_error("Unable to run sub-command.\n");
|
||||
paused = 1;
|
||||
rs_finished_text = "Hit a key to exit...";
|
||||
}
|
||||
|
@ -3438,12 +3438,12 @@ cmd_getc(void)
|
|||
if (retval < 0) {
|
||||
if (cmd_fd >= 0 && FD_ISSET(cmd_fd, &readfds)) {
|
||||
if (errno != EINTR) { /* may have rcvd SIGCHLD or so */
|
||||
print_error(" (%ld) Error reading from tty -- %s\n", getpid(), strerror(errno));
|
||||
libast_print_error(" (%ld) Error reading from tty -- %s\n", getpid(), strerror(errno));
|
||||
cmd_fd = -1;
|
||||
}
|
||||
}
|
||||
if (pipe_fd >= 0 && FD_ISSET(pipe_fd, &readfds)) {
|
||||
print_error("Error reading from pipe -- %s\n", strerror(errno));
|
||||
libast_print_error("Error reading from pipe -- %s\n", strerror(errno));
|
||||
pipe_fd = -1;
|
||||
}
|
||||
if (pipe_fd < 0 && cmd_fd < 0 && !paused) {
|
||||
|
@ -3661,7 +3661,7 @@ main_loop(void)
|
|||
}
|
||||
handle = iconv_open("WCHAR_T", "UTF-8");
|
||||
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",
|
||||
libast_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");
|
||||
scr_add_lines(str, nlines, (cmdbuf_ptr - str));
|
||||
|
@ -3679,27 +3679,27 @@ main_loop(void)
|
|||
errno = 0;
|
||||
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));
|
||||
libast_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) {
|
||||
errno = 0;
|
||||
}
|
||||
if (errno == E2BIG) {
|
||||
print_error("My UTF-8 decode buffer was too small by %lu bytes?!\n", bufflen);
|
||||
libast_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);
|
||||
libast_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",
|
||||
libast_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);
|
||||
libast_print_warning("Converted %lu input chars to %lu output chars.\n", (cmdbuf_ptr - str), outlen);
|
||||
}
|
||||
|
||||
print_warning("Moo2: %s\n", safe_print_string(outbuff, outlen));
|
||||
libast_print_warning("Moo2: %s\n", safe_print_string(outbuff, outlen));
|
||||
MEMSET(outbuff + outlen, 0, sizeof(wchar_t));
|
||||
wcbuff = SPIF_CAST_C(wchar_t *) outbuff;
|
||||
MEMSET(&mbs, 0, sizeof(mbstate_t));
|
||||
|
@ -3710,9 +3710,9 @@ main_loop(void)
|
|||
outlen = wcsrtombs(outbuff, &wcbuff, outlen, &mbs);
|
||||
if ((long) outlen >= 0) {
|
||||
FREE(wcbuff);
|
||||
print_error("I win!\n");
|
||||
libast_print_error("I win!\n");
|
||||
} else {
|
||||
print_error("wcsrtombs() returned %ld (errno is %d (%s))\n", (unsigned long) outlen, errno,
|
||||
libast_print_error("wcsrtombs() returned %ld (errno is %d (%s))\n", (unsigned long) outlen, errno,
|
||||
strerror(errno));
|
||||
}
|
||||
if (pinbuff > (char *) str) {
|
||||
|
@ -3720,7 +3720,7 @@ main_loop(void)
|
|||
scr_add_lines(outbuff, nlines, outlen);
|
||||
}
|
||||
} else {
|
||||
print_error("wcsrtombs(NULL, %10p, 0) returned %ld (errno is %d (%s))\n", wcbuff, (unsigned long) outlen,
|
||||
libast_print_error("wcsrtombs(NULL, %10p, 0) returned %ld (errno is %d (%s))\n", wcbuff, (unsigned long) outlen,
|
||||
errno, strerror(errno));
|
||||
}
|
||||
FREE(outbuff);
|
||||
|
@ -3823,7 +3823,7 @@ v_writeBig(int f, char *d, int len)
|
|||
v_bufend = v_bufptr + len;
|
||||
} else {
|
||||
/* no memory: ignore entire write request */
|
||||
print_error("cannot allocate buffer space\n");
|
||||
libast_print_error("cannot allocate buffer space\n");
|
||||
v_buffer = v_bufstr; /* restore clobbered pointer */
|
||||
c = 0;
|
||||
}
|
||||
|
|
|
@ -874,7 +874,7 @@ xerror_handler(Display * display, XErrorEvent * event)
|
|||
|
||||
strcpy(err_string, "");
|
||||
XGetErrorText(display, event->error_code, err_string, sizeof(err_string));
|
||||
print_error("XError in function %s, resource 0x%08x (request %d.%d): %s (error %d)\n",
|
||||
libast_print_error("XError in function %s, resource 0x%08x (request %d.%d): %s (error %d)\n",
|
||||
request_code_to_name(event->request_code), (int) event->resourceid, event->request_code, event->minor_code,
|
||||
err_string, event->error_code);
|
||||
#if DEBUG > DEBUG_X11
|
||||
|
@ -882,6 +882,6 @@ xerror_handler(Display * display, XErrorEvent * event)
|
|||
dump_stack_trace();
|
||||
}
|
||||
#endif
|
||||
print_error("Attempting to continue...\n");
|
||||
libast_print_error("Attempting to continue...\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -95,7 +95,6 @@
|
|||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
|
||||
# define LIBAST_COMPAT_05_API 1
|
||||
# include <libast.h>
|
||||
# include "eterm_debug.h"
|
||||
|
||||
|
@ -111,8 +110,9 @@
|
|||
/* Disable the secondary screen ("\E[?47h" / "\E[?47l") */
|
||||
/* #define NO_SECONDARY_SCREEN */
|
||||
|
||||
/* The number of screenfuls between refreshes. */
|
||||
# define REFRESH_PERIOD 2
|
||||
/* The number of screenfuls between refreshes. Anything higher than 1
|
||||
* will cause gaps in the scrollback buffer. */
|
||||
# define REFRESH_PERIOD 1
|
||||
|
||||
/* This will force clearing of characters before writing new ones on top of
|
||||
* them. This is experimental - added in order to try and fix pixel dropping
|
||||
|
|
30
src/font.c
30
src/font.c
|
@ -417,9 +417,9 @@ load_font(const char *name, const char *fallback, unsigned char type)
|
|||
/* No match in the cache, so we'll have to add it. */
|
||||
if (type == FONT_TYPE_X) {
|
||||
if ((xfont = XLoadQueryFont(Xdisplay, name)) == NULL) {
|
||||
print_error("Unable to load font \"%s\". Falling back on \"%s\"\n", name, fallback);
|
||||
libast_print_error("Unable to load font \"%s\". Falling back on \"%s\"\n", name, fallback);
|
||||
if ((xfont = XLoadQueryFont(Xdisplay, fallback)) == NULL) {
|
||||
fatal_error("Couldn't load the fallback font either. Giving up.\n");
|
||||
libast_fatal_error("Couldn't load the fallback font either. Giving up.\n");
|
||||
} else {
|
||||
font_cache_add(fallback, type, (void *) xfont);
|
||||
}
|
||||
|
@ -740,7 +740,7 @@ parse_font_fx(char *line)
|
|||
|
||||
ASSERT_RVAL(line != NULL, 0);
|
||||
|
||||
n = num_words(line);
|
||||
n = spiftool_num_words(line);
|
||||
|
||||
if (!BEG_STRCASECMP(line, "none")) {
|
||||
MEMSET(&fshadow, 0, sizeof(fontshadow_t));
|
||||
|
@ -748,7 +748,7 @@ parse_font_fx(char *line)
|
|||
if (n != 2) {
|
||||
return 0;
|
||||
}
|
||||
color = get_word(2, line);
|
||||
color = spiftool_get_word(2, line);
|
||||
p = get_color_by_name(color, "black");
|
||||
FREE(color);
|
||||
for (which = 0; which < 4; which++) {
|
||||
|
@ -757,10 +757,10 @@ parse_font_fx(char *line)
|
|||
} else if (!BEG_STRCASECMP(line, "shadow")) {
|
||||
if (n == 2) {
|
||||
which = SHADOW_BOTTOM_RIGHT;
|
||||
color = get_word(2, line);
|
||||
color = spiftool_get_word(2, line);
|
||||
} else if (n == 3) {
|
||||
color = get_word(3, line);
|
||||
corner = get_pword(2, line);
|
||||
color = spiftool_get_word(3, line);
|
||||
corner = spiftool_get_pword(2, line);
|
||||
which = get_corner(corner);
|
||||
if (which >= 4) {
|
||||
return 0;
|
||||
|
@ -774,12 +774,12 @@ parse_font_fx(char *line)
|
|||
if (n != 3) {
|
||||
return 0;
|
||||
}
|
||||
color = get_word(2, line);
|
||||
color = spiftool_get_word(2, line);
|
||||
p = get_color_by_name(color, "black");
|
||||
set_shadow_color_by_pixel(SHADOW_BOTTOM_RIGHT, p);
|
||||
FREE(color);
|
||||
|
||||
color = get_word(3, line);
|
||||
color = spiftool_get_word(3, line);
|
||||
p = get_color_by_name(color, "white");
|
||||
set_shadow_color_by_pixel(SHADOW_TOP_LEFT, p);
|
||||
FREE(color);
|
||||
|
@ -787,12 +787,12 @@ parse_font_fx(char *line)
|
|||
if (n != 3) {
|
||||
return 0;
|
||||
}
|
||||
color = get_word(2, line);
|
||||
color = spiftool_get_word(2, line);
|
||||
p = get_color_by_name(color, "black");
|
||||
set_shadow_color_by_pixel(SHADOW_TOP_LEFT, p);
|
||||
FREE(color);
|
||||
|
||||
color = get_word(3, line);
|
||||
color = spiftool_get_word(3, line);
|
||||
p = get_color_by_name(color, "white");
|
||||
set_shadow_color_by_pixel(SHADOW_BOTTOM_RIGHT, p);
|
||||
FREE(color);
|
||||
|
@ -803,11 +803,11 @@ parse_font_fx(char *line)
|
|||
which = get_corner(line);
|
||||
if (which >= 4) {
|
||||
which = i;
|
||||
color = get_word(1, line);
|
||||
line = get_pword(2, line);
|
||||
color = spiftool_get_word(1, line);
|
||||
line = spiftool_get_pword(2, line);
|
||||
} else {
|
||||
color = get_word(2, line);
|
||||
line = get_pword(3, line);
|
||||
color = spiftool_get_word(2, line);
|
||||
line = spiftool_get_pword(3, line);
|
||||
}
|
||||
set_shadow_color_by_name(which, color);
|
||||
FREE(color);
|
||||
|
|
|
@ -2013,7 +2013,7 @@ ns_add_region(_ns_sess * s, _ns_disp * d, int after, char *name)
|
|||
#ifdef NS_HAVE_SCREEN
|
||||
case NS_MODE_SCREEN:
|
||||
/* ret = ns_screen_command(s, "\x01S"); */
|
||||
ret = ns_statement(s, "split");
|
||||
ret = ns_statement(s, "spiftool_split");
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
@ -2663,7 +2663,7 @@ ns_inp_tab(void *xd, char *b, size_t l, size_t m)
|
|||
"resize", "screen", "scrollback", "select",
|
||||
"sessionname", "setenv", "setsid", "shell",
|
||||
"shelltitle", "silence", "silencewait", "sleep",
|
||||
"slowpast", "source", "sorendition", "split", "stuff",
|
||||
"slowpast", "source", "sorendition", "spiftool_split", "stuff",
|
||||
"su", "suspend", "term", "termcap", "terminfo",
|
||||
"termcapinfo", "unsetenv", "utf8", "vbell",
|
||||
"vbell_msg", "vbellwait", "verbose", "version",
|
||||
|
|
|
@ -1239,7 +1239,7 @@ menu_action(menuitem_t *item)
|
|||
menu_dialog(NULL, item->action.alert, 0, NULL, NULL);
|
||||
break;
|
||||
default:
|
||||
fatal_error("Internal Program Error: Unknown menuitem type: %u\n", item->type);
|
||||
libast_fatal_error("Internal Program Error: Unknown menuitem type: %u\n", item->type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ str_trim(char *str)
|
|||
|
||||
if (str && *str) {
|
||||
|
||||
chomp(str);
|
||||
spiftool_chomp(str);
|
||||
n = strlen(str);
|
||||
|
||||
if (!n) {
|
||||
|
@ -216,7 +216,7 @@ parse_escaped_string(char *str)
|
|||
#if DEBUG >= DEBUG_STRINGS
|
||||
if (DEBUG_LEVEL >= DEBUG_STRINGS) {
|
||||
D_STRINGS(("New value is:\n"));
|
||||
hex_dump(str, (size_t) (pnew - str));
|
||||
spiftool_hex_dump(str, (size_t) (pnew - str));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
632
src/options.c
632
src/options.c
File diff suppressed because it is too large
Load Diff
|
@ -152,7 +152,7 @@ extern KeySym ks_smallfont;
|
|||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern char *conf_parse_theme(char **theme, char *conf_name, unsigned char fallback);
|
||||
extern char *spifconf_parse_theme(char **theme, char *spifconf_name, unsigned char fallback);
|
||||
extern void init_libast(void);
|
||||
extern void init_defaults(void);
|
||||
extern void post_parse(void);
|
||||
|
|
36
src/pixmap.c
36
src/pixmap.c
|
@ -625,7 +625,7 @@ check_image_ipc(unsigned char reset)
|
|||
snprintf(buff, sizeof(buff), "imageclass %s query", iclass);
|
||||
reply = enl_send_and_wait(buff);
|
||||
if (strstr(reply, "not")) {
|
||||
print_error("ImageClass \"%s\" is not defined in Enlightenment. Disallowing \"auto\" mode for this image.\n", iclass);
|
||||
libast_print_error("ImageClass \"%s\" is not defined in Enlightenment. Disallowing \"auto\" mode for this image.\n", iclass);
|
||||
image_mode_fallback(i);
|
||||
} else if (strstr(reply, "Error")) {
|
||||
/* *INDENT-OFF* */
|
||||
|
@ -642,7 +642,7 @@ check_image_ipc(unsigned char reset)
|
|||
}
|
||||
);
|
||||
/* *INDENT-ON* */
|
||||
print_error("Looks like this version of Enlightenment doesn't support the IPC "
|
||||
libast_print_error("Looks like this version of Enlightenment doesn't support the IPC "
|
||||
"commands I need. Disallowing \"auto\" mode for all images.\n");
|
||||
FREE(reply);
|
||||
checked = 2;
|
||||
|
@ -759,7 +759,7 @@ create_viewport_pixmap(simage_t *simg, Drawable d, int x, int y, unsigned short
|
|||
imlib_render_pixmaps_for_whole_image(&viewport_pixmap, &mask);
|
||||
}
|
||||
if (viewport_pixmap == None) {
|
||||
print_error("Delayed image load failure for \"%s\". Using solid color mode.\n", imlib_image_get_filename());
|
||||
libast_print_error("Delayed image load failure for \"%s\". Using solid color mode.\n", imlib_image_get_filename());
|
||||
image_set_mode(image_bg, MODE_SOLID);
|
||||
reset_simage(simg, RESET_ALL_SIMG);
|
||||
return None;
|
||||
|
@ -834,13 +834,13 @@ paste_simage(simage_t *simg, unsigned char which, Window win, Drawable d, unsign
|
|||
snprintf(buff, sizeof(buff), "imageclass %s apply_copy 0x%x %s %hd %hd", iclass, (int) d, state, w, h);
|
||||
reply = enl_send_and_wait(buff);
|
||||
if (strstr(reply, "Error")) {
|
||||
print_error
|
||||
libast_print_error
|
||||
("Enlightenment didn't seem to like something about my syntax. Disallowing \"auto\" mode for this image.\n");
|
||||
image_mode_fallback(which);
|
||||
FREE(reply);
|
||||
} else {
|
||||
pmap = (Pixmap) strtoul(reply, (char **) NULL, 0);
|
||||
mask = (Pixmap) strtoul(get_pword(2, reply), (char **) NULL, 0);
|
||||
mask = (Pixmap) strtoul(spiftool_get_pword(2, reply), (char **) NULL, 0);
|
||||
FREE(reply);
|
||||
enl_ipc_sync();
|
||||
if (pmap) {
|
||||
|
@ -853,7 +853,7 @@ paste_simage(simage_t *simg, unsigned char which, Window win, Drawable d, unsign
|
|||
LIBAST_X_FREE_GC(gc);
|
||||
return;
|
||||
} else {
|
||||
print_error
|
||||
libast_print_error
|
||||
("Enlightenment returned a null pixmap, which I can't use. Disallowing \"auto\" mode for this image.\n");
|
||||
FREE(reply);
|
||||
image_mode_fallback(which);
|
||||
|
@ -906,7 +906,7 @@ paste_simage(simage_t *simg, unsigned char which, Window win, Drawable d, unsign
|
|||
imlib_render_pixmaps_for_whole_image_at_size(&pmap, &mask, w, h);
|
||||
}
|
||||
if (pmap == None) {
|
||||
print_error("Delayed image load failure for \"%s\".\n", NONULL(imlib_image_get_filename()));
|
||||
libast_print_error("Delayed image load failure for \"%s\".\n", NONULL(imlib_image_get_filename()));
|
||||
reset_simage(simg, RESET_ALL_SIMG);
|
||||
return;
|
||||
}
|
||||
|
@ -1064,7 +1064,7 @@ render_simage(simage_t *simg, Window win, unsigned short width, unsigned short h
|
|||
height);
|
||||
reply = enl_send_and_wait(buff);
|
||||
if (strstr(reply, "Error")) {
|
||||
print_error
|
||||
libast_print_error
|
||||
("Enlightenment didn't seem to like something about my syntax. Disallowing \"auto\" mode for this image.\n");
|
||||
image_mode_fallback(which);
|
||||
FREE(reply);
|
||||
|
@ -1072,7 +1072,7 @@ render_simage(simage_t *simg, Window win, unsigned short width, unsigned short h
|
|||
Pixmap pmap, mask;
|
||||
|
||||
pmap = (Pixmap) strtoul(reply, (char **) NULL, 0);
|
||||
mask = (Pixmap) strtoul(get_pword(2, reply), (char **) NULL, 0);
|
||||
mask = (Pixmap) strtoul(spiftool_get_pword(2, reply), (char **) NULL, 0);
|
||||
FREE(reply);
|
||||
enl_ipc_sync();
|
||||
if (pmap) {
|
||||
|
@ -1094,7 +1094,7 @@ render_simage(simage_t *simg, Window win, unsigned short width, unsigned short h
|
|||
snprintf(buff, sizeof(buff), "imageclass %s free_pixmap 0x%08x", iclass, (int) pmap);
|
||||
enl_ipc_send(buff);
|
||||
} else {
|
||||
print_error
|
||||
libast_print_error
|
||||
("Enlightenment returned a null pixmap, which I can't use. Disallowing \"auto\" mode for this image.\n");
|
||||
FREE(reply);
|
||||
image_mode_fallback(which);
|
||||
|
@ -1274,7 +1274,7 @@ render_simage(simage_t *simg, Window win, unsigned short width, unsigned short h
|
|||
}
|
||||
}
|
||||
} else {
|
||||
print_error("Delayed image load failure for \"%s\". Using solid color mode.\n", imlib_image_get_filename());
|
||||
libast_print_error("Delayed image load failure for \"%s\". Using solid color mode.\n", imlib_image_get_filename());
|
||||
image_set_mode(which, MODE_SOLID);
|
||||
reset_simage(simg, RESET_ALL_SIMG);
|
||||
}
|
||||
|
@ -1453,7 +1453,7 @@ load_image(const char *file, simage_t *simg)
|
|||
if (f != NULL) {
|
||||
im = imlib_load_image_with_error_return(f, &im_err);
|
||||
if (im == NULL) {
|
||||
print_error("Unable to load image file \"%s\" -- %s\n", file, imlib_strerror(im_err));
|
||||
libast_print_error("Unable to load image file \"%s\" -- %s\n", file, imlib_strerror(im_err));
|
||||
return 0;
|
||||
} else {
|
||||
reset_simage(simg, (RESET_IMLIB_IM | RESET_PMAP_PIXMAP | RESET_PMAP_MASK));
|
||||
|
@ -1462,7 +1462,7 @@ load_image(const char *file, simage_t *simg)
|
|||
D_PIXMAP(("Found image %8p.\n", im));
|
||||
return 1;
|
||||
} else {
|
||||
print_error("Unable to locate file \"%s\" in image path.\n");
|
||||
libast_print_error("Unable to locate file \"%s\" in image path.\n");
|
||||
}
|
||||
}
|
||||
reset_simage(simg, RESET_ALL_SIMG);
|
||||
|
@ -1817,7 +1817,7 @@ colormod_trans(Pixmap p, imlib_t *iml, GC gc, unsigned short w, unsigned short h
|
|||
}
|
||||
ximg = XGetImage(Xdisplay, p, 0, 0, w, h, -1, ZPixmap);
|
||||
if (ximg == NULL) {
|
||||
print_warning("XGetImage(Xdisplay, 0x%08x, 0, 0, %d, %d, -1, ZPixmap) returned NULL.\n", p, w, h);
|
||||
libast_print_warning("XGetImage(Xdisplay, 0x%08x, 0, 0, %d, %d, -1, ZPixmap) returned NULL.\n", p, w, h);
|
||||
return;
|
||||
}
|
||||
D_PIXMAP(("XGetImage(Xdisplay, 0x%08x, 0, 0, %d, %d, -1, ZPixmap) returned %8p.\n", p, w, h, ximg));
|
||||
|
@ -1896,7 +1896,7 @@ colormod_trans(Pixmap p, imlib_t *iml, GC gc, unsigned short w, unsigned short h
|
|||
#endif
|
||||
break;
|
||||
default:
|
||||
print_warning("Bit depth of %d is unsupported for tinting/shading.\n", real_depth);
|
||||
libast_print_warning("Bit depth of %d is unsupported for tinting/shading.\n", real_depth);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1921,7 +1921,7 @@ update_desktop_info(int *w, int *h)
|
|||
get_desktop_window();
|
||||
}
|
||||
if (desktop_window == None) {
|
||||
print_error("Unable to locate desktop window. If you are running Enlightenment, please\n"
|
||||
libast_print_error("Unable to locate desktop window. If you are running Enlightenment, please\n"
|
||||
"restart. If not, please set your background image with Esetroot, then try again.");
|
||||
return 0;
|
||||
}
|
||||
|
@ -1939,7 +1939,7 @@ update_desktop_info(int *w, int *h)
|
|||
XGetGeometry(Xdisplay, desktop_pixmap, &dummy, &px, &py, &pw, &ph, &pb, &pd);
|
||||
}
|
||||
if ((pw <= 0) || (ph <= 0)) {
|
||||
print_error("Value of desktop pixmap property is invalid. Please restart your \n"
|
||||
libast_print_error("Value of desktop pixmap property is invalid. Please restart your \n"
|
||||
"window manager or use Esetroot to set a new one.");
|
||||
desktop_pixmap = None;
|
||||
return 0;
|
||||
|
@ -2184,7 +2184,7 @@ set_icon_pixmap(char *filename, XWMHints * pwm_hints)
|
|||
|
||||
temp_im = imlib_load_image_with_error_return(icon_path, &im_err);
|
||||
if (temp_im == NULL) {
|
||||
print_error("Unable to load icon file \"%s\" -- %s\n", icon_path, imlib_strerror(im_err));
|
||||
libast_print_error("Unable to load icon file \"%s\" -- %s\n", icon_path, imlib_strerror(im_err));
|
||||
} else {
|
||||
/* If we're going to render the image anyway, might as well be nice and give it to the WM in a size it likes. */
|
||||
if (XGetIconSizes(Xdisplay, Xroot, &icon_sizes, &count)) {
|
||||
|
|
|
@ -2531,7 +2531,7 @@ selection_copy_string(Atom sel, char *str, size_t len)
|
|||
D_SELECT(("Changing ownership of selection %d to my window 0x%08x\n", (int) sel, (int) TermWin.vt));
|
||||
XSetSelectionOwner(Xdisplay, sel, TermWin.vt, CurrentTime);
|
||||
if (XGetSelectionOwner(Xdisplay, sel) != TermWin.vt) {
|
||||
print_error("Can't take ownership of selection\n");
|
||||
libast_print_error("Can't take ownership of selection\n");
|
||||
}
|
||||
} else {
|
||||
D_SELECT(("Copying selection to cut buffer %d\n", (int) sel));
|
||||
|
|
62
src/script.c
62
src/script.c
|
@ -103,13 +103,13 @@ eterm_handle_winop(char *action)
|
|||
int x, y, n;
|
||||
char *xx, *yy;
|
||||
|
||||
n = num_words(action);
|
||||
n = spiftool_num_words(action);
|
||||
if (n == 3 || n == 4) {
|
||||
if (n == 3) {
|
||||
win = TermWin.parent;
|
||||
}
|
||||
xx = get_pword(n - 1, action);
|
||||
yy = get_pword(n, action);
|
||||
xx = spiftool_get_pword(n - 1, action);
|
||||
yy = spiftool_get_pword(n, action);
|
||||
x = (int) strtol(xx, (char **) NULL, 0);
|
||||
y = (int) strtol(yy, (char **) NULL, 0);
|
||||
XMoveWindow(Xdisplay, win, x, y);
|
||||
|
@ -118,13 +118,13 @@ eterm_handle_winop(char *action)
|
|||
int w, h, n;
|
||||
char *ww, *hh;
|
||||
|
||||
n = num_words(action);
|
||||
n = spiftool_num_words(action);
|
||||
if (n == 3 || n == 4) {
|
||||
if (n == 3) {
|
||||
win = TermWin.parent;
|
||||
}
|
||||
ww = get_pword(n - 1, action);
|
||||
hh = get_pword(n, action);
|
||||
ww = spiftool_get_pword(n - 1, action);
|
||||
hh = spiftool_get_pword(n, action);
|
||||
w = (int) strtol(ww, (char **) NULL, 0);
|
||||
h = (int) strtol(hh, (char **) NULL, 0);
|
||||
XResizeWindow(Xdisplay, win, w, h);
|
||||
|
@ -134,7 +134,7 @@ eterm_handle_winop(char *action)
|
|||
} else if (!BEG_STRCASECMP(action, "iconify")) {
|
||||
XIconifyWindow(Xdisplay, win, Xscreen);
|
||||
} else {
|
||||
print_error("IPC Error: Unrecognized window operation \"%s\"\n", action);
|
||||
libast_print_error("IPC Error: Unrecognized window operation \"%s\"\n", action);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -171,7 +171,7 @@ script_handler_copy(spif_charptr_t *params)
|
|||
} else if (!BEG_STRCASECMP(buffer_id, "secondary")) {
|
||||
sel = XA_SECONDARY;
|
||||
} else {
|
||||
print_error("Invalid parameter to copy(): \"%s\"\n", buffer_id);
|
||||
libast_print_error("Invalid parameter to copy(): \"%s\"\n", buffer_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ script_handler_exit(spif_charptr_t *params)
|
|||
if (isdigit(params[0][0]) || (params[0][0] == '-' && isdigit(params[0][1]))) {
|
||||
code = (unsigned char) atoi(params[0]);
|
||||
} else {
|
||||
tmp = join(" ", params);
|
||||
tmp = spiftool_join(" ", params);
|
||||
printf("Exiting: %s\n", tmp);
|
||||
FREE(tmp);
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ script_handler_paste(spif_charptr_t *params)
|
|||
} else if (!BEG_STRCASECMP(buffer_id, "secondary")) {
|
||||
sel = XA_SECONDARY;
|
||||
} else {
|
||||
print_error("Invalid parameter to paste(): \"%s\"\n", buffer_id);
|
||||
libast_print_error("Invalid parameter to paste(): \"%s\"\n", buffer_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ script_handler_scroll(spif_charptr_t *params)
|
|||
} else if (str_leading_match("buffers", type)) {
|
||||
count = (long) (cnt_float * (TermWin.nrow + TermWin.saveLines));
|
||||
} else {
|
||||
print_error("Invalid modifier \"%s\" in scroll()\n", type);
|
||||
libast_print_error("Invalid modifier \"%s\" in scroll()\n", type);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
@ -411,7 +411,7 @@ script_handler_spawn(spif_charptr_t *params)
|
|||
char *tmp;
|
||||
|
||||
if (params && *params) {
|
||||
tmp = join(" ", params);
|
||||
tmp = spiftool_join(" ", params);
|
||||
system_no_wait(tmp);
|
||||
FREE(tmp);
|
||||
} else {
|
||||
|
@ -448,7 +448,7 @@ script_handler_exec_dialog(spif_charptr_t *params)
|
|||
int ret;
|
||||
|
||||
if (params && *params) {
|
||||
tmp = join(" ", params);
|
||||
tmp = spiftool_join(" ", params);
|
||||
} else {
|
||||
tmp = NULL;
|
||||
}
|
||||
|
@ -474,7 +474,7 @@ script_handler_msgbox(spif_charptr_t *params)
|
|||
char *tmp;
|
||||
|
||||
if (params && *params) {
|
||||
tmp = join(" ", params);
|
||||
tmp = spiftool_join(" ", params);
|
||||
scr_refresh(DEFAULT_REFRESH);
|
||||
menu_dialog(NULL, tmp, 1, NULL, NULL);
|
||||
FREE(tmp);
|
||||
|
@ -511,7 +511,7 @@ script_handler_es_display(spif_charptr_t *params)
|
|||
return;
|
||||
}
|
||||
|
||||
p = downcase_str(*params);
|
||||
p = spiftool_downcase_str(*params);
|
||||
a = params[index++];
|
||||
if (a && isdigit(*a)) {
|
||||
no = atoi(a);
|
||||
|
@ -565,7 +565,7 @@ script_handler_es_display(spif_charptr_t *params)
|
|||
D_ESCREEN(("View scrollback on display %d\n", no));
|
||||
ns_sbb_disp(sess, no);
|
||||
} else {
|
||||
print_error("Error in script: \"display\" has no sub-function \"%s\".\n", p);
|
||||
libast_print_error("Error in script: \"display\" has no sub-function \"%s\".\n", p);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -606,7 +606,7 @@ script_handler_es_region(spif_charptr_t *params)
|
|||
return;
|
||||
}
|
||||
|
||||
p = downcase_str(*params);
|
||||
p = spiftool_downcase_str(*params);
|
||||
a = params[index++];
|
||||
if (a && isdigit(*a)) {
|
||||
no = atoi(a);
|
||||
|
@ -626,7 +626,7 @@ script_handler_es_region(spif_charptr_t *params)
|
|||
} else if (!strcmp(p, "toggle")) {
|
||||
D_ESCREEN(("Toggle region of display %8p\n", disp));
|
||||
ns_tog_region(sess, disp);
|
||||
} else if (!strcmp(p, "new") || !strcmp(p, "split")) {
|
||||
} else if (!strcmp(p, "new") || !strcmp(p, "spiftool_split")) {
|
||||
if (!a || !*a || !strcasecmp(a, "ask")) {
|
||||
D_ESCREEN(("region new ask\n"));
|
||||
ns_add_region(sess, disp, no, NULL);
|
||||
|
@ -660,7 +660,7 @@ script_handler_es_region(spif_charptr_t *params)
|
|||
D_ESCREEN(("View scrollback for region %d of display %8p\n", no, disp));
|
||||
ns_sbb_region(sess, disp, no);
|
||||
} else {
|
||||
print_error("Error in script: \"region\" has no sub-function \"%s\".\n", p);
|
||||
libast_print_error("Error in script: \"region\" has no sub-function \"%s\".\n", p);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -676,7 +676,7 @@ script_handler_es_statement(spif_charptr_t *params)
|
|||
char *tmp;
|
||||
|
||||
if (params && *params) {
|
||||
tmp = join(" ", params);
|
||||
tmp = spiftool_join(" ", params);
|
||||
ns_statement(TermWin.screen, tmp);
|
||||
FREE(tmp);
|
||||
} else {
|
||||
|
@ -739,7 +739,7 @@ script_parse(char *s)
|
|||
|
||||
D_SCRIPT(("Parsing: \"%s\"\n", s));
|
||||
|
||||
token_list = split(";", s);
|
||||
token_list = spiftool_split(";", s);
|
||||
if (token_list == NULL) {
|
||||
D_SCRIPT(("No tokens found; ignoring script.\n"));
|
||||
return;
|
||||
|
@ -747,7 +747,7 @@ script_parse(char *s)
|
|||
|
||||
for (i = 0; token_list[i]; i++) {
|
||||
pstr = token_list[i];
|
||||
chomp(pstr);
|
||||
spiftool_chomp(pstr);
|
||||
if (!(*pstr)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -758,15 +758,15 @@ script_parse(char *s)
|
|||
strncpy(func_name, pstr, len);
|
||||
func_name[len] = 0;
|
||||
} else {
|
||||
print_error("Error in script \"%s\": Missing function name before \"%s\".\n", s, params);
|
||||
free_array((void **) token_list, 0);
|
||||
libast_print_error("Error in script \"%s\": Missing function name before \"%s\".\n", s, params);
|
||||
spiftool_free_array((void **) token_list, 0);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
func_name = STRDUP(pstr);
|
||||
}
|
||||
if (!func_name) {
|
||||
free_array((void **) token_list, 0);
|
||||
spiftool_free_array((void **) token_list, 0);
|
||||
return;
|
||||
}
|
||||
if (params) {
|
||||
|
@ -774,11 +774,11 @@ script_parse(char *s)
|
|||
if ((tmp = strrchr(params, ')')) != NULL) {
|
||||
*tmp = 0;
|
||||
} else {
|
||||
print_error("Error in script \"%s\": Missing closing parentheses for \"%s\".\n", s, token_list[i]);
|
||||
free_array((void **) token_list, 0);
|
||||
libast_print_error("Error in script \"%s\": Missing closing parentheses for \"%s\".\n", s, token_list[i]);
|
||||
spiftool_free_array((void **) token_list, 0);
|
||||
return;
|
||||
}
|
||||
param_list = split(", \t", params);
|
||||
param_list = spiftool_split(", \t", params);
|
||||
} else {
|
||||
param_list = NULL;
|
||||
}
|
||||
|
@ -786,12 +786,12 @@ script_parse(char *s)
|
|||
if ((func = script_find_handler(func_name)) != NULL) {
|
||||
(func->handler) (param_list);
|
||||
} else {
|
||||
print_error("Error in script \"%s\": No such function \"%s\".\n", s, func_name);
|
||||
libast_print_error("Error in script \"%s\": No such function \"%s\".\n", s, func_name);
|
||||
}
|
||||
}
|
||||
|
||||
if (params) {
|
||||
free_array((void **) param_list, 0);
|
||||
spiftool_free_array((void **) param_list, 0);
|
||||
}
|
||||
free_array((void **) token_list, 0);
|
||||
spiftool_free_array((void **) token_list, 0);
|
||||
}
|
||||
|
|
|
@ -923,7 +923,7 @@ scrollbar_drawing_init(void)
|
|||
#ifdef XTERM_SCROLLBAR
|
||||
gcvalue.stipple = XCreateBitmapFromData(Xdisplay, scrollbar.win, (char *) xterm_sb_bits, 12, 2);
|
||||
if (!gcvalue.stipple) {
|
||||
print_error("Unable to create xterm scrollbar bitmap.\n\n");
|
||||
libast_print_error("Unable to create xterm scrollbar bitmap.\n\n");
|
||||
if (scrollbar_get_type() == SCROLLBAR_XTERM) {
|
||||
scrollbar_set_type(SCROLLBAR_MOTIF);
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ eterm_bootstrap(int argc, char *argv[])
|
|||
privileges(REVERT);
|
||||
#endif
|
||||
if (!Xdisplay) {
|
||||
print_error("can't open display %s\n", display_name);
|
||||
libast_print_error("can't open display %s\n", display_name);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
XSetErrorHandler((XErrorHandler) xerror_handler);
|
||||
|
@ -155,20 +155,20 @@ eterm_bootstrap(int argc, char *argv[])
|
|||
props[PROP_EWMH_OPACITY] = XInternAtom(Xdisplay, "_NET_WM_WINDOW_OPACITY", True);
|
||||
props[PROP_EWMH_STARTUP_ID] = XInternAtom(Xdisplay, "_NET_STARTUP_ID", False);
|
||||
|
||||
if ((theme_dir = conf_parse_theme(&rs_theme, THEME_CFG, PARSE_TRY_ALL)) != NULL) {
|
||||
if ((theme_dir = spifconf_parse_theme(&rs_theme, THEME_CFG, PARSE_TRY_ALL)) != NULL) {
|
||||
char *tmp;
|
||||
|
||||
D_OPTIONS(("conf_parse_theme() returned \"%s\"\n", theme_dir));
|
||||
D_OPTIONS(("spifconf_parse_theme() returned \"%s\"\n", theme_dir));
|
||||
tmp = (char *) MALLOC(strlen(theme_dir) + sizeof("ETERM_THEME_ROOT=\0"));
|
||||
sprintf(tmp, "ETERM_THEME_ROOT=%s", theme_dir);
|
||||
putenv(tmp);
|
||||
}
|
||||
if ((user_dir =
|
||||
conf_parse_theme(&rs_theme, (rs_config_file ? rs_config_file : USER_CFG),
|
||||
spifconf_parse_theme(&rs_theme, (rs_config_file ? rs_config_file : USER_CFG),
|
||||
(PARSE_TRY_USER_THEME | PARSE_TRY_NO_THEME))) != NULL) {
|
||||
char *tmp;
|
||||
|
||||
D_OPTIONS(("conf_parse_theme() returned \"%s\"\n", user_dir));
|
||||
D_OPTIONS(("spifconf_parse_theme() returned \"%s\"\n", user_dir));
|
||||
tmp = (char *) MALLOC(strlen(user_dir) + sizeof("ETERM_USER_ROOT=\0"));
|
||||
sprintf(tmp, "ETERM_USER_ROOT=%s", user_dir);
|
||||
putenv(tmp);
|
||||
|
|
|
@ -92,7 +92,7 @@ system_wait(char *command)
|
|||
setreuid(my_ruid, my_ruid);
|
||||
setregid(my_rgid, my_rgid);
|
||||
execl("/bin/sh", "sh", "-c", command, (char *) NULL);
|
||||
print_error("execl(%s) failed -- %s\n", command, strerror(errno));
|
||||
libast_print_error("execl(%s) failed -- %s\n", command, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
} else {
|
||||
D_OPTIONS(("%d: fork() returned %d\n", getpid(), pid));
|
||||
|
@ -113,7 +113,7 @@ system_no_wait(char *command)
|
|||
setreuid(my_ruid, my_ruid);
|
||||
setregid(my_rgid, my_rgid);
|
||||
execl("/bin/sh", "sh", "-c", command, (char *) NULL);
|
||||
print_error("execl(%s) failed -- %s\n", command, strerror(errno));
|
||||
libast_print_error("execl(%s) failed -- %s\n", command, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
return (0);
|
||||
|
|
12
src/term.c
12
src/term.c
|
@ -1077,11 +1077,11 @@ popen_printer(void)
|
|||
FILE *stream;
|
||||
|
||||
if (((my_ruid != my_euid) || (my_rgid != my_egid)) && (strcmp(rs_print_pipe, PRINTPIPE))) {
|
||||
print_warning("Running setuid/setgid. Refusing to use custom printpipe.\n");
|
||||
libast_print_warning("Running setuid/setgid. Refusing to use custom printpipe.\n");
|
||||
RESET_AND_ASSIGN(rs_print_pipe, STRDUP(PRINTPIPE));
|
||||
}
|
||||
if ((stream = (FILE *) popen(rs_print_pipe, "w")) == NULL) {
|
||||
print_error("Can't open printer pipe \"%s\" -- %s\n", rs_print_pipe, strerror(errno));
|
||||
libast_print_error("Can't open printer pipe \"%s\" -- %s\n", rs_print_pipe, strerror(errno));
|
||||
}
|
||||
return stream;
|
||||
}
|
||||
|
@ -2526,22 +2526,22 @@ xterm_seq(int op, const char *str)
|
|||
#ifdef XTERM_SCROLLBAR
|
||||
scrollbar_change_type(SCROLLBAR_XTERM);
|
||||
#else
|
||||
print_error("Support for xterm scrollbars was not compiled in. Sorry.\n");
|
||||
libast_print_error("Support for xterm scrollbars was not compiled in. Sorry.\n");
|
||||
#endif
|
||||
} else if (!strcasecmp(nstr, "next")) {
|
||||
#ifdef NEXT_SCROLLBAR
|
||||
scrollbar_change_type(SCROLLBAR_NEXT);
|
||||
#else
|
||||
print_error("Support for NeXT scrollbars was not compiled in. Sorry.\n");
|
||||
libast_print_error("Support for NeXT scrollbars was not compiled in. Sorry.\n");
|
||||
#endif
|
||||
} else if (!strcasecmp(nstr, "motif")) {
|
||||
#ifdef MOTIF_SCROLLBAR
|
||||
scrollbar_change_type(SCROLLBAR_MOTIF);
|
||||
#else
|
||||
print_error("Support for motif scrollbars was not compiled in. Sorry.\n");
|
||||
libast_print_error("Support for motif scrollbars was not compiled in. Sorry.\n");
|
||||
#endif
|
||||
} else {
|
||||
print_error("Unrecognized scrollbar type \"%s\".\n", nstr);
|
||||
libast_print_error("Unrecognized scrollbar type \"%s\".\n", nstr);
|
||||
}
|
||||
}
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
|
|
|
@ -117,7 +117,7 @@ add_utmp_entry(const char *pty, const char *hostname, int fd)
|
|||
if (sscanf(pty, "pts/%d", &n) == 1)
|
||||
sprintf(ut_id, "vt%02x", n); /* sysv naming */
|
||||
else {
|
||||
print_error("can't parse tty name \"%s\"\n", pty);
|
||||
libast_print_error("can't parse tty name \"%s\"\n", pty);
|
||||
ut_id[0] = '\0'; /* entry not made */
|
||||
return;
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ add_utmp_entry(const char *pty, const char *hostname, int fd)
|
|||
if (!strncmp(pty, "pty", 3) || !strncmp(pty, "tty", 3))
|
||||
strncpy(ut_id, (pty + 3), sizeof(ut_id)); /* bsd naming */
|
||||
else {
|
||||
print_error("can't parse tty name \"%s\"\n", pty);
|
||||
libast_print_error("can't parse tty name \"%s\"\n", pty);
|
||||
ut_id[0] = '\0'; /* entry not made */
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ get_tint_by_color_name(const char *color)
|
|||
|
||||
D_PIXMAP(("Tint string is \"%s\", white color is rgbi:%d/%d/%d\n", color, wcol.red, wcol.green, wcol.blue));
|
||||
if (!XParseColor(Xdisplay, cmap, color, &xcol)) {
|
||||
print_error("Unable to parse tint color \"%s\". Ignoring.\n", color);
|
||||
libast_print_error("Unable to parse tint color \"%s\". Ignoring.\n", color);
|
||||
return 0xffffff;
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ get_bottom_shadow_color(Pixel norm_color, const char *type)
|
|||
xcol.blue /= 2;
|
||||
|
||||
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
|
||||
print_error("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map.\n", type, xcol.pixel, xcol.red,
|
||||
libast_print_error("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map.\n", type, xcol.pixel, xcol.red,
|
||||
xcol.green, xcol.blue);
|
||||
xcol.pixel = PixColors[minColor];
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ get_top_shadow_color(Pixel norm_color, const char *type)
|
|||
xcol.blue = MIN(white.blue, (xcol.blue * 7) / 5);
|
||||
|
||||
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
|
||||
print_error("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map.\n", type, xcol.pixel, xcol.red,
|
||||
libast_print_error("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map.\n", type, xcol.pixel, xcol.red,
|
||||
xcol.green, xcol.blue);
|
||||
xcol.pixel = PixColors[WhiteColor];
|
||||
}
|
||||
|
@ -204,11 +204,11 @@ get_color_by_name(const char *name, const char *fallback)
|
|||
}
|
||||
}
|
||||
if (!XParseColor(Xdisplay, cmap, name, &xcol)) {
|
||||
print_warning("Unable to resolve \"%s\" as a color name. Falling back on \"%s\".\n", name, NONULL(fallback));
|
||||
libast_print_warning("Unable to resolve \"%s\" as a color name. Falling back on \"%s\".\n", name, NONULL(fallback));
|
||||
name = fallback;
|
||||
if (name) {
|
||||
if (!XParseColor(Xdisplay, cmap, name, &xcol)) {
|
||||
print_warning
|
||||
libast_print_warning
|
||||
("Unable to resolve \"%s\" as a color name. This should never fail. Please repair/restore your RGB database.\n",
|
||||
name);
|
||||
return ((Pixel) - 1);
|
||||
|
@ -218,12 +218,12 @@ get_color_by_name(const char *name, const char *fallback)
|
|||
}
|
||||
}
|
||||
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
|
||||
print_warning("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map. Falling back on \"%s\".\n",
|
||||
libast_print_warning("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map. Falling back on \"%s\".\n",
|
||||
name, xcol.pixel, xcol.red, xcol.green, xcol.blue, NONULL(fallback));
|
||||
name = fallback;
|
||||
if (name) {
|
||||
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
|
||||
print_warning("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map.\n", name, xcol.pixel,
|
||||
libast_print_warning("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map.\n", name, xcol.pixel,
|
||||
xcol.red, xcol.green, xcol.blue);
|
||||
return ((Pixel) - 1);
|
||||
}
|
||||
|
@ -241,19 +241,19 @@ get_color_by_pixel(Pixel pixel, Pixel fallback)
|
|||
|
||||
xcol.pixel = pixel;
|
||||
if (!XQueryColor(Xdisplay, cmap, &xcol)) {
|
||||
print_warning("Unable to convert pixel value 0x%08x to an XColor structure. Falling back on 0x%08x.\n", pixel, fallback);
|
||||
libast_print_warning("Unable to convert pixel value 0x%08x to an XColor structure. Falling back on 0x%08x.\n", pixel, fallback);
|
||||
xcol.pixel = fallback;
|
||||
if (!XQueryColor(Xdisplay, cmap, &xcol)) {
|
||||
print_warning("Unable to convert pixel value 0x%08x to an XColor structure.\n", xcol.pixel);
|
||||
libast_print_warning("Unable to convert pixel value 0x%08x to an XColor structure.\n", xcol.pixel);
|
||||
return ((Pixel) 0);
|
||||
}
|
||||
}
|
||||
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
|
||||
print_warning("Unable to allocate 0x%08x (0x%04x, 0x%04x, 0x%04x) in the color map. Falling back on 0x%08x.\n", xcol.pixel,
|
||||
libast_print_warning("Unable to allocate 0x%08x (0x%04x, 0x%04x, 0x%04x) in the color map. Falling back on 0x%08x.\n", xcol.pixel,
|
||||
xcol.red, xcol.green, xcol.blue, fallback);
|
||||
xcol.pixel = fallback;
|
||||
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
|
||||
print_warning("Unable to allocate 0x%08x (0x%04x, 0x%04x, 0x%04x) in the color map.\n", xcol.pixel, xcol.red,
|
||||
libast_print_warning("Unable to allocate 0x%08x (0x%04x, 0x%04x, 0x%04x) in the color map.\n", xcol.pixel, xcol.red,
|
||||
xcol.green, xcol.blue);
|
||||
return ((Pixel) 0);
|
||||
}
|
||||
|
@ -380,7 +380,7 @@ Create_Windows(int argc, char *argv[])
|
|||
if (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_BORDERLESS)) {
|
||||
prop = XInternAtom(Xdisplay, "_MOTIF_WM_INFO", True);
|
||||
if (prop == None) {
|
||||
print_warning("Window Manager does not support MWM hints. Bypassing window manager control for borderless window.\n");
|
||||
libast_print_warning("Window Manager does not support MWM hints. Bypassing window manager control for borderless window.\n");
|
||||
Attributes.override_redirect = TRUE;
|
||||
mwmhints.flags = 0;
|
||||
} else {
|
||||
|
@ -740,12 +740,12 @@ set_window_color(int idx, const char *color)
|
|||
} else if (i >= 0 && i <= 7) { /* normal colors */
|
||||
PixColors[idx] = PixColors[minColor + i];
|
||||
} else {
|
||||
print_warning("Color index %d is invalid.\n", i);
|
||||
libast_print_warning("Color index %d is invalid.\n", i);
|
||||
return;
|
||||
}
|
||||
} else if (XParseColor(Xdisplay, cmap, color, &xcol)) {
|
||||
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
|
||||
print_warning("Unable to allocate \"%s\" in the color map.\n", color);
|
||||
libast_print_warning("Unable to allocate \"%s\" in the color map.\n", color);
|
||||
return;
|
||||
}
|
||||
if ((idx > maxBright) && (idx < 256) && (PixColors[idx])) {
|
||||
|
@ -753,7 +753,7 @@ set_window_color(int idx, const char *color)
|
|||
}
|
||||
PixColors[idx] = xcol.pixel;
|
||||
} else {
|
||||
print_warning("Unable to resolve \"%s\" as a color name.\n", color);
|
||||
libast_print_warning("Unable to resolve \"%s\" as a color name.\n", color);
|
||||
return;
|
||||
}
|
||||
set_colorfgbg();
|
||||
|
|
Loading…
Reference in New Issue