♻ Move utility functions into separate directory

This commit is contained in:
C-3PO 2018-07-24 17:13:51 +02:00
parent 8b8df10e33
commit 7019271bfe
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
5 changed files with 9 additions and 12 deletions

View file

@ -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

View file

@ -4,14 +4,8 @@
#include <string.h> #include <string.h>
#include "fileReader.h" #include "fileReader.h"
#include "fileUtilities.h" #include "utils/fileUtilities.h"
#include "utils/min.h"
//minimum of two integers
#define min(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })
//Opens the given file at the given offset //Opens the given file at the given offset
void initFileReader(char path[], unsigned long offset) { void initFileReader(char path[], unsigned long offset) {

View file

@ -4,7 +4,7 @@
#include <string.h> #include <string.h>
#include "fileUtilities.h" #include "fileUtilities.h"
#include "fileReader.h" #include "../fileReader.h"
//Reads the given amount of bytes from the currently open file into the given buffer. //Reads the given amount of bytes from the currently open file into the given buffer.

View file

@ -1,7 +1,5 @@
#pragma once #pragma once
#include "fileReader.h"
//A structure to store various information needed when reading from a file. //A structure to store various information needed when reading from a file.
struct FILE_INFO { struct FILE_INFO {
char* name; char* name;

5
src/utils/min.h Normal file
View file

@ -0,0 +1,5 @@
//minimum of two integers
#define min(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })