From 08bcf37dc6fd456f0dd2547c7e67b31305f368bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20F=C3=BCrmetz?= Date: Mon, 3 Jul 2017 19:53:01 +0200 Subject: Split vterm.c into header and source --- vterm-module.c | 10 +--------- vterm-module.h | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 vterm-module.h diff --git a/vterm-module.c b/vterm-module.c index e5196ce..4da49e2 100644 --- a/vterm-module.c +++ b/vterm-module.c @@ -1,4 +1,4 @@ -#include +#include "vterm-module.h" #include #include #include @@ -10,14 +10,6 @@ #define MAX(x, y) (((x) > (y)) ? (x) : (y)) -/* Declare mandatory GPL symbol. */ -int plugin_is_GPL_compatible; - -struct Term { - VTerm *vt; - int masterfd; -}; - /* Bind NAME to FUN. */ static void bind_function(emacs_env *env, const char *name, emacs_value Sfun) { /* Set the function cell of the symbol named NAME to SFUN using diff --git a/vterm-module.h b/vterm-module.h new file mode 100644 index 0000000..745052e --- /dev/null +++ b/vterm-module.h @@ -0,0 +1,36 @@ +#include +#include + +int plugin_is_GPL_compatible; + +struct Term { + VTerm *vt; + int masterfd; +}; + +static void bind_function(emacs_env *env, const char *name, emacs_value Sfun); +static void provide(emacs_env *env, const char *feature); +static void message(emacs_env *env, char *message); +static void message_value(emacs_env *env, emacs_value value); +static int string_bytes(emacs_env *env, emacs_value string); +static emacs_value string_length(emacs_env *env, emacs_value string); +static emacs_value list(emacs_env *env, emacs_value *elements, ptrdiff_t len); +static void put_text_property(emacs_env *env, emacs_value property, + emacs_value value, emacs_value string); +static void color_text(emacs_env *env, emacs_value string, emacs_value fg, + emacs_value bg); +static void byte_to_hex(uint8_t byte, char *hex); +static emacs_value color_to_rgb_string(emacs_env *env, VTermColor color); +static void erase_buffer(emacs_env *env); +static void insert(emacs_env *env, emacs_value string); +static void goto_char(emacs_env *env, int pos); + +static void vterm_redraw(VTerm *vt, emacs_env *env); +static void vterm_flush_output(struct Term *term); +static void term_finalize(void *term); +static emacs_value Fvterm_new(emacs_env *env, ptrdiff_t nargs, + emacs_value args[], void *data); +static void process_key(struct Term *term, char *key, VTermModifier modifier); +static emacs_value Fvterm_update(emacs_env *env, ptrdiff_t nargs, + emacs_value args[], void *data); +int emacs_module_init(struct emacs_runtime *ert); -- cgit v1.0