diff --git a/Include/Iony/Core/Console.h b/Include/Iony/Core/Console.h new file mode 100644 index 0000000..246ac68 --- /dev/null +++ b/Include/Iony/Core/Console.h @@ -0,0 +1,29 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ----------------------------------------------------------------------------- + * File: Console.h + * Description: + * This file contains the functions for reading and writting to the console. + * + * Author: Mineplay + * ----------------------------------------------------------------------------- + */ +#ifndef IONY_CONSOLE +#define IONY_CONSOLE + +#include "../Utils/Error.h" + +IonyError iony_print(char *text); + +#endif diff --git a/Include/Iony/Utils/Error.h b/Include/Iony/Utils/Error.h index 9fed0c9..4c45b41 100644 --- a/Include/Iony/Utils/Error.h +++ b/Include/Iony/Utils/Error.h @@ -26,6 +26,6 @@ typedef enum { IONY_ERROR_NONE = 0, IONY_ERROR_INVALID_POINTER = 1, -} FledastyError; +} IonyError; #endif diff --git a/Src/Core/Console.c b/Src/Core/Console.c new file mode 100644 index 0000000..e6088af --- /dev/null +++ b/Src/Core/Console.c @@ -0,0 +1,36 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ----------------------------------------------------------------------------- + * File: Console.c + * Description: + * This file contains the functions for reading and writting to the console. + * + * Author: Mineplay + * ----------------------------------------------------------------------------- + */ +#include "../../Include/Iony/Core/Console.h" + +IonyError iony_print(char *text) { + if (text == ((void*)0)) { + return IONY_ERROR_INVALID_POINTER; + } + + #if defined(_WIN32) + + #elif defined(__linux__) + + #endif + + return IONY_ERROR_NONE; +} diff --git a/Tests/Main.c b/Tests/Main.c index a0ba57d..97f2c4c 100644 --- a/Tests/Main.c +++ b/Tests/Main.c @@ -19,9 +19,13 @@ * Author: Mineplay * ----------------------------------------------------------------------------- */ -#include +#include +#include int main(void) { - printf("Hello, World!\n"); + if (iony_print("Hello, World!\n") != IONY_ERROR_NONE) { + return -1; + } + return 0; } \ No newline at end of file