Browse Source

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
master
Michael Jennings 17 years ago
parent
commit
fccdc9bb52
  1. 6
      ChangeLog
  2. 5
      reformat-code
  3. 16
      src/command.c
  4. 3
      src/eterm_utmp.h
  5. 42
      src/script.c
  6. 38
      src/script.h
  7. 18
      src/utmp.c

6
ChangeLog

@ -5466,3 +5466,9 @@ Mon Feb 6 01:02:15 2006 Michael Jennings (mej)
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.
----------------------------------------------------------------------

5
reformat-code

@ -9,8 +9,9 @@ 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 -cli4 -cs -di1 -i4 -l132 \
-lp -lps -nbc -nbfda -npcs -nprs -nsob -nss -nut -psl -saf -sai -saw $TYPENAMES $i
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 -sbi0 \
$TYPENAMES $i
fi
done

16
src/command.c

@ -1003,7 +1003,9 @@ void
dump_stack_trace(void)
{
char cmd[256];
#ifdef GDB
struct stat st;
#endif
#ifdef NO_STACK_TRACE
return;
@ -1208,14 +1210,16 @@ x_resource_dump(int sig)
for (i = 0; i < count; i++) {
if (types[i].resource_type == pixmap_atom) {
fprintf(stderr, "Process %lu, window 0x%08x (%s): %d pixmaps (%d bytes).\n", my_pid, TermWin.parent,
NONULL(title), types[i].count, bytes);
fprintf(stderr, "Process %lu, window 0x%08x (%s): %d pixmaps (%lu bytes).\n", (unsigned long) my_pid,
(unsigned int) TermWin.parent, NONULL(title), types[i].count, bytes);
} 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,
NONULL(title), types[i].count, types[i].count * (sizeof(XGCValues) + sizeof(GC)));
fprintf(stderr, "Process %lu, window 0x%08x (%s): %d GC's (%d bytes).\n", (unsigned long) my_pid,
(unsigned int) TermWin.parent, NONULL(title), types[i].count,
types[i].count * (sizeof(XGCValues) + sizeof(GC)));
} 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,
NONULL(title), types[i].count, types[i].count * (sizeof(XFontStruct) + sizeof(Font)));
fprintf(stderr, "Process %lu, window 0x%08x (%s): %d fonts (%d bytes).\n", (unsigned long) my_pid,
(unsigned int) TermWin.parent, NONULL(title), types[i].count,
types[i].count * (sizeof(XFontStruct) + sizeof(Font)));
}
}
XFree(clients);

3
src/eterm_utmp.h

@ -69,8 +69,9 @@
# ifdef HAVE_LASTLOG_H
# include <lastlog.h>
# endif
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DragonFly__)
# include <ttyent.h>
# define NEW_BSD_UTMP
# endif
# ifdef HAVE_LIBUTEMPTER

42
src/script.c

@ -153,7 +153,7 @@ eterm_handle_winop(char *action)
* the "primary" buffer (XA_PRIMARY in Xlib-speak).
*/
void
script_handler_copy(char **params)
script_handler_copy(spif_charptr_t *params)
{
unsigned char i;
char *buffer_id;
@ -186,9 +186,9 @@ script_handler_copy(char **params)
* <string> is the string of characters to send to the pty.
*/
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++) {
tt_write(*tmp, strlen(*tmp));
@ -205,7 +205,7 @@ script_handler_echo(char **params)
* and no message.
*/
void
script_handler_exit(char **params)
script_handler_exit(spif_charptr_t *params)
{
unsigned char code = 0;
char *tmp;
@ -230,7 +230,7 @@ script_handler_exit(char **params)
* specified, SIGTERM is the default.
*/
void
script_handler_kill(char **params)
script_handler_kill(spif_charptr_t *params)
{
int sig;
@ -254,7 +254,7 @@ script_handler_kill(char **params)
* the "primary" buffer (XA_PRIMARY in Xlib-speak).
*/
void
script_handler_paste(char **params)
script_handler_paste(spif_charptr_t *params)
{
unsigned char i;
char *buffer_id;
@ -291,7 +291,7 @@ script_handler_paste(char **params)
* will be theme.cfg.
*/
void
script_handler_save(char **params)
script_handler_save(spif_charptr_t *params)
{
if (params && *params) {
if (!strcasecmp(params[0], "theme")) {
@ -312,7 +312,7 @@ script_handler_save(char **params)
* the specified file.
*/
void
script_handler_save_buff(char **params)
script_handler_save_buff(spif_charptr_t *params)
{
if (params && *params) {
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.
*/
void
script_handler_scroll(char **params)
script_handler_scroll(spif_charptr_t *params)
{
char *type;
double cnt_float;
@ -384,7 +384,7 @@ script_handler_scroll(char **params)
* search() will clear the previously-highlighted search term.
*/
void
script_handler_search(char **params)
script_handler_search(spif_charptr_t *params)
{
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.
*/
void
script_handler_spawn(char **params)
script_handler_spawn(spif_charptr_t *params)
{
char *tmp;
@ -426,9 +426,9 @@ script_handler_spawn(char **params)
* <string> is the string of characters to send to the handler.
*/
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++) {
cmd_write(*tmp, strlen(*tmp));
@ -442,7 +442,7 @@ script_handler_string(char **params)
* <command> is the command to be executed.
*/
void
script_handler_exec_dialog(char **params)
script_handler_exec_dialog(spif_charptr_t *params)
{
char *tmp;
int ret;
@ -469,7 +469,7 @@ script_handler_exec_dialog(char **params)
* <message> is the message to present.
*/
void
script_handler_msgbox(char **params)
script_handler_msgbox(spif_charptr_t *params)
{
char *tmp;
@ -500,7 +500,7 @@ script_handler_msgbox(char **params)
* scrollback - View the scrollback for a display
*/
void
script_handler_es_display(char **params)
script_handler_es_display(spif_charptr_t *params)
{
_ns_sess *sess = TermWin.screen;
char *p, *a;
@ -588,7 +588,7 @@ script_handler_es_display(char **params)
* scrollback - View the scrollback for a region
*/
void
script_handler_es_region(char **params)
script_handler_es_region(spif_charptr_t *params)
{
_ns_sess *sess = TermWin.screen;
_ns_disp *disp;
@ -671,7 +671,7 @@ script_handler_es_region(char **params)
* <statement> is the Escreen (screen) statement to execute.
*/
void
script_handler_es_statement(char **params)
script_handler_es_statement(spif_charptr_t *params)
{
char *tmp;
@ -689,7 +689,7 @@ script_handler_es_statement(char **params)
* Syntax: es_reset()
*/
void
script_handler_es_reset(char **params)
script_handler_es_reset(spif_charptr_t *params)
{
USE_VAR(params);
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.
*/
void
script_handler_nop(char **params)
script_handler_nop(spif_charptr_t *params)
{
USE_VAR(params);
}
@ -728,7 +728,7 @@ eterm_script_handler_t *script_find_handler(const char *name)
void
script_parse(char *s)
{
char **token_list, **param_list;
spif_charptr_t *token_list, *param_list;
register char *pstr;
register unsigned long i;
char *func_name, *params, *tmp;

38
src/script.h

@ -31,7 +31,7 @@
/************ Macros and Definitions ************/
/************ Structures ************/
typedef void (*eterm_script_handler_function_t)(char **);
typedef void (*eterm_script_handler_function_t)(spif_charptr_t *);
typedef struct {
char *name;
eterm_script_handler_function_t handler;
@ -43,26 +43,26 @@ typedef struct {
_XFUNCPROTOBEGIN
/* Handlers */
extern void script_handler_copy(char **);
extern void script_handler_echo(char **);
extern void script_handler_exec_dialog(char **);
extern void script_handler_exit(char **);
extern void script_handler_kill(char **);
extern void script_handler_msgbox(char **);
extern void script_handler_paste(char **);
extern void script_handler_save(char **);
extern void script_handler_save_buff(char **);
extern void script_handler_scroll(char **);
extern void script_handler_search(char **);
extern void script_handler_spawn(char **);
extern void script_handler_string(char **);
extern void script_handler_nop(char **);
extern void script_handler_copy(spif_charptr_t *);
extern void script_handler_echo(spif_charptr_t *);
extern void script_handler_exec_dialog(spif_charptr_t *);
extern void script_handler_exit(spif_charptr_t *);
extern void script_handler_kill(spif_charptr_t *);
extern void script_handler_msgbox(spif_charptr_t *);
extern void script_handler_paste(spif_charptr_t *);
extern void script_handler_save(spif_charptr_t *);
extern void script_handler_save_buff(spif_charptr_t *);
extern void script_handler_scroll(spif_charptr_t *);
extern void script_handler_search(spif_charptr_t *);
extern void script_handler_spawn(spif_charptr_t *);
extern void script_handler_string(spif_charptr_t *);
extern void script_handler_nop(spif_charptr_t *);
#ifdef ESCREEN
extern void script_handler_es_display(char **);
extern void script_handler_es_region(char **);
extern void script_handler_es_statement(char **);
extern void script_handler_es_reset(char **);
extern void script_handler_es_display(spif_charptr_t *);
extern void script_handler_es_region(spif_charptr_t *);
extern void script_handler_es_statement(spif_charptr_t *);
extern void script_handler_es_reset(spif_charptr_t *);
#endif
/* Engine */

18
src/utmp.c

@ -38,7 +38,7 @@ static const char cvs_ident[] = "$Id$";
# endif
/* 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 */
# else
static int utmp_pos; /* BSD position of utmp-stamp */
@ -222,7 +222,7 @@ remove_utmp_entry(void)
# else /* USE_SYSV_UTMP */
/* BSD utmp support */
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
# ifdef NEW_BSD_UTMP
/* used to hold the line we are using */
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 */
/*----------------------------------------------------------------------*
@ -328,7 +328,7 @@ write_utmp(struct utmp *putmp)
return rval;
}
# endif /* __FreeBSD__ || NetBSD || BSDI */
# endif /* NEW_BSD_UTMP */
void
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;
}
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
# ifdef NEW_BSD_UTMP
strncpy(ut_line, pty, 31);
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);
b_login(&utmp);
# else /* __FreeBSD__ || NetBSD || BSDI */
# else /* NEW_BSD_UTMP */
strncpy(utmp.ut_line, ut_id, sizeof(utmp.ut_line));
strncpy(utmp.ut_name, pwent->pw_name, sizeof(utmp.ut_name));
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
remove_utmp_entry(void)
{
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
# ifdef NEW_BSD_UTMP
logout(ut_line);
logwtmp(ut_line, "", "");
# else /* __FreeBSD__ */
# else /* NEW_BSD_UTMP */
FILE *fd;
privileges(INVOKE);
@ -393,7 +393,7 @@ remove_utmp_entry(void)
fclose(fd);
}
privileges(REVERT);
# endif /* __FreeBSD__ || NetBSD || BSDI */
# endif /* NEW_BSD_UTMP */
}
# endif /* USE_SYSV_UTMP */

Loading…
Cancel
Save