projects
/
platform
/
upstream
/
flac.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename _flac_stat to flac_stat_s.
[platform/upstream/flac.git]
/
src
/
share
/
grabbag
/
file.c
diff --git
a/src/share/grabbag/file.c
b/src/share/grabbag/file.c
index
1394ea5
..
dd2880c
100644
(file)
--- a/
src/share/grabbag/file.c
+++ b/
src/share/grabbag/file.c
@@
-1,5
+1,5
@@
/* grabbag - Convenience lib for various routines common to several tools
/* grabbag - Convenience lib for various routines common to several tools
- * Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Josh Coalson
+ * Copyright (C) 2002,2003,2004,2005,2006,2007,2008
,2009
Josh Coalson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@
-50,22
+50,22
@@
void grabbag__file_copy_metadata(const char *srcpath, const char *destpath)
{
void grabbag__file_copy_metadata(const char *srcpath, const char *destpath)
{
- struct
stat
srcstat;
+ struct
flac_stat_s
srcstat;
struct utimbuf srctime;
struct utimbuf srctime;
- if(0 == stat(srcpath, &srcstat)) {
+ if(0 ==
flac_
stat(srcpath, &srcstat)) {
srctime.actime = srcstat.st_atime;
srctime.modtime = srcstat.st_mtime;
srctime.actime = srcstat.st_atime;
srctime.modtime = srcstat.st_mtime;
- (void)chmod(destpath, srcstat.st_mode);
- (void)utime(destpath, &srctime);
+ (void)
flac_
chmod(destpath, srcstat.st_mode);
+ (void)
flac_
utime(destpath, &srctime);
}
}
}
}
-off_t grabbag__file_get_filesize(const char *srcpath)
+
FLAC__
off_t grabbag__file_get_filesize(const char *srcpath)
{
{
- struct
stat
srcstat;
+ struct
flac_stat_s
srcstat;
- if(0 == stat(srcpath, &srcstat))
+ if(0 ==
flac_
stat(srcpath, &srcstat))
return srcstat.st_size;
else
return -1;
return srcstat.st_size;
else
return -1;
@@
-86,9
+86,9
@@
const char *grabbag__file_get_basename(const char *srcpath)
FLAC__bool grabbag__file_change_stats(const char *filename, FLAC__bool read_only)
{
FLAC__bool grabbag__file_change_stats(const char *filename, FLAC__bool read_only)
{
- struct
stat
stats;
+ struct
flac_stat_s
stats;
- if(0 == stat(filename, &stats)) {
+ if(0 ==
flac_
stat(filename, &stats)) {
#if !defined _MSC_VER && !defined __MINGW32__
if(read_only) {
stats.st_mode &= ~S_IWUSR;
#if !defined _MSC_VER && !defined __MINGW32__
if(read_only) {
stats.st_mode &= ~S_IWUSR;
@@
-104,7
+104,7
@@
FLAC__bool grabbag__file_change_stats(const char *filename, FLAC__bool read_only
else
stats.st_mode |= S_IWRITE;
#endif
else
stats.st_mode |= S_IWRITE;
#endif
- if(0 != chmod(filename, stats.st_mode))
+ if(0 !=
flac_
chmod(filename, stats.st_mode))
return false;
}
else
return false;
}
else
@@
-145,14
+145,14
@@
FLAC__bool grabbag__file_are_same(const char *f1, const char *f2)
CloseHandle(h2);
return same;
#else
CloseHandle(h2);
return same;
#else
- struct
stat
s1, s2;
- return f1 && f2 &&
stat(f1, &s1) == 0 &&
stat(f2, &s2) == 0 && s1.st_ino == s2.st_ino && s1.st_dev == s2.st_dev;
+ struct
flac_stat_s
s1, s2;
+ return f1 && f2 &&
flac_stat(f1, &s1) == 0 && flac_
stat(f2, &s2) == 0 && s1.st_ino == s2.st_ino && s1.st_dev == s2.st_dev;
#endif
}
FLAC__bool grabbag__file_remove_file(const char *filename)
{
#endif
}
FLAC__bool grabbag__file_remove_file(const char *filename)
{
- return grabbag__file_change_stats(filename, /*read_only=*/false) && 0 == unlink(filename);
+ return grabbag__file_change_stats(filename, /*read_only=*/false) && 0 ==
flac_
unlink(filename);
}
FILE *grabbag__file_get_binary_stdin(void)
}
FILE *grabbag__file_get_binary_stdin(void)