diff options
Diffstat (limited to 'src/qreg-commands.h')
| -rw-r--r-- | src/qreg-commands.h | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/src/qreg-commands.h b/src/qreg-commands.h index e224797..d0f6990 100644 --- a/src/qreg-commands.h +++ b/src/qreg-commands.h @@ -51,48 +51,44 @@ gboolean teco_state_expectqreg_insert_completion(teco_machine_main_t *ctx, const * Super class for states accepting Q-Register specifications. */ #define TECO_DEFINE_STATE_EXPECTQREG(NAME, ...) \ - static teco_state_t * \ - NAME##_input(teco_machine_main_t *ctx, gunichar chr, GError **error) \ - { \ - return teco_state_expectqreg_input(ctx, chr, error); \ - } \ TECO_DEFINE_STATE(NAME, \ .initial_cb = (teco_state_initial_cb_t)teco_state_expectqreg_initial, \ + .input_cb = (teco_state_input_cb_t)teco_state_expectqreg_input, \ .process_edit_cmd_cb = (teco_state_process_edit_cmd_cb_t) \ teco_state_expectqreg_process_edit_cmd, \ .insert_completion_cb = (teco_state_insert_completion_cb_t) \ teco_state_expectqreg_insert_completion, \ .style = SCE_SCITECO_QREG, \ .expectqreg.type = TECO_QREG_REQUIRED, \ - .expectqreg.got_register_cb = NAME##_got_register, /* always required */ \ ##__VA_ARGS__ \ - ) + ); \ + TECO_ASSERT_SAFE(NAME.expectqreg.got_register_cb != NULL) /* * FIXME: Some of these states are referenced only in qreg-commands.c, * so they should be moved there? */ -TECO_DECLARE_STATE(teco_state_pushqreg); -TECO_DECLARE_STATE(teco_state_popqreg); +extern teco_state_t teco_state_pushqreg; +extern teco_state_t teco_state_popqreg; -TECO_DECLARE_STATE(teco_state_eqcommand); -TECO_DECLARE_STATE(teco_state_loadqreg); +extern teco_state_t teco_state_eqcommand; +extern teco_state_t teco_state_loadqreg; -TECO_DECLARE_STATE(teco_state_epctcommand); -TECO_DECLARE_STATE(teco_state_saveqreg); +extern teco_state_t teco_state_epctcommand; +extern teco_state_t teco_state_saveqreg; -TECO_DECLARE_STATE(teco_state_queryqreg); +extern teco_state_t teco_state_queryqreg; -TECO_DECLARE_STATE(teco_state_ctlucommand); -TECO_DECLARE_STATE(teco_state_setqregstring_nobuilding); -TECO_DECLARE_STATE(teco_state_eucommand); -TECO_DECLARE_STATE(teco_state_setqregstring_building); +extern teco_state_t teco_state_ctlucommand; +extern teco_state_t teco_state_setqregstring_nobuilding; +extern teco_state_t teco_state_eucommand; +extern teco_state_t teco_state_setqregstring_building; -TECO_DECLARE_STATE(teco_state_getqregstring); -TECO_DECLARE_STATE(teco_state_setqreginteger); -TECO_DECLARE_STATE(teco_state_increaseqreg); +extern teco_state_t teco_state_getqregstring; +extern teco_state_t teco_state_setqreginteger; +extern teco_state_t teco_state_increaseqreg; -TECO_DECLARE_STATE(teco_state_macro); -TECO_DECLARE_STATE(teco_state_indirect); +extern teco_state_t teco_state_macro; +extern teco_state_t teco_state_indirect; -TECO_DECLARE_STATE(teco_state_copytoqreg); +extern teco_state_t teco_state_copytoqreg; |
