diff --git a/include/WindRun.h b/include/WindRun.h index fc1b5a7..da5d9cd 100644 --- a/include/WindRun.h +++ b/include/WindRun.h @@ -2,22 +2,22 @@ #define WIND_RUN_H #include -#include "WindStream.h" +#include "WindData.h" #include "WindExec.h" #include "WindLoad.h" // central header that handles running of code -int WindRun_exec(WindStream* ws, const char** code); +int WindRun_exec(const char** code); -int WindRun_load(WindStream* ws, const char** code); +int WindRun_load(const char** code); // Parses the source code for a command name. // When found, does a goto to TRANS_TO_LOAD to switch state. -int WindRun_command(WindStream* ws, const char** code); +int WindRun_command(const char** code); // Top level function that takes a stream and runs textual source code on it. -void WindRun_code(WindStream* ws, const char* code); +void WindRun_code(const char* code); #endif diff --git a/src/util/Debug.c b/old/Debug.c similarity index 100% rename from src/util/Debug.c rename to old/Debug.c diff --git a/src/stream/WindBuf.c b/old/WindBuf.c similarity index 100% rename from src/stream/WindBuf.c rename to old/WindBuf.c diff --git a/include/WindBuf.h b/old/WindBuf.h similarity index 100% rename from include/WindBuf.h rename to old/WindBuf.h diff --git a/src/stream/WindStream.c b/old/WindStream.c similarity index 100% rename from src/stream/WindStream.c rename to old/WindStream.c diff --git a/include/WindStream.h b/old/WindStream.h similarity index 100% rename from include/WindStream.h rename to old/WindStream.h diff --git a/src/code/WindRun.c b/src/code/WindRun.c index 5490408..7e98657 100644 --- a/src/code/WindRun.c +++ b/src/code/WindRun.c @@ -1,7 +1,7 @@ #include #include "WindRun.h" -int WindRun_exec(WindStream* ws, const char** code) +int WindRun_exec(const char** code) { switch(ws->command) { @@ -26,7 +26,7 @@ int WindRun_exec(WindStream* ws, const char** code) return 1; } -int WindRun_load(WindStream* ws, const char** code) +int WindRun_load(const char** code) { while(**code) { @@ -148,7 +148,7 @@ int WindRun_load(WindStream* ws, const char** code) return 1; } -int WindRun_command(WindStream* ws, const char** code) +int WindRun_command(const char** code) { while(**code) { @@ -265,33 +265,33 @@ int WindRun_command(WindStream* ws, const char** code) return 1; } -void WindRun_code(WindStream* ws, const char* code) +void WindRun_code(const char* code) { while(*code) { - if(ws->hasErr) + if(WindState_has_err()) { - WindStream_print_err(ws); + WindState_print_err(); return; } - switch(ws->state) + switch(WindState_get_cmd()) { - case StreamState_command: + case WindMode_command: WindRun_command(ws, &code); break; - case StreamState_load: + case WindMode_load: WindRun_load(ws, &code); break; - case StreamState_exec: + case WindMode_exec: WindRun_exec(ws, &code); break; } } // Executes any lasting commands, if null char is reached first. - if(ws->command != WindCommand_null) WindRun_exec(ws, &code); - if(ws->hasErr) + if(WindState_has_cmd()) WindRun_exec(ws, &code); + if(WindState_has_err()) { - WindStream_print_err(ws); + WindState_print_err(); return; } } diff --git a/src/flow/WindState.c b/src/flow/WindState.c index a517378..eac7ba4 100644 --- a/src/flow/WindState.c +++ b/src/flow/WindState.c @@ -71,7 +71,7 @@ WindCommand WindState_get_cmd(void) int WindState_has_cmd(void) { - return WindState_COMMAND == WindCommand_null; + return WindState_COMMAND != WindCommand_null; } void WindState_print_cmd(void)