Implement basic variables (to hide pointers from logs)

This commit is contained in:
2022-05-31 17:43:41 +04:00
parent 20b2013007
commit 5314ef2cae
9 changed files with 505 additions and 280 deletions
+16
View File
@@ -3,11 +3,27 @@
#include <stdio.h>
enum shell_var_type {
SHELL_VAR_SINT,
SHELL_VAR_UINT,
SHELL_VAR_POINTER,
};
#define SHELL_VAR_NAME_LEN 16
struct shell_var {
struct shell_var *next;
enum shell_var_type type;
char name[SHELL_VAR_NAME_LEN];
union {ssize_t sint; size_t uint; uint64_t uint64; void *ptr;} value;
};
struct shell_ctx {
FILE *fin;
FILE *fout;
int reproducible;
const char *hist_file;
struct shell_var *var;
};
void *run_test(struct shell_ctx *ctx);