diff options
Diffstat (limited to 'src/utils.c')
| -rw-r--r-- | src/utils.c | 41 |
1 files changed, 23 insertions, 18 deletions
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 //---------------------------------------------------------------------------------- |
