diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-19 05:14:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-19 05:14:18 +0300 |
commit | 5a093689570d27df5ecd7394284a670fc32234b5 (patch) | |
tree | 6f819caecb1f62583033c579305a8f12174ea049 /source/blender/blenlib/intern/fileops.c | |
parent | 0b74aab939c24a6999a67cbe58584957b69d6f49 (diff) |
use 'const char *' for imbuf and file ops.
Diffstat (limited to 'source/blender/blenlib/intern/fileops.c')
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 931dd6119a2..7a30bcde327 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -58,7 +58,7 @@ return -1 if zlib fails, -2 if the originating file does not exist note: will remove the "from" file */ -int BLI_gzip(char *from, char *to) { +int BLI_gzip(const char *from, const char *to) { char buffer[10240]; int file; int readsize = 0; @@ -98,7 +98,7 @@ int BLI_gzip(char *from, char *to) { } /* return 1 when file can be written */ -int BLI_is_writable(char *filename) +int BLI_is_writable(const char *filename) { int file; @@ -151,7 +151,7 @@ int BLI_exists(const char *file) { static char str[MAXPATHLEN+12]; -int BLI_delete(char *file, int dir, int recursive) { +int BLI_delete(const char *file, int dir, int recursive) { int err; if (recursive) { @@ -168,7 +168,7 @@ int BLI_delete(char *file, int dir, int recursive) { return err; } -int BLI_move(char *file, char *to) { +int BLI_move(const char *file, const char *to) { int err; // windows doesn't support moveing to a directory @@ -193,7 +193,7 @@ int BLI_move(char *file, char *to) { } -int BLI_copy_fileops(char *file, char *to) { +int BLI_copy_fileops(const char *file, const char *to) { int err; // windows doesn't support copying to a directory @@ -218,13 +218,13 @@ int BLI_copy_fileops(char *file, char *to) { return err; } -int BLI_link(char *file, char *to) { +int BLI_link(const char *file, const char *to) { callLocalErrorCallBack("Linking files is unsupported on Windows"); return 1; } -void BLI_recurdir_fileops(char *dirname) { +void BLI_recurdir_fileops(const char *dirname) { char *lslash; char tmp[MAXPATHLEN]; @@ -254,7 +254,7 @@ void BLI_recurdir_fileops(char *dirname) { callLocalErrorCallBack("Unable to create directory\n"); } -int BLI_rename(char *from, char *to) { +int BLI_rename(const char *from, const char *to) { if (!BLI_exists(from)) return 0; /* make sure the filenames are different (case insensitive) before removing */ @@ -273,7 +273,7 @@ int BLI_rename(char *from, char *to) { * */ static char str[MAXPATHLEN+12]; -int BLI_delete(char *file, int dir, int recursive) +int BLI_delete(const char *file, int dir, int recursive) { if(strchr(file, '"')) { printf("Error: not deleted file %s because of quote!\n", file); @@ -294,25 +294,25 @@ int BLI_delete(char *file, int dir, int recursive) return -1; } -int BLI_move(char *file, char *to) { +int BLI_move(const char *file, const char *to) { sprintf(str, "/bin/mv -f \"%s\" \"%s\"", file, to); return system(str); } -int BLI_copy_fileops(char *file, char *to) { +int BLI_copy_fileops(const char *file, const char *to) { sprintf(str, "/bin/cp -rf \"%s\" \"%s\"", file, to); return system(str); } -int BLI_link(char *file, char *to) { +int BLI_link(const char *file, const char *to) { sprintf(str, "/bin/ln -f \"%s\" \"%s\"", file, to); return system(str); } -void BLI_recurdir_fileops(char *dirname) { +void BLI_recurdir_fileops(const char *dirname) { char *lslash; char tmp[MAXPATHLEN]; @@ -330,7 +330,7 @@ void BLI_recurdir_fileops(char *dirname) { mkdir(dirname, 0777); } -int BLI_rename(char *from, char *to) { +int BLI_rename(const char *from, const char *to) { if (!BLI_exists(from)) return 0; if (BLI_exists(to)) if(BLI_delete(to, 0, 0)) return 1; |