From a64db11b6ca1c0c99937cd99129758dbbe575ac2 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 17 Jan 2012 12:45:45 +0200 Subject: 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. --- sal/osl/unx/uunxapi.cxx | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'sal/osl/unx/uunxapi.cxx') 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 @@ -144,19 +144,39 @@ return bRet; } + //######################### + //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 -- cgit