From 3b2abd8de40010ff5746196ad429e3024e9ac39a Mon Sep 17 00:00:00 2001 From: AlexVanin Date: Tue, 28 Jan 2014 14:43:49 +0400 Subject: [PATCH] Changed layout of Main.c file --- VaninVM/Main.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/VaninVM/Main.c b/VaninVM/Main.c index 71cb5ef..b60273c 100644 --- a/VaninVM/Main.c +++ b/VaninVM/Main.c @@ -11,8 +11,21 @@ long long cmp_int(long long* a, long long* b); double cmp_double(double* a, double* b); +void run_intepreter(char* filename); int main(int argc, char** argv) +{ + int return_code; + if (argc<2) + { + printf("%s", "File is not specified"); + return 1; + } + return_code = run_interpreter(argv[1]); + +} + +int run_interpreter(char* filename) { //ByteCode Variables FILE* input; @@ -35,14 +48,7 @@ int main(int argc, char** argv) //Running Variable int exec_status = 1; - - if (argc<2) - { - printf("%s", "File is not specified"); - return 1; - } - - fopen_s(&input, argv[1], "rb"); + fopen_s(&input, filename, "rb"); //const_pull if (read_constant(input, &const_count, &const_index) != 0) return 1;