feat(file): added enum for error handling
This commit is contained in:
parent
5ea177d928
commit
59928a9a55
3 changed files with 14 additions and 5 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -65,5 +65,7 @@ compile_commands.json
|
|||
CTestTestfile.cmake
|
||||
_deps
|
||||
CMakeUserPresets.json
|
||||
|
||||
build
|
||||
|
||||
# clangd
|
||||
.cache/
|
||||
|
|
|
|||
|
|
@ -9,7 +9,12 @@
|
|||
#ifndef COSMS_CORE_FILE
|
||||
#define COSMS_CORE_FILE
|
||||
|
||||
void cosms_core_file_read(char *path);
|
||||
void cosms_core_file_write(char *path);
|
||||
typedef enum {
|
||||
COSMS_FILE_OK = 0,
|
||||
COSMS_FILE_NOT_FOUND = -1,
|
||||
} CosmsFileError;
|
||||
|
||||
CosmsFileError cosms_core_file_read(char *path);
|
||||
CosmsFileError cosms_core_file_write(char *path);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -10,10 +10,12 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
void cosms_core_file_read(char *path) {
|
||||
CosmsFileError cosms_core_file_read(char *path) {
|
||||
printf("Hello, World!");
|
||||
return COSMS_FILE_OK;
|
||||
}
|
||||
|
||||
void cosms_core_file_write(char *path) {
|
||||
CosmsFileError cosms_core_file_write(char *path) {
|
||||
printf("Hello, World");
|
||||
return COSMS_FILE_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue