Implement common command buffer for the shell and os

This commit is contained in:
2023-01-31 02:38:48 +00:00
parent 68cfb39f8d
commit d16177c36d
13 changed files with 285 additions and 234 deletions

10
shell.h
View File

@@ -11,6 +11,7 @@
#define SHELL_H_INCLUDED
#include <stdio.h>
#include <threads.h>
#include "umka.h"
#include "io.h"
@@ -40,11 +41,15 @@ struct shell_ctx {
struct shell_var *var;
FILE *fin;
FILE *fout;
const int *running;
cnd_t cmd_done;
mtx_t cmd_mutex;
};
struct shell_ctx *
shell_init(int reproducible, const char *hist_file, struct umka_ctx *umka,
struct umka_io *io, FILE *fin, FILE *fout);
struct umka_io *io, FILE *fin, FILE *fout, const int *running);
void
shell_close(struct shell_ctx *shell);
@@ -52,4 +57,7 @@ shell_close(struct shell_ctx *shell);
void *
run_test(struct shell_ctx *ctx);
void
umka_run_cmd_sync(struct shell_ctx *ctx);
#endif // SHELL_H_INCLUDED