Fixed macros: used G_STMT_*, replaced function-like macros without arguments, made them upper-case

master
Yevgen Muntyan 2005-07-15 15:11:08 +00:00
parent 99c7d42589
commit d785c3b7f0
10 changed files with 337 additions and 388 deletions

View File

@ -986,7 +986,7 @@ void moo_term_force_update (MooTerm *term)
void moo_term_invert_colors (MooTerm *term,
gboolean invert)
{
term_implement_me ();
TERM_IMPLEMENT_ME;
}

View File

@ -310,19 +310,12 @@ gboolean moo_term_key_release (GtkWidget *widget,
static void start_press_tracking (MooTerm *term);
static void start_button_tracking (MooTerm *term);
static void start_hilite_tracking (MooTerm *term);
static void stop_mouse_tracking (MooTerm *term);
static gboolean button_press (MooTerm *term,
GdkEventButton *event);
static gboolean button_press_or_release (MooTerm *term,
GdkEventButton *event);
static gboolean hilite_button_press (MooTerm *term,
GdkEventButton *event);
static gboolean hilite_button_release (MooTerm *term,
GdkEventButton *event);
static gboolean hilite_motion_notify (MooTerm *term,
GdkEventMotion *event);
void moo_term_set_mouse_tracking (MooTerm *term,
@ -346,11 +339,6 @@ void moo_term_set_mouse_tracking (MooTerm *term,
start_button_tracking (term);
break;
case MODE_HILITE_MOUSE_TRACKING:
term->priv->tracking_mouse = TRUE;
start_hilite_tracking (term);
break;
default:
term->priv->tracking_mouse = FALSE;
stop_mouse_tracking (term);
@ -366,12 +354,9 @@ static void stop_mouse_tracking (MooTerm *term)
g_signal_handler_disconnect (term, term->priv->track_press_id);
if (term->priv->track_release_id)
g_signal_handler_disconnect (term, term->priv->track_release_id);
if (term->priv->track_motion_id)
g_signal_handler_disconnect (term, term->priv->track_motion_id);
term->priv->track_press_id = 0;
term->priv->track_release_id = 0;
term->priv->track_motion_id = 0;
}
@ -394,21 +379,6 @@ static void start_button_tracking (MooTerm *term)
}
static void start_hilite_tracking (MooTerm *term)
{
term->priv->track_press_id =
g_signal_connect (term, "button-press-event",
G_CALLBACK (hilite_button_press), NULL);
term->priv->track_release_id =
g_signal_connect (term, "button-release-event",
G_CALLBACK (hilite_button_release), NULL);
term->priv->track_motion_id =
g_signal_connect (term, "motion-notify-event",
G_CALLBACK (hilite_motion_notify), NULL);
}
static void get_mouse_coordinates (MooTerm *term,
GdkEventButton *event,
int *x,
@ -485,27 +455,3 @@ static gboolean button_press_or_release (MooTerm *term,
g_free (string);
return TRUE;
}
static gboolean hilite_button_press (MooTerm *term,
GdkEventButton *event)
{
term_implement_me ();
return TRUE;
}
static gboolean hilite_button_release (MooTerm *term,
GdkEventButton *event)
{
term_implement_me ();
return TRUE;
}
static gboolean hilite_motion_notify (MooTerm *term,
GdkEventMotion *event)
{
term_implement_me ();
return TRUE;
}

View File

@ -20,12 +20,12 @@
G_BEGIN_DECLS
#if 0
#define term_implement_me_warning g_warning
#define TERM_IMPLEMENT_ME_WARNING g_warning
#else
#define term_implement_me_warning g_message
#define TERM_IMPLEMENT_ME_WARNING g_message
#endif
#define term_implement_me() term_implement_me_warning ("%s: implement me", G_STRFUNC)
#define TERM_IMPLEMENT_ME TERM_IMPLEMENT_ME_WARNING ("%s: implement me", G_STRFUNC)
#define ADJUSTMENT_PRIORITY G_PRIORITY_HIGH_IDLE
@ -111,7 +111,6 @@ struct _MooTermPrivate {
int tracking_mouse;
gulong track_press_id;
gulong track_release_id;
gulong track_motion_id;
GtkIMContext *im;
gboolean im_preedit_active;
@ -291,10 +290,10 @@ enum {
struct _TermSelection {
guint screen_width;
// absolute coordinates in the buffer
// selected range is [(l_row, l_col), (r_row, r_col))
// l_row, l_col and r_row are valid
// r_col may be equal to _width
/* absolute coordinates in the buffer
selected range is [(l_row, l_col), (r_row, r_col))
l_row, l_col and r_row are valid
r_col may be equal to _width */
guint l_row;
guint l_col;
guint r_row;

View File

@ -18,108 +18,108 @@
#if 1
#define vt_not_implemented() \
{ \
#define VT_NOT_IMPLEMENTED \
G_STMT_START { \
char *s = _moo_term_current_ctl (parser); \
term_implement_me_warning ("'%s': implement me", s); \
TERM_IMPLEMENT_ME_WARNING ("'%s': implement me", s); \
g_free (s); \
}
#define vt_ignored() \
{ \
} G_STMT_END
#define VT_IGNORED \
G_STMT_START { \
char *s = _moo_term_current_ctl (parser); \
g_warning ("'%s' ignored", s); \
g_free (s); \
}
} G_STMT_END
#else
#define vt_not_implemented()
#define vt_ignored()
#define VT_NOT_IMPLEMENTED G_STMT_START {} G_STMT_END
#define VT_IGNORED G_STMT_START {} G_STMT_END
#endif
#define vt_print_char(ch) moo_term_buffer_print_unichar (parser->term->priv->buffer, ch)
#define VT_PRINT_CHAR(ch) moo_term_buffer_print_unichar (parser->term->priv->buffer, ch)
#define vt_XON() g_warning ("%s: got XON", G_STRLOC)
#define vt_XOFF() g_warning ("%s: got XOFF", G_STRLOC)
#define VT_XON g_warning ("%s: got XON", G_STRLOC)
#define VT_XOFF g_warning ("%s: got XOFF", G_STRLOC)
#define vt_SET_ICON_NAME(s) moo_term_set_icon_name (parser->term, s)
#define vt_SET_WINDOW_TITLE(s) moo_term_set_window_title (parser->term, s)
#define vt_BEL() moo_term_bell (parser->term)
#define vt_BS() moo_term_buffer_backspace (parser->term->priv->buffer)
#define vt_TAB() moo_term_buffer_tab (parser->term->priv->buffer, 1)
#define vt_LF() moo_term_buffer_linefeed (parser->term->priv->buffer)
#define vt_CR() moo_term_buffer_carriage_return (parser->term->priv->buffer)
#define vt_SO() moo_term_buffer_shift (parser->term->priv->buffer, 1)
#define vt_SI() moo_term_buffer_shift (parser->term->priv->buffer, 0)
#define vt_IND() moo_term_buffer_index (parser->term->priv->buffer)
#define vt_NEL() moo_term_buffer_new_line (parser->term->priv->buffer)
#define vt_HTS() moo_term_buffer_set_tab_stop (parser->term->priv->buffer)
#define vt_TBC(w) moo_term_buffer_clear_tab_stop (parser->term->priv->buffer, w)
#define vt_RI() moo_term_buffer_reverse_index (parser->term->priv->buffer)
#define vt_SS2() moo_term_buffer_single_shift (parser->term->priv->buffer, 2)
#define vt_SS3() moo_term_buffer_single_shift (parser->term->priv->buffer, 3)
#define vt_DECID() moo_term_decid (parser->term)
#define vt_SGR() moo_term_buffer_sgr (parser->term->priv->buffer, \
#define VT_BEL moo_term_bell (parser->term)
#define VT_BS moo_term_buffer_backspace (parser->term->priv->buffer)
#define VT_TAB moo_term_buffer_tab (parser->term->priv->buffer, 1)
#define VT_LF moo_term_buffer_linefeed (parser->term->priv->buffer)
#define VT_CR moo_term_buffer_carriage_return (parser->term->priv->buffer)
#define VT_SO moo_term_buffer_shift (parser->term->priv->buffer, 1)
#define VT_SI moo_term_buffer_shift (parser->term->priv->buffer, 0)
#define VT_IND moo_term_buffer_index (parser->term->priv->buffer)
#define VT_NEL moo_term_buffer_new_line (parser->term->priv->buffer)
#define VT_HTS moo_term_buffer_set_tab_stop (parser->term->priv->buffer)
#define VT_TBC(w) moo_term_buffer_clear_tab_stop (parser->term->priv->buffer, w)
#define VT_RI moo_term_buffer_reverse_index (parser->term->priv->buffer)
#define VT_SS2 moo_term_buffer_single_shift (parser->term->priv->buffer, 2)
#define VT_SS3 moo_term_buffer_single_shift (parser->term->priv->buffer, 3)
#define VT_DECID moo_term_decid (parser->term)
#define VT_SGR moo_term_buffer_sgr (parser->term->priv->buffer, \
(int*) parser->numbers->data, \
parser->numbers->len)
#define vt_CUU(n) moo_term_buffer_cuu (parser->term->priv->buffer, n)
#define vt_CUD(n) moo_term_buffer_cud (parser->term->priv->buffer, n)
#define vt_CUF(n) moo_term_buffer_cursor_move (parser->term->priv->buffer, 0, n)
#define vt_CUB(n) moo_term_buffer_cursor_move (parser->term->priv->buffer, 0, -n)
#define vt_DCH(n) moo_term_buffer_delete_char (parser->term->priv->buffer, n)
#define vt_DL(n) moo_term_buffer_delete_line (parser->term->priv->buffer, n)
#define vt_ECH(n) moo_term_buffer_erase_char (parser->term->priv->buffer, n)
#define vt_ED(n) moo_term_buffer_erase_in_display (parser->term->priv->buffer, n)
#define vt_EL(n) moo_term_buffer_erase_in_line (parser->term->priv->buffer, n)
#define vt_ICH(n) moo_term_buffer_insert_char (parser->term->priv->buffer, n)
#define vt_IL(n) moo_term_buffer_insert_line (parser->term->priv->buffer, n)
#define vt_CUP(r,c) moo_term_buffer_cup (parser->term->priv->buffer, (r)-1, (c)-1)
#define vt_DECSTBM(t,b) moo_term_buffer_set_scrolling_region (parser->term->priv->buffer, (t)-1, (b)-1);
#define vt_DECSC() moo_term_buffer_decsc (parser->term->priv->buffer)
#define vt_DECRC() moo_term_buffer_decrc (parser->term->priv->buffer)
#define vt_DECSET() moo_term_set_dec_modes (parser->term, \
#define VT_CUU(n) moo_term_buffer_cuu (parser->term->priv->buffer, n)
#define VT_CUD(n) moo_term_buffer_cud (parser->term->priv->buffer, n)
#define VT_CUF(n) moo_term_buffer_cursor_move (parser->term->priv->buffer, 0, n)
#define VT_CUB(n) moo_term_buffer_cursor_move (parser->term->priv->buffer, 0, -n)
#define VT_DCH(n) moo_term_buffer_delete_char (parser->term->priv->buffer, n)
#define VT_DL(n) moo_term_buffer_delete_line (parser->term->priv->buffer, n)
#define VT_ECH(n) moo_term_buffer_erase_char (parser->term->priv->buffer, n)
#define VT_ED(n) moo_term_buffer_erase_in_display (parser->term->priv->buffer, n)
#define VT_EL(n) moo_term_buffer_erase_in_line (parser->term->priv->buffer, n)
#define VT_ICH(n) moo_term_buffer_insert_char (parser->term->priv->buffer, n)
#define VT_IL(n) moo_term_buffer_insert_line (parser->term->priv->buffer, n)
#define VT_CUP(r,c) moo_term_buffer_cup (parser->term->priv->buffer, (r)-1, (c)-1)
#define VT_DECSTBM(t,b) moo_term_buffer_set_scrolling_region (parser->term->priv->buffer, (t)-1, (b)-1);
#define VT_DECSC moo_term_buffer_decsc (parser->term->priv->buffer)
#define VT_DECRC moo_term_buffer_decrc (parser->term->priv->buffer)
#define VT_DECSET moo_term_set_dec_modes (parser->term, \
(int*) parser->numbers->data, \
parser->numbers->len, \
TRUE)
#define vt_DECRST() moo_term_set_dec_modes (parser->term, \
#define VT_DECRST moo_term_set_dec_modes (parser->term, \
(int*) parser->numbers->data, \
parser->numbers->len, \
FALSE)
#define vt_SM() moo_term_set_ansi_modes (parser->term, \
#define VT_SM moo_term_set_ansi_modes (parser->term, \
(int*) parser->numbers->data, \
parser->numbers->len, \
TRUE)
#define vt_RM() moo_term_set_ansi_modes (parser->term, \
#define VT_RM moo_term_set_ansi_modes (parser->term, \
(int*) parser->numbers->data, \
parser->numbers->len, \
FALSE)
#define vt_SCS(n,s) moo_term_buffer_select_charset (parser->term->priv->buffer, n, s)
#define vt_DECKPAM() moo_term_set_mode (parser->term, MODE_DECNKM, TRUE)
#define vt_DECKPNM() moo_term_set_mode (parser->term, MODE_DECNKM, FALSE)
#define vt_DECSAVE() moo_term_save_dec_modes (parser->term, \
#define VT_SCS(n,s) moo_term_buffer_select_charset (parser->term->priv->buffer, n, s)
#define VT_DECKPAM moo_term_set_mode (parser->term, MODE_DECNKM, TRUE)
#define VT_DECKPNM moo_term_set_mode (parser->term, MODE_DECNKM, FALSE)
#define VT_DECSAVE moo_term_save_dec_modes (parser->term, \
(int*) parser->numbers->data, \
parser->numbers->len)
#define vt_DECRESTORE() moo_term_restore_dec_modes (parser->term, \
#define VT_DECRESTORE moo_term_restore_dec_modes (parser->term, \
(int*) parser->numbers->data, \
parser->numbers->len)
#define vt_DA1() moo_term_da1 (parser->term)
#define vt_DA2() moo_term_da2 (parser->term)
#define vt_DA3() moo_term_da3 (parser->term)
#define vt_DECRQSS(s) moo_term_setting_request (parser->term, s)
#define vt_DSR(t,a,e) moo_term_dsr (parser->term, t, a, e)
#define vt_DECSTR() moo_term_soft_reset (parser->term)
#define vt_RIS() moo_term_reset (parser->term)
#define VT_DA1 moo_term_da1 (parser->term)
#define VT_DA2 moo_term_da2 (parser->term)
#define VT_DA3 moo_term_da3 (parser->term)
#define VT_DECRQSS(s) moo_term_setting_request (parser->term, s)
#define VT_DSR(t,a,e) moo_term_dsr (parser->term, t, a, e)
#define VT_DECSTR moo_term_soft_reset (parser->term)
#define VT_RIS moo_term_reset (parser->term)
#define vt_CBT(n) moo_term_buffer_back_tab (parser->term->priv->buffer, n)
#define vt_CHA(n) moo_term_buffer_cursor_move_to (parser->term->priv->buffer, -1, n)
#define vt_CHT(n) moo_term_buffer_tab (parser->term->priv->buffer, n)
#define vt_CNL(n) moo_term_buffer_cursor_next_line (parser->term->priv->buffer, n)
#define vt_CPL(n) moo_term_buffer_cursor_prev_line (parser->term->priv->buffer, n)
#define vt_HPA(n) moo_term_buffer_cursor_move_to (parser->term->priv->buffer, -1, n)
#define vt_HPR(n) moo_term_buffer_cursor_move (parser->term->priv->buffer, 0, n)
#define vt_VPA(n) moo_term_buffer_cursor_move_to (parser->term->priv->buffer, n, -1)
#define vt_VPR(n) moo_term_buffer_cursor_move (parser->term->priv->buffer, n, 0)
#define vt_DECALN() moo_term_buffer_decaln (parser->term->priv->buffer)
#define VT_CBT(n) moo_term_buffer_back_tab (parser->term->priv->buffer, n)
#define VT_CHA(n) moo_term_buffer_cursor_move_to (parser->term->priv->buffer, -1, n)
#define VT_CHT(n) moo_term_buffer_tab (parser->term->priv->buffer, n)
#define VT_CNL(n) moo_term_buffer_cursor_next_line (parser->term->priv->buffer, n)
#define VT_CPL(n) moo_term_buffer_cursor_prev_line (parser->term->priv->buffer, n)
#define VT_HPA(n) moo_term_buffer_cursor_move_to (parser->term->priv->buffer, -1, n)
#define VT_HPR(n) moo_term_buffer_cursor_move (parser->term->priv->buffer, 0, n)
#define VT_VPA(n) moo_term_buffer_cursor_move_to (parser->term->priv->buffer, n, -1)
#define VT_VPR(n) moo_term_buffer_cursor_move (parser->term->priv->buffer, n, 0)
#define VT_DECALN moo_term_buffer_decaln (parser->term->priv->buffer)
#endif /* MOOTERM_MOOTERM_CTLFUNCS_H */

View File

@ -1073,14 +1073,14 @@ void moo_term_set_mode (MooTerm *term,
void moo_term_set_ca_mode (MooTerm *term,
gboolean set)
{
term_implement_me ();
TERM_IMPLEMENT_ME;
}
void moo_term_set_alternate_buffer (MooTerm *term,
gboolean alternate)
{
term_implement_me ();
TERM_IMPLEMENT_ME;
}

View File

@ -181,7 +181,7 @@ inline static GdkRegion *buf_get_changed(MooTermBuffer *buf)
#define buf_changed_add_rect(buf,rect) \
{ \
G_STMT_START { \
if (!buf->priv->changed_all) \
{ \
if (buf->priv->changed) \
@ -189,19 +189,19 @@ inline static GdkRegion *buf_get_changed(MooTermBuffer *buf)
else \
buf->priv->changed = gdk_region_rectangle (&rect); \
} \
}
} G_STMT_END
#define buf_changed_add_range(buf, row, start, len) \
{ \
G_STMT_START { \
if (!buf->priv->changed_all) \
{ \
{ \
GdkRectangle rec = {start, row, len, 1}; \
buf_changed_add_rect (buf, rec); \
} \
}
} G_STMT_END
#define buf_changed_set_all(buf) \
{ \
G_STMT_START { \
if (!buf->priv->changed_all) \
{ \
GdkRectangle rec = { \
@ -210,7 +210,7 @@ inline static GdkRegion *buf_get_changed(MooTermBuffer *buf)
buf_changed_add_rect (buf, rec); \
buf->priv->changed_all = TRUE; \
} \
}
} G_STMT_END
#define buf_set_attrs_mask(mask_) buf->priv->current_attr.mask = (mask_)
@ -218,6 +218,7 @@ inline static GdkRegion *buf_get_changed(MooTermBuffer *buf)
#define buf_remove_attrs_mask(mask_) buf->priv->current_attr.mask &= ~(mask_)
#define buf_set_ansi_foreground(color) \
G_STMT_START { \
if ((color) < MOO_TERM_COLOR_MAX) \
{ \
buf->priv->current_attr.mask |= MOO_TERM_TEXT_FOREGROUND; \
@ -226,9 +227,11 @@ inline static GdkRegion *buf_get_changed(MooTermBuffer *buf)
else \
{ \
buf->priv->current_attr.mask &= ~MOO_TERM_TEXT_FOREGROUND; \
}
} \
} G_STMT_END
#define buf_set_ansi_background(color) \
G_STMT_START { \
if ((color) < MOO_TERM_COLOR_MAX) \
{ \
buf->priv->current_attr.mask |= MOO_TERM_TEXT_BACKGROUND; \
@ -237,7 +240,8 @@ inline static GdkRegion *buf_get_changed(MooTermBuffer *buf)
else \
{ \
buf->priv->current_attr.mask &= ~MOO_TERM_TEXT_BACKGROUND; \
}
} \
} G_STMT_END
inline static MooTermLine *buf_line (MooTermBuffer *buf,

View File

@ -852,38 +852,38 @@ void moo_term_buffer_thaw_cursor_notify (MooTermBuffer *buf)
}
#define freeze_notify() \
{ \
#define FREEZE_NOTIFY \
G_STMT_START { \
moo_term_buffer_freeze_changed_notify (buf); \
moo_term_buffer_freeze_cursor_notify (buf); \
}
} G_STMT_END
#define notify() \
{ \
#define NOTIFY \
G_STMT_START { \
moo_term_buffer_changed (buf); \
moo_term_buffer_cursor_moved (buf); \
}
} G_STMT_END
#define thaw_notify() \
{ \
#define THAW_NOTIFY \
G_STMT_START { \
moo_term_buffer_thaw_changed_notify (buf); \
moo_term_buffer_thaw_cursor_notify (buf); \
}
} G_STMT_END
#define thaw_and_notify() \
{ \
thaw_notify (); \
notify(); \
}
#define THAW_AND_NOTIFY \
G_STMT_START { \
THAW_NOTIFY; \
NOTIFY; \
} G_STMT_END
#define notify_changed() moo_term_buffer_changed (buf)
#define freeze_changed() moo_term_buffer_freeze_changed_notify (buf);
#define NOTIFY_CHANGED moo_term_buffer_changed (buf)
#define FREEZE_CHANGED moo_term_buffer_freeze_changed_notify (buf)
#define thaw_and_notify_changed() \
{ \
#define THAW_AND_NOTIFY_CHANGED \
G_STMT_START { \
moo_term_buffer_thaw_changed_notify (buf); \
moo_term_buffer_changed (buf); \
}
} G_STMT_END
/*****************************************************************************/
@ -930,10 +930,10 @@ void moo_term_buffer_cud (MooTermBuffer *buf,
void moo_term_buffer_new_line (MooTermBuffer *buf)
{
freeze_notify ();
FREEZE_NOTIFY;
moo_term_buffer_index (buf);
moo_term_buffer_cursor_move_to (buf, -1, 0);
thaw_and_notify ();
THAW_AND_NOTIFY;
}
@ -1001,7 +1001,7 @@ void moo_term_buffer_index (MooTermBuffer *buf)
}
}
notify ();
NOTIFY;
}
@ -1036,7 +1036,7 @@ void moo_term_buffer_reverse_index (MooTermBuffer *buf)
buf->priv->cursor_row -= 1;
}
notify ();
NOTIFY;
}
@ -1190,7 +1190,7 @@ void moo_term_buffer_delete_char (MooTermBuffer *buf,
cursor_col, n);
buf_changed_add_range(buf, cursor_row, cursor_col,
buf_screen_width (buf) - cursor_col);
notify_changed ();
NOTIFY_CHANGED;
}
@ -1209,7 +1209,7 @@ void moo_term_buffer_erase_range (MooTermBuffer *buf,
term_line_erase_range (buf_screen_line (buf, row),
col, len);
buf_changed_add_range (buf, row, col, len);
notify_changed ();
NOTIFY_CHANGED;
}
@ -1237,7 +1237,7 @@ void moo_term_buffer_erase_in_display (MooTermBuffer *buf,
g_return_if_fail (what == 0 || what == 1 || what == 2);
freeze_changed ();
FREEZE_CHANGED;
switch (what)
{
@ -1261,7 +1261,7 @@ void moo_term_buffer_erase_in_display (MooTermBuffer *buf,
break;
}
thaw_and_notify_changed ();
THAW_AND_NOTIFY_CHANGED;
}
@ -1313,7 +1313,7 @@ void moo_term_buffer_insert_char (MooTermBuffer *buf,
&ZERO_ATTR, buf_screen_width (buf));
buf_changed_add_range (buf, cursor_row, cursor_col,
buf_screen_width (buf) - cursor_col);
notify_changed ();
NOTIFY_CHANGED;
}
@ -1536,7 +1536,7 @@ void moo_term_buffer_reset (MooTermBuffer *buf)
{
guint i;
freeze_notify ();
FREEZE_NOTIFY;
for (i = 0; i < buf->priv->lines->len; ++i)
term_line_free (g_ptr_array_index (buf->priv->lines, i));
@ -1551,7 +1551,7 @@ void moo_term_buffer_reset (MooTermBuffer *buf)
set_defaults (buf);
buf_changed_set_all (buf);
thaw_and_notify ();
THAW_AND_NOTIFY;
moo_term_buffer_scrollback_changed (buf);
}
@ -1621,7 +1621,7 @@ void moo_term_buffer_decaln (MooTermBuffer *buf)
guint width = buf_screen_width (buf);
guint height = buf_screen_height (buf);
freeze_changed ();
FREEZE_CHANGED;
for (i = 0; i < height; ++i)
term_line_set_unichar (buf_screen_line (buf, i),
@ -1631,5 +1631,5 @@ void moo_term_buffer_decaln (MooTermBuffer *buf)
buf_changed_set_all (buf);
thaw_and_notify_changed ();
THAW_AND_NOTIFY_CHANGED;
}

View File

@ -3,8 +3,8 @@
#include "mooterm/mootermparser.h"
#include "mooterm/mooterm-vtctls.h"
#define add_number(n) \
{ \
#define ADD_NUMBER(n) \
G_STMT_START { \
if (parser->numbers->len >= MAX_PARAMS_NUM) \
{ \
g_warning ("%s: too many parameters passed", \
@ -16,17 +16,17 @@
int val = n; \
g_array_append_val (parser->numbers, val); \
} \
}
} G_STMT_END
#define nums_len() (parser->numbers->len)
#define NUMS_LEN (parser->numbers->len)
#define check_nums_len(n) \
{ \
#define CHECK_NUMS_LEN(n) \
G_STMT_START { \
if (parser->numbers->len != n) \
YYABORT; \
}
} G_STMT_END
#define get_num(n) (((int*)parser->numbers->data)[n])
#define GET_NUM(n) (((int*)parser->numbers->data)[n])
#define TERMINAL_HEIGHT (buf_screen_height (parser->term->priv->buffer))
#define TERMINAL_WIDTH (buf_screen_width (parser->term->priv->buffer))
@ -80,44 +80,44 @@ escape_sequence: NEL
;
NEL: '\033' 'E' { vt_NEL (); };
DECRC: '\033' '8' { vt_DECRC (); };
DECSC: '\033' '7' { vt_DECSC (); };
HTS: '\033' 'H' { vt_HTS (); };
DECBI: '\033' '6' { vt_not_implemented(); };
DECFI: '\033' '9' { vt_not_implemented(); };
IND: '\033' 'D' { vt_IND (); };
RI: '\033' 'M' { vt_RI (); };
SS2: '\033' 'N' { vt_not_implemented(); };
SS3: '\033' 'O' { vt_not_implemented(); };
DECID: '\033' 'Z' { vt_not_implemented(); };
RIS: '\033' 'c' { vt_RIS (); };
DECANM: '\033' '<' { vt_not_implemented(); };
DECKPAM: '\033' '=' { vt_DECKPAM (); };
DECKPNM: '\033' '>' { vt_DECKPNM (); };
LS1R: '\033' '~' { vt_not_implemented(); };
LS2: '\033' 'n' { vt_not_implemented(); };
LS2R: '\033' '}' { vt_not_implemented(); };
LS3: '\033' 'o' { vt_not_implemented(); };
LS3R: '\033' '|' { vt_not_implemented(); };
DECDHLT: '\033' '#' '3' { vt_not_implemented(); };
DECDHLB: '\033' '#' '4' { vt_not_implemented(); };
DECSWL: '\033' '#' '5' { vt_not_implemented(); };
DECDWL: '\033' '#' '6' { vt_not_implemented(); };
DECALN: '\033' '#' '8' { vt_DECALN (); };
S7C1T: '\033' ' ' 'F' { vt_ignored (); };
S8C1T: '\033' ' ' 'G' { vt_ignored (); };
NEL: '\033' 'E' { VT_NEL; };
DECRC: '\033' '8' { VT_DECRC; };
DECSC: '\033' '7' { VT_DECSC; };
HTS: '\033' 'H' { VT_HTS; };
DECBI: '\033' '6' { VT_NOT_IMPLEMENTED; };
DECFI: '\033' '9' { VT_NOT_IMPLEMENTED; };
IND: '\033' 'D' { VT_IND; };
RI: '\033' 'M' { VT_RI; };
SS2: '\033' 'N' { VT_NOT_IMPLEMENTED; };
SS3: '\033' 'O' { VT_NOT_IMPLEMENTED; };
DECID: '\033' 'Z' { VT_NOT_IMPLEMENTED; };
RIS: '\033' 'c' { VT_RIS; };
DECANM: '\033' '<' { VT_NOT_IMPLEMENTED; };
DECKPAM: '\033' '=' { VT_DECKPAM; };
DECKPNM: '\033' '>' { VT_DECKPNM; };
LS1R: '\033' '~' { VT_NOT_IMPLEMENTED; };
LS2: '\033' 'n' { VT_NOT_IMPLEMENTED; };
LS2R: '\033' '}' { VT_NOT_IMPLEMENTED; };
LS3: '\033' 'o' { VT_NOT_IMPLEMENTED; };
LS3R: '\033' '|' { VT_NOT_IMPLEMENTED; };
DECDHLT: '\033' '#' '3' { VT_NOT_IMPLEMENTED; };
DECDHLB: '\033' '#' '4' { VT_NOT_IMPLEMENTED; };
DECSWL: '\033' '#' '5' { VT_NOT_IMPLEMENTED; };
DECDWL: '\033' '#' '6' { VT_NOT_IMPLEMENTED; };
DECALN: '\033' '#' '8' { VT_DECALN; };
S7C1T: '\033' ' ' 'F' { VT_IGNORED; };
S8C1T: '\033' ' ' 'G' { VT_IGNORED; };
SCS: '\033' SCS_set_num SCS_set { vt_SCS (get_num(0), get_num(1)); };
SCS_set_num: '(' { add_number (0); }
| ')' { add_number (1); }
| '*' { add_number (2); }
| '+' { add_number (3); };
SCS_set: '0' { add_number (0); }
| '1' { add_number (1); }
| '2' { add_number (2); }
| 'A' { add_number (3); }
| 'B' { add_number (4); };
SCS: '\033' SCS_set_num SCS_set { VT_SCS (GET_NUM(0), GET_NUM(1)); };
SCS_set_num: '(' { ADD_NUMBER (0); }
| ')' { ADD_NUMBER (1); }
| '*' { ADD_NUMBER (2); }
| '+' { ADD_NUMBER (3); };
SCS_set: '0' { ADD_NUMBER (0); }
| '1' { ADD_NUMBER (1); }
| '2' { ADD_NUMBER (2); }
| 'A' { ADD_NUMBER (3); }
| 'B' { ADD_NUMBER (4); };
/****************************************************************************/
@ -195,171 +195,171 @@ control_sequence: DECSR
;
DECSR: '\233' number '+' 'p' { vt_not_implemented(); };
DECSR: '\233' number '+' 'p' { VT_NOT_IMPLEMENTED; };
/* default parameter - 1 */
CUU: '\233' number 'A' { vt_CUU ($2); }
| '\233' 'A' { vt_CUU (1); };
CUD: '\233' number 'B' { vt_CUD ($2); }
| '\233' 'B' { vt_CUD (1); };
CUF: '\233' number 'C' { vt_CUF ($2); }
| '\233' 'C' { vt_CUF (1); };
CUB: '\233' number 'D' { vt_CUB ($2); }
| '\233' 'D' { vt_CUB (1); };
CBT: '\233' number 'Z' { vt_CBT ($2 ? $2 : 1); }
| '\233' 'Z' { vt_CBT (1); };
CHA: '\233' number 'G' { vt_CHA ($2 ? $2 : 1); }
| '\233' 'G' { vt_CHA (1); };
CHT: '\233' number 'I' { vt_CHT ($2 ? $2 : 1); }
| '\233' 'I' { vt_CHT (1); };
CNL: '\233' number 'E' { vt_CNL ($2 ? $2 : 1); }
| '\233' 'E' { vt_CNL (1); };
CPL: '\233' number 'F' { vt_CPL ($2 ? $2 : 1); }
| '\233' 'F' { vt_CPL (1); };
HPA: '\233' number '`' { vt_HPA ($2 ? $2 : 1); }
| '\233' '`' { vt_HPA (1); };
HPR: '\233' number 'a' { vt_HPR ($2 ? $2 : 1); }
| '\233' 'a' { vt_HPR (1); };
VPA: '\233' number 'd' { vt_VPA ($2 ? $2 : 1); }
| '\233' 'd' { vt_VPA (1); };
VPR: '\233' number 'e' { vt_VPR ($2 ? $2 : 1); }
| '\233' 'e' { vt_VPR (1); };
CUU: '\233' number 'A' { VT_CUU ($2); }
| '\233' 'A' { VT_CUU (1); };
CUD: '\233' number 'B' { VT_CUD ($2); }
| '\233' 'B' { VT_CUD (1); };
CUF: '\233' number 'C' { VT_CUF ($2); }
| '\233' 'C' { VT_CUF (1); };
CUB: '\233' number 'D' { VT_CUB ($2); }
| '\233' 'D' { VT_CUB (1); };
CBT: '\233' number 'Z' { VT_CBT ($2 ? $2 : 1); }
| '\233' 'Z' { VT_CBT (1); };
CHA: '\233' number 'G' { VT_CHA ($2 ? $2 : 1); }
| '\233' 'G' { VT_CHA (1); };
CHT: '\233' number 'I' { VT_CHT ($2 ? $2 : 1); }
| '\233' 'I' { VT_CHT (1); };
CNL: '\233' number 'E' { VT_CNL ($2 ? $2 : 1); }
| '\233' 'E' { VT_CNL (1); };
CPL: '\233' number 'F' { VT_CPL ($2 ? $2 : 1); }
| '\233' 'F' { VT_CPL (1); };
HPA: '\233' number '`' { VT_HPA ($2 ? $2 : 1); }
| '\233' '`' { VT_HPA (1); };
HPR: '\233' number 'a' { VT_HPR ($2 ? $2 : 1); }
| '\233' 'a' { VT_HPR (1); };
VPA: '\233' number 'd' { VT_VPA ($2 ? $2 : 1); }
| '\233' 'd' { VT_VPA (1); };
VPR: '\233' number 'e' { VT_VPR ($2 ? $2 : 1); }
| '\233' 'e' { VT_VPR (1); };
CUP: '\233' numbers 'H' { check_nums_len (2);
vt_CUP (get_num (0) ? get_num (0) : 1,
get_num (1) ? get_num (1) : 1); }
| '\233' 'H' { vt_CUP (1, 1); }
| '\233' numbers 'f' { check_nums_len (2);
vt_CUP (get_num (0) ? get_num (0) : 1,
get_num (1) ? get_num (1) : 1); } /* HVP */
| '\233' 'f' { vt_CUP (1, 1); };
CUP: '\233' numbers 'H' { CHECK_NUMS_LEN (2);
VT_CUP (GET_NUM (0) ? GET_NUM (0) : 1,
GET_NUM (1) ? GET_NUM (1) : 1); }
| '\233' 'H' { VT_CUP (1, 1); }
| '\233' numbers 'f' { CHECK_NUMS_LEN (2);
VT_CUP (GET_NUM (0) ? GET_NUM (0) : 1,
GET_NUM (1) ? GET_NUM (1) : 1); } /* HVP */
| '\233' 'f' { VT_CUP (1, 1); };
DECSCUSR: '\233' number ' ' 'q' { vt_not_implemented(); }
| '\233' ' ' 'q' { vt_not_implemented(); };
DECSCUSR: '\233' number ' ' 'q' { VT_NOT_IMPLEMENTED; }
| '\233' ' ' 'q' { VT_NOT_IMPLEMENTED; };
DECST8C: '\233' '?' number 'W' { vt_not_implemented(); };
TBC: '\233' number 'g' { vt_TBC ($2); }
| '\233' 'g' { vt_TBC (0); };
DECST8C: '\233' '?' number 'W' { VT_NOT_IMPLEMENTED; };
TBC: '\233' number 'g' { VT_TBC ($2); }
| '\233' 'g' { VT_TBC (0); };
DECSLRM: '\233' numbers 's' { vt_not_implemented(); }
| '\233' 's' { vt_not_implemented(); };
DECSLRM: '\233' numbers 's' { VT_NOT_IMPLEMENTED; }
| '\233' 's' { VT_NOT_IMPLEMENTED; };
DECSSCLS: '\233' number ' ' 'p' { vt_not_implemented(); }
| '\233' ' ' 'p' { vt_not_implemented(); };
DECSSCLS: '\233' number ' ' 'p' { VT_NOT_IMPLEMENTED; }
| '\233' ' ' 'p' { VT_NOT_IMPLEMENTED; };
DECSTBM: '\233' numbers 'r' { check_nums_len (2);
vt_DECSTBM (get_num (0) ? get_num (0) : 1,
get_num (1) ? get_num (1) : 1); }
| '\233' 'r' { vt_DECSTBM (1, TERMINAL_HEIGHT); };
DECSTBM: '\233' numbers 'r' { CHECK_NUMS_LEN (2);
VT_DECSTBM (GET_NUM (0) ? GET_NUM (0) : 1,
GET_NUM (1) ? GET_NUM (1) : 1); }
| '\233' 'r' { VT_DECSTBM (1, TERMINAL_HEIGHT); };
DECSLPP: '\233' number 't' { vt_not_implemented(); }
| '\233' 't' { vt_not_implemented(); };
DECSLPP: '\233' number 't' { VT_NOT_IMPLEMENTED; }
| '\233' 't' { VT_NOT_IMPLEMENTED; };
NP: '\233' number 'U' { vt_not_implemented(); }
| '\233' 'U' { vt_not_implemented(); };
PP: '\233' number 'V' { vt_not_implemented(); }
| '\233' 'V' { vt_not_implemented(); };
NP: '\233' number 'U' { VT_NOT_IMPLEMENTED; }
| '\233' 'U' { VT_NOT_IMPLEMENTED; };
PP: '\233' number 'V' { VT_NOT_IMPLEMENTED; }
| '\233' 'V' { VT_NOT_IMPLEMENTED; };
PPA: '\233' number ' ' 'P' { vt_not_implemented(); }
| '\233' ' ' 'P' { vt_not_implemented(); };
PPB: '\233' number ' ' 'R' { vt_not_implemented(); }
| '\233' ' ' 'R' { vt_not_implemented(); };
PPR: '\233' number ' ' 'Q' { vt_not_implemented(); }
| '\233' ' ' 'Q' { vt_not_implemented(); };
PPA: '\233' number ' ' 'P' { VT_NOT_IMPLEMENTED; }
| '\233' ' ' 'P' { VT_NOT_IMPLEMENTED; };
PPB: '\233' number ' ' 'R' { VT_NOT_IMPLEMENTED; }
| '\233' ' ' 'R' { VT_NOT_IMPLEMENTED; };
PPR: '\233' number ' ' 'Q' { VT_NOT_IMPLEMENTED; }
| '\233' ' ' 'Q' { VT_NOT_IMPLEMENTED; };
DECRQDE: '\233' '"' 'v' { vt_not_implemented(); };
DECRQDE: '\233' '"' 'v' { VT_NOT_IMPLEMENTED; };
SD: '\233' number 'S' { vt_not_implemented(); };
SU: '\233' number 'T' { vt_not_implemented(); };
SD: '\233' number 'S' { VT_NOT_IMPLEMENTED; };
SU: '\233' number 'T' { VT_NOT_IMPLEMENTED; };
DECRQUPSS: '\233' '&' 'u' { vt_not_implemented(); };
DECRQUPSS: '\233' '&' 'u' { VT_NOT_IMPLEMENTED; };
DECDC: '\233' number '\'' '~' { vt_not_implemented(); }
| '\233' '\'' '~' { vt_not_implemented(); };
DECIC: '\233' number '\'' '}' { vt_not_implemented(); }
| '\233' '\'' '}' { vt_not_implemented(); };
DCH: '\233' number 'P' { vt_DCH ($2 ? $2 : 1); }
| '\233' 'P' { vt_DCH (1); };
DL: '\233' number 'M' { vt_DL ($2 ? $2 : 1); }
| '\233' 'M' { vt_DL (1); };
ECH: '\233' number 'X' { vt_ECH ($2 ? $2 : 1); }
| '\233' 'X' { vt_ECH (1); };
ED: '\233' number 'J' { vt_ED ($2); }
| '\233' 'J' { vt_ED (0); };
EL: '\233' number 'K' { vt_EL ($2); }
| '\233' 'K' { vt_EL (0); };
ICH: '\233' number '@' { vt_ICH ($2 ? $2 : 1); }
| '\233' '@' { vt_ICH (1); };
IL: '\233' number 'L' { vt_IL ($2 ? $2 : 1); }
| '\233' 'L' { vt_IL (1); };
DECDC: '\233' number '\'' '~' { VT_NOT_IMPLEMENTED; }
| '\233' '\'' '~' { VT_NOT_IMPLEMENTED; };
DECIC: '\233' number '\'' '}' { VT_NOT_IMPLEMENTED; }
| '\233' '\'' '}' { VT_NOT_IMPLEMENTED; };
DCH: '\233' number 'P' { VT_DCH ($2 ? $2 : 1); }
| '\233' 'P' { VT_DCH (1); };
DL: '\233' number 'M' { VT_DL ($2 ? $2 : 1); }
| '\233' 'M' { VT_DL (1); };
ECH: '\233' number 'X' { VT_ECH ($2 ? $2 : 1); }
| '\233' 'X' { VT_ECH (1); };
ED: '\233' number 'J' { VT_ED ($2); }
| '\233' 'J' { VT_ED (0); };
EL: '\233' number 'K' { VT_EL ($2); }
| '\233' 'K' { VT_EL (0); };
ICH: '\233' number '@' { VT_ICH ($2 ? $2 : 1); }
| '\233' '@' { VT_ICH (1); };
IL: '\233' number 'L' { VT_IL ($2 ? $2 : 1); }
| '\233' 'L' { VT_IL (1); };
DECSCA: '\233' number '"' 'q' { vt_not_implemented(); };
DECSED: '\233' '?' number 'J' { vt_not_implemented(); }
| '\233' '?' 'J' { vt_not_implemented(); };
DECSEL: '\233' '?' number 'K' { vt_not_implemented(); }
| '\233' '?' 'K' { vt_not_implemented(); };
DECSCA: '\233' number '"' 'q' { VT_NOT_IMPLEMENTED; };
DECSED: '\233' '?' number 'J' { VT_NOT_IMPLEMENTED; }
| '\233' '?' 'J' { VT_NOT_IMPLEMENTED; };
DECSEL: '\233' '?' number 'K' { VT_NOT_IMPLEMENTED; }
| '\233' '?' 'K' { VT_NOT_IMPLEMENTED; };
DECSCPP: '\233' numbers '$' '|' { vt_not_implemented(); }
| '\233' '$' '|' { vt_not_implemented(); };
DECCARA: '\233' numbers '$' 'r' { vt_not_implemented(); };
DECCRA: '\233' numbers '$' 'v' { vt_not_implemented(); };
DECERA: '\233' numbers '$' 'z' { vt_not_implemented(); };
DECFRA: '\233' numbers '$' 'x' { vt_not_implemented(); };
DECRARA: '\233' numbers '$' 't' { vt_not_implemented(); };
DECSERA: '\233' numbers '$' '{' { vt_not_implemented(); };
DECSASD: '\233' numbers '$' '}' { vt_not_implemented(); };
DECSSDT: '\233' numbers '$' '~' { vt_not_implemented(); };
DECSCPP: '\233' numbers '$' '|' { VT_NOT_IMPLEMENTED; }
| '\233' '$' '|' { VT_NOT_IMPLEMENTED; };
DECCARA: '\233' numbers '$' 'r' { VT_NOT_IMPLEMENTED; };
DECCRA: '\233' numbers '$' 'v' { VT_NOT_IMPLEMENTED; };
DECERA: '\233' numbers '$' 'z' { VT_NOT_IMPLEMENTED; };
DECFRA: '\233' numbers '$' 'x' { VT_NOT_IMPLEMENTED; };
DECRARA: '\233' numbers '$' 't' { VT_NOT_IMPLEMENTED; };
DECSERA: '\233' numbers '$' '{' { VT_NOT_IMPLEMENTED; };
DECSASD: '\233' numbers '$' '}' { VT_NOT_IMPLEMENTED; };
DECSSDT: '\233' numbers '$' '~' { VT_NOT_IMPLEMENTED; };
DECSACE: '\233' numbers '*' 'x' { vt_not_implemented(); };
DECSNLS: '\233' numbers '*' '|' { vt_not_implemented(); };
DECRQCRA: '\233' numbers '*' 'y' { vt_not_implemented(); };
DECSACE: '\233' numbers '*' 'x' { VT_NOT_IMPLEMENTED; };
DECSNLS: '\233' numbers '*' '|' { VT_NOT_IMPLEMENTED; };
DECRQCRA: '\233' numbers '*' 'y' { VT_NOT_IMPLEMENTED; };
DSR: '\233' '?' numbers 'n' { if (nums_len() == 2)
DSR: '\233' '?' numbers 'n' { if (NUMS_LEN == 2)
{
vt_DSR (get_num (0), get_num (1), TRUE);
VT_DSR (GET_NUM (0), GET_NUM (1), TRUE);
}
else
{
vt_DSR (get_num (0), -1, TRUE);
VT_DSR (GET_NUM (0), -1, TRUE);
}
}
| '\233' numbers 'n' { if (nums_len() == 2)
| '\233' numbers 'n' { if (NUMS_LEN == 2)
{
vt_DSR (get_num (0), get_num (1), FALSE);
VT_DSR (GET_NUM (0), GET_NUM (1), FALSE);
}
else
{
vt_DSR (get_num (0), -1, FALSE);
VT_DSR (GET_NUM (0), -1, FALSE);
}
};
DA1: '\233' 'c' { vt_DA1 (); }
| '\233' number 'c' { vt_DA1 (); };
DA2: '\233' '>' 'c' { vt_DA2 (); }
| '\233' '>' number 'c' { vt_DA2 (); };
DA3: '\233' '=' 'c' { vt_DA3 (); }
| '\233' '=' number 'c' { vt_DA3 (); };
DA1: '\233' 'c' { VT_DA1; }
| '\233' number 'c' { VT_DA1; };
DA2: '\233' '>' 'c' { VT_DA2; }
| '\233' '>' number 'c' { VT_DA2; };
DA3: '\233' '=' 'c' { VT_DA3; }
| '\233' '=' number 'c' { VT_DA3; };
DECTST: '\233' numbers 'y' { vt_ignored (); };
DECTST: '\233' numbers 'y' { VT_IGNORED; };
DECSTR: '\233' '!' 'p' { vt_DECSTR (); };
DECSTR: '\233' '!' 'p' { VT_DECSTR; };
SGR: '\233' numbers 'm' { vt_SGR (); }
| '\233' 'm' { vt_SGR (); };
DECSET: '\233' '?' numbers 'h' { vt_DECSET (); }
| '\233' '?' 'h' { vt_DECSET (); };
DECRST: '\233' '?' numbers 'l' { vt_DECRST (); }
| '\233' '?' 'l' { vt_DECRST (); };
SM: '\233' numbers 'h' { vt_SM (); }
| '\233' 'h' { vt_SM (); };
RM: '\233' numbers 'l' { vt_RM (); }
| '\233' 'l' { vt_RM (); };
DECSAVE: '\233' '?' numbers 's' { vt_DECSAVE (); }
| '\233' '?' 's' { vt_DECSAVE (); };
DECRESTORE: '\233' '?' numbers 'r' { vt_DECRESTORE (); }
| '\233' '?' 'r' { vt_DECRESTORE (); };
SGR: '\233' numbers 'm' { VT_SGR; }
| '\233' 'm' { VT_SGR; };
DECSET: '\233' '?' numbers 'h' { VT_DECSET; }
| '\233' '?' 'h' { VT_DECSET; };
DECRST: '\233' '?' numbers 'l' { VT_DECRST; }
| '\233' '?' 'l' { VT_DECRST; };
SM: '\233' numbers 'h' { VT_SM; }
| '\233' 'h' { VT_SM; };
RM: '\233' numbers 'l' { VT_RM; }
| '\233' 'l' { VT_RM; };
DECSAVE: '\233' '?' numbers 's' { VT_DECSAVE; }
| '\233' '?' 's' { VT_DECSAVE; };
DECRESTORE: '\233' '?' numbers 'r' { VT_DECRESTORE; }
| '\233' '?' 'r' { VT_DECRESTORE; };
/****************************************************************************/
@ -369,14 +369,14 @@ DECRESTORE: '\233' '?' numbers 'r' { vt_DECRESTORE (); }
device_control_sequence: DECRQSS;
DECRQSS: '\220' '$' 'q' DECRQSS_param '\234' { vt_DECRQSS (get_num (0)); }
DECRQSS: '\220' '$' 'q' DECRQSS_param '\234' { VT_DECRQSS (GET_NUM (0)); }
DECRQSS_param: '$' 'g' { add_number (CODE_DECSASD); }
| '"' 'p' { add_number (CODE_DECSCL); }
| '$' '|' { add_number (CODE_DECSCPP); }
| 't' { add_number (CODE_DECSLPP); }
| '*' '|' { add_number (CODE_DECSNLS); }
| 'r' { add_number (CODE_DECSTBM); }
DECRQSS_param: '$' 'g' { ADD_NUMBER (CODE_DECSASD); }
| '"' 'p' { ADD_NUMBER (CODE_DECSCL); }
| '$' '|' { ADD_NUMBER (CODE_DECSCPP); }
| 't' { ADD_NUMBER (CODE_DECSLPP); }
| '*' '|' { ADD_NUMBER (CODE_DECSNLS); }
| 'r' { ADD_NUMBER (CODE_DECSTBM); }
;
@ -401,10 +401,10 @@ digit: '0' { $$ = 0; }
;
semicolons: ';'
| semicolons ';' { add_number (-1); }
| semicolons ';' { ADD_NUMBER (-1); }
;
numbers: number { add_number ($1); }
| semicolons number { add_number (-1); add_number ($2); }
| numbers semicolons number { add_number ($3); }
numbers: number { ADD_NUMBER ($1); }
| semicolons number { ADD_NUMBER (-1); ADD_NUMBER ($2); }
| numbers semicolons number { ADD_NUMBER ($3); }
;

View File

@ -195,7 +195,7 @@
/* SUB - cancel sequence in progress and \
print error */ \
case 0x1A: \
vt_print_char (ERROR_CHAR); \
VT_PRINT_CHAR (ERROR_CHAR); \
goto_initial (); \
\
case 0x05: \
@ -230,7 +230,7 @@
/* SUB - cancel sequence in progress and \
print error */ \
case 0x1A: \
vt_print_char (ERROR_CHAR); \
VT_PRINT_CHAR (ERROR_CHAR); \
goto_initial (); \
\
case 0x05: \
@ -307,7 +307,7 @@
{ \
g_warning ("%s: invalid UTF8 '%s'", G_STRLOC, \
parser->character->str); \
vt_print_char (ERROR_CHAR); \
VT_PRINT_CHAR (ERROR_CHAR); \
g_string_truncate (parser->character, 0); \
} \
}
@ -330,12 +330,12 @@
case -1: \
g_warning ("%s: invalid UTF8 '%s'", G_STRLOC, \
parser->character->str); \
vt_print_char (ERROR_CHAR); \
VT_PRINT_CHAR (ERROR_CHAR); \
g_string_truncate (parser->character, 0); \
break; \
\
default: \
vt_print_char (uc); \
VT_PRINT_CHAR (uc); \
g_string_truncate (parser->character, 0); \
break; \
} \
@ -352,7 +352,7 @@
{ \
if (c < 128) \
{ \
vt_print_char (c); \
VT_PRINT_CHAR (c); \
} \
else \
{ \
@ -575,7 +575,7 @@ STATE_APC_:
/* SUB - cancel sequence in progress and
print error */
case 0x1A:
vt_print_char (ERROR_CHAR);
VT_PRINT_CHAR (ERROR_CHAR);
goto_initial ();
case 0x1B:
@ -616,7 +616,7 @@ STATE_PM_:
/* SUB - cancel sequence in progress and
print error */
case 0x1A:
vt_print_char (ERROR_CHAR);
VT_PRINT_CHAR (ERROR_CHAR);
goto_initial ();
case 0x1B:
@ -657,7 +657,7 @@ STATE_OSC_:
/* SUB - cancel sequence in progress and
print error */
case 0x1A:
vt_print_char (ERROR_CHAR);
VT_PRINT_CHAR (ERROR_CHAR);
goto_initial ();
case 0x1B:
@ -847,55 +847,55 @@ static void exec_cmd (MooTermParser *parser,
switch (cmd)
{
case 0x07:
vt_BEL ();
VT_BEL;
break;
case 0x08:
vt_BS ();
VT_BS;
break;
case 0x09:
vt_TAB ();
VT_TAB;
break;
case 0x0A:
case 0x0B:
case 0x0C:
vt_LF ();
VT_LF;
break;
case 0x0D:
vt_CR ();
VT_CR;
break;
case 0x0E:
vt_SO ();
VT_SO;
break;
case 0x0F:
vt_SI ();
VT_SI;
break;
case 0x11:
vt_XON ();
VT_XON;
break;
case 0x13:
vt_XOFF ();
VT_XOFF;
break;
case 0x84:
vt_IND ();
VT_IND;
break;
case 0x85:
vt_NEL ();
VT_NEL;
break;
case 0x88:
vt_HTS ();
VT_HTS;
break;
case 0x8D:
vt_RI ();
VT_RI;
break;
case 0x8E:
vt_SS2 ();
VT_SS2;
break;
case 0x8F:
vt_SS3 ();
VT_SS3;
break;
case 0x9A:
vt_DECID ();
VT_DECID;
break;
case 0x05:

View File

@ -217,16 +217,16 @@
</kdevdoctreeview>
<kdevfilecreate>
<filetypes>
<type icon="source" ext="g" create="template" name="GAP source" >
<type icon="source" ext="g" name="GAP source" create="template" >
<descr>A new empty GAP source file</descr>
</type>
<type icon="source_cpp" ext="cpp" create="template" name="C++ Source" >
<type icon="source_cpp" ext="cpp" name="C++ Source" create="template" >
<descr>A new empty C++ file.</descr>
</type>
<type icon="source_h" ext="h" create="template" name="C/C++ Header" >
<type icon="source_h" ext="h" name="C/C++ Header" create="template" >
<descr>A new empty header file for C/C++.</descr>
</type>
<type icon="source_c" ext="c" create="template" name="C Source" >
<type icon="source_c" ext="c" name="C Source" create="template" >
<descr>A new empty C file.</descr>
</type>
</filetypes>