Mon Feb 6 17:15:49 2006 Michael Jennings (mej)
DragonFly BSD fixes from Joerg Sonnenberger <joerg@britannica.bec.de>. Also some type mismatch fixes. ---------------------------------------------------------------------- SVN revision: 20313
This commit is contained in:
parent
f7397a0611
commit
fccdc9bb52
|
@ -5466,3 +5466,9 @@ Mon Feb 6 01:02:15 2006 Michael Jennings (mej)
|
||||||
|
|
||||||
Fixed paste from clipboard.
|
Fixed paste from clipboard.
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
Mon Feb 6 17:15:49 2006 Michael Jennings (mej)
|
||||||
|
|
||||||
|
DragonFly BSD fixes from Joerg Sonnenberger <joerg@britannica.bec.de>.
|
||||||
|
|
||||||
|
Also some type mismatch fixes.
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
|
@ -9,8 +9,9 @@ done
|
||||||
for i in *.c src/*.c utils/*.c ; do
|
for i in *.c src/*.c utils/*.c ; do
|
||||||
if test -f $i; then
|
if test -f $i; then
|
||||||
echo Reformatting $i
|
echo Reformatting $i
|
||||||
indent -bad -bap -bbo -br -brs -cdw -ce -ci4 -cli4 -cs -di1 -i4 -l132 \
|
indent -bad -bap -bbo -bli0 -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
|
-lp -lps -nbc -nbfda -npcs -nprs -nsob -nss -nut -psl -saf -sai -saw -sbi0 \
|
||||||
|
$TYPENAMES $i
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -1003,7 +1003,9 @@ void
|
||||||
dump_stack_trace(void)
|
dump_stack_trace(void)
|
||||||
{
|
{
|
||||||
char cmd[256];
|
char cmd[256];
|
||||||
|
#ifdef GDB
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NO_STACK_TRACE
|
#ifdef NO_STACK_TRACE
|
||||||
return;
|
return;
|
||||||
|
@ -1208,14 +1210,16 @@ x_resource_dump(int sig)
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
if (types[i].resource_type == pixmap_atom) {
|
if (types[i].resource_type == pixmap_atom) {
|
||||||
fprintf(stderr, "Process %lu, window 0x%08x (%s): %d pixmaps (%d bytes).\n", my_pid, TermWin.parent,
|
fprintf(stderr, "Process %lu, window 0x%08x (%s): %d pixmaps (%lu bytes).\n", (unsigned long) my_pid,
|
||||||
NONULL(title), types[i].count, bytes);
|
(unsigned int) TermWin.parent, NONULL(title), types[i].count, bytes);
|
||||||
} else if (types[i].resource_type == gc_atom) {
|
} else if (types[i].resource_type == gc_atom) {
|
||||||
fprintf(stderr, "Process %lu, window 0x%08x (%s): %d GC's (%d bytes).\n", my_pid, TermWin.parent,
|
fprintf(stderr, "Process %lu, window 0x%08x (%s): %d GC's (%d bytes).\n", (unsigned long) my_pid,
|
||||||
NONULL(title), types[i].count, types[i].count * (sizeof(XGCValues) + sizeof(GC)));
|
(unsigned int) TermWin.parent, NONULL(title), types[i].count,
|
||||||
|
types[i].count * (sizeof(XGCValues) + sizeof(GC)));
|
||||||
} else if (types[i].resource_type == font_atom) {
|
} else if (types[i].resource_type == font_atom) {
|
||||||
fprintf(stderr, "Process %lu, window 0x%08x (%s): %d fonts (%d bytes).\n", my_pid, TermWin.parent,
|
fprintf(stderr, "Process %lu, window 0x%08x (%s): %d fonts (%d bytes).\n", (unsigned long) my_pid,
|
||||||
NONULL(title), types[i].count, types[i].count * (sizeof(XFontStruct) + sizeof(Font)));
|
(unsigned int) TermWin.parent, NONULL(title), types[i].count,
|
||||||
|
types[i].count * (sizeof(XFontStruct) + sizeof(Font)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
XFree(clients);
|
XFree(clients);
|
||||||
|
|
|
@ -69,8 +69,9 @@
|
||||||
# ifdef HAVE_LASTLOG_H
|
# ifdef HAVE_LASTLOG_H
|
||||||
# include <lastlog.h>
|
# include <lastlog.h>
|
||||||
# endif
|
# endif
|
||||||
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
|
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DragonFly__)
|
||||||
# include <ttyent.h>
|
# include <ttyent.h>
|
||||||
|
# define NEW_BSD_UTMP
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef HAVE_LIBUTEMPTER
|
# ifdef HAVE_LIBUTEMPTER
|
||||||
|
|
42
src/script.c
42
src/script.c
|
@ -153,7 +153,7 @@ eterm_handle_winop(char *action)
|
||||||
* the "primary" buffer (XA_PRIMARY in Xlib-speak).
|
* the "primary" buffer (XA_PRIMARY in Xlib-speak).
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_copy(char **params)
|
script_handler_copy(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
unsigned char i;
|
unsigned char i;
|
||||||
char *buffer_id;
|
char *buffer_id;
|
||||||
|
@ -186,9 +186,9 @@ script_handler_copy(char **params)
|
||||||
* <string> is the string of characters to send to the pty.
|
* <string> is the string of characters to send to the pty.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_echo(char **params)
|
script_handler_echo(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
char **tmp;
|
spif_charptr_t *tmp;
|
||||||
|
|
||||||
for (tmp = params; tmp && *tmp; tmp++) {
|
for (tmp = params; tmp && *tmp; tmp++) {
|
||||||
tt_write(*tmp, strlen(*tmp));
|
tt_write(*tmp, strlen(*tmp));
|
||||||
|
@ -205,7 +205,7 @@ script_handler_echo(char **params)
|
||||||
* and no message.
|
* and no message.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_exit(char **params)
|
script_handler_exit(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
unsigned char code = 0;
|
unsigned char code = 0;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
@ -230,7 +230,7 @@ script_handler_exit(char **params)
|
||||||
* specified, SIGTERM is the default.
|
* specified, SIGTERM is the default.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_kill(char **params)
|
script_handler_kill(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
int sig;
|
int sig;
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ script_handler_kill(char **params)
|
||||||
* the "primary" buffer (XA_PRIMARY in Xlib-speak).
|
* the "primary" buffer (XA_PRIMARY in Xlib-speak).
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_paste(char **params)
|
script_handler_paste(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
unsigned char i;
|
unsigned char i;
|
||||||
char *buffer_id;
|
char *buffer_id;
|
||||||
|
@ -291,7 +291,7 @@ script_handler_paste(char **params)
|
||||||
* will be theme.cfg.
|
* will be theme.cfg.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_save(char **params)
|
script_handler_save(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
if (params && *params) {
|
if (params && *params) {
|
||||||
if (!strcasecmp(params[0], "theme")) {
|
if (!strcasecmp(params[0], "theme")) {
|
||||||
|
@ -312,7 +312,7 @@ script_handler_save(char **params)
|
||||||
* the specified file.
|
* the specified file.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_save_buff(char **params)
|
script_handler_save_buff(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
if (params && *params) {
|
if (params && *params) {
|
||||||
scr_dump_to_file(params[0]);
|
scr_dump_to_file(params[0]);
|
||||||
|
@ -334,7 +334,7 @@ script_handler_save_buff(char **params)
|
||||||
* and the type may be passed as a second parameter if you wish.
|
* and the type may be passed as a second parameter if you wish.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_scroll(char **params)
|
script_handler_scroll(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
char *type;
|
char *type;
|
||||||
double cnt_float;
|
double cnt_float;
|
||||||
|
@ -384,7 +384,7 @@ script_handler_scroll(char **params)
|
||||||
* search() will clear the previously-highlighted search term.
|
* search() will clear the previously-highlighted search term.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_search(char **params)
|
script_handler_search(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
static char *search = NULL;
|
static char *search = NULL;
|
||||||
|
|
||||||
|
@ -406,7 +406,7 @@ script_handler_search(char **params)
|
||||||
* If no command is specified, the default is to execute another Eterm.
|
* If no command is specified, the default is to execute another Eterm.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_spawn(char **params)
|
script_handler_spawn(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
|
@ -426,9 +426,9 @@ script_handler_spawn(char **params)
|
||||||
* <string> is the string of characters to send to the handler.
|
* <string> is the string of characters to send to the handler.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_string(char **params)
|
script_handler_string(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
char **tmp;
|
spif_charptr_t *tmp;
|
||||||
|
|
||||||
for (tmp = params; tmp && *tmp; tmp++) {
|
for (tmp = params; tmp && *tmp; tmp++) {
|
||||||
cmd_write(*tmp, strlen(*tmp));
|
cmd_write(*tmp, strlen(*tmp));
|
||||||
|
@ -442,7 +442,7 @@ script_handler_string(char **params)
|
||||||
* <command> is the command to be executed.
|
* <command> is the command to be executed.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_exec_dialog(char **params)
|
script_handler_exec_dialog(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
char *tmp;
|
char *tmp;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -469,7 +469,7 @@ script_handler_exec_dialog(char **params)
|
||||||
* <message> is the message to present.
|
* <message> is the message to present.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_msgbox(char **params)
|
script_handler_msgbox(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
|
@ -500,7 +500,7 @@ script_handler_msgbox(char **params)
|
||||||
* scrollback - View the scrollback for a display
|
* scrollback - View the scrollback for a display
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_es_display(char **params)
|
script_handler_es_display(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
_ns_sess *sess = TermWin.screen;
|
_ns_sess *sess = TermWin.screen;
|
||||||
char *p, *a;
|
char *p, *a;
|
||||||
|
@ -588,7 +588,7 @@ script_handler_es_display(char **params)
|
||||||
* scrollback - View the scrollback for a region
|
* scrollback - View the scrollback for a region
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_es_region(char **params)
|
script_handler_es_region(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
_ns_sess *sess = TermWin.screen;
|
_ns_sess *sess = TermWin.screen;
|
||||||
_ns_disp *disp;
|
_ns_disp *disp;
|
||||||
|
@ -671,7 +671,7 @@ script_handler_es_region(char **params)
|
||||||
* <statement> is the Escreen (screen) statement to execute.
|
* <statement> is the Escreen (screen) statement to execute.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_es_statement(char **params)
|
script_handler_es_statement(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
|
@ -689,7 +689,7 @@ script_handler_es_statement(char **params)
|
||||||
* Syntax: es_reset()
|
* Syntax: es_reset()
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_es_reset(char **params)
|
script_handler_es_reset(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
USE_VAR(params);
|
USE_VAR(params);
|
||||||
ns_reset(TermWin.screen, 0);
|
ns_reset(TermWin.screen, 0);
|
||||||
|
@ -703,7 +703,7 @@ script_handler_es_reset(char **params)
|
||||||
* This function can be used to cancel undesired default behavior.
|
* This function can be used to cancel undesired default behavior.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
script_handler_nop(char **params)
|
script_handler_nop(spif_charptr_t *params)
|
||||||
{
|
{
|
||||||
USE_VAR(params);
|
USE_VAR(params);
|
||||||
}
|
}
|
||||||
|
@ -728,7 +728,7 @@ eterm_script_handler_t *script_find_handler(const char *name)
|
||||||
void
|
void
|
||||||
script_parse(char *s)
|
script_parse(char *s)
|
||||||
{
|
{
|
||||||
char **token_list, **param_list;
|
spif_charptr_t *token_list, *param_list;
|
||||||
register char *pstr;
|
register char *pstr;
|
||||||
register unsigned long i;
|
register unsigned long i;
|
||||||
char *func_name, *params, *tmp;
|
char *func_name, *params, *tmp;
|
||||||
|
|
38
src/script.h
38
src/script.h
|
@ -31,7 +31,7 @@
|
||||||
/************ Macros and Definitions ************/
|
/************ Macros and Definitions ************/
|
||||||
|
|
||||||
/************ Structures ************/
|
/************ Structures ************/
|
||||||
typedef void (*eterm_script_handler_function_t)(char **);
|
typedef void (*eterm_script_handler_function_t)(spif_charptr_t *);
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *name;
|
char *name;
|
||||||
eterm_script_handler_function_t handler;
|
eterm_script_handler_function_t handler;
|
||||||
|
@ -43,26 +43,26 @@ typedef struct {
|
||||||
_XFUNCPROTOBEGIN
|
_XFUNCPROTOBEGIN
|
||||||
|
|
||||||
/* Handlers */
|
/* Handlers */
|
||||||
extern void script_handler_copy(char **);
|
extern void script_handler_copy(spif_charptr_t *);
|
||||||
extern void script_handler_echo(char **);
|
extern void script_handler_echo(spif_charptr_t *);
|
||||||
extern void script_handler_exec_dialog(char **);
|
extern void script_handler_exec_dialog(spif_charptr_t *);
|
||||||
extern void script_handler_exit(char **);
|
extern void script_handler_exit(spif_charptr_t *);
|
||||||
extern void script_handler_kill(char **);
|
extern void script_handler_kill(spif_charptr_t *);
|
||||||
extern void script_handler_msgbox(char **);
|
extern void script_handler_msgbox(spif_charptr_t *);
|
||||||
extern void script_handler_paste(char **);
|
extern void script_handler_paste(spif_charptr_t *);
|
||||||
extern void script_handler_save(char **);
|
extern void script_handler_save(spif_charptr_t *);
|
||||||
extern void script_handler_save_buff(char **);
|
extern void script_handler_save_buff(spif_charptr_t *);
|
||||||
extern void script_handler_scroll(char **);
|
extern void script_handler_scroll(spif_charptr_t *);
|
||||||
extern void script_handler_search(char **);
|
extern void script_handler_search(spif_charptr_t *);
|
||||||
extern void script_handler_spawn(char **);
|
extern void script_handler_spawn(spif_charptr_t *);
|
||||||
extern void script_handler_string(char **);
|
extern void script_handler_string(spif_charptr_t *);
|
||||||
extern void script_handler_nop(char **);
|
extern void script_handler_nop(spif_charptr_t *);
|
||||||
|
|
||||||
#ifdef ESCREEN
|
#ifdef ESCREEN
|
||||||
extern void script_handler_es_display(char **);
|
extern void script_handler_es_display(spif_charptr_t *);
|
||||||
extern void script_handler_es_region(char **);
|
extern void script_handler_es_region(spif_charptr_t *);
|
||||||
extern void script_handler_es_statement(char **);
|
extern void script_handler_es_statement(spif_charptr_t *);
|
||||||
extern void script_handler_es_reset(char **);
|
extern void script_handler_es_reset(spif_charptr_t *);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Engine */
|
/* Engine */
|
||||||
|
|
18
src/utmp.c
18
src/utmp.c
|
@ -38,7 +38,7 @@ static const char cvs_ident[] = "$Id$";
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/* don't go off end of ut_id & remember if an entry has been made */
|
/* don't go off end of ut_id & remember if an entry has been made */
|
||||||
# if defined(USE_SYSV_UTMP) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
|
# if defined(USE_SYSV_UTMP) || defined(NEW_BSD_UTMP) || defined(__OpenBSD__)
|
||||||
static char ut_id[5]; /* remember if entry to utmp made */
|
static char ut_id[5]; /* remember if entry to utmp made */
|
||||||
# else
|
# else
|
||||||
static int utmp_pos; /* BSD position of utmp-stamp */
|
static int utmp_pos; /* BSD position of utmp-stamp */
|
||||||
|
@ -222,7 +222,7 @@ remove_utmp_entry(void)
|
||||||
# else /* USE_SYSV_UTMP */
|
# else /* USE_SYSV_UTMP */
|
||||||
/* BSD utmp support */
|
/* BSD utmp support */
|
||||||
|
|
||||||
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
|
# ifdef NEW_BSD_UTMP
|
||||||
|
|
||||||
/* used to hold the line we are using */
|
/* used to hold the line we are using */
|
||||||
static char ut_line[32];
|
static char ut_line[32];
|
||||||
|
@ -270,7 +270,7 @@ b_login(struct utmp *ut)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# else /* __FreeBSD__ || NetBSD || BSDI */
|
# else /* NEW_BSD_UTMP */
|
||||||
static int utmp_pos = 0; /* position of utmp-stamp */
|
static int utmp_pos = 0; /* position of utmp-stamp */
|
||||||
|
|
||||||
/*----------------------------------------------------------------------*
|
/*----------------------------------------------------------------------*
|
||||||
|
@ -328,7 +328,7 @@ write_utmp(struct utmp *putmp)
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif /* __FreeBSD__ || NetBSD || BSDI */
|
# endif /* NEW_BSD_UTMP */
|
||||||
|
|
||||||
void
|
void
|
||||||
add_utmp_entry(const char *pty, const char *hostname, int fd)
|
add_utmp_entry(const char *pty, const char *hostname, int fd)
|
||||||
|
@ -348,7 +348,7 @@ add_utmp_entry(const char *pty, const char *hostname, int fd)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
|
# ifdef NEW_BSD_UTMP
|
||||||
strncpy(ut_line, pty, 31);
|
strncpy(ut_line, pty, 31);
|
||||||
|
|
||||||
strncpy(utmp.ut_line, pty, UT_LINESIZE);
|
strncpy(utmp.ut_line, pty, UT_LINESIZE);
|
||||||
|
@ -357,7 +357,7 @@ add_utmp_entry(const char *pty, const char *hostname, int fd)
|
||||||
utmp.ut_time = time(NULL);
|
utmp.ut_time = time(NULL);
|
||||||
|
|
||||||
b_login(&utmp);
|
b_login(&utmp);
|
||||||
# else /* __FreeBSD__ || NetBSD || BSDI */
|
# else /* NEW_BSD_UTMP */
|
||||||
strncpy(utmp.ut_line, ut_id, sizeof(utmp.ut_line));
|
strncpy(utmp.ut_line, ut_id, sizeof(utmp.ut_line));
|
||||||
strncpy(utmp.ut_name, pwent->pw_name, sizeof(utmp.ut_name));
|
strncpy(utmp.ut_name, pwent->pw_name, sizeof(utmp.ut_name));
|
||||||
strncpy(utmp.ut_host, hostname, sizeof(utmp.ut_host));
|
strncpy(utmp.ut_host, hostname, sizeof(utmp.ut_host));
|
||||||
|
@ -376,10 +376,10 @@ add_utmp_entry(const char *pty, const char *hostname, int fd)
|
||||||
void
|
void
|
||||||
remove_utmp_entry(void)
|
remove_utmp_entry(void)
|
||||||
{
|
{
|
||||||
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
|
# ifdef NEW_BSD_UTMP
|
||||||
logout(ut_line);
|
logout(ut_line);
|
||||||
logwtmp(ut_line, "", "");
|
logwtmp(ut_line, "", "");
|
||||||
# else /* __FreeBSD__ */
|
# else /* NEW_BSD_UTMP */
|
||||||
FILE *fd;
|
FILE *fd;
|
||||||
|
|
||||||
privileges(INVOKE);
|
privileges(INVOKE);
|
||||||
|
@ -393,7 +393,7 @@ remove_utmp_entry(void)
|
||||||
fclose(fd);
|
fclose(fd);
|
||||||
}
|
}
|
||||||
privileges(REVERT);
|
privileges(REVERT);
|
||||||
# endif /* __FreeBSD__ || NetBSD || BSDI */
|
# endif /* NEW_BSD_UTMP */
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif /* USE_SYSV_UTMP */
|
# endif /* USE_SYSV_UTMP */
|
||||||
|
|
Loading…
Reference in New Issue