writing scene
This commit is contained in:
parent
0be3768867
commit
fe34c61b12
3 changed files with 17 additions and 8 deletions
|
|
@ -19,22 +19,19 @@
|
|||
#include "kubo_command.h"
|
||||
|
||||
static inline void kubo_command_exit(struct kubo_context *context);
|
||||
static inline void kubo_command_write(struct kubo_context *context);
|
||||
|
||||
static const struct kubo_command_data kubo_commands[] = {
|
||||
{":q", kubo_command_exit}};
|
||||
{":q", kubo_command_exit}, {":w", kubo_command_write}};
|
||||
|
||||
static const size_t kubo_commands_size =
|
||||
sizeof(kubo_commands) / sizeof(kubo_commands[0]);
|
||||
|
||||
static struct kubo_char_arr command;
|
||||
|
||||
void kubo_command_init() {
|
||||
kubo_char_arr_init(&command);
|
||||
}
|
||||
void kubo_command_init() { kubo_char_arr_init(&command); }
|
||||
|
||||
void kubo_command_cleanup() {
|
||||
kubo_char_arr_free(&command);
|
||||
}
|
||||
void kubo_command_cleanup() { kubo_char_arr_free(&command); }
|
||||
|
||||
void kubo_command_append_char(int c) { kubo_char_arr_add(&command, c); }
|
||||
|
||||
|
|
@ -61,3 +58,7 @@ void kubo_command_clear() { kubo_char_arr_clear(&command); }
|
|||
static inline void kubo_command_exit(struct kubo_context *context) {
|
||||
context->exit_pending = true;
|
||||
}
|
||||
|
||||
static inline void kubo_command_write(struct kubo_context *context) {
|
||||
kubo_file_write(context);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue