Changeset 589 in vbox
- Timestamp:
- Feb 4, 2007 12:25:57 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 18212
- Location:
- trunk/src/libs/xpcom18a4
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/Makefile.kmk
r227 r589 23 23 24 24 25 # We start by creating a couple of templates for building XPCOM. In L4, this is slightly 26 # complicated by the fact that we still build the tools for use in Linux, since L4 isn't 27 # really up to scratch yet as a development environment. Whereas formerly the operating 28 # system definitions were "hard coded" by copying the correct file to prcpucfg.h, we now 29 # use a file which will include the correct definitions based on whether the variable 30 # __LINUX_XPCOM__ or __L4_XPCOM__ is defined. Unfortunately, we can't use __LINUX__ and 31 # __L4ENV__, since these are defined globally, not on a per-template basis, so __L4ENV__ 32 # will also be defined when building the Linux-based tools. 33 34 XPCOM_SUFF_LIB.linux = .a 35 XPCOM_SUFF_LIB.l4 = .a 36 XPCOM_SUFF_LIB = $(XPCOM_SUFF_LIB.$(BUILD_TARGET)) 37 XPCOM_SUFF_DLL.linux = .so 38 XPCOM_SUFF_DLL.l4 = .s.so 39 XPCOM_SUFF_DLL = $(XPCOM_SUFF_DLL.$(BUILD_TARGET)) 40 41 # 42 # Template for building the XPCOM libraries 43 # 44 TEMPLATE_XPCOM = XPCOM libraries 45 TEMPLATE_XPCOM_TOOL = GCC3 46 TEMPLATE_XPCOM_CXXFLAGS = -pipe -fPIC -ansi -Wall -Wno-unused -Wno-non-virtual-dtor \ 25 # 26 # Template for building the XPCOM libraries (shared). 27 # 28 TEMPLATE_XPCOM = XPCOM libraries (shared) 29 TEMPLATE_XPCOM_EXTENDS = VBOXR3NP 30 TEMPLATE_XPCOM_ASTOOL = $(TEMPLATE_VBOXR3NP_TOOL) 31 TEMPLATE_XPCOM_ASFLAGS = $(NO_SUCH_VARIABLE) 32 TEMPLATE_XPCOM_ASDEFS = $(NO_SUCH_VARIABLE) 33 TEMPLATE_XPCOM_CXXFLAGS = -pipe -ansi -Wall -Wno-unused -Wno-non-virtual-dtor \ 47 34 $(VBOX_GCC_Wno-invalid-offsetof) -Wno-sign-compare -Wno-unused -Wno-ctor-dtor-privacy 35 48 36 TEMPLATE_XPCOM_CXXFLAGS.debug = -fno-inline 49 37 TEMPLATE_XPCOM_CXXFLAGS.release = -O 50 38 TEMPLATE_XPCOM_CXXFLAGS.profile = -O 39 TEMPLATE_XPCOM_CXXFLAGS.darwin = -fpascal-strings -fshort-wchar -fno-common -fno-rtti 40 TEMPLATE_XPCOM_CXXFLAGS.l4 = -fno-exceptions -nostdinc 51 41 TEMPLATE_XPCOM_CXXFLAGS.linux = -pthread 52 TEMPLATE_XPCOM_CXXFLAGS.l4 = -fno-exceptions -nostdinc 53 TEMPLATE_XPCOM_CFLAGS = -pipe -fPIC -ansi -pthread -Wall -Wno-unused \ 54 -Wno-parentheses -Wno-uninitialized 42 TEMPLATE_XPCOM_CFLAGS = -pipe -Wall -Wno-unused -Wno-parentheses -Wno-uninitialized 55 43 TEMPLATE_XPCOM_CFLAGS.debug = -fno-inline 56 44 TEMPLATE_XPCOM_CFLAGS.release = -O 57 45 TEMPLATE_XPCOM_CFLAGS.profile = -O 58 TEMPLATE_XPCOM_CFLAGS.linux = -pthread59 46 TEMPLATE_XPCOM_CFLAGS.l4 = -nostdinc 60 TEMPLATE_XPCOM_DEFS = MOZILLA_CLIENT=1 MOZ_PRESERVE_PIC 47 TEMPLATE_XPCOM_CFLAGS.linux = -pthread -ansi 48 TEMPLATE_XPCOM_DEFS = MOZILLA_CLIENT=1 61 49 TEMPLATE_XPCOM_DEFS.amd64 = HAVE_VA_LIST_AS_ARRAY HAVE_VA_COPY VA_COPY\(a\,b\)=__builtin_va_copy\(a\,b\) 62 TEMPLATE_XPCOM_DEFS.linux = XP_UNIX=1 __LINUX_XPCOM__ OSTYPE="Linux2.6" OSARCH="Linux" \ 63 MOZ_DLL_SUFFIX="\".so\"" 64 TEMPLATE_XPCOM_DEFS.l4 = XP_UNIX=1 __L4_XPCOM__ OSTYPE="L4ENV" OSARCH="L4" \ 65 MOZ_DLL_SUFFIX="\".s.so\"" L4ENV 50 TEMPLATE_XPCOM_DEFS.darwin = OSTYPE=\"Darwin8.8.1\" OSARCH=\"Darwin\" MOZ_DLL_SUFFIX=\".dylib\" XP_UNIX=1 XP_MACOSX=1 51 TEMPLATE_XPCOM_DEFS.linux = OSTYPE=\"Linux2.6\" OSARCH=\"Linux\" MOZ_DLL_SUFFIX=\".so\" XP_UNIX=1 52 TEMPLATE_XPCOM_DEFS.l4 = OSTYPE=\"L4ENV\" OSARCH=\"L4\" MOZ_DLL_SUFFIX=\".s.so\" XP_UNIX=1 L4ENV 53 TEMPLATE_XPCOM_DEFS.os2 = OSTYPE=\"OS/2 4.5\" OSARCH=\"OS/2\" MOZ_DLL_SUFFIX=\".dll\" XP_UNIX=1 54 TEMPLATE_XPCOM_LDFLAGS.darwin = $(VBOXR3NP_LDFLAGS.darwin) \ 55 -fshort-wchar -fno-rtti -fno-exceptions -fpascal-strings \ 56 -framework CoreServices -framework CoreFoundation -framework Foundation -framework AppKit -framework Carbon 57 ifeq ($(filter os2 win,$(BUILD_TARGET)),) 58 TEMPLATE_XPCOM_CXXFLAGS += -fPIC 59 TEMPLATE_XPCOM_CFLAGS += -fPIC 60 TEMPLATE_XPCOM_LDFLAGS += -fPIC 61 TEMPLATE_XPCOM_DEFS += MOZ_PRESERVE_PIC 62 endif 66 63 TEMPLATE_XPCOM_INCS = $(PATH_TARGET) \ 67 64 xpcom/build \ … … 85 82 $(PATH_BIN)/sdk/include/xpcom/xpcom \ 86 83 $(PATH_BIN)/sdk/include/xpcom/ipcd 84 TEMPLATE_XPCOM_INCS.darwin = /Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon 87 85 TEMPLATE_XPCOM_INCS.l4 = $(L4_INCDIR) $(VBOX_L4_GCC3_INCS) 88 86 TEMPLATE_XPCOM_LDFLAGS.l4 = $(L4_DIR)/lib/x86_586/crt0.o \ 89 -T$(L4_DIR)/lib/x86_586/main_rel.ld -nostdlib \90 # -Wl,--whole-archive,--no-allow-shlib-undefined87 -T$(L4_DIR)/lib/x86_586/main_rel.ld -nostdlib \ 88 # -Wl,--whole-archive,--no-allow-shlib-undefined 91 89 TEMPLATE_XPCOM_LIBS.l4 = $(VBOX_GCC_LIBGCC) 90 TEMPLATE_XPCOM_ORDERDEPS = $(foreach hdrinst, $(filter %-HEADERS, $(INSTALLS)), $(TARGET_$(hdrinst))) 91 92 92 93 93 # 94 94 # Template for building the XPCOM executables 95 95 # 96 TEMPLATE_XPCOMEXE = XPCOM executable files 97 TEMPLATE_XPCOMEXE_TOOL = GCC3 98 TEMPLATE_XPCOMEXE_CXXFLAGS = -pipe -ansi -Wall -Wno-non-virtual-dtor 99 TEMPLATE_XPCOMEXE_CXXFLAGS.debug = -fno-inline 100 TEMPLATE_XPCOMEXE_CXXFLAGS.release = -O 101 TEMPLATE_XPCOMEXE_CXXFLAGS.profile = -O 102 TEMPLATE_XPCOMEXE_CXXFLAGS.linux = -pthread 103 TEMPLATE_XPCOMEXE_CXXFLAGS.l4 = -fno-exceptions -nostdinc 104 TEMPLATE_XPCOMEXE_CFLAGS = -pipe -ansi -Wall 105 TEMPLATE_XPCOMEXE_CFLAGS.debug = -fno-inline 106 TEMPLATE_XPCOMEXE_CFLAGS.release = -O 107 TEMPLATE_XPCOMEXE_CFLAGS.profile = -O 108 TEMPLATE_XPCOMEXE_CFLAGS.linux = -pthread 109 TEMPLATE_XPCOMEXE_CFLAGS.l4 = -fno-exceptions -nostdinc 110 TEMPLATE_XPCOMEXE_DEFS = MOZILLA_CLIENT=1 BUILD_DCONNECT="1" 111 TEMPLATE_XPCOMEXE_DEFS.linux = XP_UNIX=1 __LINUX_XPCOM__ OSTYPE="Linux2.6" \ 112 OSARCH="Linux" MOZ_DLL_SUFFIX="\".so\"" _BSD_SOURCE 113 TEMPLATE_XPCOMEXE_DEFS.l4 = XP_UNIX=1 __L4_XPCOM__ OSTYPE="L4ENV" OSARCH="L4" \ 114 MOZ_DLL_SUFFIX="\".s.so\"" _BSD_SOURCE L4ENV 115 TEMPLATE_XPCOMEXE_INCS = $(PATH_TARGET) ipc/ipcd/shared/src \ 116 $(PATH_BIN)/sdk/include \ 117 $(PATH_BIN)/sdk/include/xpcom \ 118 $(PATH_BIN)/sdk/include/xpcom/nsprpub \ 119 $(PATH_BIN)/sdk/include/xpcom/string \ 120 $(PATH_BIN)/sdk/include/xpcom/xpcom \ 121 $(PATH_BIN)/sdk/include/xpcom/ipcd 122 TEMPLATE_XPCOMEXE_INCS.l4 = $(L4_INCDIR) $(VBOX_L4_GCC3_INCS) 123 TEMPLATE_XPCOMEXE_LIBS = \ 124 $(PATH_LIB)/VBox-xpcom-ipcshared$(VBOX_SUFF_LIB) \ 125 $(PATH_BIN)/VBoxXPCOM$(XPCOM_SUFF_DLL) 126 TEMPLATE_XPCOMEXE_LIBS.linux = dl $(LIB_PTHREAD) 127 TEMPLATE_XPCOMEXE_LIBS.l4 = $(LIB_RUNTIME) $(VBOX_GCC_LIBGCC) 128 TEMPLATE_XPCOMEXE_LDFLAGS.l4 = $(L4_DIR)/lib/x86_586/crt0.o \ 96 TEMPLATE_XPCOMEXE = XPCOM executable files (testcases) 97 TEMPLATE_XPCOMEXE_EXTENDS = XPCOM 98 ## @todo undo -fPIC. 99 TEMPLATE_XPCOMEXE_INCS = $(PATH_TARGET) ipc/ipcd/shared/src \ 100 $(PATH_BIN)/sdk/include \ 101 $(PATH_BIN)/sdk/include/xpcom \ 102 $(PATH_BIN)/sdk/include/xpcom/nsprpub \ 103 $(PATH_BIN)/sdk/include/xpcom/string \ 104 $(PATH_BIN)/sdk/include/xpcom/xpcom \ 105 $(PATH_BIN)/sdk/include/xpcom/ipcd 106 TEMPLATE_XPCOMEXE_LIBS = \ 107 $(TARGET_VBox-xpcom-ipcshared) \ 108 $(TARGET_VBoxXPCOM) 109 TEMPLATE_XPCOMEXE_LIBS.linux = dl $(LIB_PTHREAD) 110 TEMPLATE_XPCOMEXE_LIBS.l4 = $(LIB_RUNTIME) $(VBOX_GCC_LIBGCC) 111 TEMPLATE_XPCOMEXE_LDFLAGS.darwin = -bind_at_load $(TEMPLATE_XPCOM_LDFLAGS.darwin) 112 TEMPLATE_XPCOMEXE_LDFLAGS.l4 = $(L4_DIR)/lib/x86_586/crt0.o \ 129 113 -T$(L4_DIR)/lib/x86_586/main_dyn.ld -nostdlib -lgcc \ 130 114 -Wl,--export-dynamic,--dynamic-linker=libld-l4.s.so \ … … 133 117 134 118 # 135 # Template for building XPCOM Linux-based executables. 136 # 137 TEMPLATE_XPCOMLINUX = XPCOM Linux executables 138 TEMPLATE_XPCOMLINUX_TOOL = GCC3 139 TEMPLATE_XPCOMLINUX_ASTOOL = NASM 140 TEMPLATE_XPCOMLINUX_DEFS = __LINUX_XPCOM__ MOZILLA_CLIENT=1 \ 141 OSTYPE="Linux2.6" OSARCH="Linux" 142 TEMPLATE_XPCOMLINUX_CXXFLAGS = -pipe -ansi -Wall -pthread -Wno-non-virtual-dtor 143 TEMPLATE_XPCOMLINUX_CXXFLAGS.debug = fno-inline 144 TEMPLATE_XPCOMLINUX_CXXFLAGS.release = -O 145 TEMPLATE_XPCOMLINUX_CXXFLAGS.profile = -O 146 TEMPLATE_XPCOMLINUX_CFLAGS = -pipe -ansi -Wall -pthread -Wno-unused 147 TEMPLATE_XPCOMLINUX_CFLAGS.debug = -fno-inline 148 TEMPLATE_XPCOMLINUX_CFLAGS.release = -O 149 TEMPLATE_XPCOMLINUX_CFLAGS.profile = -O 150 TEMPLATE_XPCOMLINUX_LIBS = dl 151 TEMPLATE_XPCOMLINUX_INCS = $(PATH_BIN)/sdk/include \ 152 $(PATH_BIN)/sdk/include/xpcom \ 153 $(PATH_BIN)/sdk/include/xpcom/nsprpub \ 154 $(PATH_BIN)/sdk/include/xpcom/string \ 155 $(PATH_BIN)/sdk/include/xpcom/xpcom \ 156 $(PATH_BIN)/sdk/include/xpcom/ipcd 157 ifdef VBOX_USE_GPROF 158 TEMPLATE_XPCOMLINUX_CFLAGS.profile += -pg 159 TEMPLATE_XPCOMLINUX_CXXFLAGS.profile += -pg 160 TEMPLATE_XPCOMLINUX_LDFLAGS.profile += -pg 161 endif 162 ifdef VBOX_USE_FNCCHECK 163 TEMPLATE_XPCOMLINUX_CFLAGS.profile += -finstrument-functions 164 TEMPLATE_XPCOMLINUX_CXXFLAGS.profile += -finstrument-functions 165 TEMPLATE_XPCOMLINUX_LDFLAGS.profile += -lfnccheck_hack -lfnccheck 166 endif 167 168 # 169 # First we have to build the IDL compiler as it is required for the rest 119 # Template for building XPCOM executables for running at build time. 120 # 121 # It extends the BLDPROG template in config.kmk but overrides CFLAGS 122 # and CXXFLAGS completely at the moment. 123 # 124 TEMPLATE_XPCOMBLDPROG = XPCOM Build programs executables 125 TEMPLATE_XPCOMBLDPROG_EXTENDS = BLDPROG 126 127 TEMPLATE_XPCOMBLDPROG_DEFS = $(TEMPLATE_BLDPROG_DEFS) $(TEMPLATE_XPCOMEXE_DEFS) 128 TEMPLATE_XPCOMBLDPROG_DEFS.$(BUILD_TARGET) = $(TEMPLATE_BLDPROG_DEFS.$(BUILD_TARGET)) $(TEMPLATE_XPCOMEXE_DEFS.$(BUILD_TARGET)) 129 TEMPLATE_XPCOMBLDPROG_DEFS.$(BUILD_TARGET_ARCH) = $(TEMPLATE_BLDPROG_DEFS.$(BUILD_TARGET_ARCH)) $(TEMPLATE_XPCOMEXE_DEFS.$(BUILD_TARGET_ARCH)) 130 TEMPLATE_XPCOMBLDPROG_CXXFLAGS = -ansi -Wall -Wno-non-virtual-dtor 131 TEMPLATE_XPCOMBLDPROG_CXXFLAGS.linux = -pthread 132 TEMPLATE_XPCOMBLDPROG_CXXFLAGS.release = -O 133 TEMPLATE_XPCOMBLDPROG_CXXFLAGS.profile = -O 134 TEMPLATE_XPCOMBLDPROG_CFLAGS = -pipe -ansi -Wall -Wno-unused 135 TEMPLATE_XPCOMBLDPROG_CFLAGS.linux = -pthread 136 TEMPLATE_XPCOMBLDPROG_CFLAGS.release = -O 137 TEMPLATE_XPCOMBLDPROG_CFLAGS.profile = -O 138 TEMPLATE_XPCOMBLDPROG_INCS = $(PATH_BIN)/sdk/include \ 139 $(PATH_BIN)/sdk/include/xpcom \ 140 $(PATH_BIN)/sdk/include/xpcom/nsprpub \ 141 $(PATH_BIN)/sdk/include/xpcom/string \ 142 $(PATH_BIN)/sdk/include/xpcom/xpcom \ 143 $(PATH_BIN)/sdk/include/xpcom/ipcd 144 TEMPLATE_XPCOMBLDPROG_ORDERDEPS = $(TEMPLATE_XPCOM_ORDERDEPS) 145 146 147 # 148 # Header installs. 149 # 150 INSTALLS = \ 151 NSPRPUB-HEADERS \ 152 NSPRPUB-MD-HEADERS \ 153 NSPRPUB-OBS-HEADERS \ 154 NSPRPUB-PRIV-HEADERS \ 155 STRING-HEADERS \ 156 XPCOM-HEADERS \ 157 IPCD-HEADERS 158 159 # 160 # The IDL compiler and typelib linker. 170 161 # 171 162 BLDPROGS = \ … … 174 165 175 166 # 176 # We build several libraries so that the Win32linker command line177 # length limit will not be hit167 # We build several libraries so that any linker command line 168 # length restrictions limit will be avoided. (Solaris, Mac?) 178 169 # 179 170 LIBRARIES = \ … … 225 216 # tstTestPermanentAtoms 226 217 endif # VBOX_WITH_TESTCASES 227 PROGRAMS .linux= VBoxXPCOMIPCD218 PROGRAMS += VBoxXPCOMIPCD 228 219 229 220 OTHERS = \ 230 $(PATH_BIN)/VBoxXPCOMBase.xpt 221 $(PATH_BIN)/VBoxXPCOMBase.xpt 231 222 232 223 OTHER_CLEAN = \ … … 235 226 $(PATH_BIN)/VBoxXPCOMBase.xpt 236 227 237 # 238 # defines for all libraries. Unfortunately, a global DEFS 239 # statement doesn't appear to work 240 # 241 # r=bird: Yes, it DOES work. It just depends on when config.kmk is included and += vs =. 242 XPCOMDEFS = \ 243 HAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1 \ 244 HAVE_VISIBILITY_PRAGMA=1 \ 245 _LARGEFILE64_SOURCE=1 \ 246 HAVE_FCNTL_FILE_LOCKING=1 \ 247 HAVE_LCHOWN=1 \ 248 HAVE_STRERROR=1 \ 249 _REENTRANT=1 \ 250 FORCE_PR_LOG \ 251 HAVE_CVAR_BUILT_ON_SEM \ 252 _NSPR_BUILD_ 253 XPCOMDEFS.linux = \ 254 _POSIX_SOURCE=1 \ 255 _BSD_SOURCE=1 \ 256 _SVID_SOURCE=1 \ 257 LINUX=1 \ 258 i386=1 \ 259 _PR_PTHREADS 260 # _BSD_SOURCE is here to keep the Glibc header files happy and make them include the right things 261 XPCOMDEFS.l4 = \ 262 L4=1 \ 263 _POSIX_SOURCE=1 \ 264 _BSD_SOURCE=1 \ 265 i386=1 266 267 # The IDL compiler. We build it statically because we cannot 268 # rely on additional .a files like in the original build 269 xpidl_TEMPLATE = XPCOMLINUX 228 229 230 # 231 # SDK headers - lot's of files to install... 232 # 233 # Tip: If you are going to remove files here, you might 234 # wish to do a `kmk uninstall' first to avoid have 235 # obsoleted files in the $(INST_SDK) directory. 236 # 237 238 NSPRPUB-HEADERS_INST = $(INST_SDK)/include/xpcom/nsprpub/ 239 NSPRPUB-HEADERS_IFFLAGS = -p -m 644 240 NSPRPUB-HEADERS_SOURCES = \ 241 nsprpub/pr/include/nspr.h \ 242 nsprpub/lib/ds/plarena.h \ 243 nsprpub/lib/ds/plarenas.h \ 244 nsprpub/lib/libc/include/plbase64.h \ 245 nsprpub/lib/libc/include/plerror.h \ 246 nsprpub/lib/libc/include/plgetopt.h \ 247 nsprpub/lib/ds/plhash.h \ 248 nsprpub/lib/libc/include/plresolv.h \ 249 nsprpub/lib/libc/include/plstr.h \ 250 nsprpub/pr/include/pratom.h \ 251 nsprpub/pr/include/prbit.h \ 252 nsprpub/pr/include/prclist.h \ 253 nsprpub/pr/include/prcmon.h \ 254 nsprpub/pr/include/prcountr.h \ 255 nsprpub/pr/include/prcvar.h \ 256 nsprpub/pr/include/prdtoa.h \ 257 nsprpub/pr/include/prenv.h \ 258 nsprpub/pr/include/prerr.h \ 259 nsprpub/pr/include/prerror.h \ 260 nsprpub/pr/include/prinet.h \ 261 nsprpub/pr/include/prinit.h \ 262 nsprpub/pr/include/prinrval.h \ 263 nsprpub/pr/include/prio.h \ 264 nsprpub/pr/include/pripcsem.h \ 265 nsprpub/pr/include/prlink.h \ 266 nsprpub/pr/include/prlock.h \ 267 nsprpub/pr/include/prlog.h \ 268 nsprpub/pr/include/prlong.h \ 269 nsprpub/pr/include/prmem.h \ 270 nsprpub/pr/include/prmon.h \ 271 nsprpub/pr/include/prmwait.h \ 272 nsprpub/pr/include/prnetdb.h \ 273 nsprpub/pr/include/prolock.h \ 274 nsprpub/pr/include/prpdce.h \ 275 nsprpub/pr/include/prprf.h \ 276 nsprpub/pr/include/prproces.h \ 277 nsprpub/pr/include/prrng.h \ 278 nsprpub/pr/include/prrwlock.h \ 279 nsprpub/pr/include/prshm.h \ 280 nsprpub/pr/include/prshma.h \ 281 nsprpub/pr/include/prsystem.h \ 282 nsprpub/pr/include/prthread.h \ 283 nsprpub/pr/include/prtime.h \ 284 nsprpub/pr/include/prtpool.h \ 285 nsprpub/pr/include/prtrace.h \ 286 nsprpub/pr/include/prtypes.h \ 287 nsprpub/pr/include/prvrsion.h \ 288 nsprpub/pr/include/prwin16.h \ 289 nsprpub/pr/include/md/_vbox.cfg=>prcpucfg.h \ 290 291 NSPRPUB-MD-HEADERS_INST = $(INST_SDK)/include/xpcom/nsprpub/md 292 NSPRPUB-MD-HEADERS_IFFLAGS = -p -m 644 293 NSPRPUB-MD-HEADERS_SOURCES = \ 294 nsprpub/pr/include/md/_darwin.h \ 295 nsprpub/pr/include/md/_freebsd.h \ 296 nsprpub/pr/include/md/_l4v2.h \ 297 nsprpub/pr/include/md/_linux.h \ 298 nsprpub/pr/include/md/_macos.h \ 299 nsprpub/pr/include/md/_netbsd.h \ 300 nsprpub/pr/include/md/_openbsd.h \ 301 nsprpub/pr/include/md/_os2.h \ 302 nsprpub/pr/include/md/_solaris.h \ 303 nsprpub/pr/include/md/_unix_errors.h \ 304 nsprpub/pr/include/md/_unixos.h \ 305 nsprpub/pr/include/md/_pth.h \ 306 nsprpub/pr/include/md/prosdep.h \ 307 \ 308 nsprpub/pr/include/md/_freebsd.cfg \ 309 nsprpub/pr/include/md/_linux.cfg \ 310 nsprpub/pr/include/md/_darwin.cfg \ 311 nsprpub/pr/include/md/_netbsd.cfg \ 312 nsprpub/pr/include/md/_openbsd.cfg \ 313 nsprpub/pr/include/md/_os2.cfg \ 314 nsprpub/pr/include/md/_solaris32.cfg \ 315 nsprpub/pr/include/md/_solaris64.cfg \ 316 nsprpub/pr/include/md/_l4v2.cfg 317 318 NSPRPUB-OBS-HEADERS_INST = $(INST_SDK)/include/xpcom/nsprpub/obsolete 319 NSPRPUB-OBS-HEADERS_IFFLAGS = -p -m 644 320 NSPRPUB-OBS-HEADERS_SOURCES = \ 321 nsprpub/pr/include/obsolete/pralarm.h \ 322 nsprpub/pr/include/obsolete/probslet.h \ 323 nsprpub/pr/include/obsolete/protypes.h \ 324 nsprpub/pr/include/obsolete/prsem.h 325 326 NSPRPUB-PRIV-HEADERS_INST = $(INST_SDK)/include/xpcom/nsprpub/private 327 NSPRPUB-PRIV-HEADERS_IFFLAGS = -p -m 644 328 NSPRPUB-PRIV-HEADERS_SOURCES = \ 329 nsprpub/pr/include/private/pprio.h \ 330 nsprpub/pr/include/private/pprthred.h \ 331 nsprpub/pr/include/private/prpriv.h 332 333 STRING-HEADERS_INST = $(INST_SDK)/include/xpcom/string 334 STRING-HEADERS_IFFLAGS = -p -m 644 335 STRING-HEADERS_SOURCES = \ 336 xpcom/string/public/nsAString.h \ 337 xpcom/string/public/nsAlgorithm.h \ 338 xpcom/string/public/nsCharTraits.h \ 339 xpcom/string/public/nsDependentString.h \ 340 xpcom/string/public/nsDependentSubstring.h \ 341 xpcom/string/public/nsEmbedString.h \ 342 xpcom/string/public/nsLiteralString.h \ 343 xpcom/string/public/nsObsoleteAString.h \ 344 xpcom/string/public/nsPrintfCString.h \ 345 xpcom/string/public/nsPromiseFlatString.h \ 346 xpcom/string/public/nsReadableUtils.h \ 347 xpcom/string/public/nsString.h \ 348 xpcom/string/public/nsStringAPI.h \ 349 xpcom/string/public/nsStringFwd.h \ 350 xpcom/string/public/nsStringIterator.h \ 351 xpcom/string/public/nsSubstring.h \ 352 xpcom/string/public/nsSubstringTuple.h \ 353 xpcom/string/public/nsTAString.h \ 354 xpcom/string/public/nsTDependentString.h \ 355 xpcom/string/public/nsTDependentSubstring.h \ 356 xpcom/string/public/nsTObsoleteAString.h \ 357 xpcom/string/public/nsTPromiseFlatString.h \ 358 xpcom/string/public/nsTString.h \ 359 xpcom/string/public/nsTSubstring.h \ 360 xpcom/string/public/nsTSubstringTuple.h \ 361 xpcom/string/public/nsUTF8Utils.h \ 362 xpcom/string/public/nsXPIDLString.h \ 363 xpcom/string/public/string-template-def-char.h \ 364 xpcom/string/public/string-template-def-unichar.h \ 365 xpcom/string/public/string-template-undef.h 366 367 XPCOM-HEADERS_INST = $(INST_SDK)/include/xpcom/xpcom 368 XPCOM-HEADERS_IFFLAGS = -p -m 644 369 XPCOM-HEADERS_SOURCES = \ 370 xpcom/base/nsAgg.h \ 371 xpcom/io/nsAppDirectoryServiceDefs.h \ 372 xpcom/ds/nsArray.h \ 373 xpcom/ds/nsArrayEnumerator.h \ 374 xpcom/ds/nsAtomService.h \ 375 xpcom/ds/nsAutoBuffer.h \ 376 xpcom/threads/nsAutoLock.h \ 377 xpcom/base/nsAutoPtr.h \ 378 xpcom/ds/nsBaseHashtable.h \ 379 xpcom/ds/nsCOMArray.h \ 380 xpcom/glue/nsCOMPtr.h \ 381 xpcom/ds/nsCRT.h \ 382 xpcom/components/nsCategoryManagerUtils.h \ 383 xpcom/ds/nsCheapSets.h \ 384 xpcom/ds/nsClassHashtable.h \ 385 xpcom/base/nsCom.h \ 386 xpcom/components/nsComponentManagerObsolete.h \ 387 xpcom/components/nsComponentManagerUtils.h \ 388 xpcom/ds/nsCppSharedAllocator.h \ 389 xpcom/ds/nsDataHashtable.h \ 390 xpcom/glue/nsDebug.h \ 391 xpcom/base/nsDebugImpl.h \ 392 xpcom/ds/nsDeque.h \ 393 xpcom/io/nsDirectoryService.h \ 394 xpcom/io/nsDirectoryServiceDefs.h \ 395 xpcom/io/nsDirectoryServiceUtils.h \ 396 xpcom/ds/nsDoubleHashtable.h \ 397 xpcom/ds/nsEnumeratorUtils.h \ 398 xpcom/base/nsError.h \ 399 xpcom/io/nsEscape.h \ 400 xpcom/threads/nsEventQueueUtils.h \ 401 xpcom/io/nsFastLoadPtr.h \ 402 xpcom/io/nsFastLoadService.h \ 403 xpcom/ds/nsFixedSizeAllocator.h \ 404 xpcom/glue/nsGenericFactory.h \ 405 xpcom/ds/nsHashKeys.h \ 406 xpcom/ds/nsHashSets.h \ 407 xpcom/ds/nsHashtable.h \ 408 xpcom/base/nsIAllocator.h \ 409 xpcom/ds/nsIByteBuffer.h \ 410 xpcom/base/nsID.h \ 411 xpcom/glue/nsIGenericFactory.h \ 412 xpcom/base/nsIID.h \ 413 xpcom/glue/nsIInterfaceRequestorUtils.h \ 414 xpcom/components/nsIServiceManagerObsolete.h \ 415 xpcom/components/nsIServiceManagerUtils.h \ 416 xpcom/base/nsISupportsBase.h \ 417 xpcom/glue/nsISupportsImpl.h \ 418 xpcom/base/nsISupportsObsolete.h \ 419 xpcom/glue/nsISupportsUtils.h \ 420 xpcom/ds/nsIUnicharBuffer.h \ 421 xpcom/io/nsIUnicharInputStream.h \ 422 xpcom/glue/nsIWeakReferenceUtils.h \ 423 xpcom/ds/nsInt64.h \ 424 xpcom/ds/nsInterfaceHashtable.h \ 425 xpcom/io/nsLinebreakConverter.h \ 426 xpcom/io/nsLocalFile.h \ 427 xpcom/io/nsLocalFileUnix.h \ 428 xpcom/io/nsLocalFileOS2.h \ 429 xpcom/io/nsLocalFileOSX.h \ 430 xpcom/glue/nsMemory.h \ 431 xpcom/components/nsModule.h \ 432 xpcom/io/nsMultiplexInputStream.h \ 433 xpcom/io/nsNativeCharsetUtils.h \ 434 xpcom/components/nsNativeComponentLoader.h \ 435 xpcom/ds/nsObserverService.h \ 436 xpcom/components/nsObsoleteModuleLoading.h \ 437 xpcom/threads/nsProcess.h \ 438 xpcom/proxy/public/nsProxiedService.h \ 439 xpcom/proxy/public/nsProxyEvent.h \ 440 xpcom/proxy/public/nsProxyRelease.h \ 441 xpcom/ds/nsQuickSort.h \ 442 xpcom/ds/nsRecyclingAllocator.h \ 443 xpcom/ds/nsRefPtrHashtable.h \ 444 xpcom/io/nsScriptableInputStream.h \ 445 xpcom/ds/nsStaticAtom.h \ 446 xpcom/components/nsStaticComponent.h \ 447 xpcom/ds/nsStaticNameTable.h \ 448 xpcom/io/nsStorageStream.h \ 449 xpcom/io/nsStreamUtils.h \ 450 xpcom/ds/nsStringEnumerator.h \ 451 xpcom/io/nsStringIO.h \ 452 xpcom/io/nsStringStream.h \ 453 xpcom/ds/nsSupportsArray.h \ 454 xpcom/ds/nsSupportsPrimitives.h \ 455 xpcom/ds/nsTHashtable.h \ 456 xpcom/ds/nsTextFormatter.h \ 457 xpcom/ds/nsTime.h \ 458 xpcom/glue/nsTraceRefcnt.h \ 459 xpcom/base/nsTraceRefcntImpl.h \ 460 xpcom/ds/nsUnitConversion.h \ 461 xpcom/ds/nsValueArray.h \ 462 xpcom/ds/nsVariant.h \ 463 xpcom/ds/nsVoidArray.h \ 464 xpcom/base/nsWeakPtr.h \ 465 xpcom/glue/nsWeakReference.h \ 466 xpcom/build/nsXPCOM.h \ 467 xpcom/build/nsXPCOMCID.h \ 468 xpcom/glue/standalone/nsXPCOMGlue.h \ 469 xpcom/base/nscore.h \ 470 xpcom/ds/pldhash.h \ 471 xpcom/threads/plevent.h \ 472 xpcom/components/xcDll.h \ 473 xpcom/typelib/xpt/public/xpt_arena.h \ 474 xpcom/typelib/xpt/public/xpt_struct.h \ 475 xpcom/typelib/xpt/public/xpt_xdr.h \ 476 xpcom/reflect/xptcall/public/xptcall.h \ 477 xpcom/reflect/xptcall/public/xptcstubsdecl.inc \ 478 xpcom/reflect/xptcall/public/xptcstubsdef.inc \ 479 xpcom/reflect/xptinfo/public/xptinfo.h \ 480 xpcom-config.h 481 482 IPCD-HEADERS_INST = $(INST_SDK)/include/xpcom/ipcd 483 IPCD-HEADERS_IFFLAGS = -p -m 644 484 IPCD-HEADERS_SOURCES = \ 485 ipc/ipcd/client/public/ipcCID.h \ 486 ipc/ipcd/extensions/lock/public/ipcLockCID.h \ 487 ipc/ipcd/util/public/ipcMessageReader.h \ 488 ipc/ipcd/util/public/ipcMessageWriter.h \ 489 ipc/ipcd/daemon/public/ipcModule.h \ 490 ipc/ipcd/daemon/public/ipcModuleUtil.h \ 491 ipc/ipcd/client/public/ipcdclient.h 492 493 494 # 495 # The IDL compiler. 496 # 497 # We build it statically because we cannot rely on additional .a files 498 # like in the original build 499 # 500 xpidl_TEMPLATE = XPCOMBLDPROG 270 501 xpidl_DEFS = EXPORT_XPT_API 502 ## @todo This assumes HOST == TARGET. 271 503 xpidl_INST = bin/ $(INST_SDK)/bin/ 272 504 xpidl_SOURCES = \ … … 281 513 xpcom/typelib/xpt/src/xpt_struct.c \ 282 514 xpcom/typelib/xpt/src/xpt_xdr.c 283 # This will, because this is the very first target built, cause the headers284 # to be installed.285 xpidl_DEPS = \286 $(PATH_BIN)/sdk/include/xpcom/.keep287 515 288 516 # We do these ONCE. … … 295 523 $(libIDL_config_libs) 296 524 297 # XPT linker 298 xpt_link_TEMPLATE = XPCOMLINUX 525 # 526 # The XPT linker. 527 # 528 xpt_link_TEMPLATE = XPCOMBLDPROG 299 529 xpt_link_SOURCES = \ 300 530 xpcom/typelib/xpt/tools/xpt_link.c \ 301 531 xpcom/typelib/xpt/src/xpt_arena.c \ 302 532 xpcom/typelib/xpt/src/xpt_struct.c \ 303 533 xpcom/typelib/xpt/src/xpt_xdr.c 304 534 535 536 # 537 # The NSPR Library. 538 # 305 539 VBox-xpcom-nspr_TEMPLATE = XPCOM 306 VBox-xpcom-nspr_DEFS = $(XPCOMDEFS) 307 VBox-xpcom-nspr_DEFS.linux = $(XPCOMDEFS.linux) 308 VBox-xpcom-nspr_DEFS.l4 = $(XPCOMDEFS.l4) 540 VBox-xpcom-nspr_NOINST = 1 541 VBox-xpcom-nspr_DEFS = \ 542 _NSPR_BUILD_ \ 543 HAVE_LCHOWN=1 \ 544 HAVE_STRERROR=1 \ 545 FORCE_PR_LOG 546 VBox-xpcom-nspr_DEFS.darwin = \ 547 HAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1 \ 548 HAVE_BSD_FLOCK=1 \ 549 _PR_PTHREADS 550 VBox-xpcom-nspr_DEFS.freebsd = \ 551 HAVE_CVAR_BUILT_ON_SEM \ 552 _PR_PTHREADS 553 # FIXME: LINUX should be defined by _linux.cfg 554 VBox-xpcom-nspr_DEFS.linux = \ 555 LINUX=1 \ 556 _POSIX_SOURCE=1 \ 557 _BSD_SOURCE=1 \ 558 _SVID_SOURCE=1 \ 559 _REENTRANT=1 \ 560 _LARGEFILE64_SOURCE=1 \ 561 HAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1 \ 562 HAVE_VISIBILITY_PRAGMA=1 \ 563 HAVE_FCNTL_FILE_LOCKING=1 \ 564 HAVE_CVAR_BUILT_ON_SEM \ 565 _PR_PTHREADS 566 # _BSD_SOURCE is here to keep the Glibc header files happy and make them include the right things 567 # FIXME: L4 should be defined by _linux.cfg 568 VBox-xpcom-nspr_DEFS.l4 = \ 569 L4=1 \ 570 _REENTRANT=1 \ 571 _LARGEFILE64_SOURCE=1 \ 572 _POSIX_SOURCE=1 \ 573 _BSD_SOURCE=1 \ 574 HAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1 \ 575 HAVE_VISIBILITY_PRAGMA=1 \ 576 HAVE_FCNTL_FILE_LOCKING=1 \ 577 HAVE_CVAR_BUILT_ON_SEM 578 VBox-xpcom-nspr_DEFS.netbsd = \ 579 _PR_PTHREADS 580 VBox-xpcom-nspr_DEFS.openbsd = \ 581 _PR_PTHREADS 582 VBox-xpcom-nspr_DEFS.os2 = 583 VBox-xpcom-nspr_DEFS.solaris = \ 584 _PR_PTHREADS 585 VBox-xpcom-nspr_DEFS.x86 = i386=1 586 VBox-xpcom-nspr_DEFS.amd64 = i386=1 309 587 VBox-xpcom-nspr_DEFS.debug = NDEBUG 310 588 VBox-xpcom-nspr_INCS = \ 311 589 nsprpub/pr/include/private \ 312 590 $(PATH_TARGET)/VBox-xpcom-nspr 313 VBoxXPCOM_LIBS.l4 = $(L4_LIBDIR)/libxpcomstubs.a $(L4_LIBDIR)/../libuc_c++.a \ 314 $(VBOX_PATH_L4_GCC3_INSTALL)/libsupc++.a $(VBOX_PATH_L4_GCC3_INSTALL)/libgcc_eh.a 591 315 592 VBox-xpcom-nspr_SOURCES = \ 316 593 nsprpub/pr/src/io/prfdcach.c \ … … 375 652 nsprpub/lib/libc/src/plgetopt.c 376 653 377 VBox-xpcom-nspr_SOURCES. linux= \654 VBox-xpcom-nspr_SOURCES.darwin = \ 378 655 nsprpub/pr/src/md/unix/unix.c \ 379 656 nsprpub/pr/src/md/unix/unix_errors.c \ … … 382 659 nsprpub/pr/src/md/unix/uxshm.c \ 383 660 nsprpub/pr/src/md/unix/uxwrap.c \ 384 nsprpub/pr/src/md/unix/ linux.c \661 nsprpub/pr/src/md/unix/darwin.c \ 385 662 nsprpub/pr/src/pthreads/ptio.c \ 386 663 nsprpub/pr/src/pthreads/ptsynch.c \ 387 664 nsprpub/pr/src/pthreads/ptthread.c \ 388 665 nsprpub/pr/src/pthreads/ptmisc.c 389 390 # L4 is ok with os_Linux_x86. 391 VBox-xpcom-nspr_SOURCES.x86 = nsprpub/pr/src/md/unix/os_Linux_x86.s 392 VBox-xpcom-nspr_SOURCES.amd64 = nsprpub/pr/src/md/unix/os_Linux_x86_64.s 666 VBox-xpcom-nspr_SOURCES.darwin.x86 = nsprpub/pr/src/md/unix/os_Darwin_x86.s 393 667 394 668 VBox-xpcom-nspr_SOURCES.l4 = \ … … 413 687 # nsprpub/pr/src/md/l4env/prnetdb.c \ 414 688 # nsprpub/pr/src/md/l4env/threads.c 689 VBox-xpcom-nspr_SOURCES.l4.x86 = nsprpub/pr/src/md/unix/os_Linux_x86.s 690 VBox-xpcom-nspr_SOURCES.l4.amd64 = nsprpub/pr/src/md/unix/os_Linux_x86_64.s 691 692 VBox-xpcom-nspr_SOURCES.linux = \ 693 nsprpub/pr/src/md/unix/unix.c \ 694 nsprpub/pr/src/md/unix/unix_errors.c \ 695 nsprpub/pr/src/md/unix/uxproces.c \ 696 nsprpub/pr/src/md/unix/uxrng.c \ 697 nsprpub/pr/src/md/unix/uxshm.c \ 698 nsprpub/pr/src/md/unix/uxwrap.c \ 699 nsprpub/pr/src/md/unix/linux.c \ 700 nsprpub/pr/src/pthreads/ptio.c \ 701 nsprpub/pr/src/pthreads/ptsynch.c \ 702 nsprpub/pr/src/pthreads/ptthread.c \ 703 nsprpub/pr/src/pthreads/ptmisc.c 704 VBox-xpcom-nspr_SOURCES.linux.x86 = nsprpub/pr/src/md/unix/os_Linux_x86.s 705 VBox-xpcom-nspr_SOURCES.linux.amd64 = nsprpub/pr/src/md/unix/os_Linux_x86_64.s 706 415 707 416 708 nsprpub/pr/src/linking/prlink.c_DEFS = _GNU_SOURCE 417 709 nsprpub/pr/src/prvrsion.c_DEPS = $(PATH_VBox-xpcom-nspr)/_pr_bld.h 418 710 nsprpub/lib/ds/plvrsion.c_DEPS = $(PATH_VBox-xpcom-nspr)/_pl_bld.h 711 712 713 VBox-xpcom-typelib_TEMPLATE = XPCOM 714 VBox-xpcom-typelib_NOINST = 1 715 VBox-xpcom-typelib_SOURCES = \ 716 xpcom/typelib/xpt/src/xpt_arena.c \ 717 xpcom/typelib/xpt/src/xpt_struct.c \ 718 xpcom/typelib/xpt/src/xpt_xdr.c 719 720 VBox-xpcom-string_TEMPLATE = XPCOM 721 VBox-xpcom-string_NOINST = 1 722 VBox-xpcom-string_DEFS = _IMPL_NS_COM 723 VBox-xpcom-string_SOURCES = \ 724 xpcom/string/src/nsAString.cpp \ 725 xpcom/string/src/nsDependentSubstring.cpp \ 726 xpcom/string/src/nsObsoleteAStringThunk.cpp \ 727 xpcom/string/src/nsPrintfCString.cpp \ 728 xpcom/string/src/nsPromiseFlatString.cpp \ 729 xpcom/string/src/nsReadableUtils.cpp \ 730 xpcom/string/src/nsSubstring.cpp \ 731 xpcom/string/src/nsSubstringTuple.cpp \ 732 xpcom/string/src/nsString.cpp \ 733 xpcom/string/src/nsStringComparator.cpp \ 734 xpcom/string/src/nsStringObsolete.cpp 735 736 VBox-xpcom-base_TEMPLATE = XPCOM 737 VBox-xpcom-base_NOINST = 1 738 VBox-xpcom-base_SOURCES = \ 739 xpcom/base/nsAllocator.cpp \ 740 xpcom/base/nsConsoleMessage.cpp \ 741 xpcom/base/nsConsoleService.cpp \ 742 xpcom/base/nsDebugImpl.cpp \ 743 xpcom/base/nsErrorService.cpp \ 744 xpcom/base/nsExceptionService.cpp \ 745 xpcom/base/nsID.cpp \ 746 xpcom/base/nsMemoryImpl.cpp \ 747 xpcom/base/nsTraceRefcntImpl.cpp \ 748 xpcom/base/nsStackFrameUnix.cpp 749 750 VBox-xpcom-ds_TEMPLATE = XPCOM 751 VBox-xpcom-ds_NOINST = 1 752 VBox-xpcom-ds_SOURCES = \ 753 xpcom/ds/pldhash.c \ 754 xpcom/ds/nsAtomTable.cpp \ 755 xpcom/ds/nsAtomService.cpp \ 756 xpcom/ds/nsByteBuffer.cpp \ 757 xpcom/ds/nsCheapSets.cpp \ 758 xpcom/ds/nsCRT.cpp \ 759 xpcom/ds/nsDeque.cpp \ 760 xpcom/ds/nsEmptyEnumerator.cpp \ 761 xpcom/ds/nsEnumeratorUtils.cpp \ 762 xpcom/ds/nsFixedSizeAllocator.cpp \ 763 xpcom/ds/nsHashSets.cpp \ 764 xpcom/ds/nsHashtable.cpp \ 765 xpcom/ds/nsObserverList.cpp \ 766 xpcom/ds/nsObserverService.cpp \ 767 xpcom/ds/nsProperties.cpp \ 768 xpcom/ds/nsPersistentProperties.cpp \ 769 xpcom/ds/nsQuickSort.cpp \ 770 xpcom/ds/nsRecyclingAllocator.cpp \ 771 xpcom/ds/nsStaticNameTable.cpp \ 772 xpcom/ds/nsStringEnumerator.cpp \ 773 xpcom/ds/nsSupportsArray.cpp \ 774 xpcom/ds/nsSupportsArrayEnumerator.cpp \ 775 xpcom/ds/nsSupportsPrimitives.cpp \ 776 xpcom/ds/nsTHashtable.cpp \ 777 xpcom/ds/nsUnicharBuffer.cpp \ 778 xpcom/ds/nsVariant.cpp \ 779 xpcom/ds/nsVoidArray.cpp \ 780 xpcom/ds/nsTextFormatter.cpp \ 781 xpcom/ds/nsTimelineService.cpp \ 782 xpcom/ds/nsValueArray.cpp \ 783 xpcom/ds/nsCOMArray.cpp \ 784 xpcom/ds/nsArray.cpp \ 785 xpcom/ds/nsArrayEnumerator.cpp 786 # xpcom/ds/nsHashPropertyBag.cpp 787 788 # @todo what about MOZ_USER_DIR? 789 VBox-xpcom-io_TEMPLATE = XPCOM 790 VBox-xpcom-io_NOINST = 1 791 VBox-xpcom-io_DEFS = MOZ_USER_DIR=\".mozilla\" 792 VBox-xpcom-io_INCS.darwin = \ 793 xpcom/MoreFiles 794 VBox-xpcom-io_SOURCES = \ 795 xpcom/io/nsAppFileLocationProvider.cpp \ 796 xpcom/io/nsBinaryStream.cpp \ 797 xpcom/io/nsByteArrayInputStream.cpp \ 798 xpcom/io/nsDirectoryService.cpp \ 799 xpcom/io/nsEscape.cpp \ 800 xpcom/io/nsFastLoadFile.cpp \ 801 xpcom/io/nsFastLoadService.cpp \ 802 xpcom/io/nsInputStreamTee.cpp \ 803 xpcom/io/nsLinebreakConverter.cpp \ 804 xpcom/io/nsLocalFileCommon.cpp \ 805 xpcom/io/nsMultiplexInputStream.cpp \ 806 xpcom/io/nsPipe3.cpp \ 807 xpcom/io/nsStreamUtils.cpp \ 808 xpcom/io/nsScriptableInputStream.cpp \ 809 xpcom/io/nsSegmentedBuffer.cpp \ 810 xpcom/io/SpecialSystemDirectory.cpp \ 811 xpcom/io/nsStorageStream.cpp \ 812 xpcom/io/nsStringStream.cpp \ 813 xpcom/io/nsUnicharInputStream.cpp \ 814 xpcom/io/nsNativeCharsetUtils.cpp 815 VBox-xpcom-io_SOURCES.darwin = \ 816 xpcom/io/nsLocalFileOSX.cpp \ 817 xpcom/MoreFiles/FSCopyObject.c \ 818 xpcom/MoreFiles/MoreFilesX.c 819 VBox-xpcom-io_SOURCES.l4 = \ 820 xpcom/io/nsLocalFileL4.cpp 821 ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) 822 VBox-xpcom-io_SOURCES += \ 823 xpcom/io/nsLocalFileUnix.cpp 824 endif 825 VBox-xpcom-io_SOURCES.os2 = \ 826 xpcom/io/nsLocalFileOS2.cpp 827 828 VBox-xpcom-components_TEMPLATE = XPCOM 829 VBox-xpcom-components_NOINST = 1 830 VBox-xpcom-components_DEFS = EXPORT_XPTI_API 831 VBox-xpcom-components_SOURCES = \ 832 xpcom/components/nsCategoryManager.cpp \ 833 xpcom/components/nsComponentManager.cpp \ 834 xpcom/components/nsComponentManagerObsolete.cpp \ 835 xpcom/components/nsNativeComponentLoader.cpp \ 836 xpcom/components/nsServiceManagerObsolete.cpp \ 837 xpcom/components/xcDll.cpp \ 838 xpcom/components/nsStaticComponentLoader.cpp 839 840 VBox-xpcom-threads_TEMPLATE = XPCOM 841 VBox-xpcom-threads_NOINST = 1 842 VBox-xpcom-threads_SOURCES = \ 843 xpcom/threads/plevent.c \ 844 xpcom/threads/nsAutoLock.cpp \ 845 xpcom/threads/nsEnvironment.cpp \ 846 xpcom/threads/nsEventQueue.cpp \ 847 xpcom/threads/nsEventQueueService.cpp \ 848 xpcom/threads/nsThread.cpp \ 849 xpcom/threads/nsTimerImpl.cpp \ 850 xpcom/threads/nsProcessCommon.cpp \ 851 xpcom/threads/TimerThread.cpp 852 853 VBox-xpcom-xptinfo_TEMPLATE = XPCOM 854 VBox-xpcom-xptinfo_NOINST = 1 855 VBox-xpcom-xptinfo_DEFS = EXPORT_XPTI_API 856 VBox-xpcom-xptinfo_SOURCES = \ 857 xpcom/reflect/xptinfo/src/xptiFile.cpp \ 858 xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp \ 859 xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp \ 860 xpcom/reflect/xptinfo/src/xptiManifest.cpp \ 861 xpcom/reflect/xptinfo/src/xptiMisc.cpp \ 862 xpcom/reflect/xptinfo/src/xptiTypelibGuts.cpp \ 863 xpcom/reflect/xptinfo/src/xptiWorkingSet.cpp \ 864 xpcom/reflect/xptinfo/src/xptiZipItem.cpp \ 865 xpcom/reflect/xptinfo/src/xptiZipLoader.cpp 866 867 868 VBox-xpcom-xptcall_TEMPLATE = XPCOM 869 VBox-xpcom-xptcall_NOINST = 1 870 VBox-xpcom-xptcall_DEFS = EXPORT_XPTC_API 871 VBox-xpcom-xptcall_DEFS.darwin = KEEP_STACK_16_BYTE_ALIGNED 872 VBox-xpcom-xptcall_DEFS.l4 = L4 873 VBox-xpcom-xptcall_SOURCES = xpcom/reflect/xptcall/src/xptcall.cpp 874 VBox-xpcom-xptcall_SOURCES.darwin.x86 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp \ 875 xpcom/reflect/xptcall/src/md/unix/xptcstubs_unixish_x86.cpp 876 VBox-xpcom-xptcall_SOURCES.linux.x86 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp \ 877 xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp 878 VBox-xpcom-xptcall_SOURCES.linux.amd64 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp \ 879 xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp 880 881 VBox-xpcom-proxy_TEMPLATE = XPCOM 882 VBox-xpcom-proxy_NOINST = 1 883 VBox-xpcom-proxy_SOURCES = xpcom/proxy/src/nsProxyEvent.cpp \ 884 xpcom/proxy/src/nsProxyEventClass.cpp \ 885 xpcom/proxy/src/nsProxyEventObject.cpp \ 886 xpcom/proxy/src/nsProxyObjectManager.cpp \ 887 xpcom/proxy/src/nsProxyRelease.cpp 888 889 # glue library which all client apps will link with 890 VBoxXPCOMGlue_TEMPLATE = XPCOM 891 VBoxXPCOMGlue_DEFS = XPCOM_GLUE 892 VBoxXPCOMGlue_SOURCES = xpcom/glue/nsCOMPtr.cpp \ 893 xpcom/glue/nsComponentManagerUtils.cpp \ 894 xpcom/glue/nsDebug.cpp \ 895 xpcom/glue/nsGenericFactory.cpp \ 896 xpcom/glue/nsIInterfaceRequestorUtils.cpp \ 897 xpcom/glue/nsMemory.cpp \ 898 xpcom/glue/nsTraceRefcnt.cpp \ 899 xpcom/glue/nsWeakReference.cpp \ 900 xpcom/glue/standalone/nsXPCOMGlue.cpp \ 901 xpcom/glue/standalone/nsGREDirServiceProvider.cpp 902 VBoxXPCOMGlue_INST = lib/ $(INST_SDK)/lib/ 903 904 905 # 906 # The VBoxXPCOM Shared Object, assembling all lib files. 907 # 908 VBoxXPCOM_TEMPLATE = XPCOM 909 VBoxXPCOM_DEFS = BUILD_DCONNECT="1" 910 VBoxXPCOM_SOURCES = \ 911 xpcom/glue/nsCOMPtr.cpp \ 912 xpcom/glue/nsComponentManagerUtils.cpp \ 913 xpcom/glue/nsDebug.cpp \ 914 xpcom/glue/nsGenericFactory.cpp \ 915 xpcom/glue/nsIInterfaceRequestorUtils.cpp \ 916 xpcom/glue/nsMemory.cpp \ 917 xpcom/glue/nsTraceRefcnt.cpp \ 918 xpcom/glue/nsWeakReference.cpp \ 919 xpcom/build/nsXPComInit.cpp \ 920 xpcom/build/nsStringAPI.cpp 921 VBoxXPCOM_SOURCES.darwin = \ 922 darwindeps.cpp 923 VBoxXPCOM_LIBS = \ 924 $(TARGET_VBox-xpcom-typelib) \ 925 $(TARGET_VBox-xpcom-string) \ 926 $(TARGET_VBox-xpcom-base) \ 927 $(TARGET_VBox-xpcom-ds) \ 928 $(TARGET_VBox-xpcom-io) \ 929 $(TARGET_VBox-xpcom-components) \ 930 $(TARGET_VBox-xpcom-threads) \ 931 $(TARGET_VBox-xpcom-xptinfo) \ 932 $(TARGET_VBox-xpcom-xptcall) \ 933 $(TARGET_VBox-xpcom-proxy) \ 934 $(TARGET_VBox-xpcom-nspr) 935 936 VBoxXPCOM_LDFLAGS.linux = -Wl,--whole-archive \ 937 $(TARGET_VBox-xpcom-typelib) \ 938 $(TARGET_VBox-xpcom-string) \ 939 $(TARGET_VBox-xpcom-base) \ 940 $(TARGET_VBox-xpcom-ds) \ 941 $(TARGET_VBox-xpcom-io) \ 942 $(TARGET_VBox-xpcom-components) \ 943 $(TARGET_VBox-xpcom-threads) \ 944 $(TARGET_VBox-xpcom-xptinfo) \ 945 $(TARGET_VBox-xpcom-xptcall) \ 946 $(TARGET_VBox-xpcom-proxy) \ 947 $(TARGET_VBox-xpcom-nspr) \ 948 -Wl,--no-whole-archive 949 #VBoxXPCOM_LIBS.l4 = $(L4_LIBDIR)/libxpcomstubs.a $(L4_LIBDIR)/../libuc_c++.a \ 950 # $(VBOX_PATH_L4_GCC3_INSTALL)/libsupc++.a $(VBOX_PATH_L4_GCC3_INSTALL)/libgcc_eh.a 951 # EF heap 952 #VBoxXPCOM_LIBS += $(LIB_RUNTIME_EF) 953 #VBoxXPCOM_LDFLAGS = -Wl,--whole-archive $(VBoxXPCOM_LIBS) -Wl,--no-whole-archive $(LIB_RUNTIME) 954 955 ifdef VBOX_IPC_RELEASE_LOG 956 IPC_LOGGING = 1 957 else ifneq ($(BUILD_TYPE),release) 958 IPC_LOGGING = 1 959 endif 960 961 TEMPLATE_XPCOMIPC = XPCOM IPC libraries 962 TEMPLATE_XPCOMIPC_EXTENDS = XPCOM 963 TEMPLATE_XPCOMIPC_DEFS = $(TEMPLATE_XPCOM_DEFS) BUILD_DCONNECT="1" 964 ifdef IPC_LOGGING 965 TEMPLATE_XPCOMIPC_DEFS += IN_RING3 IPC_LOGGING 966 TEMPLATE_XPCOMIPC_LIBS = $(TEMPLATE_XPCOM_LIBS) $(LIB_RUNTIME) 967 endif 968 TEMPLATE_XPCOMIPC_LIBS.darwin = $(TARGET_VBoxXPCOM) 969 970 TEMPLATE_XPCOMIPCEXE = XPCOM IPC executables 971 TEMPLATE_XPCOMIPCEXE_EXTENDS = XPCOMEXE 972 TEMPLATE_XPCOMIPCEXE_DEFS = $(TEMPLATE_XPCOMEXE_DEFS) BUILD_DCONNECT="1" 973 ifdef IPC_LOGGING 974 TEMPLATE_XPCOMIPCEXE_DEFS += IN_RING3 IPC_LOGGING 975 TEMPLATE_XPCOMIPCEXE_LIBS = $(TEMPLATE_XPCOMEXE_LIBS) $(LIB_RUNTIME) 976 endif 977 978 VBox-xpcom-ipcutils_TEMPLATE = XPCOMIPC 979 VBox-xpcom-ipcutils_NOINST = 1 980 VBox-xpcom-ipcutils_SOURCES = \ 981 ipc/ipcd/util/src/ipcMessageReader.cpp \ 982 ipc/ipcd/util/src/ipcMessageWriter.cpp 983 984 VBox-xpcom-ipcshared_TEMPLATE = XPCOMIPC 985 VBox-xpcom-ipcshared_NOINST = 1 986 VBox-xpcom-ipcshared_SOURCES = \ 987 ipc/ipcd/shared/src/ipcLog.cpp \ 988 ipc/ipcd/shared/src/ipcConfig.cpp \ 989 ipc/ipcd/shared/src/ipcMessage.cpp \ 990 ipc/ipcd/shared/src/ipcMessagePrimitives.cpp \ 991 ipc/ipcd/shared/src/ipcStringList.cpp \ 992 ipc/ipcd/shared/src/ipcIDList.cpp \ 993 ipc/ipcd/shared/src/ipcm.cpp 994 995 VBox-xpcom-ipcdlock_TEMPLATE = XPCOMIPC 996 VBox-xpcom-ipcdlock_NOINST = 1 997 VBox-xpcom-ipcdlock_SOURCES = \ 998 ipc/ipcd/extensions/lock/src/ipcLockProtocol.cpp \ 999 ipc/ipcd/extensions/lock/src/ipcLockService.cpp 1000 1001 VBox-xpcom-ipctransmgr_TEMPLATE = XPCOMIPC 1002 VBox-xpcom-ipctransmgr_NOINST = 1 1003 VBox-xpcom-ipctransmgr_SOURCES = \ 1004 ipc/ipcd/extensions/transmngr/src/tmTransactionService.cpp 1005 1006 VBox-xcpom-ipctmgrcom_TEMPLATE = XPCOMIPC 1007 VBox-xcpom-ipctmgrcom_NOINST = 1 1008 VBox-xcpom-ipctmgrcom_SOURCES = \ 1009 ipc/ipcd/extensions/transmngr/common/tmTransaction.cpp \ 1010 ipc/ipcd/extensions/transmngr/common/tmVector.cpp 1011 1012 1013 # DCONNECT client shared object 1014 VBoxXPCOMIPCC_TEMPLATE = XPCOMIPC 1015 VBoxXPCOMIPCC_DEFS = HAVE_DEPENDENT_LIBS 1016 VBoxXPCOMIPCC_SOURCES = \ 1017 ipc/ipcd/client/src/ipcdclient.cpp \ 1018 ipc/ipcd/client/src/ipcService.cpp \ 1019 ipc/ipcd/client/src/ipcModuleFactory.cpp \ 1020 ipc/ipcd/client/src/ipcConnectionUnix.cpp \ 1021 ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp 1022 VBoxXPCOMIPCC_LIBS = \ 1023 $(TARGET_VBox-xpcom-ipcutils) \ 1024 $(TARGET_VBox-xpcom-ipcshared) \ 1025 $(TARGET_VBox-xpcom-ipcdlock) \ 1026 $(TARGET_VBox-xpcom-ipctransmgr) \ 1027 $(TARGET_VBox-xcpom-ipctmgrcom) 1028 # EF 1029 #VBoxXPCOMIPCC_LIBS += $(LIB_RUNTIME) 1030 1031 # DCONNECT daemon executable 1032 VBoxXPCOMIPCD_TEMPLATE = XPCOMIPCEXE 1033 VBoxXPCOMIPCD_SOURCES = \ 1034 ipc/ipcd/daemon/src/ipcd.cpp \ 1035 ipc/ipcd/daemon/src/ipcClient.cpp \ 1036 ipc/ipcd/daemon/src/ipcModuleReg.cpp \ 1037 ipc/ipcd/daemon/src/ipcCommandModule.cpp \ 1038 ipc/ipcd/daemon/src/ipcdUnix.cpp 1039 1040 # 1041 # testcases 1042 # 1043 tstnsIFileEnumerator_TEMPLATE = XPCOMEXE 1044 tstnsIFileEnumerator_SOURCES = xpcom/tests/nsIFileEnumerator.cpp 1045 tstnsIFileTest_TEMPLATE = XPCOMEXE 1046 tstnsIFileTest_SOURCES = xpcom/tests/nsIFileTest.cpp 1047 tstTestArray_TEMPLATE = XPCOMEXE 1048 tstTestArray_SOURCES = xpcom/tests/TestArray.cpp 1049 tstTestAtoms_TEMPLATE = XPCOMEXE 1050 tstTestAtoms_SOURCES = xpcom/tests/TestAtoms.cpp 1051 tstTestAutoLock_TEMPLATE = XPCOMEXE 1052 tstTestAutoLock_SOURCES = xpcom/tests/TestAutoLock.cpp 1053 tstTestCallTemplates_TEMPLATE = XPCOMEXE 1054 tstTestCallTemplates_SOURCES = xpcom/tests/TestCallTemplates.cpp 1055 tstTestCOMPtr_TEMPLATE = XPCOMEXE 1056 tstTestCOMPtr_SOURCES = xpcom/tests/TestCOMPtr.cpp 1057 tstTestCOMPtrEq_TEMPLATE = XPCOMEXE 1058 tstTestCOMPtrEq_SOURCES = xpcom/tests/TestCOMPtrEq.cpp 1059 tstTestCRT_TEMPLATE = XPCOMEXE 1060 tstTestCRT_SOURCES = xpcom/tests/TestCRT.cpp 1061 tstTestFactory_TEMPLATE = XPCOMEXE 1062 tstTestFactory_SOURCES = xpcom/tests/TestFactory.cpp 1063 tstTestHashtables_TEMPLATE = XPCOMEXE 1064 tstTestHashtables_SOURCES = xpcom/tests/TestHashtables.cpp 1065 tstTestID_TEMPLATE = XPCOMEXE 1066 tstTestID_SOURCES = xpcom/tests/TestID.cpp 1067 tstTestObserverService_TEMPLATE= XPCOMEXE 1068 tstTestObserverService_SOURCES = xpcom/tests/TestObserverService.cpp 1069 tstTestPermanentAtoms_TEMPLATE = XPCOMEXE 1070 tstTestPermanentAtoms_SOURCES = xpcom/tests/TestPermanentAtoms.cpp 1071 tstTestPipes_TEMPLATE = XPCOMEXE 1072 tstTestPipes_SOURCES = xpcom/tests/TestPipes.cpp 1073 tstTestServMgr_TEMPLATE = XPCOMEXE 1074 tstTestServMgr_SOURCES = xpcom/tests/TestServMgr.cpp 1075 tstTestServMgr_INCS = xpcom/tests/services 1076 tstTestThreads_TEMPLATE = XPCOMEXE 1077 tstTestThreads_SOURCES = xpcom/tests/TestThreads.cpp 1078 tstTestXPIDLString_TEMPLATE = XPCOMEXE 1079 tstTestXPIDLString_SOURCES = xpcom/tests/TestXPIDLString.cpp 1080 tstTestDeque_TEMPLATE = XPCOMEXE 1081 tstTestDeque_SOURCES = xpcom/tests/TestDeque.cpp 1082 tstTestAutoPtr_TEMPLATE = XPCOMEXE 1083 tstTestAutoPtr_SOURCES = xpcom/tests/TestAutoPtr.cpp 1084 tstTestMinStringAPI_TEMPLATE = XPCOMEXE 1085 tstTestMinStringAPI_SOURCES = xpcom/tests/TestMinStringAPI.cpp 1086 tstTestStrings_TEMPLATE = XPCOMEXE 1087 tstTestStrings_SOURCES = xpcom/tests/TestStrings.cpp 1088 419 1089 420 1090 IDLFILES = \ … … 463 1133 xpcom/ds/nsIArray.idl \ 464 1134 xpcom/ds/nsIPropertyBag.idl \ 1135 xpcom/ds/nsIHashable.idl \ 465 1136 xpcom/io/nsIDirectoryService.idl \ 1137 xpcom/io/nsIDirectoryEnumerator.idl \ 466 1138 xpcom/io/nsIFile.idl \ 467 1139 xpcom/io/nsILocalFile.idl \ 1140 xpcom/io/nsILocalFileMac.idl \ 468 1141 xpcom/io/nsIInputStream.idl \ 469 1142 xpcom/io/nsIObjectInputStream.idl \ … … 508 1181 ipc/ipcd/extensions/transmngr/public/ipcITransactionObserver.idl 509 1182 510 VBox-xpcom-typelib_TEMPLATE = XPCOM511 VBox-xpcom-typelib_SOURCES = \512 xpcom/typelib/xpt/src/xpt_arena.c \513 xpcom/typelib/xpt/src/xpt_struct.c \514 xpcom/typelib/xpt/src/xpt_xdr.c515 516 VBox-xpcom-string_TEMPLATE = XPCOM517 VBox-xpcom-string_DEFS = _IMPL_NS_COM518 VBox-xpcom-string_SOURCES = \519 xpcom/string/src/nsAString.cpp \520 xpcom/string/src/nsDependentSubstring.cpp \521 xpcom/string/src/nsObsoleteAStringThunk.cpp \522 xpcom/string/src/nsPrintfCString.cpp \523 xpcom/string/src/nsPromiseFlatString.cpp \524 xpcom/string/src/nsReadableUtils.cpp \525 xpcom/string/src/nsSubstring.cpp \526 xpcom/string/src/nsSubstringTuple.cpp \527 xpcom/string/src/nsString.cpp \528 xpcom/string/src/nsStringComparator.cpp \529 xpcom/string/src/nsStringObsolete.cpp530 531 VBox-xpcom-base_TEMPLATE = XPCOM532 VBox-xpcom-base_SOURCES = \533 xpcom/base/nsAllocator.cpp \534 xpcom/base/nsConsoleMessage.cpp \535 xpcom/base/nsConsoleService.cpp \536 xpcom/base/nsDebugImpl.cpp \537 xpcom/base/nsErrorService.cpp \538 xpcom/base/nsExceptionService.cpp \539 xpcom/base/nsID.cpp \540 xpcom/base/nsMemoryImpl.cpp \541 xpcom/base/nsTraceRefcntImpl.cpp \542 xpcom/base/nsStackFrameUnix.cpp543 544 VBox-xpcom-ds_TEMPLATE = XPCOM545 VBox-xpcom-ds_SOURCES = \546 xpcom/ds/pldhash.c \547 xpcom/ds/nsAtomTable.cpp \548 xpcom/ds/nsAtomService.cpp \549 xpcom/ds/nsByteBuffer.cpp \550 xpcom/ds/nsCheapSets.cpp \551 xpcom/ds/nsCRT.cpp \552 xpcom/ds/nsDeque.cpp \553 xpcom/ds/nsEmptyEnumerator.cpp \554 xpcom/ds/nsEnumeratorUtils.cpp \555 xpcom/ds/nsFixedSizeAllocator.cpp \556 xpcom/ds/nsHashSets.cpp \557 xpcom/ds/nsHashtable.cpp \558 xpcom/ds/nsObserverList.cpp \559 xpcom/ds/nsObserverService.cpp \560 xpcom/ds/nsProperties.cpp \561 xpcom/ds/nsPersistentProperties.cpp \562 xpcom/ds/nsQuickSort.cpp \563 xpcom/ds/nsRecyclingAllocator.cpp \564 xpcom/ds/nsStaticNameTable.cpp \565 xpcom/ds/nsStringEnumerator.cpp \566 xpcom/ds/nsSupportsArray.cpp \567 xpcom/ds/nsSupportsArrayEnumerator.cpp \568 xpcom/ds/nsSupportsPrimitives.cpp \569 xpcom/ds/nsTHashtable.cpp \570 xpcom/ds/nsUnicharBuffer.cpp \571 xpcom/ds/nsVariant.cpp \572 xpcom/ds/nsVoidArray.cpp \573 xpcom/ds/nsTextFormatter.cpp \574 xpcom/ds/nsTimelineService.cpp \575 xpcom/ds/nsValueArray.cpp \576 xpcom/ds/nsCOMArray.cpp \577 xpcom/ds/nsArray.cpp \578 xpcom/ds/nsArrayEnumerator.cpp579 # xpcom/ds/nsHashPropertyBag.cpp580 581 # @todo what about MOZ_USER_DIR?582 VBox-xpcom-io_TEMPLATE = XPCOM583 VBox-xpcom-io_DEFS = MOZ_USER_DIR="\".mozilla\""584 VBox-xpcom-io_SOURCES = \585 xpcom/io/nsAppFileLocationProvider.cpp \586 xpcom/io/nsBinaryStream.cpp \587 xpcom/io/nsByteArrayInputStream.cpp \588 xpcom/io/nsDirectoryService.cpp \589 xpcom/io/nsEscape.cpp \590 xpcom/io/nsFastLoadFile.cpp \591 xpcom/io/nsFastLoadService.cpp \592 xpcom/io/nsInputStreamTee.cpp \593 xpcom/io/nsLinebreakConverter.cpp \594 xpcom/io/nsLocalFileCommon.cpp \595 xpcom/io/nsMultiplexInputStream.cpp \596 xpcom/io/nsPipe3.cpp \597 xpcom/io/nsStreamUtils.cpp \598 xpcom/io/nsScriptableInputStream.cpp \599 xpcom/io/nsSegmentedBuffer.cpp \600 xpcom/io/SpecialSystemDirectory.cpp \601 xpcom/io/nsStorageStream.cpp \602 xpcom/io/nsStringStream.cpp \603 xpcom/io/nsUnicharInputStream.cpp \604 xpcom/io/nsNativeCharsetUtils.cpp605 VBox-xpcom-io_SOURCES.linux = \606 xpcom/io/nsLocalFileUnix.cpp607 VBox-xpcom-io_SOURCES.l4 = \608 xpcom/io/nsLocalFileL4.cpp609 610 VBox-xpcom-components_TEMPLATE = XPCOM611 VBox-xpcom-components_DEFS = EXPORT_XPTI_API612 VBox-xpcom-components_SOURCES = \613 xpcom/components/nsCategoryManager.cpp \614 xpcom/components/nsComponentManager.cpp \615 xpcom/components/nsComponentManagerObsolete.cpp \616 xpcom/components/nsNativeComponentLoader.cpp \617 xpcom/components/nsServiceManagerObsolete.cpp \618 xpcom/components/xcDll.cpp \619 xpcom/components/nsStaticComponentLoader.cpp620 621 VBox-xpcom-threads_TEMPLATE = XPCOM622 VBox-xpcom-threads_SOURCES = \623 xpcom/threads/plevent.c \624 xpcom/threads/nsAutoLock.cpp \625 xpcom/threads/nsEnvironment.cpp \626 xpcom/threads/nsEventQueue.cpp \627 xpcom/threads/nsEventQueueService.cpp \628 xpcom/threads/nsThread.cpp \629 xpcom/threads/nsTimerImpl.cpp \630 xpcom/threads/nsProcessCommon.cpp \631 xpcom/threads/TimerThread.cpp632 633 VBox-xpcom-xptinfo_TEMPLATE = XPCOM634 VBox-xpcom-xptinfo_DEFS = EXPORT_XPTI_API635 VBox-xpcom-xptinfo_SOURCES = \636 xpcom/reflect/xptinfo/src/xptiFile.cpp \637 xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp \638 xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp \639 xpcom/reflect/xptinfo/src/xptiManifest.cpp \640 xpcom/reflect/xptinfo/src/xptiMisc.cpp \641 xpcom/reflect/xptinfo/src/xptiTypelibGuts.cpp \642 xpcom/reflect/xptinfo/src/xptiWorkingSet.cpp \643 xpcom/reflect/xptinfo/src/xptiZipItem.cpp \644 xpcom/reflect/xptinfo/src/xptiZipLoader.cpp645 646 647 VBox-xpcom-xptcall_TEMPLATE = XPCOM648 VBox-xpcom-xptcall_DEFS = EXPORT_XPTC_API649 VBox-xpcom-xptcall_DEFS.l4 = L4650 VBox-xpcom-xptcall_SOURCES = xpcom/reflect/xptcall/src/xptcall.cpp651 VBox-xpcom-xptcall_SOURCES.x86 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp \652 xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp653 VBox-xpcom-xptcall_SOURCES.amd64 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp \654 xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp655 656 VBox-xpcom-proxy_TEMPLATE = XPCOM657 VBox-xpcom-proxy_SOURCES = xpcom/proxy/src/nsProxyEvent.cpp \658 xpcom/proxy/src/nsProxyEventClass.cpp \659 xpcom/proxy/src/nsProxyEventObject.cpp \660 xpcom/proxy/src/nsProxyObjectManager.cpp \661 xpcom/proxy/src/nsProxyRelease.cpp662 663 # glue library which all client apps will link with664 VBoxXPCOMGlue_TEMPLATE = XPCOM665 VBoxXPCOMGlue_DEFS = XPCOM_GLUE666 VBoxXPCOMGlue_SOURCES = xpcom/glue/nsCOMPtr.cpp \667 xpcom/glue/nsComponentManagerUtils.cpp \668 xpcom/glue/nsDebug.cpp \669 xpcom/glue/nsGenericFactory.cpp \670 xpcom/glue/nsIInterfaceRequestorUtils.cpp \671 xpcom/glue/nsMemory.cpp \672 xpcom/glue/nsTraceRefcnt.cpp \673 xpcom/glue/nsWeakReference.cpp \674 xpcom/glue/standalone/nsXPCOMGlue.cpp \675 xpcom/glue/standalone/nsGREDirServiceProvider.cpp676 VBoxXPCOMGlue_INST = lib/ $(INST_SDK)/lib/677 678 # the big DLL, assembling all lib files679 VBoxXPCOM_TEMPLATE = XPCOM680 VBoxXPCOM_DEFS = BUILD_DCONNECT="1"681 VBoxXPCOM_SOURCES = \682 xpcom/glue/nsCOMPtr.cpp \683 xpcom/glue/nsComponentManagerUtils.cpp \684 xpcom/glue/nsDebug.cpp \685 xpcom/glue/nsGenericFactory.cpp \686 xpcom/glue/nsIInterfaceRequestorUtils.cpp \687 xpcom/glue/nsMemory.cpp \688 xpcom/glue/nsTraceRefcnt.cpp \689 xpcom/glue/nsWeakReference.cpp \690 xpcom/build/nsXPComInit.cpp \691 xpcom/build/nsStringAPI.cpp692 VBoxXPCOM_LIBS = \693 $(PATH_LIB)/VBox-xpcom-typelib$(XPCOM_SUFF_LIB) \694 $(PATH_LIB)/VBox-xpcom-string$(XPCOM_SUFF_LIB) \695 $(PATH_LIB)/VBox-xpcom-base$(XPCOM_SUFF_LIB) \696 $(PATH_LIB)/VBox-xpcom-ds$(XPCOM_SUFF_LIB) \697 $(PATH_LIB)/VBox-xpcom-io$(XPCOM_SUFF_LIB) \698 $(PATH_LIB)/VBox-xpcom-components$(XPCOM_SUFF_LIB) \699 $(PATH_LIB)/VBox-xpcom-threads$(XPCOM_SUFF_LIB) \700 $(PATH_LIB)/VBox-xpcom-xptinfo$(XPCOM_SUFF_LIB) \701 $(PATH_LIB)/VBox-xpcom-xptcall$(XPCOM_SUFF_LIB) \702 $(PATH_LIB)/VBox-xpcom-proxy$(XPCOM_SUFF_LIB) \703 $(PATH_LIB)/VBox-xpcom-nspr$(XPCOM_SUFF_LIB)704 VBoxXPCOM_LDFLAGS = -Wl,--whole-archive $(VBoxXPCOM_LIBS) -Wl,--no-whole-archive705 # EF heap706 #VBoxXPCOM_LIBS += $(LIB_RUNTIME_EF)707 #VBoxXPCOM_LDFLAGS = -Wl,--whole-archive $(VBoxXPCOM_LIBS) -Wl,--no-whole-archive $(LIB_RUNTIME)708 709 ifdef VBOX_IPC_RELEASE_LOG710 IPC_LOGGING = 1711 else ifneq ($(BUILD_TYPE),release)712 IPC_LOGGING = 1713 endif714 715 TEMPLATE_XPCOMIPC = XPCOM IPC libraries716 TEMPLATE_XPCOMIPC_EXTENDS = XPCOM717 TEMPLATE_XPCOMIPC_DEFS = $(TEMPLATE_XPCOM_DEFS) BUILD_DCONNECT="1"718 ifdef IPC_LOGGING719 TEMPLATE_XPCOMIPC_DEFS += IN_RING3 IPC_LOGGING720 TEMPLATE_XPCOMIPC_LIBS = $(TEMPLATE_XPCOM_LIBS) $(LIB_RUNTIME)721 endif722 723 TEMPLATE_XPCOMIPCEXE = XPCOM IPC executables724 TEMPLATE_XPCOMIPCEXE_EXTENDS = XPCOMEXE725 TEMPLATE_XPCOMIPCEXE_DEFS = $(TEMPLATE_XPCOMEXE_DEFS) BUILD_DCONNECT="1"726 ifdef IPC_LOGGING727 TEMPLATE_XPCOMIPCEXE_DEFS += IN_RING3 IPC_LOGGING728 TEMPLATE_XPCOMIPCEXE_LIBS = $(TEMPLATE_XPCOMEXE_LIBS) $(LIB_RUNTIME)729 endif730 731 VBox-xpcom-ipcutils_TEMPLATE = XPCOMIPC732 VBox-xpcom-ipcutils_SOURCES = \733 ipc/ipcd/util/src/ipcMessageReader.cpp \734 ipc/ipcd/util/src/ipcMessageWriter.cpp735 736 VBox-xpcom-ipcshared_TEMPLATE = XPCOMIPC737 VBox-xpcom-ipcshared_SOURCES = \738 ipc/ipcd/shared/src/ipcLog.cpp \739 ipc/ipcd/shared/src/ipcConfig.cpp \740 ipc/ipcd/shared/src/ipcMessage.cpp \741 ipc/ipcd/shared/src/ipcMessagePrimitives.cpp \742 ipc/ipcd/shared/src/ipcStringList.cpp \743 ipc/ipcd/shared/src/ipcIDList.cpp \744 ipc/ipcd/shared/src/ipcm.cpp745 746 VBox-xpcom-ipcdlock_TEMPLATE = XPCOMIPC747 VBox-xpcom-ipcdlock_SOURCES = \748 ipc/ipcd/extensions/lock/src/ipcLockProtocol.cpp \749 ipc/ipcd/extensions/lock/src/ipcLockService.cpp750 751 VBox-xpcom-ipctransmgr_TEMPLATE = XPCOMIPC752 VBox-xpcom-ipctransmgr_SOURCES = \753 ipc/ipcd/extensions/transmngr/src/tmTransactionService.cpp754 755 VBox-xcpom-ipctmgrcom_TEMPLATE = XPCOMIPC756 VBox-xcpom-ipctmgrcom_SOURCES = \757 ipc/ipcd/extensions/transmngr/common/tmTransaction.cpp \758 ipc/ipcd/extensions/transmngr/common/tmVector.cpp759 760 761 # DCONNECT client shared object762 VBoxXPCOMIPCC_TEMPLATE = XPCOMIPC763 VBoxXPCOMIPCC_DEFS = HAVE_DEPENDENT_LIBS764 VBoxXPCOMIPCC_SOURCES = \765 ipc/ipcd/client/src/ipcdclient.cpp \766 ipc/ipcd/client/src/ipcService.cpp \767 ipc/ipcd/client/src/ipcModuleFactory.cpp \768 ipc/ipcd/client/src/ipcConnectionUnix.cpp \769 ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp770 VBoxXPCOMIPCC_LIBS = \771 $(PATH_LIB)/VBox-xpcom-ipcutils$(XPCOM_SUFF_LIB) \772 $(PATH_LIB)/VBox-xpcom-ipcshared$(XPCOM_SUFF_LIB) \773 $(PATH_LIB)/VBox-xpcom-ipcdlock$(XPCOM_SUFF_LIB) \774 $(PATH_LIB)/VBox-xpcom-ipctransmgr$(XPCOM_SUFF_LIB) \775 $(PATH_LIB)/VBox-xcpom-ipctmgrcom$(XPCOM_SUFF_LIB)776 # EF777 #VBoxXPCOMIPCC_LIBS += $(LIB_RUNTIME)778 779 # DCONNECT daemon executable780 VBoxXPCOMIPCD_TEMPLATE = XPCOMIPCEXE781 VBoxXPCOMIPCD_SOURCES = \782 ipc/ipcd/daemon/src/ipcd.cpp \783 ipc/ipcd/daemon/src/ipcClient.cpp \784 ipc/ipcd/daemon/src/ipcModuleReg.cpp \785 ipc/ipcd/daemon/src/ipcCommandModule.cpp \786 ipc/ipcd/daemon/src/ipcdUnix.cpp787 788 #789 # testcases790 #791 tstnsIFileEnumerator_TEMPLATE = XPCOMEXE792 tstnsIFileEnumerator_SOURCES = xpcom/tests/nsIFileEnumerator.cpp793 tstnsIFileTest_TEMPLATE = XPCOMEXE794 tstnsIFileTest_SOURCES = xpcom/tests/nsIFileTest.cpp795 tstTestArray_TEMPLATE = XPCOMEXE796 tstTestArray_SOURCES = xpcom/tests/TestArray.cpp797 tstTestAtoms_TEMPLATE = XPCOMEXE798 tstTestAtoms_SOURCES = xpcom/tests/TestAtoms.cpp799 tstTestAutoLock_TEMPLATE = XPCOMEXE800 tstTestAutoLock_SOURCES = xpcom/tests/TestAutoLock.cpp801 tstTestCallTemplates_TEMPLATE = XPCOMEXE802 tstTestCallTemplates_SOURCES = xpcom/tests/TestCallTemplates.cpp803 tstTestCOMPtr_TEMPLATE = XPCOMEXE804 tstTestCOMPtr_SOURCES = xpcom/tests/TestCOMPtr.cpp805 tstTestCOMPtrEq_TEMPLATE = XPCOMEXE806 tstTestCOMPtrEq_SOURCES = xpcom/tests/TestCOMPtrEq.cpp807 tstTestCRT_TEMPLATE = XPCOMEXE808 tstTestCRT_SOURCES = xpcom/tests/TestCRT.cpp809 tstTestFactory_TEMPLATE = XPCOMEXE810 tstTestFactory_SOURCES = xpcom/tests/TestFactory.cpp811 tstTestHashtables_TEMPLATE = XPCOMEXE812 tstTestHashtables_SOURCES = xpcom/tests/TestHashtables.cpp813 tstTestID_TEMPLATE = XPCOMEXE814 tstTestID_SOURCES = xpcom/tests/TestID.cpp815 tstTestObserverService_TEMPLATE= XPCOMEXE816 tstTestObserverService_SOURCES = xpcom/tests/TestObserverService.cpp817 tstTestPermanentAtoms_TEMPLATE = XPCOMEXE818 tstTestPermanentAtoms_SOURCES = xpcom/tests/TestPermanentAtoms.cpp819 tstTestPipes_TEMPLATE = XPCOMEXE820 tstTestPipes_SOURCES = xpcom/tests/TestPipes.cpp821 tstTestServMgr_TEMPLATE = XPCOMEXE822 tstTestServMgr_SOURCES = xpcom/tests/TestServMgr.cpp823 tstTestServMgr_INCS = xpcom/tests/services824 tstTestThreads_TEMPLATE = XPCOMEXE825 tstTestThreads_SOURCES = xpcom/tests/TestThreads.cpp826 tstTestXPIDLString_TEMPLATE = XPCOMEXE827 tstTestXPIDLString_SOURCES = xpcom/tests/TestXPIDLString.cpp828 tstTestDeque_TEMPLATE = XPCOMEXE829 tstTestDeque_SOURCES = xpcom/tests/TestDeque.cpp830 tstTestAutoPtr_TEMPLATE = XPCOMEXE831 tstTestAutoPtr_SOURCES = xpcom/tests/TestAutoPtr.cpp832 tstTestMinStringAPI_TEMPLATE = XPCOMEXE833 tstTestMinStringAPI_SOURCES = xpcom/tests/TestMinStringAPI.cpp834 tstTestStrings_TEMPLATE = XPCOMEXE835 tstTestStrings_SOURCES = xpcom/tests/TestStrings.cpp836 1183 837 1184 OTHER_CLEAN += \ … … 846 1193 847 1194 848 NSPRPUB_HEADERS = nsprpub/pr/include/nspr.h nsprpub/lib/ds/plarena.h nsprpub/lib/ds/plarenas.h \849 nsprpub/lib/libc/include/plbase64.h nsprpub/lib/libc/include/plerror.h \850 nsprpub/lib/libc/include/plgetopt.h nsprpub/lib/ds/plhash.h \851 nsprpub/lib/libc/include/plresolv.h nsprpub/lib/libc/include/plstr.h \852 nsprpub/pr/include/pratom.h nsprpub/pr/include/prbit.h nsprpub/pr/include/prclist.h \853 nsprpub/pr/include/prcmon.h nsprpub/pr/include/prcountr.h nsprpub/pr/include/prcvar.h \854 nsprpub/pr/include/prdtoa.h nsprpub/pr/include/prenv.h nsprpub/pr/include/prerr.h \855 nsprpub/pr/include/prerror.h nsprpub/pr/include/prinet.h nsprpub/pr/include/prinit.h \856 nsprpub/pr/include/prinrval.h nsprpub/pr/include/prio.h nsprpub/pr/include/pripcsem.h \857 nsprpub/pr/include/prlink.h nsprpub/pr/include/prlock.h nsprpub/pr/include/prlog.h \858 nsprpub/pr/include/prlong.h nsprpub/pr/include/prmem.h nsprpub/pr/include/prmon.h \859 nsprpub/pr/include/prmwait.h nsprpub/pr/include/prnetdb.h nsprpub/pr/include/prolock.h \860 nsprpub/pr/include/prpdce.h nsprpub/pr/include/prprf.h nsprpub/pr/include/prproces.h \861 nsprpub/pr/include/prrng.h nsprpub/pr/include/prrwlock.h nsprpub/pr/include/prshm.h \862 nsprpub/pr/include/prshma.h nsprpub/pr/include/prsystem.h nsprpub/pr/include/prthread.h \863 nsprpub/pr/include/prtime.h nsprpub/pr/include/prtpool.h nsprpub/pr/include/prtrace.h \864 nsprpub/pr/include/prtypes.h nsprpub/pr/include/prvrsion.h nsprpub/pr/include/prwin16.h865 NSPRPUB_MD_HEADERS = \866 nsprpub/pr/include/md/_linux.h nsprpub/pr/include/md/_l4v2.h \867 nsprpub/pr/include/md/_unixos.h nsprpub/pr/include/md/_unix_errors.h \868 nsprpub/pr/include/md/_pth.h nsprpub/pr/include/md/prosdep.h869 NSPRPUB_OBS_HEADERS = \870 nsprpub/pr/include/obsolete/pralarm.h nsprpub/pr/include/obsolete/probslet.h \871 nsprpub/pr/include/obsolete/protypes.h nsprpub/pr/include/obsolete/prsem.h872 873 NSPRPUB_PRIV_HEADERS = \874 nsprpub/pr/include/private/pprio.h nsprpub/pr/include/private/pprthred.h \875 nsprpub/pr/include/private/prpriv.h876 877 STRING_HEADERS = xpcom/string/public/nsAString.h xpcom/string/public/nsAlgorithm.h \878 xpcom/string/public/nsCharTraits.h xpcom/string/public/nsDependentString.h \879 xpcom/string/public/nsDependentSubstring.h xpcom/string/public/nsEmbedString.h \880 xpcom/string/public/nsLiteralString.h xpcom/string/public/nsObsoleteAString.h \881 xpcom/string/public/nsPrintfCString.h xpcom/string/public/nsPromiseFlatString.h \882 xpcom/string/public/nsReadableUtils.h xpcom/string/public/nsString.h \883 xpcom/string/public/nsStringAPI.h xpcom/string/public/nsStringFwd.h \884 xpcom/string/public/nsStringIterator.h xpcom/string/public/nsSubstring.h \885 xpcom/string/public/nsSubstringTuple.h xpcom/string/public/nsTAString.h \886 xpcom/string/public/nsTDependentString.h xpcom/string/public/nsTDependentSubstring.h \887 xpcom/string/public/nsTObsoleteAString.h xpcom/string/public/nsTPromiseFlatString.h \888 xpcom/string/public/nsTString.h xpcom/string/public/nsTSubstring.h \889 xpcom/string/public/nsTSubstringTuple.h xpcom/string/public/nsUTF8Utils.h \890 xpcom/string/public/nsXPIDLString.h xpcom/string/public/string-template-def-char.h \891 xpcom/string/public/string-template-def-unichar.h \892 xpcom/string/public/string-template-undef.h893 894 XPCOM_HEADERS = xpcom/base/nsAgg.h xpcom/io/nsAppDirectoryServiceDefs.h \895 xpcom/ds/nsArray.h xpcom/ds/nsArrayEnumerator.h xpcom/ds/nsAtomService.h \896 xpcom/ds/nsAutoBuffer.h xpcom/threads/nsAutoLock.h xpcom/base/nsAutoPtr.h \897 xpcom/ds/nsBaseHashtable.h xpcom/ds/nsCOMArray.h xpcom/glue/nsCOMPtr.h \898 xpcom/ds/nsCRT.h xpcom/components/nsCategoryManagerUtils.h xpcom/ds/nsCheapSets.h \899 xpcom/ds/nsClassHashtable.h xpcom/base/nsCom.h \900 xpcom/components/nsComponentManagerObsolete.h \901 xpcom/components/nsComponentManagerUtils.h xpcom/ds/nsCppSharedAllocator.h \902 xpcom/ds/nsDataHashtable.h xpcom/glue/nsDebug.h xpcom/base/nsDebugImpl.h \903 xpcom/ds/nsDeque.h xpcom/io/nsDirectoryService.h xpcom/io/nsDirectoryServiceDefs.h \904 xpcom/io/nsDirectoryServiceUtils.h xpcom/ds/nsDoubleHashtable.h \905 xpcom/ds/nsEnumeratorUtils.h xpcom/base/nsError.h xpcom/io/nsEscape.h \906 xpcom/threads/nsEventQueueUtils.h xpcom/io/nsFastLoadPtr.h \907 xpcom/io/nsFastLoadService.h xpcom/ds/nsFixedSizeAllocator.h \908 xpcom/glue/nsGenericFactory.h xpcom/ds/nsHashKeys.h xpcom/ds/nsHashSets.h \909 xpcom/ds/nsHashtable.h xpcom/base/nsIAllocator.h xpcom/ds/nsIByteBuffer.h \910 xpcom/base/nsID.h xpcom/glue/nsIGenericFactory.h xpcom/base/nsIID.h \911 xpcom/glue/nsIInterfaceRequestorUtils.h xpcom/components/nsIServiceManagerObsolete.h \912 xpcom/components/nsIServiceManagerUtils.h xpcom/base/nsISupportsBase.h \913 xpcom/glue/nsISupportsImpl.h xpcom/base/nsISupportsObsolete.h \914 xpcom/glue/nsISupportsUtils.h xpcom/ds/nsIUnicharBuffer.h \915 xpcom/io/nsIUnicharInputStream.h xpcom/glue/nsIWeakReferenceUtils.h \916 xpcom/ds/nsInt64.h xpcom/ds/nsInterfaceHashtable.h \917 xpcom/io/nsLinebreakConverter.h xpcom/io/nsLocalFile.h xpcom/io/nsLocalFileUnix.h \918 xpcom/glue/nsMemory.h xpcom/components/nsModule.h xpcom/io/nsMultiplexInputStream.h \919 xpcom/io/nsNativeCharsetUtils.h xpcom/components/nsNativeComponentLoader.h \920 xpcom/ds/nsObserverService.h xpcom/components/nsObsoleteModuleLoading.h \921 xpcom/threads/nsProcess.h xpcom/proxy/public/nsProxiedService.h \922 xpcom/proxy/public/nsProxyEvent.h xpcom/proxy/public/nsProxyRelease.h \923 xpcom/ds/nsQuickSort.h xpcom/ds/nsRecyclingAllocator.h xpcom/ds/nsRefPtrHashtable.h \924 xpcom/io/nsScriptableInputStream.h xpcom/ds/nsStaticAtom.h \925 xpcom/components/nsStaticComponent.h xpcom/ds/nsStaticNameTable.h \926 xpcom/io/nsStorageStream.h xpcom/io/nsStreamUtils.h xpcom/ds/nsStringEnumerator.h \927 xpcom/io/nsStringIO.h xpcom/io/nsStringStream.h xpcom/ds/nsSupportsArray.h \928 xpcom/ds/nsSupportsPrimitives.h xpcom/ds/nsTHashtable.h xpcom/ds/nsTextFormatter.h \929 xpcom/ds/nsTime.h xpcom/glue/nsTraceRefcnt.h xpcom/base/nsTraceRefcntImpl.h \930 xpcom/ds/nsUnitConversion.h xpcom/ds/nsValueArray.h xpcom/ds/nsVariant.h \931 xpcom/ds/nsVoidArray.h xpcom/base/nsWeakPtr.h xpcom/glue/nsWeakReference.h \932 xpcom/build/nsXPCOM.h xpcom/build/nsXPCOMCID.h xpcom/glue/standalone/nsXPCOMGlue.h \933 xpcom/base/nscore.h xpcom/ds/pldhash.h xpcom/threads/plevent.h \934 xpcom/components/xcDll.h xpcom/typelib/xpt/public/xpt_arena.h \935 xpcom/typelib/xpt/public/xpt_struct.h xpcom/typelib/xpt/public/xpt_xdr.h \936 xpcom/reflect/xptcall/public/xptcall.h xpcom/reflect/xptcall/public/xptcstubsdecl.inc \937 xpcom/reflect/xptcall/public/xptcstubsdef.inc xpcom/reflect/xptinfo/public/xptinfo.h \938 xpcom-config.h939 940 IPCD_HEADERS = ipc/ipcd/client/public/ipcCID.h ipc/ipcd/extensions/lock/public/ipcLockCID.h \941 ipc/ipcd/util/public/ipcMessageReader.h ipc/ipcd/util/public/ipcMessageWriter.h \942 ipc/ipcd/daemon/public/ipcModule.h ipc/ipcd/daemon/public/ipcModuleUtil.h \943 ipc/ipcd/client/public/ipcdclient.h944 945 # dummy target for copying XPCOM header files. This is done manually for now946 # as we have to choose the right target directories947 $(PATH_BIN)/sdk/include/xpcom/.keep: nsprpub/pr/include/md/_vbox.cfg \948 nsprpub/pr/include/md/_linux.cfg nsprpub/pr/include/md/_l4v2.cfg $(NSPRPUB_HEADERS) \949 $(NSPRPUB_MD_HEADERS) $(NSPRPUB_OBS_HEADERS) $(NSPRPUB_PRIV_HEADERS) \950 $(STRING_HEADERS) $(XPCOM_HEADERS) $(IPCD_HEADERS)951 $(call MSG_L1,Installing XPCOM headers)952 $(QUIET)$(MKDIR) -p \953 $(@D)/nsprpub \954 $(@D)/nsprpub/md \955 $(@D)/nsprpub/obsolete \956 $(@D)/nsprpub/private \957 $(@D)/string \958 $(@D)/xpcom \959 $(@D)/ipcd960 $(QUIET)$(CP) -p nsprpub/pr/include/md/_vbox.cfg $(@D)/nsprpub/prcpucfg.h961 $(QUIET)$(CP) -p nsprpub/pr/include/md/_linux.cfg $(@D)/nsprpub/_linuxcfg.h962 $(QUIET)$(CP) -p nsprpub/pr/include/md/_l4v2.cfg $(@D)/nsprpub/_l4v2cfg.h963 $(QUIET)$(CP) -p $(NSPRPUB_HEADERS) $(@D)/nsprpub964 $(QUIET)$(CP) -p $(NSPRPUB_MD_HEADERS) $(@D)/nsprpub/md965 $(QUIET)$(CP) -p $(NSPRPUB_OBS_HEADERS) $(@D)/nsprpub/obsolete966 $(QUIET)$(CP) -p $(NSPRPUB_PRIV_HEADERS) $(@D)/nsprpub/private967 $(QUIET)$(CP) -p $(STRING_HEADERS) $(@D)/string968 $(QUIET)$(CP) -p $(XPCOM_HEADERS) $(@D)/xpcom969 $(QUIET)$(CP) -p $(IPCD_HEADERS) $(@D)/ipcd970 $(QUIET)$(RM) -f $@971 $(QUIET)$(APPEND) "$@" "keep"972 973 # Add the header files which we just installed to the "CLEAN" target974 OTHER_CLEAN += \975 $(PATH_BIN)/sdk/include/xpcom/nsprpub/prcpucfg.h \976 $(PATH_BIN)/sdk/include/xpcom/nsprpub/_linuxcfg.h \977 $(PATH_BIN)/sdk/include/xpcom/nsprpub/_l4v2cfg.h \978 $(addprefix $(PATH_BIN)/sdk/include/xpcom/nsprpub/,$(notdir $(NSPRPUB_HEADERS))) \979 $(addprefix $(PATH_BIN)/sdk/include/xpcom/nsprpub/md/,$(notdir $(NSPRPUB_MD_HEADERS))) \980 $(addprefix $(PATH_BIN)/sdk/include/xpcom/nsprpub/obsolete/,$(notdir $(NSPRPUB_OBS_HEADERS))) \981 $(addprefix $(PATH_BIN)/sdk/include/xpcom/nsprpub/private/,$(notdir $(NSPRPUB_PRIV_HEADERS))) \982 $(addprefix $(PATH_BIN)/sdk/include/xpcom/string/,$(notdir $(STRING_HEADERS))) \983 $(addprefix $(PATH_BIN)/sdk/include/xpcom/xpcom/,$(notdir $(XPCOM_HEADERS))) \984 $(addprefix $(PATH_BIN)/sdk/include/xpcom/ipcd/,$(notdir $(IPCD_HEADERS))) \985 $(PATH_BIN)/sdk/include/xpcom/.keep986 1195 987 1196 XPTFILES = $(addprefix $(PATH_TARGET)/, \ … … 1112 1321 # Manual dependency... 1113 1322 xpcom/string/src/nsAString.cpp: $(PATH_VBox-xpcom-string)/idl_ts 1323 1324 #/home/bird/pdp8/coding/vbox/svn/trunk/out/linux.x86/release/obj/src/libs/xpcom18a4/VBoxXPCOMGlue/xpcom/glue/nsMemory.o -
trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_darwin.cfg
r1 r589 42 42 #define XP_UNIX 43 43 #endif 44 45 #ifndef DARWIN /*bird*/ 46 #define DARWIN /*bird*/ 47 #endif /*bird*/ 44 48 45 49 #define PR_AF_INET6 30 /* same as AF_INET6 */ -
trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_darwin.h
r1 r589 43 43 #include <sys/syscall.h> 44 44 45 #ifdef XP_MACOSX 46 #include <AvailabilityMacros.h> 47 #endif 48 45 49 #define PR_LINKER_ARCH "darwin" 46 50 #define _PR_SI_SYSNAME "DARWIN" 47 #ifdef i38651 #ifdef __i386__ 48 52 #define _PR_SI_ARCHITECTURE "x86" 49 #el se53 #elif defined(__ppc__) 50 54 #define _PR_SI_ARCHITECTURE "ppc" 51 55 #endif … … 62 66 #define _PR_HAVE_SOCKADDR_LEN 63 67 #define _PR_STAT_HAS_ST_ATIMESPEC 64 #define _PR_ NO_LARGE_FILES68 #define _PR_HAVE_LARGE_OFF_T 65 69 #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY 66 70 … … 78 82 */ 79 83 #define _PR_GHBA_DISALLOW_V4MAPPED 84 #ifdef XP_MACOSX 85 #if !defined(MAC_OS_X_VERSION_10_3) || \ 86 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3 80 87 /* 81 88 * socket(AF_INET6) fails with EPROTONOSUPPORT on Mac OS X 10.1. 82 89 * IPv6 under OS X 10.2 and below is not complete (see bug 222031). 83 90 */ 84 #if MACOS_DEPLOYMENT_TARGET < 10030085 91 #define _PR_INET6_PROBE 86 #endif 92 #endif /* DT < 10.3 */ 93 #if defined(MAC_OS_X_VERSION_10_2) && \ 94 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2 87 95 /* Mac OS X 10.2 has inet_ntop and inet_pton. */ 88 #if MACOS_DEPLOYMENT_TARGET >= 10020089 96 #define _PR_HAVE_INET_NTOP 97 #endif /* DT >= 10.2 */ 98 #endif /* XP_MACOSX */ 99 #define _PR_IPV6_V6ONLY_PROBE 100 /* The IPV6_V6ONLY socket option is not defined on Mac OS X 10.1. */ 101 #ifndef IPV6_V6ONLY 102 #define IPV6_V6ONLY 27 90 103 #endif 91 104 … … 101 114 extern PRInt32 _PR_DarwinPPC_AtomicAdd(PRInt32 *ptr, PRInt32 val); 102 115 #define _MD_ATOMIC_ADD(ptr, val) _PR_DarwinPPC_AtomicAdd(ptr, val) 103 #endif /* __ppc__ */ 116 #elif defined(__i386__) 117 #define _PR_HAVE_ATOMIC_OPS 118 #define _MD_INIT_ATOMIC() 119 extern PRInt32 _PR_Darwin_x86_AtomicIncrement(PRInt32 *val); 120 #define _MD_ATOMIC_INCREMENT(val) _PR_Darwin_x86_AtomicIncrement(val) 121 extern PRInt32 _PR_Darwin_x86_AtomicDecrement(PRInt32 *val); 122 #define _MD_ATOMIC_DECREMENT(val) _PR_Darwin_x86_AtomicDecrement(val) 123 extern PRInt32 _PR_Darwin_x86_AtomicSet(PRInt32 *val, PRInt32 newval); 124 #define _MD_ATOMIC_SET(val, newval) _PR_Darwin_x86_AtomicSet(val, newval) 125 extern PRInt32 _PR_Darwin_x86_AtomicAdd(PRInt32 *ptr, PRInt32 val); 126 #define _MD_ATOMIC_ADD(ptr, val) _PR_Darwin_x86_AtomicAdd(ptr, val) 127 #endif /* __i386__ */ 104 128 105 129 #define USE_SETJMP -
trunk/src/libs/xpcom18a4/nsprpub/pr/include/md/_vbox.cfg
r1 r589 21 21 * 22 22 * Contributor(s): 23 * InnoTek 23 24 * 24 25 * Alternatively, the contents of this file may be used under the terms of … … 39 40 #define nspr_vboxcfg___ 40 41 41 #ifndef __L4_XPCOM__ 42 # include <_linuxcfg.h> 42 #ifdef __DARWIN__ 43 # include <md/_darwin.cfg> 44 #elif defined(__FREEBSD__) 45 # include <md/_freebsd.cfg> 46 #elif defined(__L4__) 47 # include <md/_l4v2.cfg> 48 #elif defined(__LINUX__) 49 # include <md/_linux.cfg> 50 #elif defined(__NETBSD__) 51 # include <md/_netbsd.cfg> 52 #elif defined(__OPENBSD__) 53 # include <md/_openbsd.cfg> 54 #elif defined(__SOLARIS__) 55 # include <md/_solaris.cfg> 43 56 #else 44 # include <_l4v2cfg.h>57 # error "Define the correct platform identifier / Port me." 45 58 #endif 46 59 -
trunk/src/libs/xpcom18a4/xpcom/MoreFiles/FSCopyObject.c
r1 r589 44 44 Copyright © 2002 Apple Computer, Inc., All Rights Reserved 45 45 */ 46 47 // Modified 2006-01-23 - added this comment. 46 48 47 49 #include "FSCopyObject.h" -
trunk/src/libs/xpcom18a4/xpcom/MoreFiles/FSCopyObject.h
r1 r589 42 42 */ 43 43 44 // Modified 2006-01-23 - added this comment. 44 45 45 46 #ifndef __FSCOPYOBJECT_H__ -
trunk/src/libs/xpcom18a4/xpcom/MoreFiles/MoreFilesX.c
r1 r589 69 69 <1> 1/25/02 JL MoreFilesX 1.0 70 70 */ 71 72 // Modified 2006-01-23 - added this comment. 71 73 72 74 #if defined(__MACH__) … … 2125 2127 /*****************************************************************************/ 2126 2128 2127 OSErr 2128 FSLockRange( 2129 /* Renamed from FSLockRange to MFX_FSLockRange to avoid a conflict with 2130 * the FSLockRange function present in the system library since Mac OS X 2131 * 10.4. */ 2132 2133 OSErr 2134 MFX_FSLockRange( 2129 2135 SInt16 refNum, 2130 2136 SInt32 rangeLength, … … 2148 2154 /*****************************************************************************/ 2149 2155 2150 OSErr 2151 FSUnlockRange( 2156 /* Renamed from FSUnlockRange to MFX_FSUnlockRange to avoid a conflict with 2157 * the FSUnlockRange function present in the system library since Mac OS X 2158 * 10.4. */ 2159 2160 OSErr 2161 MFX_FSUnlockRange( 2152 2162 SInt16 refNum, 2153 2163 SInt32 rangeLength, … … 2307 2317 /*****************************************************************************/ 2308 2318 2319 // This function exists in Mac OS X 10.5, we cannot re-define it here. 2320 // We don't use this function, so just don't compile it. 2321 #if 0 2309 2322 OSErr 2310 2323 FSVolumeMount( … … 2330 2343 return ( result ); 2331 2344 } 2345 #endif 2332 2346 2333 2347 /*****************************************************************************/ -
trunk/src/libs/xpcom18a4/xpcom/MoreFiles/MoreFilesX.h
r1 r589 84 84 do less work. 85 85 */ 86 87 // Modified 2006-01-23 - added this comment. 86 88 87 89 #ifndef __MOREFILESX__ … … 1333 1335 /*****************************************************************************/ 1334 1336 1335 #pragma mark FSLockRange 1336 1337 OSErr 1338 FSLockRange( 1337 #pragma mark MFX_FSLockRange 1338 /* Renamed from FSLockRange to MFX_FSLockRange to avoid a conflict with 1339 * the FSLockRange function present in the system library since Mac OS X 1340 * 10.4. */ 1341 1342 OSErr 1343 MFX_FSLockRange( 1339 1344 SInt16 refNum, 1340 1345 SInt32 rangeLength, … … 1356 1361 /*****************************************************************************/ 1357 1362 1358 #pragma mark FSUnlockRange 1359 1360 OSErr 1361 FSUnlockRange( 1363 #pragma mark MFX_FSUnlockRange 1364 /* Renamed from FSUnlockRange to MFX_FSUnlockRange to avoid a conflict with 1365 * the FSUnlockRange function present in the system library since Mac OS X 1366 * 10.4. */ 1367 1368 OSErr 1369 MFX_FSUnlockRange( 1362 1370 SInt16 refNum, 1363 1371 SInt32 rangeLength, … … 1483 1491 #pragma mark FSVolumeMount 1484 1492 1493 // This function exists in Mac OS X 10.5, we cannot re-define it here. 1494 // We don't use this function, so just don't compile it. 1495 #if 0 1485 1496 OSErr 1486 1497 FSVolumeMount( 1487 1498 const void *volMountInfo, 1488 1499 FSVolumeRefNum *volRefNum); 1500 #endif 1489 1501 1490 1502 /* -
trunk/src/libs/xpcom18a4/xpcom/io/nsILocalFileMac.idl
r1 r589 22 22 * Contributor(s): 23 23 * Conrad Carlen <[email protected]> 24 * Mark Mentovai <[email protected]> 24 25 * 25 26 * Alternatively, the contents of this file may be used under the terms of … … 51 52 native CFURLRef(CFURLRef); 52 53 53 [ uuid(614c3010-1dd2-11b2-be04-bcd57a64ffc9)]54 [scriptable, uuid(748f3ffe-27d9-4402-9de9-494badbeebf4)] 54 55 interface nsILocalFileMac : nsILocalFile 55 56 { … … 65 66 * 66 67 */ 67 68 [noscript] void initWithCFURL(in CFURLRef aCFURL); 68 69 69 70 /** … … 77 78 * 78 79 */ 79 80 [noscript] void initWithFSRef([const] in FSRefPtr aFSRef); 80 81 81 82 /** … … 88 89 * 89 90 */ 90 91 [noscript] void initWithFSSpec([const] in FSSpecPtr aFileSpec); 91 92 92 93 /** … … 100 101 * 101 102 */ 102 103 [noscript] void initToAppWithCreatorCode(in OSType aAppCreator); 103 104 104 105 /** … … 116 117 * 117 118 * @return 118 * 119 */ 120 121 119 * 120 */ 121 [noscript] CFURLRef getCFURL(); 122 122 123 /** 123 124 * getFSRef … … 133 134 * 134 135 * @return 135 * 136 */ 137 138 136 * 137 */ 138 [noscript] FSRef getFSRef(); 139 139 140 /** 140 141 * getFSSpec … … 148 149 * 149 150 * @return 150 * 151 */ 152 151 * 152 */ 153 [noscript] FSSpec getFSSpec(); 153 154 154 155 /** 155 156 * fileSizeWithResFork 156 * 157 * 157 158 * Returns the combined size of both the data fork and the resource 158 159 * fork (if present) rather than just the size of the data fork … … 160 161 * 161 162 */ 162 163 163 readonly attribute PRInt64 fileSizeWithResFork; 164 164 165 /** 165 166 * Use with SetFileType() to specify the signature of current process 166 167 */ 167 168 168 const unsigned long CURRENT_PROCESS_CREATOR = 0x8000000; 169 169 170 /** 170 171 * fileType, creator … … 173 174 * 174 175 */ 175 attribute OSType fileType;176 attribute OSType fileCreator;177 176 [noscript] attribute OSType fileType; 177 [noscript] attribute OSType fileCreator; 178 178 179 /** 179 180 * setFileTypeAndCreatorFromMIMEType … … 185 186 * 186 187 */ 187 188 188 void setFileTypeAndCreatorFromMIMEType(in string aMIMEType); 189 189 190 /** 190 191 * setFileTypeAndCreatorFromExtension … … 196 197 * 197 198 */ 198 199 199 void setFileTypeAndCreatorFromExtension(in string aExtension); 200 200 201 /** 201 202 * launchWithDoc … … 207 208 * 208 209 */ 209 210 void launchWithDoc(in nsILocalFile aDocToLoad, in boolean aLaunchInBackground); 210 211 211 212 /** … … 220 221 * 221 222 */ 222 223 void openDocWithApp(in nsILocalFile aAppToOpenWith, in boolean aLaunchInBackground); 223 224 224 225 /** … … 228 229 * 229 230 */ 230 boolean isPackage(); 231 boolean isPackage(); 232 233 /** 234 * bundleDisplayName 235 * 236 * returns the display name of the application bundle (usually the human 237 * readable name of the application) 238 */ 239 readonly attribute AString bundleDisplayName; 240 241 /** 242 * bundleIdentifier 243 * 244 * returns the identifier of the bundle 245 */ 246 readonly attribute AUTF8String bundleIdentifier; 231 247 }; 232 248 … … 240 256 241 257 NS_EXPORT nsresult NS_NewLocalFileWithFSSpec(const FSSpec* inSpec, PRBool followSymlinks, nsILocalFileMac* *result); 258 259 // NS_NewLocalFileWithFSRef is available since Mozilla 1.8.1. 260 NS_EXPORT nsresult NS_NewLocalFileWithFSRef(const FSRef* aFSRef, PRBool aFollowSymlinks, nsILocalFileMac** result); 242 261 } 243 262 %} -
trunk/src/libs/xpcom18a4/xpcom/io/nsLocalFileOSX.cpp
r1 r589 23 23 * Conrad Carlen <[email protected]> 24 24 * Jungshik Shin <[email protected]> 25 * Asaf Romano <[email protected]> 26 * Mark Mentovai <[email protected]> 25 27 * 26 28 * Alternatively, the contents of this file may be used under the terms of … … 39 41 40 42 #include "nsLocalFile.h" 43 #include "nsDirectoryServiceDefs.h" 41 44 42 45 #include "nsString.h" 43 46 #include "nsReadableUtils.h" 47 #include "nsIDirectoryEnumerator.h" 44 48 #include "nsISimpleEnumerator.h" 45 49 #include "nsITimelineService.h" … … 49 53 #include "prmem.h" 50 54 #include "nsCRT.h" 55 #include "nsHashKeys.h" 51 56 52 57 #include "MoreFilesX.h" 53 58 #include "FSCopyObject.h" 54 59 #include "nsAutoBuffer.h" 60 #include "nsTraceRefcntImpl.h" 55 61 56 62 // Mac Includes 57 #include <Aliases.h>58 #include <Gestalt.h>59 #include <AppleEvents.h>60 #include <AEDataModel.h>61 #include <Processes.h>62 63 #include <Carbon/Carbon.h> 63 64 64 65 // Unix Includes 66 #include <unistd.h> 65 67 #include <sys/stat.h> 68 #include <stdlib.h> 69 70 #if !defined(MAC_OS_X_VERSION_10_4) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4 71 #define GetAliasSizeFromRecord(aliasRecord) aliasRecord.aliasSize 72 #else 73 #define GetAliasSizeFromRecord(aliasRecord) GetAliasSizeFromPtr(&aliasRecord) 74 #endif 75 76 #define CHECK_mBaseRef() \ 77 PR_BEGIN_MACRO \ 78 if (!mBaseRef) \ 79 return NS_ERROR_NOT_INITIALIZED; \ 80 PR_END_MACRO 66 81 67 82 //***************************************************************************** … … 108 123 mFile.SetFollowLinks(mSavedState); 109 124 } 110 125 111 126 private: 112 127 nsLocalFile& mFile; … … 117 132 #pragma mark [nsDirEnumerator] 118 133 119 class nsDirEnumerator : public nsISimpleEnumerator 134 class nsDirEnumerator : public nsISimpleEnumerator, 135 public nsIDirectoryEnumerator 120 136 { 121 137 public: … … 130 146 } 131 147 132 nsresult Init(nsILocalFileMac* parent) 148 nsresult Init(nsILocalFileMac* parent) 133 149 { 134 150 NS_ENSURE_ARG(parent); 135 151 136 152 OSErr err; 137 153 nsresult rv; 138 154 FSRef parentRef; 139 155 140 156 rv = parent->GetFSRef(&parentRef); 141 157 if (NS_FAILED(rv)) 142 158 return rv; 143 159 144 160 mFSRefsArray = (FSRef *)nsMemory::Alloc(sizeof(FSRef) 145 161 * kRequestCountPerIteration); 146 162 if (!mFSRefsArray) 147 163 return NS_ERROR_OUT_OF_MEMORY; 148 164 149 165 err = ::FSOpenIterator(&parentRef, kFSIterateFlat, &mIterator); 150 166 if (err != noErr) 151 167 return MacErrorMapper(err); 152 168 153 169 return NS_OK; 154 170 } 155 171 156 NS_IMETHOD HasMoreElements(PRBool *result) 172 NS_IMETHOD HasMoreElements(PRBool *result) 157 173 { 158 174 if (mNext == nsnull) { … … 168 184 nsnull, 169 185 nsnull); 170 186 171 187 if (err == noErr || err == errFSNoMoreItems) { 172 188 mArrayCnt = actualCnt; … … 183 199 mArrayIndex++; 184 200 mNext = newFile; 185 } 201 } 186 202 } 187 203 *result = mNext != nsnull; 204 if (!*result) 205 Close(); 188 206 return NS_OK; 189 207 } 190 208 191 NS_IMETHOD GetNext(nsISupports **result) 209 NS_IMETHOD GetNext(nsISupports **result) 192 210 { 193 211 NS_ENSURE_ARG_POINTER(result); … … 206 224 } 207 225 226 NS_IMETHOD GetNextFile(nsIFile **result) 227 { 228 *result = nsnull; 229 PRBool hasMore = PR_FALSE; 230 nsresult rv = HasMoreElements(&hasMore); 231 if (NS_FAILED(rv) || !hasMore) 232 return rv; 233 *result = mNext; 234 NS_IF_ADDREF(*result); 235 mNext = nsnull; 236 return NS_OK; 237 } 238 239 NS_IMETHOD Close() 240 { 241 if (mIterator) { 242 ::FSCloseIterator(mIterator); 243 mIterator = nsnull; 244 } 245 if (mFSRefsArray) { 246 nsMemory::Free(mFSRefsArray); 247 mFSRefsArray = nsnull; 248 } 249 return NS_OK; 250 } 251 208 252 private: 209 ~nsDirEnumerator() 253 ~nsDirEnumerator() 210 254 { 211 if (mIterator) 212 ::FSCloseIterator(mIterator); 213 if (mFSRefsArray) 214 nsMemory::Free(mFSRefsArray); 255 Close(); 215 256 } 216 257 … … 221 262 kRequestCountPerIteration = ((4096 * 4) / sizeof(FSRef)) 222 263 }; 223 264 224 265 nsCOMPtr<nsILocalFileMac> mNext; 225 266 226 267 FSIterator mIterator; 227 268 FSRef *mFSRefsArray; … … 229 270 }; 230 271 231 NS_IMPL_ISUPPORTS 1(nsDirEnumerator, nsISimpleEnumerator)272 NS_IMPL_ISUPPORTS2(nsDirEnumerator, nsISimpleEnumerator, nsIDirectoryEnumerator) 232 273 233 274 #pragma mark - … … 242 283 dataHandle = nil; 243 284 } 244 285 245 286 ~StAEDesc() 246 287 { … … 305 346 #pragma mark [nsISupports] 306 347 307 NS_IMPL_THREADSAFE_ISUPPORTS 3(nsLocalFile,348 NS_IMPL_THREADSAFE_ISUPPORTS4(nsLocalFile, 308 349 nsILocalFileMac, 309 350 nsILocalFile, 310 nsIFile) 311 351 nsIFile, 352 nsIHashable) 353 312 354 NS_METHOD nsLocalFile::nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr) 313 355 { … … 318 360 if (inst == NULL) 319 361 return NS_ERROR_OUT_OF_MEMORY; 320 362 321 363 nsresult rv = inst->QueryInterface(aIID, aInstancePtr); 322 364 if (NS_FAILED(rv)) … … 338 380 NS_IMETHODIMP nsLocalFile::Append(const nsAString& aNode) 339 381 { 340 return AppendNative(NS_ConvertU CS2toUTF8(aNode));382 return AppendNative(NS_ConvertUTF16toUTF8(aNode)); 341 383 } 342 384 … … 344 386 NS_IMETHODIMP nsLocalFile::AppendNative(const nsACString& aNode) 345 387 { 346 if (!mBaseRef)347 return NS_ERROR_NOT_INITIALIZED;388 // Check we are correctly initialized. 389 CHECK_mBaseRef(); 348 390 349 391 nsACString::const_iterator start, end; … … 372 414 NS_IMETHODIMP nsLocalFile::Normalize() 373 415 { 374 return NS_OK; 416 // Check we are correctly initialized. 417 CHECK_mBaseRef(); 418 419 // CFURL doesn't doesn't seem to resolve paths containing relative 420 // components, so we'll nick the stdlib code from nsLocalFileUnix 421 UInt8 path[PATH_MAX] = ""; 422 Boolean success; 423 success = ::CFURLGetFileSystemRepresentation(mBaseRef, true, path, PATH_MAX); 424 if (!success) 425 return NS_ERROR_FAILURE; 426 427 char resolved_path[PATH_MAX] = ""; 428 char *resolved_path_ptr = nsnull; 429 resolved_path_ptr = realpath((char*)path, resolved_path); 430 431 // if there is an error, the return is null. 432 if (!resolved_path_ptr) 433 return NSRESULT_FOR_ERRNO(); 434 435 // Need to know whether we're a directory to create a new CFURLRef 436 PRBool isDirectory; 437 nsresult rv = IsDirectory(&isDirectory); 438 NS_ENSURE_SUCCESS(rv, rv); 439 440 rv = NS_ERROR_FAILURE; 441 CFStringRef pathStrRef = 442 ::CFStringCreateWithCString(kCFAllocatorDefault, 443 resolved_path, 444 kCFStringEncodingUTF8); 445 if (pathStrRef) { 446 CFURLRef newURLRef = 447 ::CFURLCreateWithFileSystemPath(kCFAllocatorDefault, pathStrRef, 448 kCFURLPOSIXPathStyle, isDirectory); 449 if (newURLRef) { 450 SetBaseRef(newURLRef); 451 ::CFRelease(newURLRef); 452 rv = NS_OK; 453 } 454 ::CFRelease(pathStrRef); 455 } 456 457 return rv; 375 458 } 376 459 … … 380 463 if (type != NORMAL_FILE_TYPE && type != DIRECTORY_TYPE) 381 464 return NS_ERROR_FILE_UNKNOWN_TYPE; 382 if (!mBaseRef) 383 return NS_ERROR_NOT_INITIALIZED; 384 465 466 // Check we are correctly initialized. 467 CHECK_mBaseRef(); 468 385 469 nsStringArray nonExtantNodes; 386 470 CFURLRef pathURLRef = mBaseRef; … … 389 473 nsAutoBuffer<UniChar, FILENAME_BUFFER_SIZE> buffer; 390 474 Boolean success; 391 475 392 476 // Work backwards through the path to find the last node which 393 477 // exists. Place the nodes which don't exist in an array and we'll … … 405 489 ::CFRelease(leafStrRef); 406 490 leafStrRef = nsnull; 407 491 408 492 // Get the parent of the leaf for the next go round 409 493 CFURLRef parent = ::CFURLCreateCopyDeletingLastPathComponent(NULL, pathURLRef); … … 423 507 if (nodesToCreate == 0) 424 508 return NS_ERROR_FILE_ALREADY_EXISTS; 425 426 OSErr err; 509 510 OSErr err; 427 511 nsAutoString nextNodeName; 428 512 for (PRInt32 i = nodesToCreate - 1; i > 0; i--) { … … 451 535 nsnull, nsnull, nsnull, nsnull); 452 536 } 453 537 454 538 return MacErrorMapper(err); 455 539 } … … 468 552 NS_IMETHODIMP nsLocalFile::SetLeafName(const nsAString& aLeafName) 469 553 { 470 return SetNativeLeafName(NS_ConvertU CS2toUTF8(aLeafName));554 return SetNativeLeafName(NS_ConvertUTF16toUTF8(aLeafName)); 471 555 } 472 556 … … 474 558 NS_IMETHODIMP nsLocalFile::GetNativeLeafName(nsACString& aNativeLeafName) 475 559 { 476 if (!mBaseRef) 477 return NS_ERROR_NOT_INITIALIZED; 560 // Check we are correctly initialized. 561 CHECK_mBaseRef(); 562 478 563 nsresult rv = NS_ERROR_FAILURE; 479 564 CFStringRef leafStrRef = ::CFURLCopyLastPathComponent(mBaseRef); … … 482 567 ::CFRelease(leafStrRef); 483 568 } 484 return rv; 569 return rv; 485 570 } 486 571 487 572 NS_IMETHODIMP nsLocalFile::SetNativeLeafName(const nsACString& aNativeLeafName) 488 573 { 489 if (!mBaseRef) 490 return NS_ERROR_NOT_INITIALIZED; 574 // Check we are correctly initialized. 575 CHECK_mBaseRef(); 576 491 577 nsresult rv = NS_ERROR_FAILURE; 492 578 CFURLRef parentURLRef = ::CFURLCreateCopyDeletingLastPathComponent(kCFAllocatorDefault, mBaseRef); … … 514 600 NS_IMETHODIMP nsLocalFile::CopyTo(nsIFile *newParentDir, const nsAString& newName) 515 601 { 516 return MoveCopy(newParentDir, newName, PR_TRUE, PR_FALSE);602 return CopyInternal(newParentDir, newName, PR_FALSE); 517 603 } 518 604 … … 520 606 NS_IMETHODIMP nsLocalFile::CopyToNative(nsIFile *newParentDir, const nsACString& newName) 521 607 { 522 return MoveCopy(newParentDir, NS_ConvertUTF8toUCS2(newName), PR_TRUE, PR_FALSE);608 return CopyInternal(newParentDir, NS_ConvertUTF8toUTF16(newName), PR_FALSE); 523 609 } 524 610 … … 526 612 NS_IMETHODIMP nsLocalFile::CopyToFollowingLinks(nsIFile *newParentDir, const nsAString& newName) 527 613 { 528 return MoveCopy(newParentDir, newName, PR_TRUE, PR_TRUE);614 return CopyInternal(newParentDir, newName, PR_TRUE); 529 615 } 530 616 … … 532 618 NS_IMETHODIMP nsLocalFile::CopyToFollowingLinksNative(nsIFile *newParentDir, const nsACString& newName) 533 619 { 534 return MoveCopy(newParentDir, NS_ConvertUTF8toUCS2(newName), PR_TRUE, PR_TRUE);620 return CopyInternal(newParentDir, NS_ConvertUTF8toUTF16(newName), PR_TRUE); 535 621 } 536 622 … … 538 624 NS_IMETHODIMP nsLocalFile::MoveTo(nsIFile *newParentDir, const nsAString& newName) 539 625 { 540 return MoveCopy(newParentDir, newName, FALSE, FALSE);626 return MoveToNative(newParentDir, NS_ConvertUTF16toUTF8(newName)); 541 627 } 542 628 … … 544 630 NS_IMETHODIMP nsLocalFile::MoveToNative(nsIFile *newParentDir, const nsACString& newName) 545 631 { 546 return MoveCopy(newParentDir, NS_ConvertUTF8toUCS2(newName), FALSE, FALSE); 632 // Check we are correctly initialized. 633 CHECK_mBaseRef(); 634 635 StFollowLinksState followLinks(*this, PR_FALSE); 636 637 PRBool isDirectory; 638 nsresult rv = IsDirectory(&isDirectory); 639 if (NS_FAILED(rv)) 640 return rv; 641 642 // Get the source path. 643 nsCAutoString srcPath; 644 rv = GetNativePath(srcPath); 645 if (NS_FAILED(rv)) 646 return rv; 647 648 // Build the destination path. 649 nsCOMPtr<nsIFile> parentDir = newParentDir; 650 if (!parentDir) { 651 if (newName.IsEmpty()) 652 return NS_ERROR_INVALID_ARG; 653 rv = GetParent(getter_AddRefs(parentDir)); 654 if (NS_FAILED(rv)) 655 return rv; 656 } 657 else { 658 PRBool exists; 659 rv = parentDir->Exists(&exists); 660 if (NS_FAILED(rv)) 661 return rv; 662 if (!exists) { 663 rv = parentDir->Create(nsIFile::DIRECTORY_TYPE, 0777); 664 if (NS_FAILED(rv)) 665 return rv; 666 } 667 } 668 669 nsCAutoString destPath; 670 rv = parentDir->GetNativePath(destPath); 671 if (NS_FAILED(rv)) 672 return rv; 673 674 if (!newName.IsEmpty()) 675 destPath.Append(NS_LITERAL_CSTRING("/") + newName); 676 else { 677 nsCAutoString leafName; 678 rv = GetNativeLeafName(leafName); 679 if (NS_FAILED(rv)) 680 return rv; 681 destPath.Append(NS_LITERAL_CSTRING("/") + leafName); 682 } 683 684 // Perform the move. 685 if (rename(srcPath.get(), destPath.get()) != 0) { 686 if (errno == EXDEV) { 687 // Can't move across volume (device) boundaries. Copy and remove. 688 rv = CopyToNative(parentDir, newName); 689 if (NS_SUCCEEDED(rv)) { 690 // Permit removal failure. 691 Remove(PR_TRUE); 692 } 693 } 694 else 695 rv = NSRESULT_FOR_ERRNO(); 696 697 if (NS_FAILED(rv)) 698 return rv; 699 } 700 701 // Update |this| to refer to the moved file. 702 CFURLRef newBaseRef = 703 ::CFURLCreateFromFileSystemRepresentation(NULL, (UInt8*)destPath.get(), 704 destPath.Length(), isDirectory); 705 if (!newBaseRef) 706 return NS_ERROR_FAILURE; 707 SetBaseRef(newBaseRef); 708 ::CFRelease(newBaseRef); 709 710 return rv; 547 711 } 548 712 … … 550 714 NS_IMETHODIMP nsLocalFile::Remove(PRBool recursive) 551 715 { 552 StFollowLinksState followLinks(*this, PR_FALSE); // XXX If we're an alias, never remove target 553 716 // Check we are correctly initialized. 717 CHECK_mBaseRef(); 718 719 // XXX If we're an alias, never remove target 720 StFollowLinksState followLinks(*this, PR_FALSE); 721 722 PRBool isDirectory; 723 nsresult rv = IsDirectory(&isDirectory); 724 if (NS_FAILED(rv)) 725 return rv; 726 727 if (recursive && isDirectory) { 728 FSRef fsRef; 729 rv = GetFSRefInternal(fsRef); 730 if (NS_FAILED(rv)) 731 return rv; 732 733 // Call MoreFilesX to do a recursive removal. 734 OSStatus err = ::FSDeleteContainer(&fsRef); 735 rv = MacErrorMapper(err); 736 } 737 else { 738 nsCAutoString path; 739 rv = GetNativePath(path); 740 if (NS_FAILED(rv)) 741 return rv; 742 743 const char* pathPtr = path.get(); 744 int status; 745 if (isDirectory) 746 status = rmdir(pathPtr); 747 else 748 status = unlink(pathPtr); 749 750 if (status != 0) 751 rv = NSRESULT_FOR_ERRNO(); 752 } 753 754 mCachedFSRefValid = PR_FALSE; 755 return rv; 756 } 757 758 /* attribute unsigned long permissions; */ 759 NS_IMETHODIMP nsLocalFile::GetPermissions(PRUint32 *aPermissions) 760 { 761 NS_ENSURE_ARG_POINTER(aPermissions); 762 554 763 FSRef fsRef; 555 764 nsresult rv = GetFSRefInternal(fsRef); 556 765 if (NS_FAILED(rv)) 557 766 return rv; 558 559 PRBool isDir; 560 rv = IsDirectory(&isDir); 561 if (NS_FAILED(rv)) 562 return rv; 563 564 OSErr err; 565 if (recursive && isDir) 566 err = ::FSDeleteContainer(&fsRef); 567 else 568 err = ::FSDeleteObject(&fsRef); 569 570 mCachedFSRefValid = PR_FALSE; 571 return MacErrorMapper(err); 572 } 573 574 /* attribute unsigned long permissions; */ 575 NS_IMETHODIMP nsLocalFile::GetPermissions(PRUint32 *aPermissions) 576 { 577 NS_ENSURE_ARG_POINTER(aPermissions); 578 579 FSRef fsRef; 580 nsresult rv = GetFSRefInternal(fsRef); 581 if (NS_FAILED(rv)) 582 return rv; 583 767 584 768 FSCatalogInfo catalogInfo; 585 769 OSErr err = ::FSGetCatalogInfo(&fsRef, kFSCatInfoPermissions, &catalogInfo, … … 598 782 if (NS_FAILED(rv)) 599 783 return rv; 600 784 601 785 FSCatalogInfo catalogInfo; 602 786 OSErr err = ::FSGetCatalogInfo(&fsRef, kFSCatInfoPermissions, &catalogInfo, … … 626 810 NS_IMETHODIMP nsLocalFile::GetLastModifiedTime(PRInt64 *aLastModifiedTime) 627 811 { 812 // Check we are correctly initialized. 813 CHECK_mBaseRef(); 814 628 815 NS_ENSURE_ARG_POINTER(aLastModifiedTime); 629 816 630 817 FSRef fsRef; 631 818 nsresult rv = GetFSRefInternal(fsRef); 632 819 if (NS_FAILED(rv)) 633 820 return rv; 634 821 635 822 FSCatalogInfo catalogInfo; 636 823 OSErr err = ::FSGetCatalogInfo(&fsRef, kFSCatInfoContentMod, &catalogInfo, … … 638 825 if (err != noErr) 639 826 return MacErrorMapper(err); 640 *aLastModifiedTime = HFSPlustoNSPRTime(catalogInfo.contentModDate); 827 *aLastModifiedTime = HFSPlustoNSPRTime(catalogInfo.contentModDate); 641 828 return NS_OK; 642 829 } … … 644 831 NS_IMETHODIMP nsLocalFile::SetLastModifiedTime(PRInt64 aLastModifiedTime) 645 832 { 833 // Check we are correctly initialized. 834 CHECK_mBaseRef(); 835 646 836 OSErr err; 647 837 nsresult rv; … … 661 851 if (err != noErr) 662 852 return MacErrorMapper(err); 663 853 664 854 /* Notify the parent if this is a file */ 665 855 notifyParent = (0 == (catalogInfo.nodeFlags & kFSNodeIsDirectoryMask)); … … 695 885 NS_ENSURE_ARG_POINTER(aFileSize); 696 886 *aFileSize = 0; 697 887 698 888 FSRef fsRef; 699 889 nsresult rv = GetFSRefInternal(fsRef); 700 890 if (NS_FAILED(rv)) 701 891 return rv; 702 892 703 893 FSCatalogInfo catalogInfo; 704 894 OSErr err = ::FSGetCatalogInfo(&fsRef, kFSCatInfoNodeFlags + kFSCatInfoDataSizes, &catalogInfo, … … 706 896 if (err != noErr) 707 897 return MacErrorMapper(err); 708 898 709 899 // FSGetCatalogInfo can return a bogus size for directories sometimes, so only 710 900 // rely on the answer for files … … 716 906 NS_IMETHODIMP nsLocalFile::SetFileSize(PRInt64 aFileSize) 717 907 { 908 // Check we are correctly initialized. 909 CHECK_mBaseRef(); 910 718 911 FSRef fsRef; 719 912 nsresult rv = GetFSRefInternal(fsRef); 720 913 if (NS_FAILED(rv)) 721 914 return rv; 722 723 SInt16 refNum; 915 916 SInt16 refNum; 724 917 OSErr err = ::FSOpenFork(&fsRef, 0, nsnull, fsWrPerm, &refNum); 725 918 if (err != noErr) 726 919 return MacErrorMapper(err); 727 920 err = ::FSSetForkSize(refNum, fsFromStart, aFileSize); 728 ::FSCloseFork(refNum); 729 921 ::FSCloseFork(refNum); 922 730 923 return MacErrorMapper(err); 731 924 } … … 734 927 NS_IMETHODIMP nsLocalFile::GetFileSizeOfLink(PRInt64 *aFileSizeOfLink) 735 928 { 929 // Check we are correctly initialized. 930 CHECK_mBaseRef(); 931 736 932 NS_ENSURE_ARG_POINTER(aFileSizeOfLink); 737 933 738 934 StFollowLinksState followLinks(*this, PR_FALSE); 739 935 return GetFileSize(aFileSizeOfLink); … … 768 964 NS_IMETHODIMP nsLocalFile::GetNativePath(nsACString& aNativePath) 769 965 { 770 if (!mBaseRef) 771 return NS_ERROR_NOT_INITIALIZED; 966 // Check we are correctly initialized. 967 CHECK_mBaseRef(); 968 772 969 nsresult rv = NS_ERROR_FAILURE; 773 970 CFStringRef pathStrRef = ::CFURLCopyFileSystemPath(mBaseRef, kCFURLPOSIXPathStyle); … … 782 979 NS_IMETHODIMP nsLocalFile::Exists(PRBool *_retval) 783 980 { 981 // Check we are correctly initialized. 982 CHECK_mBaseRef(); 983 784 984 NS_ENSURE_ARG_POINTER(_retval); 785 985 *_retval = PR_FALSE; 786 986 787 987 FSRef fsRef; 788 988 if (NS_SUCCEEDED(GetFSRefInternal(fsRef, PR_TRUE))) { 789 989 *_retval = PR_TRUE; 790 990 } 791 991 792 992 return NS_OK; 793 993 } … … 796 996 NS_IMETHODIMP nsLocalFile::IsWritable(PRBool *_retval) 797 997 { 998 // Check we are correctly initialized. 999 CHECK_mBaseRef(); 1000 798 1001 NS_ENSURE_ARG_POINTER(_retval); 799 1002 *_retval = PR_FALSE; 800 1003 801 1004 FSRef fsRef; 802 1005 nsresult rv = GetFSRefInternal(fsRef); 803 1006 if (NS_FAILED(rv)) 804 1007 return rv; 805 if (::FSCheckLock(&fsRef) == noErr) { 1008 if (::FSCheckLock(&fsRef) == noErr) { 806 1009 PRUint32 permissions; 807 1010 rv = GetPermissions(&permissions); … … 816 1019 NS_IMETHODIMP nsLocalFile::IsReadable(PRBool *_retval) 817 1020 { 1021 // Check we are correctly initialized. 1022 CHECK_mBaseRef(); 1023 818 1024 NS_ENSURE_ARG_POINTER(_retval); 819 1025 *_retval = PR_FALSE; 820 1026 821 1027 PRUint32 permissions; 822 1028 nsresult rv = GetPermissions(&permissions); … … 830 1036 NS_IMETHODIMP nsLocalFile::IsExecutable(PRBool *_retval) 831 1037 { 1038 // Check we are correctly initialized. 1039 CHECK_mBaseRef(); 1040 832 1041 NS_ENSURE_ARG_POINTER(_retval); 833 1042 *_retval = PR_FALSE; 834 1043 835 1044 FSRef fsRef; 836 1045 nsresult rv = GetFSRefInternal(fsRef); 837 1046 if (NS_FAILED(rv)) 838 1047 return rv; 839 1048 840 1049 LSRequestedInfo theInfoRequest = kLSRequestAllInfo; 841 1050 LSItemInfoRecord theInfo; … … 852 1061 NS_ENSURE_ARG_POINTER(_retval); 853 1062 *_retval = PR_FALSE; 854 1063 855 1064 FSRef fsRef; 856 1065 nsresult rv = GetFSRefInternal(fsRef); 857 1066 if (NS_FAILED(rv)) 858 1067 return rv; 859 1068 860 1069 FSCatalogInfo catalogInfo; 861 HFSUniStr255 leafName; 862 OSErr err = ::FSGetCatalogInfo(&fsRef, kFSCatInfo NodeFlags, &catalogInfo,1070 HFSUniStr255 leafName; 1071 OSErr err = ::FSGetCatalogInfo(&fsRef, kFSCatInfoFinderInfo, &catalogInfo, 863 1072 &leafName, nsnull, nsnull); 864 1073 if (err != noErr) 865 1074 return MacErrorMapper(err); 866 1075 867 1076 FileInfo *fInfoPtr = (FileInfo *)(catalogInfo.finderInfo); // Finder flags are in the same place whether we use FileInfo or FolderInfo 868 1077 if ((fInfoPtr->finderFlags & kIsInvisible) != 0) { … … 882 1091 NS_ENSURE_ARG_POINTER(_retval); 883 1092 *_retval = PR_FALSE; 884 1093 885 1094 FSRef fsRef; 886 1095 nsresult rv = GetFSRefInternal(fsRef, PR_FALSE); 887 1096 if (NS_FAILED(rv)) 888 1097 return rv; 889 1098 890 1099 FSCatalogInfo catalogInfo; 891 1100 OSErr err = ::FSGetCatalogInfo(&fsRef, kFSCatInfoNodeFlags, &catalogInfo, … … 902 1111 NS_ENSURE_ARG_POINTER(_retval); 903 1112 *_retval = PR_FALSE; 904 1113 905 1114 FSRef fsRef; 906 1115 nsresult rv = GetFSRefInternal(fsRef, PR_FALSE); 907 1116 if (NS_FAILED(rv)) 908 1117 return rv; 909 1118 910 1119 FSCatalogInfo catalogInfo; 911 1120 OSErr err = ::FSGetCatalogInfo(&fsRef, kFSCatInfoNodeFlags, &catalogInfo, … … 920 1129 NS_IMETHODIMP nsLocalFile::IsSymlink(PRBool *_retval) 921 1130 { 1131 // Check we are correctly initialized. 1132 CHECK_mBaseRef(); 1133 922 1134 NS_ENSURE_ARG(_retval); 923 1135 *_retval = PR_FALSE; 924 if (!mBaseRef) 925 return NS_ERROR_NOT_INITIALIZED; 926 1136 1137 // Check we are correctly initialized. 1138 CHECK_mBaseRef(); 1139 927 1140 FSRef fsRef; 928 1141 if (::CFURLGetFSRef(mBaseRef, &fsRef)) { … … 950 1163 951 1164 NS_ADDREF(*_retval); 952 1165 953 1166 return NS_OK; 954 1167 } … … 957 1170 NS_IMETHODIMP nsLocalFile::Equals(nsIFile *inFile, PRBool *_retval) 958 1171 { 1172 return EqualsInternal(inFile, PR_TRUE, _retval); 1173 } 1174 1175 nsresult 1176 nsLocalFile::EqualsInternal(nsISupports* inFile, PRBool aUpdateCache, 1177 PRBool *_retval) 1178 { 959 1179 NS_ENSURE_ARG_POINTER(_retval); 960 1180 *_retval = PR_FALSE; 961 1181 962 1182 nsCOMPtr<nsILocalFileMac> inMacFile(do_QueryInterface(inFile)); 963 1183 if (!inFile) 964 1184 return NS_OK; 965 1185 1186 nsLocalFile* inLF = 1187 NS_STATIC_CAST(nsLocalFile*, (nsILocalFileMac*) inMacFile); 1188 966 1189 // If both exist, compare FSRefs 967 1190 FSRef thisFSRef, inFSRef; 968 nsresult rv1 = GetFSRef (&thisFSRef);969 nsresult rv2 = in MacFile->GetFSRef(&inFSRef);1191 nsresult rv1 = GetFSRefInternal(thisFSRef, aUpdateCache); 1192 nsresult rv2 = inLF->GetFSRefInternal(inFSRef, aUpdateCache); 970 1193 if (NS_SUCCEEDED(rv1) && NS_SUCCEEDED(rv2)) { 971 1194 *_retval = (thisFSRef == inFSRef); 972 1195 return NS_OK; 973 1196 } 974 // If one exists and the other doesn't, not equal 1197 // If one exists and the other doesn't, not equal 975 1198 if (rv1 != rv2) 976 1199 return NS_OK; 977 1200 978 1201 // Arg, we have to get their paths and compare 979 1202 nsCAutoString thisPath, inPath; … … 983 1206 return NS_ERROR_FAILURE; 984 1207 *_retval = thisPath.Equals(inPath); 985 1208 986 1209 return NS_OK; 987 1210 } … … 990 1213 NS_IMETHODIMP nsLocalFile::Contains(nsIFile *inFile, PRBool recur, PRBool *_retval) 991 1214 { 1215 // Check we are correctly initialized. 1216 CHECK_mBaseRef(); 1217 992 1218 NS_ENSURE_ARG_POINTER(_retval); 993 1219 *_retval = PR_FALSE; … … 1009 1235 if (inPath[thisPathLen] == kPathSepChar) 1010 1236 *_retval = PR_TRUE; 1011 } 1237 } 1012 1238 return NS_OK; 1013 1239 } … … 1018 1244 NS_ENSURE_ARG_POINTER(aParent); 1019 1245 *aParent = nsnull; 1020 if (!mBaseRef) 1021 return NS_ERROR_NOT_INITIALIZED; 1022 1246 1247 // Check we are correctly initialized. 1248 CHECK_mBaseRef(); 1249 1023 1250 nsLocalFile *newFile = nsnull; 1024 1251 … … 1039 1266 } 1040 1267 ::CFRelease(parentURLRef); 1041 } 1268 } 1042 1269 return rv; 1043 1270 } … … 1052 1279 PRBool isDir; 1053 1280 rv = IsDirectory(&isDir); 1054 if (NS_FAILED(rv)) 1281 if (NS_FAILED(rv)) 1055 1282 return rv; 1056 1283 if (!isDir) … … 1067 1294 } 1068 1295 *aDirectoryEntries = dirEnum; 1069 1296 1070 1297 return NS_OK; 1071 1298 } … … 1081 1308 NS_IMETHODIMP nsLocalFile::InitWithPath(const nsAString& filePath) 1082 1309 { 1083 return InitWithNativePath(NS_ConvertU CS2toUTF8(filePath));1310 return InitWithNativePath(NS_ConvertUTF16toUTF8(filePath)); 1084 1311 } 1085 1312 … … 1087 1314 NS_IMETHODIMP nsLocalFile::InitWithNativePath(const nsACString& filePath) 1088 1315 { 1089 if (filePath.IsEmpty() || filePath.First() != '/') 1316 nsCAutoString fixedPath; 1317 if (Substring(filePath, 0, 2).EqualsLiteral("~/")) { 1318 nsCOMPtr<nsIFile> homeDir; 1319 nsCAutoString homePath; 1320 nsresult rv = NS_GetSpecialDirectory(NS_OS_HOME_DIR, 1321 getter_AddRefs(homeDir)); 1322 NS_ENSURE_SUCCESS(rv, rv); 1323 rv = homeDir->GetNativePath(homePath); 1324 NS_ENSURE_SUCCESS(rv, rv); 1325 1326 fixedPath = homePath + Substring(filePath, 1, filePath.Length() - 1); 1327 } 1328 else if (filePath.IsEmpty() || filePath.First() != '/') 1090 1329 return NS_ERROR_FILE_UNRECOGNIZED_PATH; 1091 // On 10.2, huge paths crash CFURLGetFSRef()1092 if (filePath.Length() > PATH_MAX)1093 return NS_ERROR_FILE_NAME_TOO_LONG; 1094 // A nd, apath with consecutive '/'s which are not between1095 // nodes alsocrashes CFURLGetFSRef(). Consecutive '/'s which1330 else 1331 fixedPath.Assign(filePath); 1332 1333 // A path with consecutive '/'s which are not between 1334 // nodes crashes CFURLGetFSRef(). Consecutive '/'s which 1096 1335 // are between actual nodes are OK. So, convert consecutive 1097 1336 // '/'s to a single one. 1098 nsCAutoString fixedPath;1099 fixedPath.Assign(filePath);1100 1337 fixedPath.ReplaceSubstring("//", "/"); 1338 1339 // On 10.2, huge paths also crash CFURLGetFSRef() 1340 if (fixedPath.Length() > PATH_MAX) 1341 return NS_ERROR_FILE_NAME_TOO_LONG; 1101 1342 1102 1343 CFStringRef pathAsCFString; … … 1113 1354 SetBaseRef(pathAsCFURL); 1114 1355 ::CFRelease(pathAsCFURL); 1356 ::CFRelease(pathAsCFString); 1115 1357 return NS_OK; 1116 1358 } … … 1120 1362 { 1121 1363 NS_ENSURE_ARG(aFile); 1122 1364 1123 1365 nsCOMPtr<nsILocalFileMac> aFileMac(do_QueryInterface(aFile)); 1124 1366 if (!aFileMac) … … 1137 1379 { 1138 1380 NS_ENSURE_ARG_POINTER(aFollowLinks); 1139 1381 1140 1382 *aFollowLinks = mFollowLinks; 1141 1383 return NS_OK; … … 1160 1402 if (NS_FAILED(rv)) 1161 1403 return rv; 1162 1404 1163 1405 *_retval = PR_Open(path.get(), flags, mode); 1164 1406 if (! *_retval) … … 1177 1419 if (NS_FAILED(rv)) 1178 1420 return rv; 1179 1421 1180 1422 *_retval = fopen(path.get(), mode); 1181 1423 if (! *_retval) … … 1188 1430 NS_IMETHODIMP nsLocalFile::Load(PRLibrary **_retval) 1189 1431 { 1432 // Check we are correctly initialized. 1433 CHECK_mBaseRef(); 1434 1190 1435 NS_ENSURE_ARG_POINTER(_retval); 1191 1436 … … 1197 1442 return rv; 1198 1443 1444 #ifdef NS_BUILD_REFCNT_LOGGING 1445 nsTraceRefcntImpl::SetActivityIsLegal(PR_FALSE); 1446 #endif 1447 1199 1448 *_retval = PR_LoadLibrary(path.get()); 1449 1450 #ifdef NS_BUILD_REFCNT_LOGGING 1451 nsTraceRefcntImpl::SetActivityIsLegal(PR_TRUE); 1452 #endif 1200 1453 1201 1454 NS_TIMELINE_STOP_TIMER("PR_LoadLibrary"); … … 1204 1457 if (!*_retval) 1205 1458 return NS_ERROR_FAILURE; 1206 1459 1207 1460 return NS_OK; 1208 1461 } … … 1211 1464 NS_IMETHODIMP nsLocalFile::GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable) 1212 1465 { 1466 // Check we are correctly initialized. 1467 CHECK_mBaseRef(); 1468 1213 1469 NS_ENSURE_ARG_POINTER(aDiskSpaceAvailable); 1214 1470 1215 1471 FSRef fsRef; 1216 1472 nsresult rv = GetFSRefInternal(fsRef); 1217 1473 if (NS_FAILED(rv)) 1218 1474 return rv; 1219 1475 1220 1476 OSErr err; 1221 1477 FSCatalogInfo catalogInfo; … … 1224 1480 if (err != noErr) 1225 1481 return MacErrorMapper(err); 1226 1227 FSVolumeInfo volumeInfo; 1482 1483 FSVolumeInfo volumeInfo; 1228 1484 err = ::FSGetVolumeInfo(catalogInfo.volume, 0, nsnull, kFSVolInfoSizes, 1229 1485 &volumeInfo, nsnull, nsnull); 1230 1486 if (err != noErr) 1231 1487 return MacErrorMapper(err); 1232 1488 1233 1489 *aDiskSpaceAvailable = volumeInfo.freeBytes; 1234 1490 return NS_OK; … … 1238 1494 NS_IMETHODIMP nsLocalFile::AppendRelativePath(const nsAString& relativeFilePath) 1239 1495 { 1240 return AppendRelativeNativePath(NS_ConvertU CS2toUTF8(relativeFilePath));1496 return AppendRelativeNativePath(NS_ConvertUTF16toUTF8(relativeFilePath)); 1241 1497 } 1242 1498 1243 1499 /* [noscript] void appendRelativeNativePath (in ACString relativeFilePath); */ 1244 1500 NS_IMETHODIMP nsLocalFile::AppendRelativeNativePath(const nsACString& relativeFilePath) 1245 { 1501 { 1246 1502 if (relativeFilePath.IsEmpty()) 1247 1503 return NS_OK; 1248 // No leading '/' 1504 // No leading '/' 1249 1505 if (relativeFilePath.First() == '/') 1250 1506 return NS_ERROR_FILE_UNRECOGNIZED_PATH; … … 1255 1511 relativeFilePath.EndReading(pathEnd); 1256 1512 nsACString::const_iterator nodeEnd(nodeBegin); 1257 1513 1258 1514 while (nodeEnd != pathEnd) { 1259 1515 FindCharInReadable(kPathSepChar, nodeEnd, pathEnd); … … 1275 1531 if (NS_FAILED(rv)) 1276 1532 return rv; 1277 1533 1278 1534 AliasHandle aliasH; 1279 1535 OSErr err = ::FSNewAlias(nsnull, &fsRef, &aliasH); 1280 1536 if (err != noErr) 1281 1537 return MacErrorMapper(err); 1282 1538 1283 1539 PRUint32 bytes = ::GetHandleSize((Handle) aliasH); 1284 1540 ::HLock((Handle) aliasH); … … 1287 1543 ::DisposeHandle((Handle) aliasH); 1288 1544 NS_ENSURE_TRUE(buf, NS_ERROR_OUT_OF_MEMORY); 1289 1545 1290 1546 aPersistentDescriptor = buf; 1291 1547 PR_Free(buf); … … 1299 1555 return NS_ERROR_INVALID_ARG; 1300 1556 1557 // Support pathnames as user-supplied descriptors if they begin with '/' 1558 // or '~'. These characters do not collide with the base64 set used for 1559 // encoding alias records. 1560 char first = aPersistentDescriptor.First(); 1561 if (first == '/' || first == '~') 1562 return InitWithNativePath(aPersistentDescriptor); 1563 1301 1564 nsresult rv = NS_OK; 1302 1303 PRUint32 dataSize = aPersistentDescriptor.Length(); 1565 1566 PRUint32 dataSize = aPersistentDescriptor.Length(); 1304 1567 char* decodedData = PL_Base64Decode(PromiseFlatCString(aPersistentDescriptor).get(), dataSize, nsnull); 1305 1568 if (!decodedData) { … … 1307 1570 return NS_ERROR_FAILURE; 1308 1571 } 1309 1572 1310 1573 // Cast to an alias record and resolve. 1311 PRInt32 aliasSize = (dataSize * 3) / 4;1312 AliasRecord aliasHeader = *(AliasPtr)decodedData;1313 if (alias Header.aliasSize > aliasSize) {// be paranoid about having too few data1574 AliasRecord aliasHeader = *(AliasPtr)decodedData; 1575 PRInt32 aliasSize = GetAliasSizeFromRecord(aliasHeader); 1576 if (aliasSize > (dataSize * 3) / 4) { // be paranoid about having too few data 1314 1577 PR_Free(decodedData); 1315 1578 return NS_ERROR_FAILURE; 1316 1579 } 1317 1318 aliasSize = aliasHeader.aliasSize; 1319 1580 1320 1581 // Move the now-decoded data into the Handle. 1321 1582 // The size of the decoded data is 3/4 the size of the encoded data. See plbase64.h … … 1330 1591 FSRef resolvedFSRef; 1331 1592 OSErr err = ::FSResolveAlias(nsnull, (AliasHandle)newHandle, &resolvedFSRef, &changed); 1332 1593 1333 1594 rv = MacErrorMapper(err); 1334 1595 DisposeHandle(newHandle); 1335 1596 if (NS_FAILED(rv)) 1336 1597 return rv; 1337 1598 1338 1599 return InitWithFSRef(&resolvedFSRef); 1339 1600 } … … 1348 1609 OSErr err; 1349 1610 ProcessSerialNumber process; 1350 1611 1351 1612 nsresult rv = GetFSRefInternal(fsRefToReveal); 1352 1613 if (NS_FAILED(rv)) 1353 1614 return rv; 1354 1615 1355 1616 err = ::FindRunningAppBySignature ('MACS', process); 1356 if (err == noErr) { 1617 if (err == noErr) { 1357 1618 err = ::AECreateDesc(typeProcessSerialNumber, (Ptr)&process, sizeof(process), &myAddressDesc); 1358 1619 if (err == noErr) { 1359 1620 // Create the FinderEvent 1360 1621 err = ::AECreateAppleEvent(kAEMiscStandards, kAEMakeObjectsVisible, &myAddressDesc, 1361 kAutoGenerateReturnID, kAnyTransactionID, &aeEvent); 1622 kAutoGenerateReturnID, kAnyTransactionID, &aeEvent); 1362 1623 if (err == noErr) { 1363 1624 // Create the file list … … 1381 1642 } 1382 1643 } 1383 1644 1384 1645 return NS_OK; 1385 1646 } … … 1408 1669 { 1409 1670 NS_ENSURE_ARG(aCFURL); 1410 1671 1411 1672 SetBaseRef(aCFURL); 1412 1673 return NS_OK; … … 1418 1679 NS_ENSURE_ARG(aFSRef); 1419 1680 nsresult rv = NS_ERROR_FAILURE; 1420 1681 1421 1682 CFURLRef newURLRef = ::CFURLCreateFromFSRef(kCFAllocatorDefault, aFSRef); 1422 1683 if (newURLRef) { … … 1432 1693 { 1433 1694 NS_ENSURE_ARG(aFileSpec); 1434 1695 1435 1696 FSRef fsRef; 1436 1697 OSErr err = ::FSpMakeFSRef(aFileSpec, &fsRef); … … 1440 1701 CInfoPBRec pBlock; 1441 1702 FSSpec parentDirSpec; 1442 1703 1443 1704 memset(&pBlock, 0, sizeof(CInfoPBRec)); 1444 1705 parentDirSpec.name[0] = 0; … … 1450 1711 if (err != noErr) 1451 1712 return MacErrorMapper(err); 1452 1713 1453 1714 parentDirSpec.vRefNum = aFileSpec->vRefNum; 1454 1715 parentDirSpec.parID = pBlock.dirInfo.ioDrParID; … … 1463 1724 if (NS_FAILED(rv)) 1464 1725 return rv; 1465 return Append(nsDependentString(unicodeName.unicode, unicodeName.length)); 1726 return Append(nsDependentString(unicodeName.unicode, unicodeName.length)); 1466 1727 } 1467 1728 return MacErrorMapper(err); … … 1500 1761 { 1501 1762 NS_ENSURE_ARG_POINTER(_retval); 1502 if (!mBaseRef) 1503 return NS_ERROR_NOT_INITIALIZED; 1504 1763 1764 // Check we are correctly initialized. 1765 CHECK_mBaseRef(); 1766 1505 1767 OSErr err; 1506 1768 FSRef fsRef; … … 1510 1772 err = ::FSGetCatalogInfo(&fsRef, kFSCatInfoNone, 1511 1773 nsnull, nsnull, _retval, nsnull); 1512 return MacErrorMapper(err); 1774 return MacErrorMapper(err); 1513 1775 } 1514 1776 else if (rv == NS_ERROR_FILE_NOT_FOUND) { … … 1532 1794 catalogInfo.nodeID == fsRtDirID, 1533 1795 hfsName)) == noErr) 1534 err = ::FSMakeFSSpec(catalogInfo.volume, catalogInfo.nodeID, hfsName, _retval); 1796 err = ::FSMakeFSSpec(catalogInfo.volume, catalogInfo.nodeID, hfsName, _retval); 1535 1797 } 1536 1798 } … … 1546 1808 { 1547 1809 NS_ENSURE_ARG_POINTER(aFileSizeWithResFork); 1548 1810 1549 1811 FSRef fsRef; 1550 1812 nsresult rv = GetFSRefInternal(fsRef); 1551 1813 if (NS_FAILED(rv)) 1552 1814 return rv; 1553 1815 1554 1816 FSCatalogInfo catalogInfo; 1555 1817 OSErr err = ::FSGetCatalogInfo(&fsRef, kFSCatInfoDataSizes + kFSCatInfoRsrcSizes, … … 1557 1819 if (err != noErr) 1558 1820 return MacErrorMapper(err); 1559 1821 1560 1822 *aFileSizeWithResFork = catalogInfo.dataLogicalSize + catalogInfo.rsrcLogicalSize; 1561 1823 return NS_OK; … … 1566 1828 { 1567 1829 NS_ENSURE_ARG_POINTER(aFileType); 1568 1830 1569 1831 FSRef fsRef; 1570 1832 nsresult rv = GetFSRefInternal(fsRef); 1571 1833 if (NS_FAILED(rv)) 1572 1834 return rv; 1573 1574 FinderInfo fInfo; 1835 1836 FinderInfo fInfo; 1575 1837 OSErr err = ::FSGetFinderInfo(&fsRef, &fInfo, nsnull, nsnull); 1576 1838 if (err != noErr) … … 1586 1848 if (NS_FAILED(rv)) 1587 1849 return rv; 1588 1850 1589 1851 OSErr err = ::FSChangeCreatorType(&fsRef, 0, aFileType); 1590 1852 return MacErrorMapper(err); … … 1595 1857 { 1596 1858 NS_ENSURE_ARG_POINTER(aFileCreator); 1597 1859 1598 1860 FSRef fsRef; 1599 1861 nsresult rv = GetFSRefInternal(fsRef); 1600 1862 if (NS_FAILED(rv)) 1601 1863 return rv; 1602 1603 FinderInfo fInfo; 1864 1865 FinderInfo fInfo; 1604 1866 OSErr err = ::FSGetFinderInfo(&fsRef, &fInfo, nsnull, nsnull); 1605 1867 if (err != noErr) … … 1615 1877 if (NS_FAILED(rv)) 1616 1878 return rv; 1617 1879 1618 1880 OSErr err = ::FSChangeCreatorType(&fsRef, aFileCreator, 0); 1619 1881 return MacErrorMapper(err); … … 1657 1919 return rv; 1658 1920 } 1659 1921 1660 1922 LSLaunchFlags theLaunchFlags = kLSLaunchDefaults; 1661 1923 LSLaunchFSRefSpec thelaunchSpec; … … 1701 1963 if (!isExecutable) 1702 1964 return NS_ERROR_FILE_EXECUTION_FAILED; 1703 1965 1704 1966 rv = appFileMac->GetFSRef(&appFSRef); 1705 1967 if (NS_FAILED(rv)) … … 1716 1978 return MacErrorMapper(err); 1717 1979 } 1718 1980 1719 1981 LSLaunchFlags theLaunchFlags = kLSLaunchDefaults; 1720 1982 LSLaunchFSRefSpec thelaunchSpec; … … 1741 2003 NS_ENSURE_ARG(_retval); 1742 2004 *_retval = PR_FALSE; 1743 2005 1744 2006 FSRef fsRef; 1745 2007 nsresult rv = GetFSRefInternal(fsRef); … … 1773 2035 } 1774 2036 2037 NS_IMETHODIMP 2038 nsLocalFile::GetBundleDisplayName(nsAString& outBundleName) 2039 { 2040 PRBool isPackage = PR_FALSE; 2041 nsresult rv = IsPackage(&isPackage); 2042 if (NS_FAILED(rv) || !isPackage) 2043 return NS_ERROR_FAILURE; 2044 2045 nsAutoString name; 2046 rv = GetLeafName(name); 2047 if (NS_FAILED(rv)) 2048 return rv; 2049 2050 PRInt32 length = name.Length(); 2051 if (Substring(name, length - 4, length).EqualsLiteral(".app")) { 2052 // 4 characters in ".app" 2053 outBundleName = Substring(name, 0, length - 4); 2054 } 2055 else 2056 outBundleName = name; 2057 2058 return NS_OK; 2059 } 2060 2061 NS_IMETHODIMP 2062 nsLocalFile::GetBundleIdentifier(nsACString& outBundleIdentifier) 2063 { 2064 nsresult rv = NS_ERROR_FAILURE; 2065 2066 CFURLRef urlRef; 2067 if (NS_SUCCEEDED(GetCFURL(&urlRef))) { 2068 CFBundleRef bundle = ::CFBundleCreate(NULL, urlRef); 2069 if (bundle) { 2070 CFStringRef bundleIdentifier = ::CFBundleGetIdentifier(bundle); 2071 if (bundleIdentifier) 2072 rv = CFStringReftoUTF8(bundleIdentifier, outBundleIdentifier); 2073 2074 ::CFRelease(bundle); 2075 } 2076 ::CFRelease(urlRef); 2077 } 2078 2079 return rv; 2080 } 2081 1775 2082 1776 2083 //***************************************************************************** … … 1783 2090 { 1784 2091 NS_ENSURE_ARG(aCFURLRef); 1785 2092 1786 2093 ::CFRetain(aCFURLRef); 1787 2094 if (mBaseRef) … … 1789 2096 mBaseRef = aCFURLRef; 1790 2097 1791 mFollowLinksDirty = PR_TRUE; 2098 mFollowLinksDirty = PR_TRUE; 1792 2099 UpdateTargetRef(); 1793 2100 mCachedFSRefValid = PR_FALSE; … … 1797 2104 nsresult nsLocalFile::UpdateTargetRef() 1798 2105 { 1799 if (!mBaseRef)1800 return NS_ERROR_NOT_INITIALIZED;1801 2106 // Check we are correctly initialized. 2107 CHECK_mBaseRef(); 2108 1802 2109 if (mFollowLinksDirty) { 1803 2110 if (mTargetRef) { … … 1812 2119 if (::CFURLGetFSRef(mBaseRef, &fsRef)) { 1813 2120 Boolean targetIsFolder, wasAliased; 1814 if (FSResolveAliasFile(&fsRef, true /*resolveAliasChains*/, 2121 if (FSResolveAliasFile(&fsRef, true /*resolveAliasChains*/, 1815 2122 &targetIsFolder, &wasAliased) == noErr && wasAliased) { 1816 2123 ::CFRelease(mTargetRef); … … 1848 2155 { 1849 2156 nsresult rv = NS_ERROR_FAILURE; 1850 2157 1851 2158 CFURLRef whichURLRef = mFollowLinks ? mTargetRef : mBaseRef; 1852 2159 NS_ENSURE_TRUE(whichURLRef, NS_ERROR_NULL_POINTER); 1853 2160 1854 2161 CFStringRef pathStrRef = ::CFURLCopyFileSystemPath(whichURLRef, kCFURLPOSIXPathStyle); 1855 2162 if (pathStrRef) { … … 1860 2167 } 1861 2168 1862 nsresult nsLocalFile::MoveCopy(nsIFile* aParentDir, const nsAString& newName, PRBool isCopy, PRBool followLinks) 1863 { 2169 nsresult nsLocalFile::CopyInternal(nsIFile* aParentDir, 2170 const nsAString& newName, 2171 PRBool followLinks) 2172 { 2173 // Check we are correctly initialized. 2174 CHECK_mBaseRef(); 2175 1864 2176 StFollowLinksState srcFollowState(*this, followLinks); 1865 2177 … … 1867 2179 OSErr err; 1868 2180 FSRef srcFSRef, newFSRef; 1869 2181 1870 2182 rv = GetFSRefInternal(srcFSRef); 1871 2183 if (NS_FAILED(rv)) 1872 2184 return rv; 1873 2185 1874 2186 nsCOMPtr<nsIFile> newParentDir = aParentDir; 1875 CFURLRef newBaseURLRef;1876 2187 1877 2188 if (!newParentDir) { … … 1880 2191 rv = GetParent(getter_AddRefs(newParentDir)); 1881 2192 if (NS_FAILED(rv)) 1882 return rv; 1883 } 1884 2193 return rv; 2194 } 2195 1885 2196 // If newParentDir does not exist, create it 1886 2197 PRBool exists; … … 1889 2200 return rv; 1890 2201 if (!exists) { 1891 rv = newParentDir->Create(nsIFile::DIRECTORY_TYPE, 0 666);2202 rv = newParentDir->Create(nsIFile::DIRECTORY_TYPE, 0777); 1892 2203 if (NS_FAILED(rv)) 1893 2204 return rv; 1894 2205 } 1895 2206 1896 2207 FSRef destFSRef; 1897 2208 nsCOMPtr<nsILocalFileMac> newParentDirMac(do_QueryInterface(newParentDir)); … … 1901 2212 if (NS_FAILED(rv)) 1902 2213 return rv; 1903 1904 if (isCopy) { 1905 err = ::FSCopyObject(&srcFSRef, &destFSRef, 1906 newName.Length(), newName.Length() ? PromiseFlatString(newName).get() : nsnull, 1907 0, kFSCatInfoNone, false, false, nsnull, nsnull, &newFSRef); 1908 // don't update ourselves on a copy 1909 } 1910 else { 1911 // According to the API: "If 'this' is a file, and the destination file already 1912 // exists, moveTo will replace the old file." 1913 FSCatalogInfo catalogInfo; 1914 HFSUniStr255 leafName; 1915 err = ::FSGetCatalogInfo(&srcFSRef, kFSCatInfoNodeFlags, &catalogInfo, 1916 newName.IsEmpty() ? &leafName : nsnull, nsnull, nsnull); 1917 if (err == noErr) { 1918 if (!(catalogInfo.nodeFlags & kFSNodeIsDirectoryMask)) { 1919 FSRef oldFileRef; 1920 if (newName.IsEmpty()) 1921 err = ::FSMakeFSRefUnicode(&destFSRef, leafName.length, leafName.unicode, 1922 kTextEncodingUnknown, &oldFileRef); 1923 else 1924 err = ::FSMakeFSRefUnicode(&destFSRef, newName.Length(), PromiseFlatString(newName).get(), 1925 kTextEncodingUnknown, &oldFileRef); 1926 if (err == noErr) 1927 ::FSDeleteObject(&oldFileRef); 1928 } 1929 } 1930 // First, try the quick way which works only within the same volume 1931 err = ::FSMoveRenameObjectUnicode(&srcFSRef, &destFSRef, 1932 newName.Length(), newName.Length() ? PromiseFlatString(newName).get() : nsnull, 1933 kTextEncodingUnknown, &newFSRef); 1934 1935 if (err == diffVolErr) { 1936 // If on different volumes, resort to copy & delete 1937 err = ::FSCopyObject(&srcFSRef, &destFSRef, 1938 newName.Length(), newName.Length() ? PromiseFlatString(newName).get() : nsnull, 1939 0, kFSCatInfoNone, false, false, nsnull, nsnull, &newFSRef); 1940 ::FSDeleteObjects(&srcFSRef); 1941 } 1942 if (err == noErr) { 1943 newBaseURLRef = ::CFURLCreateFromFSRef(kCFAllocatorDefault, &newFSRef); 1944 if (!newBaseURLRef) 1945 return NS_ERROR_FAILURE; 1946 SetBaseRef(newBaseURLRef); 1947 ::CFRelease(newBaseURLRef); 1948 } 1949 } 2214 2215 err = 2216 ::FSCopyObject(&srcFSRef, &destFSRef, newName.Length(), 2217 newName.Length() ? PromiseFlatString(newName).get() : NULL, 2218 0, kFSCatInfoNone, false, false, NULL, NULL, &newFSRef); 2219 1950 2220 return MacErrorMapper(err); 1951 2221 } 1952 2222 1953 const PRInt64 kMil isecsPerSec = 1000LL;2223 const PRInt64 kMillisecsPerSec = 1000LL; 1954 2224 const PRInt64 kUTCDateTimeFractionDivisor = 65535LL; 1955 2225 … … 1957 2227 { 1958 2228 // Start with seconds since Jan. 1, 1904 GMT 1959 PRInt64 result = ((PRInt64)utcTime.highSeconds << 32) + (PRInt64)utcTime.lowSeconds; 2229 PRInt64 result = ((PRInt64)utcTime.highSeconds << 32) + (PRInt64)utcTime.lowSeconds; 1960 2230 // Subtract to convert to NSPR epoch of 1970 1961 2231 result -= kJanuaryFirst1970Seconds; 1962 // Convert to mil isecs1963 result *= kMil isecsPerSec;1964 // Convert the fraction to mil isecs and add it1965 result += ((PRInt64)utcTime.fraction * kMil isecsPerSec) / kUTCDateTimeFractionDivisor;2232 // Convert to millisecs 2233 result *= kMillisecsPerSec; 2234 // Convert the fraction to millisecs and add it 2235 result += ((PRInt64)utcTime.fraction * kMillisecsPerSec) / kUTCDateTimeFractionDivisor; 1966 2236 1967 2237 return result; … … 1970 2240 void nsLocalFile::NSPRtoHFSPlusTime(PRInt64 nsprTime, UTCDateTime& utcTime) 1971 2241 { 1972 PRInt64 fraction = nsprTime % kMil isecsPerSec;1973 PRInt64 seconds = (nsprTime / kMil isecsPerSec) + kJanuaryFirst1970Seconds;2242 PRInt64 fraction = nsprTime % kMillisecsPerSec; 2243 PRInt64 seconds = (nsprTime / kMillisecsPerSec) + kJanuaryFirst1970Seconds; 1974 2244 utcTime.highSeconds = (UInt16)((PRUint64)seconds >> 32); 1975 2245 utcTime.lowSeconds = (UInt32)seconds; 1976 utcTime.fraction = (UInt16)((fraction * kUTCDateTimeFractionDivisor) / kMil isecsPerSec);2246 utcTime.fraction = (UInt16)((fraction * kUTCDateTimeFractionDivisor) / kMillisecsPerSec); 1977 2247 } 1978 2248 … … 1984 2254 kCFStringEncodingUTF8, 0, PR_FALSE, nsnull, 0, &usedBufLen); 1985 2255 if (charsConverted == inStrLen) { 2256 #if 0 /* bird: too new? */ 2257 aOutStr.SetLength(usedBufLen); 2258 if (aOutStr.Length() != usedBufLen) 2259 return NS_ERROR_OUT_OF_MEMORY; 2260 UInt8 *buffer = (UInt8*) aOutStr.BeginWriting(); 2261 2262 ::CFStringGetBytes(aInStrRef, CFRangeMake(0, inStrLen), 2263 kCFStringEncodingUTF8, 0, false, buffer, usedBufLen, &usedBufLen); 2264 rv = NS_OK; 2265 #else 1986 2266 nsAutoBuffer<UInt8, FILENAME_BUFFER_SIZE> buffer; 1987 2267 if (buffer.EnsureElemCapacity(usedBufLen + 1)) { … … 1992 2272 rv = NS_OK; 1993 2273 } 2274 #endif 1994 2275 } 1995 2276 return rv; 2277 } 2278 2279 // nsIHashable 2280 2281 NS_IMETHODIMP 2282 nsLocalFile::Equals(nsIHashable* aOther, PRBool *aResult) 2283 { 2284 return EqualsInternal(aOther, PR_FALSE, aResult); 2285 } 2286 2287 NS_IMETHODIMP 2288 nsLocalFile::GetHashCode(PRUint32 *aResult) 2289 { 2290 CFStringRef pathStrRef = ::CFURLCopyFileSystemPath(mBaseRef, kCFURLPOSIXPathStyle); 2291 nsCAutoString path; 2292 CFStringReftoUTF8(pathStrRef, path); 2293 *aResult = HashString(path); 2294 return NS_OK; 1996 2295 } 1997 2296 … … 2032 2331 nsresult NS_NewNativeLocalFile(const nsACString& path, PRBool followLinks, nsILocalFile **result) 2033 2332 { 2034 return NS_NewLocalFile(NS_ConvertUTF8toU CS2(path), followLinks, result);2333 return NS_NewLocalFile(NS_ConvertUTF8toUTF16(path), followLinks, result); 2035 2334 } 2036 2335 … … 2053 2352 } 2054 2353 2354 nsresult NS_NewLocalFileWithFSRef(const FSRef* aFSRef, PRBool aFollowLinks, nsILocalFileMac** result) 2355 { 2356 nsLocalFile* file = new nsLocalFile(); 2357 if (file == nsnull) 2358 return NS_ERROR_OUT_OF_MEMORY; 2359 NS_ADDREF(file); 2360 2361 file->SetFollowLinks(aFollowLinks); 2362 2363 nsresult rv = file->InitWithFSRef(aFSRef); 2364 if (NS_FAILED(rv)) { 2365 NS_RELEASE(file); 2366 return rv; 2367 } 2368 *result = file; 2369 return NS_OK; 2370 } 2371 2055 2372 //***************************************************************************** 2056 2373 // Static Functions … … 2060 2377 { 2061 2378 nsresult outErr; 2062 2379 2063 2380 switch (inErr) 2064 2381 { … … 2074 2391 outErr = NS_ERROR_FILE_ALREADY_EXISTS; 2075 2392 break; 2076 2393 2077 2394 case dskFulErr: 2078 2395 outErr = NS_ERROR_FILE_DISK_FULL; 2079 2396 break; 2080 2397 2081 2398 case fLckdErr: 2082 2399 outErr = NS_ERROR_FILE_IS_LOCKED; 2083 2400 break; 2084 2401 2085 2402 // Can't find good map for some 2086 2403 case bdNamErr: … … 2088 2405 break; 2089 2406 2090 default: 2407 default: 2091 2408 outErr = NS_ERROR_FAILURE; 2092 2409 break; … … 2099 2416 ProcessInfoRec info; 2100 2417 OSErr err = noErr; 2101 2418 2102 2419 outPsn.highLongOfPSN = 0; 2103 2420 outPsn.lowLongOfPSN = kNoProcess; 2104 2421 2105 2422 while (PR_TRUE) 2106 2423 { … … 2116 2433 if (err != noErr) 2117 2434 return err; 2118 2435 2119 2436 if (info.processSignature == aAppSig) 2120 2437 return noErr; … … 2147 2464 if (!sUnicodeNormalizer) { // OS X 10.2 or earlier 2148 2465 CopyUTF8toUTF16(aSrc, aResult); 2149 return; 2466 return; 2150 2467 } 2151 2468 … … 2159 2476 if (!inStr) { 2160 2477 CopyUTF8toUTF16(aSrc, aResult); 2161 return; 2162 } 2163 2164 ::CFStringAppendCString(inStr, inFlatSrc.get(), kCFStringEncodingUTF8); 2478 return; 2479 } 2480 2481 ::CFStringAppendCString(inStr, inFlatSrc.get(), kCFStringEncodingUTF8); 2165 2482 2166 2483 sUnicodeNormalizer(inStr, kCFStringNormalizationFormC); … … 2169 2486 const UniChar* chars = CFStringGetCharactersPtr(inStr); 2170 2487 2171 if (chars) 2488 if (chars) 2172 2489 aResult.Assign(chars, length); 2173 2490 else { -
trunk/src/libs/xpcom18a4/xpcom/io/nsLocalFileOSX.h
r1 r589 42 42 #include "nsILocalFileMac.h" 43 43 #include "nsString.h" 44 #include "nsIHashable.h" 44 45 45 46 class nsDirEnumerator; … … 56 57 //***************************************************************************** 57 58 58 class NS_COM nsLocalFile : public nsILocalFileMac 59 class NS_COM nsLocalFile : public nsILocalFileMac, 60 public nsIHashable 59 61 { 60 62 friend class nsDirEnumerator; … … 71 73 NS_DECL_NSILOCALFILE 72 74 NS_DECL_NSILOCALFILEMAC 75 NS_DECL_NSIHASHABLE 73 76 74 77 public: … … 88 91 nsresult GetFSRefInternal(FSRef& aFSSpec, PRBool bForceUpdateCache = PR_TRUE); 89 92 nsresult GetPathInternal(nsACString& path); // Returns path WRT mFollowLinks 93 nsresult EqualsInternal(nsISupports* inFile, 94 PRBool aUpdateCache, PRBool *_retval); 90 95 91 nsresult MoveCopy(nsIFile* newParentDir, const nsAString &newName, PRBool isCopy, PRBool followLinks); 96 nsresult CopyInternal(nsIFile* newParentDir, 97 const nsAString& newName, 98 PRBool followLinks); 92 99 93 100 static PRInt64 HFSPlustoNSPRTime(const UTCDateTime& utcTime); -
trunk/src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp
r1 r589 21 21 * 22 22 * Contributor(s): 23 * Mark Mentovai <[email protected]> 23 24 * 24 25 * Alternatively, the contents of this file may be used under the terms of … … 79 80 #ifdef __GNUC__ /* Gnu compiler. */ 80 81 PRUint32 result; 81 / /Each param takes at most 2, 4-byte words82 //It doesn't matter if we push too many words, and calculating the exact83 // ammount takes time.82 /* Each param takes at most 2, 4-byte words 83 It doesn't matter if we push too many words, and calculating the exact 84 amount takes time. */ 84 85 PRUint32 n = paramCount << 3; 85 86 void (*fn_copy) (unsigned int, nsXPTCVariant *, PRUint32 *) = invoke_copy_to_stack; 86 int temp1, temp2, temp3; 87 87 int temp1, temp2; 88 89 /* These are only significant when KEEP_STACK_16_BYTE_ALIGNED is 90 defined. Otherwise, they're just placeholders to keep the parameter 91 indices the same for aligned and unaligned users in the inline asm 92 block. */ 93 unsigned int saved_esp; 94 88 95 __asm__ __volatile__( 96 #ifdef KEEP_STACK_16_BYTE_ALIGNED 97 "movl %%esp, %3\n\t" 98 #endif 89 99 "subl %8, %%esp\n\t" /* make room for params */ 100 #ifdef KEEP_STACK_16_BYTE_ALIGNED 101 /* For the second CALL, there will be one parameter before the ones 102 copied by invoke_copy_to_stack. Make sure that the stack will be 103 aligned for that CALL. */ 104 "subl $4, %%esp\n\t" 105 "andl $0xfffffff0, %%esp\n\t" 106 /* For the first CALL, there are three parameters. Leave padding to 107 ensure alignment. */ 108 "subl $4, %%esp\n\t" 109 /* The third parameter to invoke_copy_to_stack is the destination pointer. 110 It needs to point into the parameter area prepared for the second CALL, 111 leaving room for the |that| parameter. This reuses |n|, which was 112 the stack space to reserve, but that's OK because it's no longer needed 113 if the stack is being kept aligned. */ 114 "leal 8(%%esp), %8\n\t" 115 "pushl %8\n\t" 116 #else 90 117 "pushl %%esp\n\t" 118 #endif 91 119 "pushl %7\n\t" 92 120 "pushl %6\n\t" 93 "call *%0\n\t" /* copy params */ 121 "call *%9\n\t" /* copy params */ 122 #ifdef KEEP_STACK_16_BYTE_ALIGNED 123 /* The stack is still aligned from the first CALL. Keep it aligned for 124 the next one by popping past the parameters from the first CALL and 125 leaving space for the first (|that|) parameter for the second CALL. */ 126 "addl $0x14, %%esp\n\t" 127 #else 94 128 "addl $0xc, %%esp\n\t" 129 #endif 95 130 "movl %4, %%ecx\n\t" 96 131 #ifdef CFRONT_STYLE_THIS_ADJUST … … 115 150 #endif 116 151 "call *(%%edx)\n\t" /* safe to not cleanup esp */ 152 #ifdef KEEP_STACK_16_BYTE_ALIGNED 153 "movl %3, %%esp\n\t" 154 #else 117 155 "addl $4, %%esp\n\t" 118 156 "addl %8, %%esp" 157 #endif 119 158 : "=a" (result), /* %0 */ 120 159 "=c" (temp1), /* %1 */ 121 160 "=d" (temp2), /* %2 */ 122 "=g" (temp3) /* %3 */ 161 #ifdef KEEP_STACK_16_BYTE_ALIGNED 162 "=&g" (saved_esp) /* %3 */ 163 #else 164 /* Don't waste a register, this isn't used if alignment is unimportant */ 165 "=m" (saved_esp) /* %3 */ 166 #endif 123 167 : "g" (that), /* %4 */ 124 168 "g" (methodIndex), /* %5 */ 125 169 "1" (paramCount), /* %6 */ 126 170 "2" (params), /* %7 */ 171 #ifdef KEEP_STACK_16_BYTE_ALIGNED 172 /* Must be in a register, it's the target of an LEA instruction */ 173 "r" (n), /* %8 */ 174 #else 127 175 "g" (n), /* %8 */ 128 "0" (fn_copy) /* %3 */ 176 #endif 177 "0" (fn_copy) /* %9 */ 129 178 : "memory" 130 179 ); 131 180 132 181 return result; 133 182 … … 136 185 #endif /* __GNUC__ */ 137 186 138 } 187 } -
trunk/src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/unix/xptcstubs_unixish_x86.cpp
r1 r589 40 40 #include "xptcprivate.h" 41 41 #include "xptc_platforms_unixish_x86.h" 42 /*#include "xptiprivate.h"*/ 42 43 43 44 static nsresult … … 104 105 105 106 #ifdef __GNUC__ /* Gnu Compiler. */ 107 108 #ifdef KEEP_STACK_16_BYTE_ALIGNED 109 /* Make sure the stack is 16-byte aligned. Do that by aligning to 16 bytes and 110 * then subtracting 4 so the three subsequent pushes result in a 16-byte aligned 111 * stack. */ 112 #define ALIGN_STACK_DECL \ 113 unsigned int saved_esp; 114 115 #define ALIGN_STACK_SAVE \ 116 "movl %%esp, %3\n\t" 117 118 #define ALIGN_STACK_ALIGN \ 119 "addl $0x4, %%esp\n\t" \ 120 "andl $0xfffffff0, %%esp\n\t" \ 121 "subl $0x4, %%esp\n\t" 122 123 #define STACK_RESTORE \ 124 "movl %3, %%esp\n" 125 126 #define ALIGN_STACK_REGS_IN \ 127 , "=r"(saved_esp) /* 3 */ 128 129 #define ALIGN_STACK_REGS_OUT \ 130 , "3"(saved_esp) 131 132 #else 133 #define ALIGN_STACK_DECL 134 #define ALIGN_STACK_SAVE 135 #define ALIGN_STACK_ALIGN 136 #define STACK_RESTORE \ 137 "addl $12, %%esp\n" 138 #define ALIGN_STACK_REGS_IN 139 #define ALIGN_STACK_REGS_OUT 140 #endif 141 106 142 #define STUB_ENTRY(n) \ 107 143 nsresult nsXPTCStubBase::Stub##n() \ … … 110 146 int temp0, temp1; \ 111 147 register nsresult result; \ 148 ALIGN_STACK_DECL \ 112 149 __asm__ __volatile__( \ 150 ALIGN_STACK_SAVE \ 151 ALIGN_STACK_ALIGN \ 113 152 "leal 0x0c(%%ebp), %%ecx\n\t" /* args */ \ 114 153 "pushl %%ecx\n\t" \ … … 117 156 "pushl %%ecx\n\t" \ 118 157 "call *%%edx\n\t" /* PrepareAndDispatch */ \ 119 "addl $12, %%esp"\158 STACK_RESTORE /* "addl $12, %%esp" or restore saved */ \ 120 159 : "=a" (result), /* %0 */ \ 121 160 "=&c" (temp0), /* %1 */ \ 122 161 "=d" (temp1) /* %2 */ \ 162 ALIGN_STACK_REGS_IN \ 123 163 : "2" (method) /* %2 */ \ 124 : "memory" ); \ 164 ALIGN_STACK_REGS_OUT \ 165 : "memory" \ 166 ); \ 125 167 return result; \ 126 168 } -
trunk/src/libs/xpcom18a4/xpcom/tests/nsIFileTest.cpp
r1 r589 1 1 #include "nsILocalFile.h" 2 #if 0 /* too new */ 3 #include "nsStringGlue.h" 4 #else 2 5 #include "nsString.h" 6 #endif 3 7 4 8 #include <stdio.h> … … 8 12 #include "nsIServiceManager.h" 9 13 #include "nsIMemory.h" 10 #include "nsXPIDLString.h" 14 15 #include "nsComponentManagerUtils.h" 16 #include "nsCOMPtr.h" 11 17 12 18 void Passed(); … … 63 69 rv = file->GetNativePath(pathName); 64 70 VerifyResult(rv); 65 71 66 72 printf("filepath: %s\n", pathName.get()); 67 73 } … … 70 76 { 71 77 nsILocalFile* file = nsnull; 72 nsresult rv = nsComponentManager::CreateInstance(NS_LOCAL_FILE_CONTRACTID, 73 nsnull, 74 NS_GET_IID(nsILocalFile), 75 (void**)&file); 76 77 if (NS_FAILED(rv) || (!file)) 78 nsresult rv = CallCreateInstance(NS_LOCAL_FILE_CONTRACTID, &file); 79 80 81 if (NS_FAILED(rv) || (!file)) 78 82 { 79 83 printf("create nsILocalFile failed\n"); … … 88 92 rv = file->InitWithNativePath(nsDependentCString(creationPath)); 89 93 VerifyResult(rv); 90 94 91 95 printf("Getting Filename\n"); 92 96 rv = file->GetNativeLeafName(leafName); … … 105 109 GetPaths(file); 106 110 107 111 108 112 printf("Check For Existence\n"); 109 113 … … 121 125 PRInt32 whatToCreate, PRInt32 perm) 122 126 { 123 nsCOMPtr<nsILocalFile> file; 124 nsresult rv = 125 nsComponentManager::CreateInstance(NS_LOCAL_FILE_CONTRACTID, 126 nsnull, 127 NS_GET_IID(nsILocalFile), 128 (void **)getter_AddRefs(file)); 129 130 if (NS_FAILED(rv) || (!file)) 127 nsresult rv; 128 nsCOMPtr<nsILocalFile> file = 129 do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv); 130 131 if (NS_FAILED(rv) || (!file)) 131 132 { 132 133 printf("create nsILocalFile failed\n"); … … 139 140 rv = file->InitWithNativePath(nsDependentCString(creationPath)); 140 141 VerifyResult(rv); 141 142 142 143 printf("Appending %s\n", appendPath); 143 144 rv = file->AppendRelativeNativePath(nsDependentCString(appendPath)); 144 145 VerifyResult(rv); 145 146 146 147 printf("Check For Existence\n"); 147 148 … … 155 156 156 157 157 rv = file->Create(whatToCreate, perm); 158 rv = file->Create(whatToCreate, perm); 158 159 VerifyResult(rv); 159 160 … … 161 162 VerifyResult(rv); 162 163 163 164 164 165 if (!exists) 165 166 { … … 167 168 return; 168 169 } 169 170 } 170 171 } 171 172 172 173 void CreateUniqueTest(const char* creationPath, const char* appendPath, 173 174 PRInt32 whatToCreate, PRInt32 perm) 174 175 { 175 nsCOMPtr<nsILocalFile> file; 176 nsresult rv = 177 nsComponentManager::CreateInstance(NS_LOCAL_FILE_CONTRACTID, 178 nsnull, 179 NS_GET_IID(nsILocalFile), 180 (void **)getter_AddRefs(file)); 181 182 if (NS_FAILED(rv) || (!file)) 176 nsresult rv; 177 nsCOMPtr<nsILocalFile> file = 178 do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv); 179 180 if (NS_FAILED(rv) || (!file)) 183 181 { 184 182 printf("create nsILocalFile failed\n"); … … 191 189 rv = file->InitWithNativePath(nsDependentCString(creationPath)); 192 190 VerifyResult(rv); 193 191 194 192 printf("Appending %s\n", appendPath); 195 193 rv = file->AppendNative(nsDependentCString(appendPath)); 196 194 VerifyResult(rv); 197 195 198 196 printf("Check For Existence\n"); 199 197 … … 207 205 208 206 209 rv = file->CreateUnique(whatToCreate, perm); 207 rv = file->CreateUnique(whatToCreate, perm); 210 208 VerifyResult(rv); 211 209 … … 213 211 VerifyResult(rv); 214 212 215 213 216 214 if (!exists) 217 215 { … … 219 217 return; 220 218 } 221 222 } 219 220 } 223 221 224 222 … … 226 224 CopyTest(const char *testFile, const char *targetDir) 227 225 { 228 nsCOMPtr<nsILocalFile> file;229 nsCOMPtr<nsILocalFile> dir;230 231 226 printf("start copy test\n"); 232 227 233 nsresult rv = 234 nsComponentManager::CreateInstance(NS_LOCAL_FILE_CONTRACTID, NULL, 235 NS_GET_IID(nsILocalFile), 236 (void**)getter_AddRefs(file)); 237 238 if (NS_FAILED(rv) || (!file)) 228 nsresult rv; 229 nsCOMPtr<nsILocalFile> file = 230 do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv); 231 232 if (NS_FAILED(rv) || (!file)) 239 233 { 240 234 printf("create nsILocalFile failed\n"); … … 244 238 rv = file->InitWithNativePath(nsDependentCString(testFile)); 245 239 VerifyResult(rv); 246 247 rv = nsComponentManager::CreateInstance(NS_LOCAL_FILE_CONTRACTID, NULL, 248 NS_GET_IID(nsILocalFile), 249 (void**)getter_AddRefs(dir)); 250 251 if (NS_FAILED(rv) || (!dir)) 240 241 nsCOMPtr<nsILocalFile> dir = 242 do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv); 243 244 if (NS_FAILED(rv) || (!dir)) 252 245 { 253 246 printf("create nsILocalFile failed\n"); … … 263 256 printf("end copy test\n"); 264 257 } 265 258 266 259 void 267 260 DeletionTest(const char* creationPath, const char* appendPath, PRBool recursive) 268 261 { 269 nsCOMPtr<nsILocalFile> file; 270 nsresult rv = 271 nsComponentManager::CreateInstance(NS_LOCAL_FILE_CONTRACTID, NULL, 272 NS_GET_IID(nsILocalFile), 273 (void**)getter_AddRefs(file)); 274 275 if (NS_FAILED(rv) || (!file)) 262 nsresult rv; 263 nsCOMPtr<nsILocalFile> file = 264 do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv); 265 266 if (NS_FAILED(rv) || (!file)) 276 267 { 277 268 printf("create nsILocalFile failed\n"); … … 284 275 rv = file->InitWithNativePath(nsDependentCString(creationPath)); 285 276 VerifyResult(rv); 286 277 287 278 printf("Appending %s\n", appendPath); 288 279 rv = file->AppendNative(nsDependentCString(appendPath)); 289 280 VerifyResult(rv); 290 281 291 282 printf("Check For Existance\n"); 292 283 … … 299 290 printf("no.\n"); 300 291 301 rv = file->Remove(recursive); 292 rv = file->Remove(recursive); 302 293 VerifyResult(rv); 303 294 304 295 rv = file->Exists(&exists); 305 296 VerifyResult(rv); 306 297 307 298 if (exists) 308 299 { … … 310 301 return; 311 302 } 312 313 } 314 315 void 303 304 } 305 306 void 316 307 MoveTest(const char *testFile, const char *targetDir) 317 308 { … … 322 313 nsresult rv; 323 314 nsCOMPtr<nsILocalFile> file(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID)); 324 325 if (!file) 315 316 if (!file) 326 317 { 327 318 printf("create nsILocalFile failed\n"); … … 331 322 rv = file->InitWithNativePath(nsDependentCString(testFile)); 332 323 VerifyResult(rv); 333 324 334 325 nsCOMPtr<nsILocalFile> dir(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID)); 335 336 if (!dir) 326 327 if (!dir) 337 328 { 338 329 printf("create nsILocalFile failed\n"); … … 352 343 } 353 344 354 345 // move up the number of directories in moveUpCount, then append "foo/bar" 346 void 347 NormalizeTest(const char *testPath, int moveUpCount, 348 const char *expected) 349 { 350 Banner("Normalize Test"); 351 352 nsresult rv; 353 nsCOMPtr<nsILocalFile> file(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID)); 354 355 if (!file) 356 { 357 printf("create nsILocalFile failed\n"); 358 return; 359 } 360 361 rv = file->InitWithNativePath(nsDependentCString(testPath)); 362 VerifyResult(rv); 363 364 nsCOMPtr<nsIFile> parent; 365 nsAutoString path; 366 for (int i=0; i < moveUpCount; i++) 367 { 368 rv = file->GetParent(getter_AddRefs(parent)); 369 VerifyResult(rv); 370 rv = parent->GetPath(path); 371 VerifyResult(rv); 372 rv = file->InitWithPath(path); 373 VerifyResult(rv); 374 } 375 376 if (!parent) { 377 printf("Getting parent failed!\n"); 378 return; 379 } 380 381 rv = parent->Append(NS_LITERAL_STRING("foo")); 382 VerifyResult(rv); 383 rv = parent->Append(NS_LITERAL_STRING("bar")); 384 VerifyResult(rv); 385 386 rv = parent->Normalize(); 387 VerifyResult(rv); 388 389 nsCAutoString newPath; 390 rv = parent->GetNativePath(newPath); 391 VerifyResult(rv); 392 393 nsCOMPtr<nsILocalFile> 394 expectedFile(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID)); 395 396 if (!expectedFile) 397 { 398 printf("create nsILocalFile failed\n"); 399 return; 400 } 401 rv = expectedFile->InitWithNativePath(nsDependentCString(expected)); 402 VerifyResult(rv); 403 404 rv = expectedFile->Normalize(); 405 VerifyResult(rv); 406 407 nsCAutoString expectedPath; 408 rv = expectedFile->GetNativePath(expectedPath); 409 VerifyResult(rv); 410 411 if (!newPath.Equals(expectedPath)) { 412 printf("ERROR: Normalize() test Failed!\n"); 413 printf(" Got: %s\n", newPath.get()); 414 printf("Expected: %s\n", expectedPath); 415 } 416 417 printf("end normalize test.\n"); 418 } 355 419 356 420 int main(void) … … 361 425 NS_ASSERTION(registrar, "Null nsIComponentRegistrar"); 362 426 registrar->AutoRegister(nsnull); 363 427 364 428 #if defined(XP_WIN) || defined(XP_OS2) 365 InitTest("c:\\temp\\", "sub1/sub2/"); 366 InitTest("d:\\temp\\", "sub1\\sub2\\"); 429 InitTest("c:\\temp\\", "sub1/sub2/"); // expect failure 430 InitTest("d:\\temp\\", "sub1\\sub2\\"); // expect failure 367 431 368 432 CreationTest("c:\\temp\\", "file.txt", nsIFile::NORMAL_FILE_TYPE, 0644); … … 385 449 #else 386 450 #ifdef XP_UNIX 387 InitTest("/tmp/", "sub1/sub2/"); 388 451 InitTest("/tmp/", "sub1/sub2/"); // expect failure 452 389 453 CreationTest("/tmp", "file.txt", nsIFile::NORMAL_FILE_TYPE, 0644); 390 454 DeletionTest("/tmp/", "file.txt", PR_FALSE); 391 455 392 456 CreationTest("/tmp", "mumble/a/b/c/d/e/f/g/h/i/j/k/", nsIFile::DIRECTORY_TYPE, 0644); 393 457 DeletionTest("/tmp", "mumble", PR_TRUE); 394 CopyTest("/tmp/test.txt", "/tmp/foo"); 458 459 CreationTest("/tmp", "file", nsIFile::NORMAL_FILE_TYPE, 0644); 460 CopyTest("/tmp/file", "/tmp/newDir"); 461 MoveTest("/tmp/file", "/tmp/newDir/anotherNewDir"); 462 DeletionTest("/tmp", "newDir", PR_TRUE); 463 464 CreationTest("/tmp", "qux/quux", nsIFile::NORMAL_FILE_TYPE, 0644); 465 CreationTest("/tmp", "foo/bar", nsIFile::NORMAL_FILE_TYPE, 0644); 466 NormalizeTest("/tmp/qux/quux/..", 1, "/tmp/foo/bar"); 467 DeletionTest("/tmp", "qux", PR_TRUE); 468 DeletionTest("/tmp", "foo", PR_TRUE); 395 469 396 470 #endif /* XP_UNIX */
Note:
See TracChangeset
for help on using the changeset viewer.