Enlightenment CVS committal Author : mej Project : eterm Module : Eterm
Dir : eterm/Eterm/src Modified Files: command.c eterm_utmp.h script.c script.h utmp.c Log Message: Mon Feb 6 17:15:49 2006 Michael Jennings (mej) DragonFly BSD fixes from Joerg Sonnenberger <[EMAIL PROTECTED]>. Also some type mismatch fixes. ---------------------------------------------------------------------- =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/command.c,v retrieving revision 1.109 retrieving revision 1.110 diff -u -3 -r1.109 -r1.110 --- command.c 4 Jan 2006 08:44:14 -0000 1.109 +++ command.c 6 Feb 2006 22:16:49 -0000 1.110 @@ -34,7 +34,7 @@ * he guarantee anything whatsoever. *----------------------------------------------------------------------*/ -static const char cvs_ident[] = "$Id: command.c,v 1.109 2006/01/04 08:44:14 mej Exp $"; +static const char cvs_ident[] = "$Id: command.c,v 1.110 2006/02/06 22:16:49 mej Exp $"; /* includes: */ #include "config.h" @@ -1003,7 +1003,9 @@ dump_stack_trace(void) { char cmd[256]; +#ifdef GDB struct stat st; +#endif #ifdef NO_STACK_TRACE return; @@ -1208,14 +1210,16 @@ 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); =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/eterm_utmp.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- eterm_utmp.h 4 Jan 2006 09:22:38 -0000 1.12 +++ eterm_utmp.h 6 Feb 2006 22:16:50 -0000 1.13 @@ -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 =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/script.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -3 -r1.28 -r1.29 --- script.c 4 Jan 2006 09:22:40 -0000 1.28 +++ script.c 6 Feb 2006 22:16:50 -0000 1.29 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: script.c,v 1.28 2006/01/04 09:22:40 mej Exp $"; +static const char cvs_ident[] = "$Id: script.c,v 1.29 2006/02/06 22:16:50 mej Exp $"; #include "config.h" #include "feature.h" @@ -153,7 +153,7 @@ * 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 @@ * <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 @@ * 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 @@ * specified, SIGTERM is the default. */ void -script_handler_kill(char **params) +script_handler_kill(spif_charptr_t *params) { int sig; @@ -254,7 +254,7 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * <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 @@ * <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 @@ * <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 @@ * 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 @@ * 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 @@ * <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 @@ * 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 @@ * 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 @@ 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; =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/script.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- script.h 4 Jan 2006 09:22:40 -0000 1.16 +++ script.h 6 Feb 2006 22:16:50 -0000 1.17 @@ -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 @@ _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 */ =================================================================== RCS file: /cvsroot/enlightenment/eterm/Eterm/src/utmp.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- utmp.c 4 Jan 2006 09:22:41 -0000 1.20 +++ utmp.c 6 Feb 2006 22:16:50 -0000 1.21 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: utmp.c,v 1.20 2006/01/04 09:22:41 mej Exp $"; +static const char cvs_ident[] = "$Id: utmp.c,v 1.21 2006/02/06 22:16:50 mej Exp $"; #include "config.h" #include "feature.h" @@ -38,7 +38,7 @@ # 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 @@ # 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 @@ } } -# else /* __FreeBSD__ || NetBSD || BSDI */ +# else /* NEW_BSD_UTMP */ static int utmp_pos = 0; /* position of utmp-stamp */ /*----------------------------------------------------------------------* @@ -328,7 +328,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ fclose(fd); } privileges(REVERT); -# endif /* __FreeBSD__ || NetBSD || BSDI */ +# endif /* NEW_BSD_UTMP */ } # endif /* USE_SYSV_UTMP */ ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs