diff --git a/invertedlogic/iLPlatform/iLAbstractPlatform.h b/invertedlogic/iLPlatform/iLAbstractPlatform.h index 7c6d74e..064c828 100644 --- a/invertedlogic/iLPlatform/iLAbstractPlatform.h +++ b/invertedlogic/iLPlatform/iLAbstractPlatform.h @@ -13,6 +13,7 @@ #include "iLVersion.h" #include "iLTypes.h" #include "iLThreads.h" +#include "iLFile.h" diff --git a/invertedlogic/iLPlatform/iLAbstractPlatform.h b/invertedlogic/iLPlatform/iLAbstractPlatform.h index 7c6d74e..064c828 100644 --- a/invertedlogic/iLPlatform/iLAbstractPlatform.h +++ b/invertedlogic/iLPlatform/iLAbstractPlatform.h @@ -13,6 +13,7 @@ #include "iLVersion.h" #include "iLTypes.h" #include "iLThreads.h" +#include "iLFile.h" diff --git a/invertedlogic/iLPlatform/iLFile.h b/invertedlogic/iLPlatform/iLFile.h new file mode 100644 index 0000000..14bdc2c --- /dev/null +++ b/invertedlogic/iLPlatform/iLFile.h @@ -0,0 +1,19 @@ +#ifndef IL_FILE_H +#define IL_FILE_H + + +#include "iLTypes.h" + + +static inline iLResult iLFile_Open(iLFile* a_file, const char* a_fileName, const char* mode); +static inline iLResult iLFile_Close(iLFile* a_file); +static inline iLResult iLFile_Read(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length); +static inline iLResult iLFile_Write(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length); + + +#include "iLFile.inl" + + +#endif // IL_FILE_H + + diff --git a/invertedlogic/iLPlatform/iLAbstractPlatform.h b/invertedlogic/iLPlatform/iLAbstractPlatform.h index 7c6d74e..064c828 100644 --- a/invertedlogic/iLPlatform/iLAbstractPlatform.h +++ b/invertedlogic/iLPlatform/iLAbstractPlatform.h @@ -13,6 +13,7 @@ #include "iLVersion.h" #include "iLTypes.h" #include "iLThreads.h" +#include "iLFile.h" diff --git a/invertedlogic/iLPlatform/iLFile.h b/invertedlogic/iLPlatform/iLFile.h new file mode 100644 index 0000000..14bdc2c --- /dev/null +++ b/invertedlogic/iLPlatform/iLFile.h @@ -0,0 +1,19 @@ +#ifndef IL_FILE_H +#define IL_FILE_H + + +#include "iLTypes.h" + + +static inline iLResult iLFile_Open(iLFile* a_file, const char* a_fileName, const char* mode); +static inline iLResult iLFile_Close(iLFile* a_file); +static inline iLResult iLFile_Read(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length); +static inline iLResult iLFile_Write(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length); + + +#include "iLFile.inl" + + +#endif // IL_FILE_H + + diff --git a/invertedlogic/iLPlatform/iLFile.inl b/invertedlogic/iLPlatform/iLFile.inl new file mode 100644 index 0000000..2745a8d --- /dev/null +++ b/invertedlogic/iLPlatform/iLFile.inl @@ -0,0 +1,29 @@ + +static inline iLResult iLFile_Open(iLFile* a_file, const char* a_fileName, const char* mode) +{ + a_file = fopen(a_fileName, mode); + return iLR_OK; +} + + +static inline iLResult iLFile_Close(iLFile* a_file) +{ + fclose(a_file); + return iLR_OK; +} + + +static inline iLResult iLFile_Read(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length) +{ + fread(a_buffer, a_length, 1, a_file); + return iLR_OK; +} + + +static inline iLResult iLFile_Write(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length) +{ + fwrite(a_buffer, a_length, 1, a_file); + return iLR_OK; +} + + diff --git a/invertedlogic/iLPlatform/iLAbstractPlatform.h b/invertedlogic/iLPlatform/iLAbstractPlatform.h index 7c6d74e..064c828 100644 --- a/invertedlogic/iLPlatform/iLAbstractPlatform.h +++ b/invertedlogic/iLPlatform/iLAbstractPlatform.h @@ -13,6 +13,7 @@ #include "iLVersion.h" #include "iLTypes.h" #include "iLThreads.h" +#include "iLFile.h" diff --git a/invertedlogic/iLPlatform/iLFile.h b/invertedlogic/iLPlatform/iLFile.h new file mode 100644 index 0000000..14bdc2c --- /dev/null +++ b/invertedlogic/iLPlatform/iLFile.h @@ -0,0 +1,19 @@ +#ifndef IL_FILE_H +#define IL_FILE_H + + +#include "iLTypes.h" + + +static inline iLResult iLFile_Open(iLFile* a_file, const char* a_fileName, const char* mode); +static inline iLResult iLFile_Close(iLFile* a_file); +static inline iLResult iLFile_Read(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length); +static inline iLResult iLFile_Write(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length); + + +#include "iLFile.inl" + + +#endif // IL_FILE_H + + diff --git a/invertedlogic/iLPlatform/iLFile.inl b/invertedlogic/iLPlatform/iLFile.inl new file mode 100644 index 0000000..2745a8d --- /dev/null +++ b/invertedlogic/iLPlatform/iLFile.inl @@ -0,0 +1,29 @@ + +static inline iLResult iLFile_Open(iLFile* a_file, const char* a_fileName, const char* mode) +{ + a_file = fopen(a_fileName, mode); + return iLR_OK; +} + + +static inline iLResult iLFile_Close(iLFile* a_file) +{ + fclose(a_file); + return iLR_OK; +} + + +static inline iLResult iLFile_Read(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length) +{ + fread(a_buffer, a_length, 1, a_file); + return iLR_OK; +} + + +static inline iLResult iLFile_Write(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length) +{ + fwrite(a_buffer, a_length, 1, a_file); + return iLR_OK; +} + + diff --git a/invertedlogic/iLPlatform/iLSocket.h b/invertedlogic/iLPlatform/iLSocket.h new file mode 100644 index 0000000..a7031a3 --- /dev/null +++ b/invertedlogic/iLPlatform/iLSocket.h @@ -0,0 +1,19 @@ +#ifndef IL_SOCKET_H +#define IL_SOCKET_H + + +#include "iLTypes.h" + + +static inline iLResult iLSocket_Open(iLSocket* a_socket); +static inline iLResult iLSocket_Close(iLSocket* a_socket); +static inline iLResult iLSocket_Read(iLSocket* a_socket); +static inline iLResult iLSocket_Write(iLSocket* a_socket); + + +#include "iLSocket.inl" + + +#endif // IL_SOCKET_H + + diff --git a/invertedlogic/iLPlatform/iLAbstractPlatform.h b/invertedlogic/iLPlatform/iLAbstractPlatform.h index 7c6d74e..064c828 100644 --- a/invertedlogic/iLPlatform/iLAbstractPlatform.h +++ b/invertedlogic/iLPlatform/iLAbstractPlatform.h @@ -13,6 +13,7 @@ #include "iLVersion.h" #include "iLTypes.h" #include "iLThreads.h" +#include "iLFile.h" diff --git a/invertedlogic/iLPlatform/iLFile.h b/invertedlogic/iLPlatform/iLFile.h new file mode 100644 index 0000000..14bdc2c --- /dev/null +++ b/invertedlogic/iLPlatform/iLFile.h @@ -0,0 +1,19 @@ +#ifndef IL_FILE_H +#define IL_FILE_H + + +#include "iLTypes.h" + + +static inline iLResult iLFile_Open(iLFile* a_file, const char* a_fileName, const char* mode); +static inline iLResult iLFile_Close(iLFile* a_file); +static inline iLResult iLFile_Read(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length); +static inline iLResult iLFile_Write(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length); + + +#include "iLFile.inl" + + +#endif // IL_FILE_H + + diff --git a/invertedlogic/iLPlatform/iLFile.inl b/invertedlogic/iLPlatform/iLFile.inl new file mode 100644 index 0000000..2745a8d --- /dev/null +++ b/invertedlogic/iLPlatform/iLFile.inl @@ -0,0 +1,29 @@ + +static inline iLResult iLFile_Open(iLFile* a_file, const char* a_fileName, const char* mode) +{ + a_file = fopen(a_fileName, mode); + return iLR_OK; +} + + +static inline iLResult iLFile_Close(iLFile* a_file) +{ + fclose(a_file); + return iLR_OK; +} + + +static inline iLResult iLFile_Read(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length) +{ + fread(a_buffer, a_length, 1, a_file); + return iLR_OK; +} + + +static inline iLResult iLFile_Write(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length) +{ + fwrite(a_buffer, a_length, 1, a_file); + return iLR_OK; +} + + diff --git a/invertedlogic/iLPlatform/iLSocket.h b/invertedlogic/iLPlatform/iLSocket.h new file mode 100644 index 0000000..a7031a3 --- /dev/null +++ b/invertedlogic/iLPlatform/iLSocket.h @@ -0,0 +1,19 @@ +#ifndef IL_SOCKET_H +#define IL_SOCKET_H + + +#include "iLTypes.h" + + +static inline iLResult iLSocket_Open(iLSocket* a_socket); +static inline iLResult iLSocket_Close(iLSocket* a_socket); +static inline iLResult iLSocket_Read(iLSocket* a_socket); +static inline iLResult iLSocket_Write(iLSocket* a_socket); + + +#include "iLSocket.inl" + + +#endif // IL_SOCKET_H + + diff --git a/invertedlogic/iLPlatform/iLSocket.inl b/invertedlogic/iLPlatform/iLSocket.inl new file mode 100644 index 0000000..a22499a --- /dev/null +++ b/invertedlogic/iLPlatform/iLSocket.inl @@ -0,0 +1,22 @@ + + +static inline iLResult iLSocket_Open(iLSocket* a_socket) +{ +} + + +static inline iLResult iLSocket_Close(iLSocket* a_socket) +{ +} + + +static inline iLResult iLSocket_Read(iLSocket* a_socket) +{ +} + + +static inline iLResult iLSocket_Write(iLSocket* a_socket) +{ +} + + diff --git a/invertedlogic/iLPlatform/iLAbstractPlatform.h b/invertedlogic/iLPlatform/iLAbstractPlatform.h index 7c6d74e..064c828 100644 --- a/invertedlogic/iLPlatform/iLAbstractPlatform.h +++ b/invertedlogic/iLPlatform/iLAbstractPlatform.h @@ -13,6 +13,7 @@ #include "iLVersion.h" #include "iLTypes.h" #include "iLThreads.h" +#include "iLFile.h" diff --git a/invertedlogic/iLPlatform/iLFile.h b/invertedlogic/iLPlatform/iLFile.h new file mode 100644 index 0000000..14bdc2c --- /dev/null +++ b/invertedlogic/iLPlatform/iLFile.h @@ -0,0 +1,19 @@ +#ifndef IL_FILE_H +#define IL_FILE_H + + +#include "iLTypes.h" + + +static inline iLResult iLFile_Open(iLFile* a_file, const char* a_fileName, const char* mode); +static inline iLResult iLFile_Close(iLFile* a_file); +static inline iLResult iLFile_Read(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length); +static inline iLResult iLFile_Write(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length); + + +#include "iLFile.inl" + + +#endif // IL_FILE_H + + diff --git a/invertedlogic/iLPlatform/iLFile.inl b/invertedlogic/iLPlatform/iLFile.inl new file mode 100644 index 0000000..2745a8d --- /dev/null +++ b/invertedlogic/iLPlatform/iLFile.inl @@ -0,0 +1,29 @@ + +static inline iLResult iLFile_Open(iLFile* a_file, const char* a_fileName, const char* mode) +{ + a_file = fopen(a_fileName, mode); + return iLR_OK; +} + + +static inline iLResult iLFile_Close(iLFile* a_file) +{ + fclose(a_file); + return iLR_OK; +} + + +static inline iLResult iLFile_Read(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length) +{ + fread(a_buffer, a_length, 1, a_file); + return iLR_OK; +} + + +static inline iLResult iLFile_Write(iLFile* a_file, uint8_t* a_buffer, uint32_t a_length) +{ + fwrite(a_buffer, a_length, 1, a_file); + return iLR_OK; +} + + diff --git a/invertedlogic/iLPlatform/iLSocket.h b/invertedlogic/iLPlatform/iLSocket.h new file mode 100644 index 0000000..a7031a3 --- /dev/null +++ b/invertedlogic/iLPlatform/iLSocket.h @@ -0,0 +1,19 @@ +#ifndef IL_SOCKET_H +#define IL_SOCKET_H + + +#include "iLTypes.h" + + +static inline iLResult iLSocket_Open(iLSocket* a_socket); +static inline iLResult iLSocket_Close(iLSocket* a_socket); +static inline iLResult iLSocket_Read(iLSocket* a_socket); +static inline iLResult iLSocket_Write(iLSocket* a_socket); + + +#include "iLSocket.inl" + + +#endif // IL_SOCKET_H + + diff --git a/invertedlogic/iLPlatform/iLSocket.inl b/invertedlogic/iLPlatform/iLSocket.inl new file mode 100644 index 0000000..a22499a --- /dev/null +++ b/invertedlogic/iLPlatform/iLSocket.inl @@ -0,0 +1,22 @@ + + +static inline iLResult iLSocket_Open(iLSocket* a_socket) +{ +} + + +static inline iLResult iLSocket_Close(iLSocket* a_socket) +{ +} + + +static inline iLResult iLSocket_Read(iLSocket* a_socket) +{ +} + + +static inline iLResult iLSocket_Write(iLSocket* a_socket) +{ +} + + diff --git a/invertedlogic/iLPlatform/iLTypes.h b/invertedlogic/iLPlatform/iLTypes.h index a525182..91f896f 100644 --- a/invertedlogic/iLPlatform/iLTypes.h +++ b/invertedlogic/iLPlatform/iLTypes.h @@ -8,11 +8,13 @@ #if defined(IL_PLATFORM_UNIX) #include +typedef FILE iLFile; typedef pthread_t iLThread; typedef int32_t* iLAtomic32; typedef int64_t* iLAtomic64; #elif defined(IL_PLATFORM_WINDOWS) #include +typedef HANDLE iLFile; typedef HANDLE iLThread; typedef volatile int32_t* iLAtomic32; typedef volatile int64_t* iLAtomic64;