// ===<>===<>===-< <<< src/main.c >>> >-===<>===<>===

#include "include.h"
#include "io.h"

enum{
        CMD_MAIN_CREATE,
        CMD_MAIN_INPUT,
        CMD_MAIN_DEL,
        CMD_MAIN_SHOW,
        CMD_MAIN_LOGIC,
        CMD_MAIN_EDIT,
        CMD_MAIN_RAND,
        CMD_MAIN_COPY,
        CMD_MAIN_EXIT,
        CMD_MAIN_TEST,

        CMD_MAIN_COUNT
}CMD_MAIN_ENUM;

void declarete_cmd_main(void);

int main(){
    //declarete_cmd_main();
    init_io();
    char mode = 1;
    char inquerry;
    char querry[QUERRY_MAX];
    
    int main_cmd_id = create_cmd_list((char*[]){
    "create", "input", "del", "show",
    "logic", "edit", "rand", "copy",
    "exit", "test"
    }, 10);

    if (main_cmd_id < 0) {
        printf("Failed to create command list\n");
        return 1;
    }
    
    do{
        querry_input(&inquerry, querry);
        int cmd = cmd_querry(querry,main_cmd_id);
        //printf("CMD = %d\n",cmd);
        switch(cmd){
            case CMD_MAIN_CREATE:
                
            break;
            case CMD_MAIN_INPUT:
                
            break;
            case CMD_MAIN_DEL:
                
            break;
            case CMD_MAIN_SHOW:
                
            break;
            case CMD_MAIN_LOGIC:
                
            break;
            case CMD_MAIN_EDIT:
                
            break;
            case CMD_MAIN_RAND:
                
            break;
            case CMD_MAIN_COPY:
                
            break;
            case CMD_MAIN_EXIT:
                mode = 0;
            break;
        }   
    }while(mode);

    del_cmd_list(main_cmd_id);
    return 0;
}
