From b7a8a40e71f6c4467afd260c1f66e2c46891397f Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 26 Mar 2017 22:49:01 +0200 Subject: Work on configuration flags --- src/utils.c | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'src/utils.c') diff --git a/src/utils.c b/src/utils.c index b6b309cc..6a07f301 100644 --- a/src/utils.c +++ b/src/utils.c @@ -153,6 +153,29 @@ void SavePNG(const char *fileName, unsigned char *imgData, int width, int height #endif #endif +// Keep track of memory allocated +// NOTE: mallocType defines the type of data allocated +/* +void RecordMalloc(int mallocType, int mallocSize, const char *msg) +{ + // TODO: Investigate how to record memory allocation data... + // Maybe creating my own malloc function... +} +*/ + +bool IsFileExtension(const char *fileName, const char *ext) +{ + return (strcmp(GetExtension(fileName), ext) == 0); +} + +// Get the extension for a filename +const char *GetExtension(const char *fileName) +{ + const char *dot = strrchr(fileName, '.'); + if (!dot || dot == fileName) return ""; + return (dot + 1); +} + #if defined(PLATFORM_ANDROID) // Initialize asset manager from android app void InitAssetManager(AAssetManager *manager) @@ -173,24 +196,6 @@ FILE *android_fopen(const char *fileName, const char *mode) } #endif -// Keep track of memory allocated -// NOTE: mallocType defines the type of data allocated -/* -void RecordMalloc(int mallocType, int mallocSize, const char *msg) -{ - // TODO: Investigate how to record memory allocation data... - // Maybe creating my own malloc function... -} -*/ - -// Get the extension for a filename -const char *GetExtension(const char *fileName) -{ - const char *dot = strrchr(fileName, '.'); - if (!dot || dot == fileName) return ""; - return (dot + 1); -} - //---------------------------------------------------------------------------------- // Module specific Functions Definition //---------------------------------------------------------------------------------- -- cgit v1.2.3