Next: , Up: Api   [Contents][Index]


5.1 C Api

Emacsy provides a C API to ease integration with C and C++ programs. The C API is given below.

C Function: int emacsy_initialize (int init_flags)

Initialize Emacsy.

C Function: void emacsy_key_event (int char_code, int modifier_key_flags)

Enqueue a keyboard event.

C Function: void emacsy_mouse_event (int x, int y, int state, int button, int modifier_key_flags)

Enqueue a mouse event.

C Function: int emacsy_tick ()

Run an iteration of Emacsy’s event loop, does not block.

C Function: char *emacsy_message_or_echo_area ()
C Function: char *emacsy_mode_line ()

Return the mode line.

C Function: char *emacsy_current_buffer ()
C Function: int emacsy_run_hook_0 (char const *hook_name)

Run a hook.

C Function: int emacsy_minibuffer_point ()

Return the minibuffer point.

C Function: int emacsy_terminate ()

Terminate Emacsy; run termination hook.

C Function: SCM load_module_try (void* data)

Attempt to load a module.

The function scm_c_use_module throws an exception if it cannot find the module, so we have to split that functionality into a body function load_module_try and an error handler load_module_error.

C Function: SCM load_module_error (void *data, SCM key, SCM args)
C Function: int emacsy_load_module (char const *module)

Attempt to load a module. Returns 0 if no errors, and non-zero otherwise.

C Function: SCM modifier_key_flags_to_list (int modifier_key_flags)
C Function: SCM scm_c_string_to_symbol (char const* str)
Scheme Procedure: modifier-key-flags->list flags
C Function: SCM scm_modifier_key_flags_to_list (flags)

Convert integer flags to a list of symbols.

C Function: SCM scm_c_emacsy_ref (char const* name)

Ref name from emacsy module.


Next: , Up: Api   [Contents][Index]