diff options
| author | Ray <[email protected]> | 2017-03-26 22:49:01 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2017-03-26 22:49:01 +0200 |
| commit | b7a8a40e71f6c4467afd260c1f66e2c46891397f (patch) | |
| tree | 107369d1f3c15e9ebf55e7492e2f0a4a4ea19de4 /src/utils.c | |
| parent | 5387b4543175bee9d195b24e250a0ef863a63555 (diff) | |
| download | raylib-b7a8a40e71f6c4467afd260c1f66e2c46891397f.tar.gz raylib-b7a8a40e71f6c4467afd260c1f66e2c46891397f.zip | |
Work on configuration flags
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 //---------------------------------------------------------------------------------- |
