commit 1695143f594d7f21391c5842278b37eb73717c69 Author: Oleg Levkin <uventik999@gmail.com> Date: Mon, 15 Jun 2026 23:13:40 +0300 [INIT]: Init Commit ^^^ Diffstat:
| A | CShell | | | 0 | |
| A | compile.sh | | | 1 | + |
| A | main.c | | | 53 | +++++++++++++++++++++++++++++++++++++++++++++++++++++ |
3 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/CShell b/CShell Binary files differ. diff --git a/compile.sh b/compile.sh @@ -0,0 +1 @@ +gcc main.c -o CShell diff --git a/main.c b/main.c @@ -0,0 +1,53 @@ +#include <malloc.h> +#include <stdio.h> +#include <sys/types.h> +#include <unistdio.h> + +typedef struct { + char *get_buff; + size_t s_get_buff; +} getLineStruct; + +getLineStruct *in_get(void); +void show_greet(void); + +int main(void) { + + // First Inits + _Bool is_exit = 0; + getLineStruct *in_buff; + + // INFO: Main Cycle (Entry Point of Exec) + while (!is_exit) { + show_greet(); + in_buff = in_get(); + } +} + +getLineStruct *in_get(void) { + getLineStruct *in_buff = malloc(sizeof(getLineStruct)); + + getline(&in_buff->get_buff, &in_buff->s_get_buff, stdin); + + return in_buff; +} + +char **tokenize_line(getLineStruct *gls) { // TODO: + char c = 'a'; + char **arr; + int a = 0; + int b = 0; + + // while (c != '\n' && c != '\0') { + // if (c == ' ') { + // a++; + // } + // } + + for (;;) { + } + + return arr; // Ret: addr of array of tokens +} + +void show_greet(void) { printf("> "); }