summaryrefslogtreecommitdiff
path: root/sal/osl/unx/uunxapi.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2012-01-17 12:45:45 +0200
committerTor Lillqvist <tlillqvist@suse.com>2012-01-18 23:15:42 +0200
commita64db11b6ca1c0c99937cd99129758dbbe575ac2 (patch)
tree0132ea0e43c6311a8163daa757e10b906ec117fa /sal/osl/unx/uunxapi.cxx
parent800806ba850c7fd03e37acb011fa993e08cb8fc8 (diff)
Add some non-public API to be used by SvFileStream
Having SvFileStream call the file opening etc functions here, instead of calling open() directly itself, means we won't have to duplicate the Android .apk hooks there, too.
Diffstat (limited to 'sal/osl/unx/uunxapi.cxx')
-rw-r--r--sal/osl/unx/uunxapi.cxx34
1 files changed, 27 insertions, 7 deletions
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx
index 86e86e2bb32d..8abe57f3b2f7 100644
--- a/sal/osl/unx/uunxapi.cxx
+++ b/sal/osl/unx/uunxapi.cxx
@@ -145,18 +145,38 @@
}
//#########################
+ //stat_c
+ int stat_c(const char* cpPath, struct stat* buf)
+ {
+#ifdef ANDROID
+ if (strncmp(cpPath, "/assets", sizeof("/assets")-1) == 0 &&
+ (cpPath[sizeof("/assets")-1] == '\0' ||
+ cpPath[sizeof("/assets")-1] == '/'))
+ return lo_apk_lstat(cpPath, buf);
+#endif
+ return stat(cpPath, buf);
+ }
+
+ //#########################
+ //lstat_c
+ int lstat_c(const char* cpPath, struct stat* buf)
+ {
+#ifdef ANDROID
+ if (strncmp(cpPath, "/assets", sizeof("/assets")-1) == 0 &&
+ (cpPath[sizeof("/assets")-1] == '\0' ||
+ cpPath[sizeof("/assets")-1] == '/'))
+ return lo_apk_lstat(cpPath, buf);
+#endif
+ return lstat(cpPath, buf);
+ }
+
+ //#########################
//lstat_u
int lstat_u(const rtl_uString* pustrPath, struct stat* buf)
{
#ifndef MACOSX // not MACOSX
rtl::OString fn = OUStringToOString(pustrPath);
-#ifdef ANDROID
- if (strncmp(fn.getStr(), "/assets", sizeof("/assets")-1) == 0 &&
- (fn.getStr()[sizeof("/assets")-1] == '\0' ||
- fn.getStr()[sizeof("/assets")-1] == '/'))
- return lo_apk_lstat(fn.getStr(), buf);
-#endif
- return lstat(fn.getStr(), buf);
+ return lstat_c(fn.getStr(), buf);
#else
return lstat(macxp_resolveAliasAndConvert(pustrPath).getStr(), buf);
#endif