*** ./server-client.c.ORIG Thu Apr 4 12:43:00 2013 --- ./server-client.c Thu Apr 4 12:43:27 2013 *************** *** 334,339 **** --- 334,351 ---- window_pane_mouse(wp, c->session, m); } + #ifdef _AIX + # define timersub(a, b, result) \ + do { \ + (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ + (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ + if ((result)->tv_usec < 0) { \ + --(result)->tv_sec; \ + (result)->tv_usec += 1000000; \ + } \ + } while (0) + #endif + /* Is this fast enough to probably be a paste? */ int server_client_assume_paste(struct session *s) *** ./err.c.ORIG Wed Jan 18 22:05:08 2017 --- ./err.c Wed Jan 18 22:07:31 2017 *************** *** 0 **** --- 1,60 ---- + /***********************************************************/ + /* */ + /* AIX replacement functions: err(), errx() */ + /* */ + /***********************************************************/ + + #include + #include + #include + #include + #include + + + void err( int eval, const char *fmt, ... ) + { + va_list ap; + char *txt, *strp; + + + txt = strerror( errno ); + + if (fmt != NULL && strcmp( (void *) fmt, "" ) != 0 ) + { + strp = (char *) malloc( 1024 * sizeof( char ) ); + va_start( ap, fmt ); + vsnprintf( strp, 1023, fmt, ap ); + va_end( ap ); + + fprintf(stderr, "%s: %s\n", strp, txt); + free( strp ); + exit( eval ); + } + else + { + fprintf( stderr, "%s\n", txt); + free( txt ); + exit( eval ); + } + } + + + void errx( int eval, const char *fmt, ... ) + { + va_list ap; + char *strp; + + strp = (char *) malloc( 1024 * sizeof( char ) ); + + va_start( ap,fmt ); + vsnprintf( strp, 1023, fmt, ap ); + va_end( ap ); + + fprintf( stderr, "%s\n", strp ); + + free( strp ); + + exit( eval ); + } + + /***********************************************************/ *** ./input.c.ORIG Mon Oct 16 14:21:19 2017 --- ./input.c Mon Oct 16 14:21:36 2017 *************** *** 289,314 **** { 0x1b, 0x1b, NULL, &input_state_esc_enter } /* Forward declarations of state tables. */ ! static const struct input_transition input_state_ground_table[]; ! static const struct input_transition input_state_esc_enter_table[]; ! static const struct input_transition input_state_esc_intermediate_table[]; ! static const struct input_transition input_state_csi_enter_table[]; ! static const struct input_transition input_state_csi_parameter_table[]; ! static const struct input_transition input_state_csi_intermediate_table[]; ! static const struct input_transition input_state_csi_ignore_table[]; ! static const struct input_transition input_state_dcs_enter_table[]; ! static const struct input_transition input_state_dcs_parameter_table[]; ! static const struct input_transition input_state_dcs_intermediate_table[]; ! static const struct input_transition input_state_dcs_handler_table[]; ! static const struct input_transition input_state_dcs_escape_table[]; ! static const struct input_transition input_state_dcs_ignore_table[]; ! static const struct input_transition input_state_osc_string_table[]; ! static const struct input_transition input_state_apc_string_table[]; ! static const struct input_transition input_state_rename_string_table[]; ! static const struct input_transition input_state_consume_st_table[]; ! static const struct input_transition input_state_utf8_three_table[]; ! static const struct input_transition input_state_utf8_two_table[]; ! static const struct input_transition input_state_utf8_one_table[]; /* ground state definition. */ static const struct input_state input_state_ground = { --- 289,314 ---- { 0x1b, 0x1b, NULL, &input_state_esc_enter } /* Forward declarations of state tables. */ ! const struct input_transition input_state_ground_table[]; ! const struct input_transition input_state_esc_enter_table[]; ! const struct input_transition input_state_esc_intermediate_table[]; ! const struct input_transition input_state_csi_enter_table[]; ! const struct input_transition input_state_csi_parameter_table[]; ! const struct input_transition input_state_csi_intermediate_table[]; ! const struct input_transition input_state_csi_ignore_table[]; ! const struct input_transition input_state_dcs_enter_table[]; ! const struct input_transition input_state_dcs_parameter_table[]; ! const struct input_transition input_state_dcs_intermediate_table[]; ! const struct input_transition input_state_dcs_handler_table[]; ! const struct input_transition input_state_dcs_escape_table[]; ! const struct input_transition input_state_dcs_ignore_table[]; ! const struct input_transition input_state_osc_string_table[]; ! const struct input_transition input_state_apc_string_table[]; ! const struct input_transition input_state_rename_string_table[]; ! const struct input_transition input_state_consume_st_table[]; ! const struct input_transition input_state_utf8_three_table[]; ! const struct input_transition input_state_utf8_two_table[]; ! const struct input_transition input_state_utf8_one_table[]; /* ground state definition. */ static const struct input_state input_state_ground = { *** ./tty.c.ORIG Mon Oct 16 14:23:12 2017 --- ./tty.c Mon Oct 16 14:24:02 2017 *************** *** 1130,1136 **** tty_cmd_scrollup(struct tty *tty, const struct tty_ctx *ctx) { struct window_pane *wp = ctx->wp; ! u_int i, lines; if ((!tty_pane_full_width(tty, ctx) && !tty_use_margin(tty)) || tty_fake_bce(tty, wp, 8) || --- 1130,1136 ---- tty_cmd_scrollup(struct tty *tty, const struct tty_ctx *ctx) { struct window_pane *wp = ctx->wp; ! u_int i, AIXlines; if ((!tty_pane_full_width(tty, ctx) && !tty_use_margin(tty)) || tty_fake_bce(tty, wp, 8) || *************** *** 1149,1164 **** * than the height of the scroll region. Clamping the parameter doesn't * hurt in any case. */ ! lines = tty->rlower - tty->rupper; ! if (lines > ctx->num) ! lines = ctx->num; ! if (lines == 1 || !tty_term_has(tty->term, TTYC_INDN)) { tty_cursor(tty, tty->rright, tty->rlower); ! for (i = 0; i < lines; i++) tty_putc(tty, '\n'); } else ! tty_putcode1(tty, TTYC_INDN, lines); } void --- 1149,1164 ---- * than the height of the scroll region. Clamping the parameter doesn't * hurt in any case. */ ! AIXlines = tty->rlower - tty->rupper; ! if (AIXlines > ctx->num) ! AIXlines = ctx->num; ! if (AIXlines == 1 || !tty_term_has(tty->term, TTYC_INDN)) { tty_cursor(tty, tty->rright, tty->rlower); ! for (i = 0; i < AIXlines; i++) tty_putc(tty, '\n'); } else ! tty_putcode1(tty, TTYC_INDN, AIXlines); } void