separate command handling
This commit is contained in:
parent
90db87bec9
commit
0be3768867
11 changed files with 143 additions and 52 deletions
44
kubo_command.h
Normal file
44
kubo_command.h
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright Luka Jankovic 2025
|
||||
*
|
||||
* This file is part of Kubo.
|
||||
*
|
||||
* Kubo is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* Kubo is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* Kubo. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KUBO_COMMAND_H
|
||||
#define KUBO_COMMAND_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "kubo_char_arr.h"
|
||||
#include "kubo_context.h"
|
||||
|
||||
typedef void (*kubo_command_function)(struct kubo_context *context);
|
||||
|
||||
struct kubo_command_data {
|
||||
const char *input;
|
||||
kubo_command_function function;
|
||||
};
|
||||
|
||||
void kubo_command_init();
|
||||
void kubo_command_cleanup();
|
||||
|
||||
void kubo_command_append_char(int c);
|
||||
void kubo_command_pop();
|
||||
void kubo_command_accept_cmd(struct kubo_context *context);
|
||||
void kubo_command_clear();
|
||||
char *kubo_command_get_str();
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue