diff --git a/build.sh b/build.sh index 3ea1d02..a6c7480 100644 --- a/build.sh +++ b/build.sh @@ -1 +1 @@ -gcc -m64 -o patcher-installer lib/miniz/*.c src/*.c && chmod +x patcher-installer +gcc -m64 -o patcher-installer lib/miniz/*.c src/*.c src/*/*.c && chmod +x patcher-installer diff --git a/src/fileReader.c b/src/fileReader.c index 573ad76..9daa167 100644 --- a/src/fileReader.c +++ b/src/fileReader.c @@ -4,14 +4,8 @@ #include #include "fileReader.h" -#include "fileUtilities.h" - -//minimum of two integers -#define min(a,b) \ - ({ __typeof__ (a) _a = (a); \ - __typeof__ (b) _b = (b); \ - _a < _b ? _a : _b; }) - +#include "utils/fileUtilities.h" +#include "utils/min.h" //Opens the given file at the given offset void initFileReader(char path[], unsigned long offset) { diff --git a/src/fileUtilities.c b/src/utils/fileUtilities.c similarity index 97% rename from src/fileUtilities.c rename to src/utils/fileUtilities.c index 394594a..838c016 100644 --- a/src/fileUtilities.c +++ b/src/utils/fileUtilities.c @@ -4,7 +4,7 @@ #include #include "fileUtilities.h" -#include "fileReader.h" +#include "../fileReader.h" //Reads the given amount of bytes from the currently open file into the given buffer. diff --git a/src/fileUtilities.h b/src/utils/fileUtilities.h similarity index 94% rename from src/fileUtilities.h rename to src/utils/fileUtilities.h index 947ee8a..0fc68ef 100644 --- a/src/fileUtilities.h +++ b/src/utils/fileUtilities.h @@ -1,7 +1,5 @@ #pragma once -#include "fileReader.h" - //A structure to store various information needed when reading from a file. struct FILE_INFO { char* name; diff --git a/src/utils/min.h b/src/utils/min.h new file mode 100644 index 0000000..9605113 --- /dev/null +++ b/src/utils/min.h @@ -0,0 +1,5 @@ +//minimum of two integers +#define min(a,b) \ + ({ __typeof__ (a) _a = (a); \ + __typeof__ (b) _b = (b); \ + _a < _b ? _a : _b; })