diff options
author | YamaArashi <shadow962@live.com> | 2015-11-23 17:44:06 -0800 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2015-11-23 17:44:06 -0800 |
commit | b951fb1113b9574002f5405ebcb4750c077746ff (patch) | |
tree | 5cfc5d5b9dec5525880ef1c9aebe083020c47937 /tools/gbagfx/util.c | |
parent | 22d87f81d7097f9d2eb79bd0c784f9c74d44a79c (diff) |
dumped fonts
Diffstat (limited to 'tools/gbagfx/util.c')
-rw-r--r-- | tools/gbagfx/util.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/tools/gbagfx/util.c b/tools/gbagfx/util.c index 180b93d9b..5af380184 100644 --- a/tools/gbagfx/util.c +++ b/tools/gbagfx/util.c @@ -58,48 +58,6 @@ char *GetFileExtension(char *path) return extension; } -void ExpectFileExtension(char *path, char *expectedExtension) -{ - char *extension = GetFileExtension(path); - - if (extension == NULL) - FATAL_ERROR("\"%s\" has no file extension.\n", path); - - if (strcmp(extension, expectedExtension) != 0) - FATAL_ERROR("Unexpected file extension \"%s\". Expected \"%s\".\n", extension, expectedExtension); -} - -void AddFileExtension(char *path, char *extension) -{ - int pathLength = strlen(path); - int extensionLength = strlen(extension); - - if (pathLength + 1 + extensionLength > GBAGFX_MAX_PATH) - FATAL_ERROR("\"%s\" is too long a path to add the extension \"%s\".\n", path, extension); - - path[pathLength] = '.'; - memcpy(path + pathLength + 1, extension, extensionLength); - path[pathLength + 1 + extensionLength] = 0; -} - -void RemoveFileExtension(char *path) -{ - char *extension = GetFileExtension(path); - - if (extension == NULL) - FATAL_ERROR("\"%s\" doesn't have a file extension.\n", path); - - extension--; - - *extension = 0; -} - -void ChangeFileExtension(char *path, char *extension) -{ - RemoveFileExtension(path); - AddFileExtension(path, extension); -} - unsigned char *ReadWholeFile(char *path, int *size) { FILE *fp = fopen(path, "rb"); |