1 --- misc/mozilla/build/autoconf/mozconfig-find 2007-02-16 03:19:06.000000000 +0100
2 +++ misc/build/mozilla/build/autoconf/mozconfig-find 2008-08-19 10:12:04.000000000 +0200
4 "$topsrcdir/.mozconfig" \
5 "$topsrcdir/mozconfig" \
6 "$topsrcdir/mozconfig.sh" \
7 - "$topsrcdir/myconfig.sh" \
9 - "$HOME/.mozconfig.sh" \
10 - "$HOME/.mozmyconfig.sh"
11 + "$topsrcdir/myconfig.sh"
13 if test -f "$_config"; then
15 --- misc/mozilla/build/cygwin-wrapper 2004-08-19 01:18:55.000000000 +0200
16 +++ misc/build/mozilla/build/cygwin-wrapper 2008-08-14 16:22:21.000000000 +0200
21 # Stupid wrapper to avoid win32 dospath/cygdrive issues
22 # Try not to spawn programs from within this file. If the stuff in here looks royally
24 i=-I${mountpoint}/${driveletter}/${pathname}
27 - eval 'leader=${i%%'${mountpoint}'/[a-zA-Z]/*}'
28 - if ! test "${leader}" = "${i}"; then
29 - eval 'pathname=${i#'${leader}${mountpoint}'/[a-zA-Z]/}'
30 - eval 'no_mountpoint=${i#'${leader}${mountpoint}'/}'
31 - driveletter=${no_mountpoint%%/*}
32 - i=${leader}${driveletter}:/${pathname}
33 + # The original version missed mounted paths, the new version below
34 + # doesn't transform /para as this is most likely a parameter.
35 + eval 'notinpath=${i%%'${mountpoint}'/[a-zA-Z]/*}'
36 + if ! test "$notinpath" = "$i"; then
38 + eval 'restpath=${i#'${notinpath}${mountpoint}'/[a-zA-Z]/}'
39 + eval 'withdrive=${i#'${notinpath}${mountpoint}'/}'
40 + driveletter=${withdrive%%/*}
41 + i=${notinpath}${driveletter}:/${restpath}
43 + # check for potential path. Precheck using shell methods
45 + # Shortcut -X<path> when path does not begin with '/'
46 + noswitch=${i#-[a-zA-Z]}
47 + if test "$noswitch" != "$i"; then
48 + test "${noswitch#/}" != "$noswitch" && doconvert="1"
50 + # Precheck for possible path. Consider only absolute paths that contain at least
51 + # a second / to prevent converting of /abc parameters.
52 + test -z "$doconvert" -a "${i#/[a-zA-Z0-9_.-]*/}" != "$i" && doconvert="1"
53 + if test -n "$doconvert"; then
54 + # Can be a path. If forking grep would be faster or we could require bash 3
55 + # this regexp would be all that's needed to find pathnames that need converting
56 + pathname=`echo $i | grep -oE '^(-[a-zA-Z])?/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_./-]+$'`
57 + eval 'notinpath=${i%'${pathname}'}'
58 + if test "$notinpath" != "$i" -a "$pathname" != "${pathname#/}"; then
59 + pathname=`cygpath -am "$pathname"`
60 + i=${notinpath}${pathname}
66 --- misc/mozilla/config/Makefile.in 2006-12-22 14:50:41.000000000 +0100
67 +++ misc/build/mozilla/config/Makefile.in 2008-08-14 16:22:21.000000000 +0200
71 GLIB_CFLAGS = $(MOZ_GTK2_CFLAGS)
72 - GLIB_LIBS = $(MOZ_GTK2_LIBS)
73 + GLIB_LIBS = $(filter -lglib% -L%,$(MOZ_GTK2_LIBS))
77 --- misc/mozilla/config/autoconf.mk.in 2006-09-14 20:07:03.000000000 +0200
78 +++ misc/build/mozilla/config/autoconf.mk.in 2008-11-07 16:08:52.937500000 +0100
80 MOZ_TOOLS_DIR = @MOZ_TOOLS_DIR@
81 MOZ_DEBUG_SYMBOLS = @MOZ_DEBUG_SYMBOLS@
82 MOZ_QUANTIFY = @MOZ_QUANTIFY@
83 +MSMANIFEST_TOOL = @MSMANIFEST_TOOL@
87 --- misc/mozilla/config/config.mk 2008-01-29 20:30:22.000000000 +0100
88 +++ misc/build/mozilla/config/config.mk 2008-08-14 16:22:21.000000000 +0200
93 +# Shared library RUNPATH linker option(s)
95 +ifeq ($(OS_ARCH),Linux)
96 +EXTRA_DSO_LDOPTS += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
98 +EXTRA_DSO_LDOPTS += -Wl,-rpath,\$$ORIGIN/..:\$$ORIGIN/../../ure-link/lib
102 +ifeq ($(OS_ARCH),SunOS)
103 +EXTRA_DSO_LDOPTS += -R '$$ORIGIN'
105 +EXTRA_DSO_LDOPTS += -R '$$ORIGIN/..'
106 +endif # IS_COMPONENT
110 # Include any personal overrides the user might think are needed.
112 -include $(MY_CONFIG)
113 --- misc/mozilla/config/rules.mk 2008-01-29 20:30:22.000000000 +0100
114 +++ misc/build/mozilla/config/rules.mk 2009-02-16 14:05:23.000000000 +0100
116 ifeq ($(OS_ARCH),WINNT)
119 -DSO_LDOPTS += -Wl,--out-implib -Wl,$(IMPORT_LIBRARY)
120 +DSO_LDOPTS += -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY)
122 +DSO_LDOPTS += -Wl,--enable-runtime-pseudo-reloc -Wl,-Map -Wl,$(LIB_PREFIX)$(LIBRARY_NAME).map
128 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
129 $(LD) -NOLOGO -OUT:$@ -PDB:$(PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
130 +ifdef MSMANIFEST_TOOL
131 + @if test -f $@.manifest; then \
132 + mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
133 + rm -f $@.manifest; \
135 +endif # MSVC with manifest tool
137 ifeq ($(CPP_PROG_LINK),1)
138 $(CCC) -o $@ $(CXXFLAGS) $(WRAP_MALLOC_CFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) $(EXE_DEF_FILE)
141 ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
142 $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
143 +ifdef MSMANIFEST_TOOL
144 + @if test -f $@.manifest; then \
145 + mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
146 + rm -f $@.manifest; \
148 +endif # MSVC with manifest tool
150 $(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
154 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
155 $(LD) -nologo -out:$@ -pdb:$(PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
156 +ifdef MSMANIFEST_TOOL
157 + @if test -f $@.manifest; then \
158 + mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
159 + rm -f $@.manifest; \
161 +endif # MSVC with manifest tool
163 ifeq ($(CPP_PROG_LINK),1)
164 $(CCC) $(WRAP_MALLOC_CFLAGS) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) $(BIN_FLAGS)
165 @@ -1019,6 +1036,14 @@
166 endif # SHARED_LIBRARY_LIBS
167 endif # NO_LD_ARCHIVE_FLAGS
168 $(MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(LOBJS) $(SUB_SHLOBJS) $(RESFILE) $(LDFLAGS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE)
169 +ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
170 +ifdef MSMANIFEST_TOOL
171 + @if test -f $@.manifest; then \
172 + mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;2; \
173 + rm -f $@.manifest; \
175 +endif # MSVC with manifest tool
176 +endif # WINNT && !GCC
177 @rm -f foodummyfilefoo $(SUB_SHLOBJS) $(DELETE_AFTER_LINK)
179 $(MKSHLIB) -O:$@ -DLL -INC:_dllentry $(LDFLAGS) $(OBJS) $(LOBJS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE)
180 @@ -1043,7 +1070,7 @@
181 if test -d $(@D); then \
182 echo "Building deps for $<"; \
183 touch $(_MDDEPFILE) && \
184 - $(MKDEPEND) -o'.$(OBJ_SUFFIX)' -f$(_MDDEPFILE) $(DEFINES) $(ACDEFINES) $(INCLUDES) $< >/dev/null 2>&1 && \
185 + $(MKDEPEND) -o'.$(OBJ_SUFFIX)' -f$(_MDDEPFILE) $(DEFINES) $(ACDEFINES) $(filter-out -I/so/env% ,$(INCLUDES)) $< >/dev/null 2>&1 && \
186 mv $(_MDDEPFILE) $(_MDDEPFILE).old && \
187 cat $(_MDDEPFILE).old | sed -e "s|^$(srcdir)/||" -e "s|^$(win_srcdir)/||" > $(_MDDEPFILE) && rm -f $(_MDDEPFILE).old ; \
189 @@ -1053,7 +1080,7 @@
190 if test -d $(@D); then \
191 echo "Building deps for $<"; \
192 touch $(_MDDEPFILE) && \
193 - $(MKDEPEND) -o'.$(OBJ_SUFFIX)' -f$(_MDDEPFILE) $(DEFINES) $(ACDEFINES) $(INCLUDES) $< >/dev/null 2>&1 && \
194 + $(MKDEPEND) -o'.$(OBJ_SUFFIX)' -f$(_MDDEPFILE) $(DEFINES) $(ACDEFINES) $(filter-out -I/so/env% ,$(INCLUDES)) $< >/dev/null 2>&1 && \
195 mv $(_MDDEPFILE) $(_MDDEPFILE).old && \
196 cat $(_MDDEPFILE).old | sed -e "s|^$(<D)/||g" > $(_MDDEPFILE) && rm -f $(_MDDEPFILE).old ; \
198 @@ -1325,6 +1352,7 @@
200 $(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_COMPILE) $(XPIDL_GEN_DIR)/.done
202 + echo "PATH=" $(PATH)
203 $(ELOG) $(XPIDL_COMPILE) -m header -w -I$(srcdir) -I$(IDL_DIR) -o $(XPIDL_GEN_DIR)/$* $(_VPATH_SRCS)
204 @if test -n "$(findstring $*.h, $(EXPORTS) $(SDK_HEADERS))"; \
205 then echo "*** WARNING: file $*.h generated from $*.idl overrides $(srcdir)/$*.h"; else true; fi
206 @@ -1696,14 +1724,14 @@
207 define MAKE_DEPS_NOAUTO
210 - $(MKDEPEND) -w1024 -o'.$(OBJ_SUFFIX)' -f$@ $(DEFINES) $(ACDEFINES) $(INCLUDES) $(srcdir)/$(<F) >/dev/null 2>&1 && \
211 + $(MKDEPEND) -w1024 -o'.$(OBJ_SUFFIX)' -f$@ $(DEFINES) $(ACDEFINES) $(filter-out -I/so/env% ,$(INCLUDES)) $(srcdir)/$(<F) >/dev/null 2>&1 && \
212 mv $@ $@.old && cat $@.old | sed "s|^$(srcdir)/||g" > $@ && rm -f $@.old
215 define MAKE_DEPS_NOAUTO
218 - $(MKDEPEND) -w1024 -o'.$(OBJ_SUFFIX)' -f$@ $(DEFINES) $(ACDEFINES) $(INCLUDES) $< >/dev/null 2>&1 && \
219 + $(MKDEPEND) -w1024 -o'.$(OBJ_SUFFIX)' -f$@ $(DEFINES) $(ACDEFINES) $(filter-out -I/so/env% ,$(INCLUDES)) $< >/dev/null 2>&1 && \
220 mv $@ $@.old && cat $@.old | sed "s|^$(<D)/||g" > $@ && rm -f $@.old
223 --- misc/mozilla/configure 2008-10-30 23:05:30.000000000 +0100
224 +++ misc/build/mozilla/configure 2009-02-12 15:20:18.597579000 +0100
225 @@ -1068,6 +1068,8 @@
232 for ac_prog in gawk mawk nawk awk
234 @@ -3022,9 +3024,26 @@
236 elif test "$_CC_MAJOR_VERSION" = "14"; then
238 + CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
240 { echo "configure: error: This version of the MSVC compiler, $CC_VERSION , is unsupported." 1>&2; exit 1; }
244 + # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
245 + if test "$_CC_SUITE" -ge "8"; then
246 + MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
247 + if test -n "MSMT_TOOL"; then
248 + MSMANIFEST_TOOL_VERSION=`echo ${MSMANIFEST_TOOL}|grep -Po "(^|\s)[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(\s|$)"`
249 + if test -z "MSMANIFEST_TOOL_VERSION"; then
250 + echo "configure: warning: Unknown version of the Microsoft (R) Manifest Tool." 1>&2
255 + { echo "Microsoft (R) Manifest Tool must be in your \$PATH." 1>&2; exit 1; }
259 # Check linker version
260 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
261 @@ -3422,6 +3441,8 @@
262 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
263 cross_compiling=$ac_cv_prog_cc_cross
266 + ac_cv_prog_CXXCPP="$CXXCPP"
268 CXXCPP="$ac_cv_prog_CXXCPP"
269 echo "$ac_t""$CXXCPP" 1>&6
270 @@ -5726,6 +5747,7 @@
271 if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
273 CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
274 + CYGWIN_WRAPPER=`cygpath -u $CYGWIN_WRAPPER`
276 if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
278 @@ -6036,7 +6058,7 @@
279 CXXFLAGS="$CXXFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
282 - STRIP="$STRIP -x -S"
283 + STRIP="$STRIP -X -S" # MACOSX 10.5 strip -x sometimes fails
284 _PLATFORM_DEFAULT_TOOLKIT='mac'
285 MOZ_ENABLE_POSTSCRIPT=
286 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
287 @@ -6075,7 +6097,7 @@
291 - if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` != "elf"; then
292 + if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
296 @@ -6455,12 +6477,12 @@
302 + *-cygwin*|*-mingw*)
303 + CYGPATH_W="cygpath -u"
305 - MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
306 + MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
308 - *-cygwin*|*-msvc*|*-mks*)
310 CYGPATH_W="cygpath -a -w"
311 CYGPATH_S="sed -e s|\\\\|/|g"
312 MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
313 @@ -6718,7 +6740,7 @@
314 MOZ_USER_DIR="Mozilla"
316 if test "$MOZTOOLS"; then
317 - MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
318 + MOZ_TOOLS_DIR=`echo $MOZTOOLS`
320 { echo "configure: error: MOZTOOLS is not set" 1>&2; exit 1; }
322 @@ -8614,6 +8636,8 @@
329 echo $ac_n "checking for gethostbyname_r in -lc_r""... $ac_c" 1>&6
330 echo "configure:8620: checking for gethostbyname_r in -lc_r" >&5
331 @@ -19233,7 +19257,8 @@
332 MOZ_CAIRO_LIBS="-lmozcairo -lmozlibpixman $CAIRO_FT_LIBS"
334 if test "$MOZ_X11"; then
335 - MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender $XLIBS -lfontconfig -lfreetype"
336 +# MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender $XLIBS -lfontconfig -lfreetype"
337 + MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $XLIBS -lfontconfig -lfreetype"
339 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
340 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS -lgdi32"
341 @@ -20076,8 +20101,12 @@
342 WIN_TOP_SRC=`cd $srcdir; pwd -W`
345 - HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
346 - HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
347 +# Don't add the wrapper for the HOST_* versions as they contain an
348 +# unexpanded $CC and therfore wil get the wrapper below.
349 + if test -n "$GNU_CC"; then
350 + HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
351 + HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
353 CC="\$(CYGWIN_WRAPPER) $CC"
354 CXX="\$(CYGWIN_WRAPPER) $CXX"
355 CPP="\$(CYGWIN_WRAPPER) $CPP"
356 --- misc/mozilla/configure.in 2008-10-30 23:05:31.000000000 +0100
357 +++ misc/build/mozilla/configure.in 2009-02-05 20:12:45.456777753 +0100
364 dnl Set various checks
365 dnl ========================================================
369 elif test "$_CC_MAJOR_VERSION" = "14"; then
371 + CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
373 AC_MSG_ERROR([This version of the MSVC compiler, $CC_VERSION , is unsupported.])
377 + # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
378 + if test "$_CC_SUITE" -ge "8"; then
379 + MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
380 + if test -n "MSMT_TOOL"; then
381 + MSMANIFEST_TOOL_VERSION=`echo ${MSMANIFEST_TOOL}|grep -Po "(^|\s)[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(\s|$)"`
382 + if test -z "MSMANIFEST_TOOL_VERSION"; then
383 + AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
388 + AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
392 # Check linker version
393 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
394 @@ -1530,7 +1549,7 @@
395 CXXFLAGS="$CXXFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
398 - STRIP="$STRIP -x -S"
399 + STRIP="$STRIP -X -S" # MACOSX 10.5 strip -x sometimes fails
400 _PLATFORM_DEFAULT_TOOLKIT='mac'
401 MOZ_ENABLE_POSTSCRIPT=
402 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
403 @@ -1552,7 +1571,7 @@
407 - if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` != "elf"; then
408 + if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
412 @@ -1853,10 +1872,10 @@
414 dnl MinGW/MSYS doesn't provide or need cygpath
418 + *-cygwin*|*-mingw*)
419 + CYGPATH_W="cygpath -u"
421 - MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
422 + MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
424 *-cygwin*|*-msvc*|*-mks*)
425 CYGPATH_W="cygpath -a -w"
426 @@ -2749,6 +2768,8 @@
433 AC_CHECK_LIB(c_r, gethostbyname_r)
435 @@ -7321,6 +7342,7 @@
438 AC_SUBST(CXX_VERSION)
439 +AC_SUBST(MSMANIFEST_TOOL)
441 if test "$USING_HCC"; then
442 CC='${topsrcdir}/build/hcc'
443 @@ -7416,8 +7438,12 @@
444 WIN_TOP_SRC=`cd $srcdir; pwd -W`
447 - HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
448 - HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
449 +# Don't add the wrapper for the HOST_* versions as they contain an
450 +# unexpanded $CC and therfore wil get the wrapper below.
451 + if test -n "$GNU_CC"; then
452 + HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
453 + HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
455 CC="\$(CYGWIN_WRAPPER) $CC"
456 CXX="\$(CYGWIN_WRAPPER) $CXX"
457 CPP="\$(CYGWIN_WRAPPER) $CPP"
458 --- misc/mozilla/directory/c-sdk/build.mk 2006-02-03 15:44:29.000000000 +0100
459 +++ misc/build/mozilla/directory/c-sdk/build.mk 2008-08-14 16:22:21.000000000 +0200
462 LINK_EXE = $(CC) -o $@ $(LDFLAGS) $(LCFLAGS) $(DEPLIBS) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
463 LINK_LIB = $(AR) cr $@ $(OBJS)
464 -LINK_DLL = $(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(@:.$(DLL_SUFFIX)=.$(LIB_SUFFIX)) $(LLFLAGS) $(DLL_LDFLAGS) -o $@ $(OBJS) $(EXTRA_LIBS) $(EXTRA_DLL_LIBS)
465 +LINK_DLL = $(CC) -shared -Wl,--enable-runtime-pseudo-reloc -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(LIB_PREFIX)$(@:.$(DLL_SUFFIX)=.$(LIB_SUFFIX)) $(LLFLAGS) $(DLL_LDFLAGS) -o $@ $(OBJS) $(EXTRA_LIBS) $(EXTRA_DLL_LIBS)
467 DEBUG_LINK_OPT=-DEBUG
468 ifeq ($(BUILD_OPT), 1)
469 --- misc/mozilla/directory/c-sdk/config/FreeBSD.mk 2006-02-03 15:41:11.000000000 +0100
470 +++ misc/build/mozilla/directory/c-sdk/config/FreeBSD.mk 2008-08-14 16:22:21.000000000 +0200
475 -MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo aout)
476 +MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo elf)
478 ifeq ($(MOZ_OBJFORMAT),elf)
480 --- misc/mozilla/directory/c-sdk/config/autoconf.mk.in 2006-02-23 00:58:25.000000000 +0100
481 +++ misc/build/mozilla/directory/c-sdk/config/autoconf.mk.in 2008-08-14 16:22:21.000000000 +0200
483 LIB_SUFFIX = @LIB_SUFFIX@
484 LIB_PREFIX = @LIB_PREFIX@
485 DLL_SUFFIX = @DLL_SUFFIX@
486 +DLL_PREFIX = @DLL_PREFIX@
487 ASM_SUFFIX = @ASM_SUFFIX@
488 PROG_SUFFIX = @PROG_SUFFIX@
489 MOD_NAME = @NSPR_MODNAME@
490 --- misc/mozilla/directory/c-sdk/config/cygwin-wrapper 2004-08-19 01:18:55.000000000 +0200
491 +++ misc/build/mozilla/directory/c-sdk/config/cygwin-wrapper 2008-08-14 16:22:21.000000000 +0200
496 # Stupid wrapper to avoid win32 dospath/cygdrive issues
497 # Try not to spawn programs from within this file. If the stuff in here looks royally
498 --- misc/mozilla/directory/c-sdk/configure 2006-02-23 01:58:13.000000000 +0100
499 +++ misc/build/mozilla/directory/c-sdk/configure 2008-08-14 16:22:21.000000000 +0200
500 @@ -2738,6 +2738,7 @@
506 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
508 @@ -3444,7 +3445,7 @@
511 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
512 - MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
513 + MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
514 if test "$MOZ_OBJFORMAT" = "elf"; then
517 @@ -3811,6 +3812,7 @@
518 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
520 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
521 + DSO_LDOPTS="$DSO_LDOPTS -Wl,-rpath,'$\$ORIGIN:$\$ORIGIN/../ure-link/lib'"
522 OS_LIBS="$OS_LIBS -lc"
524 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
525 @@ -3880,7 +3882,8 @@
527 CXX="$CXX -mno-cygwin"
529 - MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) -o $@'
531 + MKSHLIB='$(CC) -shared -Wl,--enable-runtime-pseudo-reloc -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) -o $@'
532 # Use temp file for windres (bug 213281)
533 RC="$WINDRES -O coff --use-temp-file"
535 @@ -3897,6 +3900,7 @@
541 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
543 @@ -4293,6 +4297,7 @@
551 @@ -4660,6 +4665,7 @@
553 RANLIB=/usr/ccs/bin/ranlib
554 DSO_LDOPTS='-G -h $(notdir $@)'
555 + DSO_LDOPTS="$DSO_LDOPTS -R '$\$ORIGIN'"
556 if test -n "$GNU_CC"; then
559 @@ -5844,6 +5850,7 @@
560 s%@LIB_SUFFIX@%$LIB_SUFFIX%g
561 s%@LIB_PREFIX@%$LIB_PREFIX%g
562 s%@DLL_SUFFIX@%$DLL_SUFFIX%g
563 +s%@DLL_PREFIX@%$DLL_PREFIX%g
564 s%@ASM_SUFFIX@%$ASM_SUFFIX%g
565 s%@PROG_SUFFIX@%$PROG_SUFFIX%g
566 s%@MKSHLIB@%$MKSHLIB%g
567 --- misc/mozilla/directory/c-sdk/configure.in 2007-07-15 16:41:07.000000000 +0200
568 +++ misc/build/mozilla/directory/c-sdk/configure.in 2008-08-14 16:22:21.000000000 +0200
575 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
577 @@ -1037,7 +1038,7 @@
579 AC_DEFINE(HAVE_BSD_FLOCK)
580 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
581 - MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
582 + MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
583 if test "$MOZ_OBJFORMAT" = "elf"; then
586 @@ -1285,6 +1286,7 @@
587 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
589 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
590 + DSO_LDOPTS="$DSO_LDOPTS -Wl,-rpath,'$\$ORIGIN:$\$ORIGIN/../ure-link/lib'"
591 OS_LIBS="$OS_LIBS -lc"
593 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
594 @@ -1336,6 +1338,8 @@
596 CXX="$CXX -mno-cygwin"
600 MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) -o $@'
601 # Use temp file for windres (bug 213281)
602 RC="$WINDRES -O coff --use-temp-file"
603 @@ -1353,6 +1357,7 @@
609 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
611 @@ -1820,6 +1825,7 @@
613 RANLIB=/usr/ccs/bin/ranlib
614 DSO_LDOPTS='-G -h $(notdir $@)'
615 + DSO_LDOPTS="$DSO_LDOPTS -R '$\$ORIGIN'"
616 if test -n "$GNU_CC"; then
619 @@ -2410,6 +2416,7 @@
623 +AC_SUBST(DLL_PREFIX)
625 AC_SUBST(PROG_SUFFIX)
627 --- misc/mozilla/directory/c-sdk/ldap/include/Makefile.in 2006-02-03 15:44:33.000000000 +0100
628 +++ misc/build/mozilla/directory/c-sdk/ldap/include/Makefile.in 2008-11-02 21:55:34.929250000 +0100
631 ###########################################################################
633 +ifeq ($(TERM),cygwin)
634 +INCLUDEDIR:=$(shell cygpath -u $(INCLUDEDIR))
635 +GENHEADERS:=$(shell cygpath -u $(GENHEADERS))
638 all export:: $(INCLUDEDIR) $(GENHEADERS)
639 $(NSINSTALL) -D $(PRIVATEINCDIR)
640 $(INSTALL) $(INSTALLFLAGS) -m 644 $(HEADERS) $(INCLUDEDIR)
641 --- misc/mozilla/directory/c-sdk/ldap/libraries/libldap/Makefile.in 2006-02-03 15:44:42.000000000 +0100
642 +++ misc/build/mozilla/directory/c-sdk/ldap/libraries/libldap/Makefile.in 2008-08-14 16:22:21.000000000 +0200
644 HDIR = $(topsrcdir)/ldap/include
646 LIBLDAP = $(addprefix $(OBJDIR_NAME)/, $(LIB_PREFIX)$(LDAP_LIBNAME).$(LIB_SUFFIX))
647 -DLLLDAP = $(addprefix $(OBJDIR_NAME)/, $(LIB_PREFIX)$(LDAP_LIBNAME).$(DLL_SUFFIX))
648 +DLLLDAP = $(addprefix $(OBJDIR_NAME)/, $(DLL_PREFIX)$(LDAP_LIBNAME).$(DLL_SUFFIX))
650 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
653 -$(RM) $(SO_FILES_TO_REMOVE)
655 $(LINK_DLL) $(LDAP_EXPORT_FLAGS) $(EXTRA_LIBS)
656 + if test -f $@.manifest; then \
657 + mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;2; \
658 + rm -f $@.manifest; \
663 --- misc/mozilla/directory/c-sdk/ldap/libraries/libprldap/Makefile.in 2006-02-03 15:44:49.000000000 +0100
664 +++ misc/build/mozilla/directory/c-sdk/ldap/libraries/libprldap/Makefile.in 2008-08-14 16:22:21.000000000 +0200
668 DLLPRLDAP = $(addprefix $(OBJDIR_NAME)/, \
669 - $(LIB_PREFIX)$(PRLDAP_LIBNAME).$(DLL_SUFFIX))
670 + $(DLL_PREFIX)$(PRLDAP_LIBNAME).$(DLL_SUFFIX))
672 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
674 --- misc/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile 2004-08-26 01:02:30.000000000 +0200
675 +++ misc/build/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile 2008-08-14 16:22:21.000000000 +0200
677 HDIR = $(topsrcdir)/ldap/include
679 LIBSSLDAP = $(addprefix $(SSLOBJDEST)/, $(LIB_PREFIX)$(SSLDAP_LIBNAME).$(LIB_SUFFIX))
680 -DLLSSLDAP = $(addprefix $(SSLOBJDEST)/, $(LIB_PREFIX)$(SSLDAP_LIBNAME).$(DLL_SUFFIX))
681 +DLLSSLDAP = $(addprefix $(SSLOBJDEST)/, $(DLL_PREFIX)$(SSLDAP_LIBNAME).$(DLL_SUFFIX))
683 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
687 # variable definitions for exported symbols
688 ifeq ($(OS_ARCH), WINNT)
689 - SSLDAP_EXPORT_DEFS= $(srcdir)/../msdos/winsock/nsldapssl32.def
690 + SSLDAP_EXPORT_DEFS= $(win_srcdir)/../msdos/winsock/nsldapssl32.def
692 SSLDAP_EXPORT_DEFS= $(SSLOBJDEST)/libldap_ssl.exp
694 --- misc/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile.in 2006-02-03 15:44:49.000000000 +0100
695 +++ misc/build/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile.in 2008-08-14 16:22:21.000000000 +0200
697 HDIR = $(topsrcdir)/ldap/include
699 LIBSSLDAP = $(addprefix $(SSLOBJDEST)/, $(LIB_PREFIX)$(SSLDAP_LIBNAME).$(LIB_SUFFIX))
700 -DLLSSLDAP = $(addprefix $(SSLOBJDEST)/, $(LIB_PREFIX)$(SSLDAP_LIBNAME).$(DLL_SUFFIX))
701 +DLLSSLDAP = $(addprefix $(SSLOBJDEST)/, $(DLL_PREFIX)$(SSLDAP_LIBNAME).$(DLL_SUFFIX))
703 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
705 --- misc/mozilla/embedding/browser/gtk/src/Makefile.in 2006-03-22 19:22:41.000000000 +0100
706 +++ misc/build/mozilla/embedding/browser/gtk/src/Makefile.in 2008-08-14 16:22:21.000000000 +0200
707 @@ -112,14 +112,14 @@
708 gtkmozembed_internal.h
711 -EXTRA_DSO_LDOPTS = \
712 +EXTRA_DSO_LDOPTS += \
713 $(MOZ_COMPONENT_LIBS) \
718 ifdef MOZ_ENABLE_GTK2
719 -EXTRA_DSO_LDOPTS = \
720 +EXTRA_DSO_LDOPTS += \
721 $(MOZ_COMPONENT_LIBS) \
724 --- misc/mozilla/embedding/browser/gtk/tests/Makefile.in 2006-03-24 17:10:37.000000000 +0100
725 +++ misc/build/mozilla/embedding/browser/gtk/tests/Makefile.in 2008-08-14 16:22:21.000000000 +0200
727 TestGtkEmbedNotebook.cpp \
728 TestGtkEmbedSocket.cpp \
729 TestGtkEmbedChild.cpp
732 SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=)
739 --- misc/mozilla/embedding/components/printingui/src/mac/printpde/Makefile.in 2005-06-20 21:24:51.000000000 +0200
740 +++ misc/build/mozilla/embedding/components/printingui/src/mac/printpde/Makefile.in 2009-02-19 13:11:39.000000000 +0100
745 -ABS_topsrcdir := $(shell cd $(topsrcdir); pwd)
746 -ifneq ($(ABS_topsrcdir),$(MOZ_BUILD_ROOT))
748 - rsync -a --exclude .DS_Store --exclude "CVS/" $(srcdir)/$(PROJECT) .
749 - ln -fs $(srcdir)/src
750 - ln -fs $(srcdir)/res
751 - ln -fs $(srcdir)/public
752 - ln -fs $(srcdir)/Info-*.plist .
756 # Bug 297227: The next line doesn't need to stay around forever, only
757 # long enough to clean up existing depend builds from when xcodebuild
758 # was being instructed to "install"
759 if test -e build/UninstalledProducts ; then $(MAKE) clean ; rm -rf $(DIST)/package/PrintPDE.plugin ; fi
761 - $(PBBUILD) $(PROJECT_ARG) -target PrintPDE -buildstyle $(BUILDSTYLE) $(PBBUILD_ARG)
762 - mkdir -p $(DIST)/package
763 - $(INSTALL) $(XCODE_PRODUCT_DIR)/PrintPDE.plugin $(DIST)/package
764 +# $(PBBUILD) $(PROJECT_ARG) -target PrintPDE -buildstyle $(BUILDSTYLE) $(PBBUILD_ARG)
765 +# mkdir -p $(DIST)/package
766 +# $(INSTALL) $(XCODE_PRODUCT_DIR)/PrintPDE.plugin $(DIST)/package
770 --- misc/mozilla/embedding/config/Makefile.in 2007-10-08 21:08:15.000000000 +0200
771 +++ misc/build/mozilla/embedding/config/Makefile.in 2008-08-14 16:22:21.000000000 +0200
773 $(NSINSTALL) -t $(srcdir)/installed-chrome.txt $(DIST)/Embed/chrome
774 $(NSINSTALL) -t $(srcdir)/readme.html $(DIST)/Embed
776 - -$(NSINSTALL) -t $(DEPTH)/embedding/lite/$(LIB_PREFIX)embed_lite$(DLL_SUFFIX) $(DIST)/Embed/components
777 + -$(NSINSTALL) -t $(DEPTH)/embedding/lite/$(DLL_PREFIX)embed_lite$(DLL_SUFFIX) $(DIST)/Embed/components
779 ifeq ($(OS_ARCH),WINNT)
780 ifeq ($(WINAPP),mfcembed)
781 --- misc/mozilla/extensions/pref/autoconfig/src/Makefile.in 2006-02-03 15:41:09.000000000 +0100
782 +++ misc/build/mozilla/extensions/pref/autoconfig/src/Makefile.in 2008-08-14 16:22:21.000000000 +0200
787 -EXTRA_DSO_LDOPTS = \
788 +EXTRA_DSO_LDOPTS += \
791 $(MOZ_COMPONENT_LIBS) \
792 --- misc/mozilla/extensions/sql/build/Makefile.in 2004-11-29 18:39:08.000000000 +0100
793 +++ misc/build/mozilla/extensions/sql/build/Makefile.in 2008-08-18 14:03:04.000000000 +0200
795 bin/components/sqlpgsql.xpt \
796 bin/components/sqlsqlite.xpt \
797 bin/components/sqlmysql.xpt \
798 - bin/components/$(LIB_PREFIX)sql$(DLL_SUFFIX) \
799 + bin/components/$(DLL_PREFIX)sql$(DLL_SUFFIX) \
801 --- misc/mozilla/gfx/idl/nsIFreeType2.idl 2004-04-16 01:30:02.000000000 +0200
802 +++ misc/build/mozilla/gfx/idl/nsIFreeType2.idl 2008-08-14 16:22:21.000000000 +0200
804 native FT_Sfnt_Tag(FT_Sfnt_Tag);
805 native FT_Size(FT_Size);
807 -[ptr] native FTC_Image_Desc_p(FTC_Image_Desc);
808 +[ptr] native FTC_ImageType_p(FTC_ImageType);
809 native FTC_Face_Requester(FTC_Face_Requester);
810 native FTC_Font(FTC_Font);
811 -native FTC_Image_Cache(FTC_Image_Cache);
812 +native FTC_FaceID(FTC_FaceID);
813 +native FTC_ImageCache(FTC_ImageCache);
814 native FTC_Manager(FTC_Manager);
819 readonly attribute FT_Library library;
820 readonly attribute FTC_Manager FTCacheManager;
821 - readonly attribute FTC_Image_Cache ImageCache;
822 + readonly attribute FTC_ImageCache ImageCache;
824 void doneFace(in FT_Face face);
825 void doneFreeType(in FT_Library lib);
826 @@ -115,16 +116,16 @@
827 void outlineDecompose(in FT_Outline_p outline,
828 in const_FT_Outline_Funcs_p funcs, in voidPtr p);
829 void setCharmap(in FT_Face face, in FT_CharMap charmap);
830 - void imageCacheLookup(in FTC_Image_Cache cache, in FTC_Image_Desc_p desc,
831 + void imageCacheLookup(in FTC_ImageCache cache, in FTC_ImageType_p desc,
832 in FT_UInt gindex, out FT_Glyph glyph);
833 - void managerLookupSize(in FTC_Manager manager, in FTC_Font font,
834 - out FT_Face face, out FT_Size size);
835 + void managerLookupFace(in FTC_Manager manager, in FTC_FaceID face_id,
837 void managerDone(in FTC_Manager manager);
838 void managerNew(in FT_Library lib, in FT_UInt max_faces,
839 in FT_UInt max_sizes, in FT_ULong max_bytes,
840 in FTC_Face_Requester requester, in FT_Pointer req_data,
841 out FTC_Manager manager);
842 - void imageCacheNew(in FTC_Manager manager, out FTC_Image_Cache cache);
843 + void imageCacheNew(in FTC_Manager manager, out FTC_ImageCache cache);
845 void glyphTransform(in FT_Glyph glyph, in FT_Matrix_p matrix,
846 in FT_Vector_p delta);
847 --- misc/mozilla/gfx/src/freetype/nsFreeType.cpp 2005-07-13 20:21:10.000000000 +0200
848 +++ misc/build/mozilla/gfx/src/freetype/nsFreeType.cpp 2008-08-14 16:22:21.000000000 +0200
850 {"FT_Outline_Decompose", NS_FT2_OFFSET(nsFT_Outline_Decompose), PR_TRUE},
851 {"FT_Set_Charmap", NS_FT2_OFFSET(nsFT_Set_Charmap), PR_TRUE},
852 {"FTC_Image_Cache_Lookup", NS_FT2_OFFSET(nsFTC_Image_Cache_Lookup), PR_TRUE},
853 - {"FTC_Manager_Lookup_Size", NS_FT2_OFFSET(nsFTC_Manager_Lookup_Size), PR_TRUE},
854 + {"FTC_Manager_LookupFace", NS_FT2_OFFSET(nsFTC_Manager_LookupFace), PR_TRUE},
855 {"FTC_Manager_Done", NS_FT2_OFFSET(nsFTC_Manager_Done), PR_TRUE},
856 {"FTC_Manager_New", NS_FT2_OFFSET(nsFTC_Manager_New), PR_TRUE},
857 {"FTC_Image_Cache_New", NS_FT2_OFFSET(nsFTC_Image_Cache_New), PR_TRUE},
862 -nsFreeType2::ImageCacheLookup(FTC_Image_Cache cache, FTC_Image_Desc *desc,
863 +nsFreeType2::ImageCacheLookup(FTC_ImageCache cache, FTC_ImageType *desc,
864 FT_UInt glyphID, FT_Glyph *glyph)
866 // call the FreeType2 function via the function pointer
867 @@ -297,11 +297,11 @@
871 -nsFreeType2::ManagerLookupSize(FTC_Manager manager, FTC_Font font,
872 - FT_Face *face, FT_Size *size)
873 +nsFreeType2::ManagerLookupFace(FTC_Manager manager, FTC_FaceID font,
876 // call the FreeType2 function via the function pointer
877 - FT_Error error = nsFTC_Manager_Lookup_Size(manager, font, face, size);
878 + FT_Error error = nsFTC_Manager_LookupFace(manager, font, face);
879 return error ? NS_ERROR_FAILURE : NS_OK;
886 -nsFreeType2::ImageCacheNew(FTC_Manager manager, FTC_Image_Cache *cache)
887 +nsFreeType2::ImageCacheNew(FTC_Manager manager, FTC_ImageCache *cache)
889 // call the FreeType2 function via the function pointer
890 FT_Error error = nsFTC_Image_Cache_New(manager, cache);
895 -nsFreeType2::GetImageCache(FTC_Image_Cache *aCache)
896 +nsFreeType2::GetImageCache(FTC_ImageCache *aCache)
898 *aCache = mImageCache;
900 --- misc/mozilla/gfx/src/freetype/nsFreeType.h 2005-05-01 19:36:19.000000000 +0200
901 +++ misc/build/mozilla/gfx/src/freetype/nsFreeType.h 2008-08-14 16:22:21.000000000 +0200
902 @@ -120,13 +120,13 @@
903 typedef FT_Error (*FT_New_Face_t)(FT_Library, const char*, FT_Long, FT_Face*);
904 typedef FT_Error (*FT_Set_Charmap_t)(FT_Face face, FT_CharMap charmap);
905 typedef FT_Error (*FTC_Image_Cache_Lookup_t)
906 - (FTC_Image_Cache, FTC_Image_Desc*, FT_UInt, FT_Glyph*);
907 -typedef FT_Error (*FTC_Manager_Lookup_Size_t)
908 - (FTC_Manager, FTC_Font, FT_Face*, FT_Size*);
909 + (FTC_ImageCache, FTC_ImageType*, FT_UInt, FT_Glyph*);
910 +typedef FT_Error (*FTC_Manager_LookupFace_t)
911 + (FTC_Manager, FTC_FaceID, FT_Face*);
912 typedef FT_Error (*FTC_Manager_Done_t)(FTC_Manager);
913 typedef FT_Error (*FTC_Manager_New_t)(FT_Library, FT_UInt, FT_UInt, FT_ULong,
914 FTC_Face_Requester, FT_Pointer, FTC_Manager*);
915 -typedef FT_Error (*FTC_Image_Cache_New_t)(FTC_Manager, FTC_Image_Cache*);
916 +typedef FT_Error (*FTC_Image_Cache_New_t)(FTC_Manager, FTC_ImageCache*);
918 typedef FT_Error (*FT_Glyph_Transform_t)(FT_Glyph, FT_Matrix*, FT_Vector*);
919 typedef FT_Error (*FT_Get_Kerning_t)
921 FT_Outline_Decompose_t nsFT_Outline_Decompose;
922 FT_Set_Charmap_t nsFT_Set_Charmap;
923 FTC_Image_Cache_Lookup_t nsFTC_Image_Cache_Lookup;
924 - FTC_Manager_Lookup_Size_t nsFTC_Manager_Lookup_Size;
925 + FTC_Manager_LookupFace_t nsFTC_Manager_LookupFace;
926 FTC_Manager_Done_t nsFTC_Manager_Done;
927 FTC_Manager_New_t nsFTC_Manager_New;
928 FTC_Image_Cache_New_t nsFTC_Image_Cache_New;
930 PRLibrary *mSharedLib;
931 FT_Library mFreeTypeLibrary;
932 FTC_Manager mFTCacheManager;
933 - FTC_Image_Cache mImageCache;
934 + FTC_ImageCache mImageCache;
936 static nsHashtable *sFontFamilies;
937 static nsHashtable *sRange1CharSetNames;
938 --- misc/mozilla/gfx/src/gtk/Makefile.in 2006-07-20 07:12:33.000000000 +0200
939 +++ misc/build/mozilla/gfx/src/gtk/Makefile.in 2008-08-14 16:22:21.000000000 +0200
941 CXXFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS)
942 CFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS)
944 +ifeq ($(OS_ARCH), Darwin)
945 +EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS)
948 ifeq ($(OS_ARCH), SunOS)
950 # When using Sun's WorkShop compiler, including
951 --- misc/mozilla/gfx/src/ps/nsFontMetricsPS.cpp 2006-12-22 14:51:16.000000000 +0100
952 +++ misc/build/mozilla/gfx/src/ps/nsFontMetricsPS.cpp 2008-08-14 16:22:21.000000000 +0200
953 @@ -1870,10 +1870,10 @@
955 mPixelSize = NSToIntRound(app2dev * mFont->size);
957 - mImageDesc.font.face_id = (void*)mEntry;
958 - mImageDesc.font.pix_width = mPixelSize;
959 - mImageDesc.font.pix_height = mPixelSize;
960 - mImageDesc.image_type = 0;
961 + mImageDesc->face_id = (FTC_FaceID)&mEntry;
962 + mImageDesc->width = mPixelSize;
963 + mImageDesc->height = mPixelSize;
964 + mImageDesc->flags = 0;
967 mFt2 = do_GetService(NS_FREETYPE2_CONTRACTID, &rv);
968 @@ -1907,7 +1907,7 @@
972 - FTC_Image_Cache iCache;
973 + FTC_ImageCache iCache;
974 nsresult rv = mFt2->GetImageCache(&iCache);
976 NS_ERROR("Failed to get Image Cache");
977 @@ -1945,8 +1945,8 @@
979 FTC_Manager cManager;
980 mFt2->GetFTCacheManager(&cManager);
981 - nsresult rv = mFt2->ManagerLookupSize(cManager, &mImageDesc.font,
983 + nsresult rv = mFt2->ManagerLookupFace(cManager, mImageDesc->face_id,
985 NS_ASSERTION(rv==0, "failed to get face/size");
988 @@ -2392,16 +2392,16 @@
989 mEntry->GetFamilyName(fontName);
990 mEntry->GetStyleName(styleName);
992 - mImageDesc.font.face_id = (void*)mEntry;
993 + mImageDesc->face_id = (FTC_FaceID)&mEntry;
994 // TT glyph has no relation to size
995 - mImageDesc.font.pix_width = 16;
996 - mImageDesc.font.pix_height = 16;
997 - mImageDesc.image_type = 0;
998 + mImageDesc->width = 16;
999 + mImageDesc->height = 16;
1000 + mImageDesc->flags = 0;
1001 FT_Face face = nsnull;
1002 FTC_Manager cManager;
1003 mFt2->GetFTCacheManager(&cManager);
1004 - nsresult rv = mFt2->ManagerLookupSize(cManager, &mImageDesc.font,
1006 + nsresult rv = mFt2->ManagerLookupFace(cManager, mImageDesc->face_id,
1011 --- misc/mozilla/gfx/src/ps/nsFontMetricsPS.h 2005-06-28 20:29:10.000000000 +0200
1012 +++ misc/build/mozilla/gfx/src/ps/nsFontMetricsPS.h 2008-08-20 15:42:50.000000000 +0200
1014 nsCOMPtr<nsITrueTypeFontCatalogEntry> mFaceID;
1015 nsCOMPtr<nsIFreeType2> mFt2;
1016 PRUint16 mPixelSize;
1017 - FTC_Image_Desc mImageDesc;
1018 + FTC_ImageType mImageDesc;
1019 nsCString mFontNameBase; // the base name of type 1 (sub) fonts
1024 nsCOMPtr<nsITrueTypeFontCatalogEntry> mEntry;
1025 nsCOMPtr<nsIFreeType2> mFt2;
1026 - FTC_Image_Desc mImageDesc;
1027 + FTC_ImageType mImageDesc;
1029 #endif // MOZ_ENABLE_FREETYPE2
1030 #endif // MOZ_ENABLE_XFT
1031 --- misc/mozilla/gfx/src/x11shared/nsFontFreeType.cpp 2004-04-17 23:52:34.000000000 +0200
1032 +++ misc/build/mozilla/gfx/src/x11shared/nsFontFreeType.cpp 2008-08-14 16:22:21.000000000 +0200
1036 mFt2->GetFTCacheManager(&mgr);
1037 - rv = mFt2->ManagerLookupSize(mgr, &mImageDesc.font, &face, nsnull);
1038 + rv = mFt2->ManagerLookupFace(mgr, mImageDesc->face_id, &face);
1039 NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get face/size");
1042 @@ -191,22 +191,15 @@
1043 PRBool embedded_bimap = PR_FALSE;
1045 mPixelSize = aPixelSize;
1046 - mImageDesc.font.face_id = (void*)mFaceID;
1047 - mImageDesc.font.pix_width = aPixelSize;
1048 - mImageDesc.font.pix_height = aPixelSize;
1049 - mImageDesc.image_type = 0;
1050 + mImageDesc->face_id = (FTC_FaceID)&mFaceID;
1051 + mImageDesc->width = aPixelSize;
1052 + mImageDesc->height = aPixelSize;
1053 + mImageDesc->flags = 0;
1055 if (aPixelSize < nsFreeType2::gAntiAliasMinimum) {
1056 - mImageDesc.image_type |= ftc_image_mono;
1057 anti_alias = PR_FALSE;
1060 - if (nsFreeType2::gFreeType2Autohinted)
1061 - mImageDesc.image_type |= ftc_image_flag_autohinted;
1063 - if (nsFreeType2::gFreeType2Unhinted)
1064 - mImageDesc.image_type |= ftc_image_flag_unhinted;
1066 PRUint32 num_embedded_bitmaps, i;
1067 PRInt32* embedded_bitmapheights;
1068 mFaceID->GetEmbeddedBitmapHeights(&num_embedded_bitmaps,
1070 if (embedded_bitmapheights[i] == aPixelSize) {
1071 embedded_bimap = PR_TRUE;
1072 // unhinted must be set for embedded bitmaps to be used
1073 - mImageDesc.image_type |= ftc_image_flag_unhinted;
1079 return NS_ERROR_FAILURE;
1081 - FTC_Image_Cache icache;
1082 + FTC_ImageCache icache;
1083 mFt2->GetImageCache(&icache);
1085 return NS_ERROR_FAILURE;
1090 - FTC_Image_Cache icache;
1091 + FTC_ImageCache icache;
1092 mFt2->GetImageCache(&icache);
1096 if (y%4==0) (*blendPixelFunc)(sub_image, y, ascent-1, black, 255/2);
1099 - FTC_Image_Cache icache;
1100 + FTC_ImageCache icache;
1101 mFt2->GetImageCache(&icache);
1104 --- misc/mozilla/gfx/src/x11shared/nsFontFreeType.h 2004-04-17 23:52:34.000000000 +0200
1105 +++ misc/build/mozilla/gfx/src/x11shared/nsFontFreeType.h 2008-08-14 16:22:21.000000000 +0200
1107 XImage *GetXImage(PRUint32 width, PRUint32 height);
1108 nsITrueTypeFontCatalogEntry *mFaceID;
1109 PRUint16 mPixelSize;
1110 - FTC_Image_Desc mImageDesc;
1111 + FTC_ImageType mImageDesc;
1112 nsCOMPtr<nsIFreeType2> mFt2;
1115 --- misc/mozilla/jpeg/jmorecfg.h 2004-12-12 01:57:39.000000000 +0100
1116 +++ misc/build/mozilla/jpeg/jmorecfg.h 2008-08-18 09:06:05.000000000 +0200
1118 /* Defines for MMX/SSE2 support. */
1120 #if defined(XP_WIN32) && defined(_M_IX86) && !defined(__GNUC__)
1121 -#define HAVE_MMX_INTEL_MNEMONICS
1122 +//#define HAVE_MMX_INTEL_MNEMONICS
1124 /* SSE2 code appears broken for some cpus (bug 247437) */
1125 /* #define HAVE_SSE2_INTEL_MNEMONICS */
1126 --- misc/mozilla/layout/svg/renderer/src/libart/nsSVGLibartGlyphMetricsFT.cpp 2006-03-16 18:09:14.000000000 +0100
1127 +++ misc/build/mozilla/layout/svg/renderer/src/libart/nsSVGLibartGlyphMetricsFT.cpp 2008-08-14 16:22:21.000000000 +0200
1128 @@ -423,19 +423,19 @@
1132 - FTC_Image_Desc imageDesc;
1133 - imageDesc.font.face_id=(void*)font_data.font_entry.get(); // XXX do we need to addref?
1134 + FTC_ImageType imageDesc;
1135 + imageDesc->face_id=(FTC_FaceID)font_data.font_entry.get(); // XXX do we need to addref?
1136 float twipstopixel = GetTwipsToPixels();
1137 float scale = GetPixelScale();
1138 - imageDesc.font.pix_width = (int)((float)(font_data.font.size)*twipstopixel/scale);
1139 - imageDesc.font.pix_height = (int)((float)(font_data.font.size)*twipstopixel/scale);
1140 - imageDesc.image_type |= ftc_image_grays;
1141 + imageDesc->width = (int)((float)(font_data.font.size)*twipstopixel/scale);
1142 + imageDesc->height = (int)((float)(font_data.font.size)*twipstopixel/scale);
1143 + imageDesc->flags |= /* ftc_image_grays */0;
1148 nsSVGLibartFreetype::ft2->GetFTCacheManager(&mgr);
1149 - rv = nsSVGLibartFreetype::ft2->ManagerLookupSize(mgr, &imageDesc.font, &mFace, nsnull);
1150 + rv = nsSVGLibartFreetype::ft2->ManagerLookupFace(mgr, imageDesc->face_id, &mFace);
1151 NS_ASSERTION(mFace, "failed to get face/size");
1154 --- misc/mozilla/mailnews/addrbook/src/Makefile.in 2007-05-03 03:39:37.000000000 +0200
1155 +++ misc/build/mozilla/mailnews/addrbook/src/Makefile.in 2008-10-16 12:59:35.000000000 +0200
1159 nsMsgVCardService.cpp \
1161 nsAbLDIFService.cpp \
1166 nsAbCardProperty.h \
1167 nsAbMDBCardProperty.h \
1170 + nsAbAddressCollecter.h \
1171 + nsAbDirectoryQuery.h \
1174 ifeq ($(OS_ARCH),WINNT)
1175 --- misc/mozilla/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.h 2005-05-11 06:16:53.000000000 +0200
1176 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.h 2008-08-14 16:22:21.000000000 +0200
1178 #include "nsIAbBooleanExpression.h"
1179 #include "nsCOMPtr.h"
1180 #include "nsString.h"
1181 +#include "nsAbUtils.h"
1183 class nsIAbLDAPAttributeMap;
1186 nsIAbBooleanConditionString* condition,
1189 + static void GenerateMultipleFilter(
1190 + nsAbBooleanConditionType conditionType,
1191 + nsCString& filter,
1192 + NS_ConvertUCS2toUTF8 &vUTF8,
1193 + CharPtrArrayGuard *pAttrs);
1194 + static void GenerateSingleFilter(
1195 + nsAbBooleanConditionType conditionType,
1196 + nsCString& filter,
1197 + NS_ConvertUCS2toUTF8 &vUTF8,
1198 + const char *ldapProperty);
1202 --- misc/mozilla/mailnews/addrbook/src/nsAbLDAPDirectory.cpp 2007-02-18 23:18:13.000000000 +0100
1203 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbLDAPDirectory.cpp 2008-08-20 12:16:50.000000000 +0200
1204 @@ -126,11 +126,13 @@
1206 // use mURINoQuery to get a prefName
1207 nsCAutoString prefName;
1208 - prefName = nsDependentCString(mURINoQuery.get() + kLDAPDirectoryRootLen) + NS_LITERAL_CSTRING(".uri");
1209 + prefName = nsDependentCString(mURINoQuery.get() + kLDAPDirectoryRootLen);
1211 // turn moz-abldapdirectory://ldap_2.servers.nscpphonebook into -> "ldap_2.servers.nscpphonebook.uri"
1213 - rv = prefs->GetCharPref(prefName.get(), getter_Copies(URI));
1214 + nsCAutoString uriPrefName;
1215 + uriPrefName = prefName + NS_LITERAL_CSTRING(".uri");
1216 + rv = prefs->GetCharPref(uriPrefName.get(), getter_Copies(URI));
1220 @@ -154,6 +156,27 @@
1221 nsCAutoString tempLDAPURL(mURINoQuery);
1222 tempLDAPURL.ReplaceSubstring("moz-abldapdirectory:", "ldap:");
1223 rv = mURL->SetSpec(tempLDAPURL);
1224 + NS_ENSURE_SUCCESS(rv,rv);
1226 + nsCAutoString aHost;
1227 + mURL->GetHost(aHost);
1228 + aHost.ReplaceChar('.','_');
1229 + prefName = nsDependentCString("ldap_2.servers.") + aHost;
1231 + rv = prefs->GetBoolPref(
1232 + PromiseFlatCString(prefName
1233 + + NS_LITERAL_CSTRING(".UseSSL")).get(),
1237 + // If use SSL,ldap url will look like this ldaps://host:port/.....
1238 + if (!NS_FAILED(rv) && useSSL)
1240 + tempLDAPURL.ReplaceSubstring("ldap:", "ldaps:");
1241 + rv = mURL->SetSpec(tempLDAPURL);
1243 + //NS_FAILED(rv) means ldap_2.servers.nscpphonebook.UseSSL not exist
1248 @@ -164,24 +187,29 @@
1249 // get the login information, if there is any
1251 rv = prefs->GetCharPref(
1252 - PromiseFlatCString(
1253 - Substring(mURINoQuery, kLDAPDirectoryRootLen,
1254 - mURINoQuery.Length() - kLDAPDirectoryRootLen)
1255 + PromiseFlatCString(prefName
1256 + NS_LITERAL_CSTRING(".auth.dn")).get(),
1257 getter_Copies(mLogin));
1258 if (NS_FAILED(rv)) {
1259 mLogin.Truncate(); // zero out mLogin
1262 + // get the password information, if there is any
1264 + rv = prefs->GetCharPref(
1265 + PromiseFlatCString(prefName
1266 + + NS_LITERAL_CSTRING(".auth.pwd")).get(),
1267 + getter_Copies(mPassword));
1268 + if (NS_FAILED(rv)) {
1269 + mPassword.Truncate(); // zero out mLogin
1271 // get the protocol version, if there is any. using a string pref
1272 // here instead of an int, as protocol versions sometimes have names like
1275 nsXPIDLCString protocolVersion;
1276 rv = prefs->GetCharPref(
1277 - PromiseFlatCString(
1278 - Substring(mURINoQuery, kLDAPDirectoryRootLen,
1279 - mURINoQuery.Length() - kLDAPDirectoryRootLen)
1280 + PromiseFlatCString(prefName
1281 + NS_LITERAL_CSTRING(".protocolVersion")).get(),
1282 getter_Copies(protocolVersion));
1284 --- misc/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp 2006-12-22 14:51:38.000000000 +0100
1285 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp 2008-08-20 15:01:16.000000000 +0200
1287 PRInt32 resultLimit = -1,
1288 PRInt32 timeOut = 0);
1289 virtual ~nsAbQueryLDAPMessageListener ();
1291 + void SetPassword(const nsAString& aPassword){m_sPassword = aPassword;};
1293 nsresult OnLDAPMessageBind (nsILDAPMessage *aMessage);
1294 nsresult OnLDAPMessageSearchEntry (nsILDAPMessage *aMessage,
1297 PRBool mWaitingForPrevQueryToFinish;
1299 + nsAutoString m_sPassword;
1301 nsCOMPtr<nsILDAPOperation> mSearchOperation;
1306 // If mLogin is set, we're expected to use it to get a password.
1308 - if (!mDirectoryQuery->mLogin.IsEmpty()) {
1309 + if (!mDirectoryQuery->mLogin.IsEmpty() && !m_sPassword.Length()) {
1310 // XXX hack until nsUTF8AutoString exists
1311 #define nsUTF8AutoString nsCAutoString
1312 nsUTF8AutoString spec;
1313 @@ -415,10 +417,13 @@
1314 rv = ldapOperation->Init(mConnection, proxyListener, nsnull);
1315 NS_ENSURE_SUCCESS(rv, rv);
1318 - rv = ldapOperation->SimpleBind(NS_ConvertUCS2toUTF8(passwd));
1321 + if (m_sPassword.Length())
1322 + rv = ldapOperation->SimpleBind(NS_ConvertUCS2toUTF8(m_sPassword));
1324 + rv = ldapOperation->SimpleBind(NS_ConvertUCS2toUTF8(passwd));
1325 NS_ENSURE_SUCCESS(rv, rv);
1331 rv = getLdapReturnAttributes (arguments, returnAttributes);
1332 NS_ENSURE_SUCCESS(rv, rv);
1337 nsCOMPtr<nsISupports> supportsExpression;
1338 rv = arguments->GetExpression (getter_AddRefs (supportsExpression));
1339 @@ -828,6 +833,10 @@
1342 msgListener->mUrl = url;
1343 + msgListener->mQueryListener = listener;
1344 + msgListener->mResultLimit = resultLimit;
1345 + msgListener->mTimeOut = timeOut;
1346 + msgListener->mQueryArguments = arguments;
1347 return msgListener->DoSearch();
1350 @@ -845,6 +854,11 @@
1352 if (_messageListener == NULL)
1353 return NS_ERROR_OUT_OF_MEMORY;
1355 + nsAutoString wPassword;
1356 + wPassword.AssignWithConversion(mPassword.get());
1357 + _messageListener->SetPassword(wPassword);
1359 mListener = _messageListener;
1362 --- misc/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.h 2004-07-24 21:50:29.000000000 +0200
1363 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.h 2008-08-14 16:22:21.000000000 +0200
1365 friend class nsAbQueryLDAPMessageListener;
1366 nsresult Initiate ();
1367 nsXPIDLCString mLogin; // authenticate to the LDAP server as...
1368 + nsXPIDLCString mPassword; // password to the LDAP server as...
1369 nsCOMPtr<nsILDAPURL> mDirectoryUrl; // the URL for the server
1370 PRUint32 mProtocolVersion; // version of LDAP (see nsILDAPConnection.idl)
1372 --- misc/mozilla/mailnews/addrbook/src/nsAbMD5sum.cpp 2008-08-14 16:30:14.000000000 +0200
1373 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbMD5sum.cpp 2008-08-14 16:22:21.000000000 +0200
1377 + * The contents of this file are subject to the Mozilla Public
1378 + * License Version 1.1 (the "License"); you may not use this file
1379 + * except in compliance with the License. You may obtain a copy of
1380 + * the License at http://www.mozilla.org/MPL/
1382 + * Software distributed under the License is distributed on an "AS
1383 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
1384 + * implied. See the License for the specific language governing
1385 + * rights and limitations under the License.
1387 + * The Original Code is the Netscape security libraries.
1389 + * The Initial Developer of the Original Code is Netscape
1390 + * Communications Corporation. Portions created by Netscape are
1391 + * Copyright (C) 1994-2000 Netscape Communications Corporation. All
1392 + * Rights Reserved.
1396 + * Alternatively, the contents of this file may be used under the
1397 + * terms of the GNU General Public License Version 2 or later (the
1398 + * "GPL"), in which case the provisions of the GPL are applicable
1399 + * instead of those above. If you wish to allow use of your
1400 + * version of this file only under the terms of the GPL and not to
1401 + * allow others to use your version of this file under the MPL,
1402 + * indicate your decision by deleting the provisions above and
1403 + * replace them with the notice and other provisions required by
1404 + * the GPL. If you do not delete the provisions above, a recipient
1405 + * may use your version of this file under either the MPL or the
1409 +#include <stdlib.h>
1413 +#include "prtypes.h"
1414 +#include "prlong.h"
1416 +#include "nsMemory.h"
1418 +#define MD5_HASH_LEN 16
1419 +#define MD5_BUFFER_SIZE 64
1420 +#define MD5_END_BUFFER (MD5_BUFFER_SIZE - 8)
1422 +#define CV0_1 0x67452301
1423 +#define CV0_2 0xefcdab89
1424 +#define CV0_3 0x98badcfe
1425 +#define CV0_4 0x10325476
1427 +#define T1_0 0xd76aa478
1428 +#define T1_1 0xe8c7b756
1429 +#define T1_2 0x242070db
1430 +#define T1_3 0xc1bdceee
1431 +#define T1_4 0xf57c0faf
1432 +#define T1_5 0x4787c62a
1433 +#define T1_6 0xa8304613
1434 +#define T1_7 0xfd469501
1435 +#define T1_8 0x698098d8
1436 +#define T1_9 0x8b44f7af
1437 +#define T1_10 0xffff5bb1
1438 +#define T1_11 0x895cd7be
1439 +#define T1_12 0x6b901122
1440 +#define T1_13 0xfd987193
1441 +#define T1_14 0xa679438e
1442 +#define T1_15 0x49b40821
1444 +#define T2_0 0xf61e2562
1445 +#define T2_1 0xc040b340
1446 +#define T2_2 0x265e5a51
1447 +#define T2_3 0xe9b6c7aa
1448 +#define T2_4 0xd62f105d
1449 +#define T2_5 0x02441453
1450 +#define T2_6 0xd8a1e681
1451 +#define T2_7 0xe7d3fbc8
1452 +#define T2_8 0x21e1cde6
1453 +#define T2_9 0xc33707d6
1454 +#define T2_10 0xf4d50d87
1455 +#define T2_11 0x455a14ed
1456 +#define T2_12 0xa9e3e905
1457 +#define T2_13 0xfcefa3f8
1458 +#define T2_14 0x676f02d9
1459 +#define T2_15 0x8d2a4c8a
1461 +#define T3_0 0xfffa3942
1462 +#define T3_1 0x8771f681
1463 +#define T3_2 0x6d9d6122
1464 +#define T3_3 0xfde5380c
1465 +#define T3_4 0xa4beea44
1466 +#define T3_5 0x4bdecfa9
1467 +#define T3_6 0xf6bb4b60
1468 +#define T3_7 0xbebfbc70
1469 +#define T3_8 0x289b7ec6
1470 +#define T3_9 0xeaa127fa
1471 +#define T3_10 0xd4ef3085
1472 +#define T3_11 0x04881d05
1473 +#define T3_12 0xd9d4d039
1474 +#define T3_13 0xe6db99e5
1475 +#define T3_14 0x1fa27cf8
1476 +#define T3_15 0xc4ac5665
1478 +#define T4_0 0xf4292244
1479 +#define T4_1 0x432aff97
1480 +#define T4_2 0xab9423a7
1481 +#define T4_3 0xfc93a039
1482 +#define T4_4 0x655b59c3
1483 +#define T4_5 0x8f0ccc92
1484 +#define T4_6 0xffeff47d
1485 +#define T4_7 0x85845dd1
1486 +#define T4_8 0x6fa87e4f
1487 +#define T4_9 0xfe2ce6e0
1488 +#define T4_10 0xa3014314
1489 +#define T4_11 0x4e0811a1
1490 +#define T4_12 0xf7537e82
1491 +#define T4_13 0xbd3af235
1492 +#define T4_14 0x2ad7d2bb
1493 +#define T4_15 0xeb86d391
1583 +struct MD5ContextStr {
1584 + PRUint32 lsbInput;
1585 + PRUint32 msbInput;
1592 +typedef struct MD5ContextStr MD5Context;
1596 +int MD5_Hash(unsigned char *dest, const char *src);
1597 +int MD5_HashBuf(unsigned char *dest, const unsigned char *src, uint32 src_length);
1598 +MD5Context * MD5_NewContext(void);
1599 +void MD5_DestroyContext(MD5Context *cx, PRBool freeit);
1600 +void MD5_Begin(MD5Context *cx);
1601 +static void md5_compress(MD5Context *cx);
1602 +void MD5_Update(MD5Context *cx, const unsigned char *input, unsigned int inputLen);
1603 +void MD5_End(MD5Context *cx, unsigned char *digest,
1604 + unsigned int *digestLen, unsigned int maxDigestLen);
1605 +unsigned int MD5_FlattenSize(MD5Context *cx);
1606 +int MD5_Flatten(MD5Context *cx, unsigned char *space);
1607 +MD5Context * MD5_Resurrect(unsigned char *space, void *arg);
1608 +void MD5_TraceState(MD5Context *cx);
1611 +MD5_Hash(unsigned char *dest, const char *src)
1613 + return MD5_HashBuf(dest, (unsigned char *)src, PL_strlen(src));
1617 +MD5_HashBuf(unsigned char *dest, const unsigned char *src, uint32 src_length)
1620 + MD5Context *cx = MD5_NewContext();
1622 +// PORT_SetError(PR_OUT_OF_MEMORY_ERROR);
1626 + MD5_Update(cx, src, src_length);
1627 + MD5_End(cx, dest, &len, MD5_HASH_LEN);
1628 + MD5_DestroyContext(cx, PR_TRUE);
1633 +MD5_NewContext(void)
1635 + MD5Context *cx = (MD5Context *)malloc(sizeof(MD5Context));
1637 +// PORT_SetError(PR_OUT_OF_MEMORY_ERROR);
1644 +MD5_DestroyContext(MD5Context *cx, PRBool freeit)
1652 +MD5_Begin(MD5Context *cx)
1656 + memset(cx->inBuf, 0, sizeof(cx->inBuf));
1657 + cx->cv[0] = CV0_1;
1658 + cx->cv[1] = CV0_2;
1659 + cx->cv[2] = CV0_3;
1660 + cx->cv[3] = CV0_4;
1663 +#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
1665 +#define MASK 0x00ff00ff
1666 +#ifdef IS_LITTLE_ENDIAN
1667 +#define lendian(i32) \
1670 +#define lendian(i32) \
1671 + (tmp = i32 >> 16 | i32 << 16, (tmp & MASK) << 8 | tmp >> 8 & MASK)
1674 +#if defined(SOLARIS) || defined(HPUX)
1675 +#define addto64(sumhigh, sumlow, addend) \
1676 + sumlow += addend; sumhigh += (sumlow < addend);
1678 +#define addto64(sumhigh, sumlow, addend) \
1679 + sumlow += addend; if (sumlow < addend) ++sumhigh;
1682 +#define F(X, Y, Z) \
1683 + ((X & Y) | ((~X) & Z))
1685 +#define G(X, Y, Z) \
1686 + ((X & Z) | (Y & (~Z)))
1688 +#define H(X, Y, Z) \
1691 +#define I(X, Y, Z) \
1694 +#define FF(a, b, c, d, bufint, s, ti) \
1695 + a = b + cls(a + F(b, c, d) + bufint + ti, s)
1697 +#define GG(a, b, c, d, bufint, s, ti) \
1698 + a = b + cls(a + G(b, c, d) + bufint + ti, s)
1700 +#define HH(a, b, c, d, bufint, s, ti) \
1701 + a = b + cls(a + H(b, c, d) + bufint + ti, s)
1703 +#define II(a, b, c, d, bufint, s, ti) \
1704 + a = b + cls(a + I(b, c, d) + bufint + ti, s)
1707 +md5_compress(MD5Context *cx)
1709 + PRUint32 a, b, c, d;
1715 +#ifndef IS_LITTLE_ENDIAN
1716 + cx->u.w[0] = lendian(cx->u.w[0]);
1717 + cx->u.w[1] = lendian(cx->u.w[1]);
1718 + cx->u.w[2] = lendian(cx->u.w[2]);
1719 + cx->u.w[3] = lendian(cx->u.w[3]);
1720 + cx->u.w[4] = lendian(cx->u.w[4]);
1721 + cx->u.w[5] = lendian(cx->u.w[5]);
1722 + cx->u.w[6] = lendian(cx->u.w[6]);
1723 + cx->u.w[7] = lendian(cx->u.w[7]);
1724 + cx->u.w[8] = lendian(cx->u.w[8]);
1725 + cx->u.w[9] = lendian(cx->u.w[9]);
1726 + cx->u.w[10] = lendian(cx->u.w[10]);
1727 + cx->u.w[11] = lendian(cx->u.w[11]);
1728 + cx->u.w[12] = lendian(cx->u.w[12]);
1729 + cx->u.w[13] = lendian(cx->u.w[13]);
1730 + cx->u.w[14] = lendian(cx->u.w[14]);
1731 + cx->u.w[15] = lendian(cx->u.w[15]);
1733 + FF(a, b, c, d, cx->u.w[R1B0 ], S1_0, T1_0);
1734 + FF(d, a, b, c, cx->u.w[R1B1 ], S1_1, T1_1);
1735 + FF(c, d, a, b, cx->u.w[R1B2 ], S1_2, T1_2);
1736 + FF(b, c, d, a, cx->u.w[R1B3 ], S1_3, T1_3);
1737 + FF(a, b, c, d, cx->u.w[R1B4 ], S1_0, T1_4);
1738 + FF(d, a, b, c, cx->u.w[R1B5 ], S1_1, T1_5);
1739 + FF(c, d, a, b, cx->u.w[R1B6 ], S1_2, T1_6);
1740 + FF(b, c, d, a, cx->u.w[R1B7 ], S1_3, T1_7);
1741 + FF(a, b, c, d, cx->u.w[R1B8 ], S1_0, T1_8);
1742 + FF(d, a, b, c, cx->u.w[R1B9 ], S1_1, T1_9);
1743 + FF(c, d, a, b, cx->u.w[R1B10], S1_2, T1_10);
1744 + FF(b, c, d, a, cx->u.w[R1B11], S1_3, T1_11);
1745 + FF(a, b, c, d, cx->u.w[R1B12], S1_0, T1_12);
1746 + FF(d, a, b, c, cx->u.w[R1B13], S1_1, T1_13);
1747 + FF(c, d, a, b, cx->u.w[R1B14], S1_2, T1_14);
1748 + FF(b, c, d, a, cx->u.w[R1B15], S1_3, T1_15);
1749 + GG(a, b, c, d, cx->u.w[R2B0 ], S2_0, T2_0);
1750 + GG(d, a, b, c, cx->u.w[R2B1 ], S2_1, T2_1);
1751 + GG(c, d, a, b, cx->u.w[R2B2 ], S2_2, T2_2);
1752 + GG(b, c, d, a, cx->u.w[R2B3 ], S2_3, T2_3);
1753 + GG(a, b, c, d, cx->u.w[R2B4 ], S2_0, T2_4);
1754 + GG(d, a, b, c, cx->u.w[R2B5 ], S2_1, T2_5);
1755 + GG(c, d, a, b, cx->u.w[R2B6 ], S2_2, T2_6);
1756 + GG(b, c, d, a, cx->u.w[R2B7 ], S2_3, T2_7);
1757 + GG(a, b, c, d, cx->u.w[R2B8 ], S2_0, T2_8);
1758 + GG(d, a, b, c, cx->u.w[R2B9 ], S2_1, T2_9);
1759 + GG(c, d, a, b, cx->u.w[R2B10], S2_2, T2_10);
1760 + GG(b, c, d, a, cx->u.w[R2B11], S2_3, T2_11);
1761 + GG(a, b, c, d, cx->u.w[R2B12], S2_0, T2_12);
1762 + GG(d, a, b, c, cx->u.w[R2B13], S2_1, T2_13);
1763 + GG(c, d, a, b, cx->u.w[R2B14], S2_2, T2_14);
1764 + GG(b, c, d, a, cx->u.w[R2B15], S2_3, T2_15);
1765 + HH(a, b, c, d, cx->u.w[R3B0 ], S3_0, T3_0);
1766 + HH(d, a, b, c, cx->u.w[R3B1 ], S3_1, T3_1);
1767 + HH(c, d, a, b, cx->u.w[R3B2 ], S3_2, T3_2);
1768 + HH(b, c, d, a, cx->u.w[R3B3 ], S3_3, T3_3);
1769 + HH(a, b, c, d, cx->u.w[R3B4 ], S3_0, T3_4);
1770 + HH(d, a, b, c, cx->u.w[R3B5 ], S3_1, T3_5);
1771 + HH(c, d, a, b, cx->u.w[R3B6 ], S3_2, T3_6);
1772 + HH(b, c, d, a, cx->u.w[R3B7 ], S3_3, T3_7);
1773 + HH(a, b, c, d, cx->u.w[R3B8 ], S3_0, T3_8);
1774 + HH(d, a, b, c, cx->u.w[R3B9 ], S3_1, T3_9);
1775 + HH(c, d, a, b, cx->u.w[R3B10], S3_2, T3_10);
1776 + HH(b, c, d, a, cx->u.w[R3B11], S3_3, T3_11);
1777 + HH(a, b, c, d, cx->u.w[R3B12], S3_0, T3_12);
1778 + HH(d, a, b, c, cx->u.w[R3B13], S3_1, T3_13);
1779 + HH(c, d, a, b, cx->u.w[R3B14], S3_2, T3_14);
1780 + HH(b, c, d, a, cx->u.w[R3B15], S3_3, T3_15);
1781 + II(a, b, c, d, cx->u.w[R4B0 ], S4_0, T4_0);
1782 + II(d, a, b, c, cx->u.w[R4B1 ], S4_1, T4_1);
1783 + II(c, d, a, b, cx->u.w[R4B2 ], S4_2, T4_2);
1784 + II(b, c, d, a, cx->u.w[R4B3 ], S4_3, T4_3);
1785 + II(a, b, c, d, cx->u.w[R4B4 ], S4_0, T4_4);
1786 + II(d, a, b, c, cx->u.w[R4B5 ], S4_1, T4_5);
1787 + II(c, d, a, b, cx->u.w[R4B6 ], S4_2, T4_6);
1788 + II(b, c, d, a, cx->u.w[R4B7 ], S4_3, T4_7);
1789 + II(a, b, c, d, cx->u.w[R4B8 ], S4_0, T4_8);
1790 + II(d, a, b, c, cx->u.w[R4B9 ], S4_1, T4_9);
1791 + II(c, d, a, b, cx->u.w[R4B10], S4_2, T4_10);
1792 + II(b, c, d, a, cx->u.w[R4B11], S4_3, T4_11);
1793 + II(a, b, c, d, cx->u.w[R4B12], S4_0, T4_12);
1794 + II(d, a, b, c, cx->u.w[R4B13], S4_1, T4_13);
1795 + II(c, d, a, b, cx->u.w[R4B14], S4_2, T4_14);
1796 + II(b, c, d, a, cx->u.w[R4B15], S4_3, T4_15);
1804 +MD5_Update(MD5Context *cx, const unsigned char *input, unsigned int inputLen)
1806 + PRUint32 bytesToConsume;
1807 + PRUint32 inBufIndex = cx->lsbInput & 63;
1809 + /* Add the number of input bytes to the 64-bit input counter. */
1810 + addto64(cx->msbInput, cx->lsbInput, inputLen);
1812 + /* There is already data in the buffer. Fill with input. */
1813 + bytesToConsume = PR_MIN(inputLen, MD5_BUFFER_SIZE - inBufIndex);
1814 + memcpy(&cx->inBuf[inBufIndex], input, bytesToConsume);
1815 + if (inBufIndex + bytesToConsume >= MD5_BUFFER_SIZE)
1816 + /* The buffer is filled. Run the compression function. */
1818 + /* Remaining input. */
1819 + inputLen -= bytesToConsume;
1820 + input += bytesToConsume;
1823 + /* Iterate over 64-byte chunks of the message. */
1824 + while (inputLen >= MD5_BUFFER_SIZE) {
1825 + memcpy(cx->inBuf, input, MD5_BUFFER_SIZE);
1827 + inputLen -= MD5_BUFFER_SIZE;
1828 + input += MD5_BUFFER_SIZE;
1831 + /* Tail of message (message bytes mod 64). */
1833 + memcpy(cx->inBuf, input, inputLen);
1836 +static const unsigned char padbytes[] = {
1837 + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1838 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1839 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1840 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1841 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1842 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1843 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1844 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1845 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1846 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1847 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1848 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1852 +MD5_End(MD5Context *cx, unsigned char *digest,
1853 + unsigned int *digestLen, unsigned int maxDigestLen)
1855 +#ifndef IS_LITTLE_ENDIAN
1858 + PRUint32 lowInput, highInput;
1859 + PRUint32 inBufIndex = cx->lsbInput & 63;
1861 + if (maxDigestLen < MD5_HASH_LEN) {
1862 +// PORT_SetError(SEC_ERROR_INVALID_ARGS);
1866 + /* Copy out the length of bits input before padding. */
1867 + lowInput = cx->lsbInput;
1868 + highInput = (cx->msbInput << 3) | (lowInput >> 29);
1871 + if (inBufIndex < MD5_END_BUFFER) {
1872 + MD5_Update(cx, padbytes, MD5_END_BUFFER - inBufIndex);
1874 + MD5_Update(cx, padbytes,
1875 + MD5_END_BUFFER + MD5_BUFFER_SIZE - inBufIndex);
1878 + /* Store the number of bytes input (before padding) in final 64 bits. */
1879 + cx->u.w[14] = lendian(lowInput);
1880 + cx->u.w[15] = lendian(highInput);
1882 + /* Final call to compress. */
1885 + /* Copy the resulting values out of the chain variables into return buf. */
1886 + *digestLen = MD5_HASH_LEN;
1887 +#ifndef IS_LITTLE_ENDIAN
1888 + cx->cv[0] = lendian(cx->cv[0]);
1889 + cx->cv[1] = lendian(cx->cv[1]);
1890 + cx->cv[2] = lendian(cx->cv[2]);
1891 + cx->cv[3] = lendian(cx->cv[3]);
1893 + memcpy(digest, cx->cv, MD5_HASH_LEN);
1897 +MD5_FlattenSize(MD5Context *cx)
1899 + return sizeof(*cx);
1903 +MD5_Flatten(MD5Context *cx, unsigned char *space)
1905 + memcpy(space, cx, sizeof(*cx));
1910 +MD5_Resurrect(unsigned char *space, void *arg)
1912 + MD5Context *cx = MD5_NewContext();
1914 + memcpy(cx, space, sizeof(*cx));
1919 +MD5_TraceState(MD5Context *cx)
1921 +// PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
1925 +md5_stream (FILE *stream, unsigned char *dest)
1927 + /* Important: BLOCKSIZE must be a multiple of 64. */
1928 +#define BLOCKSIZE 4096
1930 + MD5Context *cx = MD5_NewContext();
1932 +// PORT_SetError(PR_OUT_OF_MEMORY_ERROR);
1936 + unsigned char buffer[BLOCKSIZE + 72];
1939 + /* Initialize the computation context. */
1942 + /* Iterate over full file contents. */
1945 + /* We read the file in blocks of BLOCKSIZE bytes. One call of the
1946 + computation function processes the whole buffer so that with the
1947 + next round of the loop another block can be read. */
1951 + /* Read block. Take care for partial reads. */
1954 + n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
1958 + while (sum < BLOCKSIZE && n != 0);
1959 + if (n == 0 && ferror (stream))
1962 + /* If end of file is reached, end the loop. */
1966 + /* Process buffer with BLOCKSIZE bytes. Note that
1967 + BLOCKSIZE % 64 == 0
1969 + MD5_Update(cx, buffer, BLOCKSIZE);
1972 + /* Add the last bytes if necessary. */
1974 + MD5_Update(cx, buffer, sum);
1976 + MD5_End(cx, dest, &len, MD5_HASH_LEN);
1977 + MD5_DestroyContext(cx, PR_TRUE);
1982 +int getMD5sum(const char * fileName,char * sum)
1984 + unsigned char bin_sum[16];
1988 + FILE *fp=fopen(fileName,"rb");
1991 + len=md5_stream(fp,bin_sum);
1993 + for (int i = 0; i < len; ++i)
1994 + sprintf (sum,"%s%02x",sum, bin_sum[i]);
2002 +int testMD5sum(const char * fileName,char * sum)
2004 + char newSum[33]="";
2005 + if (getMD5sum(fileName,newSum))
2007 + return strcmp(newSum,sum);
2009 --- misc/mozilla/mailnews/addrbook/src/nsAbMDBCardProperty.cpp 2006-12-22 14:51:38.000000000 +0100
2010 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbMDBCardProperty.cpp 2008-08-14 16:22:21.000000000 +0200
2014 mCardDatabase->EditCard(this, PR_TRUE);
2015 - mCardDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
2017 + return mCardDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
2020 return NS_ERROR_FAILURE;
2021 --- misc/mozilla/mailnews/addrbook/src/nsAbMDBDirectory.cpp 2008-01-29 20:31:58.000000000 +0100
2022 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbMDBDirectory.cpp 2008-08-14 16:22:21.000000000 +0200
2027 - mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
2028 + rv = mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
2033 return NS_ERROR_NOT_IMPLEMENTED;
2035 nsresult rv = NS_OK;
2038 rv = GetAbDatabase();
2040 @@ -736,10 +737,11 @@
2041 mDatabase->CreateNewListCardAndAddToDB(this, m_dbRowID, newCard, PR_TRUE /* notify */);
2043 mDatabase->CreateNewCardAndAddToDB(newCard, PR_TRUE);
2044 - mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
2045 + rv = mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
2047 + NS_ENSURE_SUCCESS(rv, rv);
2048 NS_IF_ADDREF(*addedCard = newCard);
2053 NS_IMETHODIMP nsAbMDBDirectory::DropCard(nsIAbCard* aCard, PRBool needToCopyCard)
2054 --- misc/mozilla/mailnews/addrbook/src/nsAbOutlookCard.cpp 2004-07-31 20:04:18.000000000 +0200
2055 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbOutlookCard.cpp 2008-08-14 16:22:21.000000000 +0200
2058 index_DisplayName = 0,
2060 + index_SecondEmailAddress,
2064 @@ -121,32 +122,34 @@
2066 static const ULONG OutlookCardMAPIProps [] =
2068 - PR_DISPLAY_NAME_W,
2069 - PR_EMAIL_ADDRESS_W,
2073 - PR_BUSINESS_TELEPHONE_NUMBER_W,
2074 - PR_HOME_TELEPHONE_NUMBER_W,
2075 - PR_BUSINESS_FAX_NUMBER_W,
2076 - PR_PAGER_TELEPHONE_NUMBER_W,
2077 - PR_MOBILE_TELEPHONE_NUMBER_W,
2078 - PR_HOME_ADDRESS_CITY_W,
2079 - PR_HOME_ADDRESS_STATE_OR_PROVINCE_W,
2080 - PR_HOME_ADDRESS_POSTAL_CODE_W,
2081 - PR_HOME_ADDRESS_COUNTRY_W,
2082 - PR_BUSINESS_ADDRESS_CITY_W,
2083 - PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE_W,
2084 - PR_BUSINESS_ADDRESS_POSTAL_CODE_W,
2085 - PR_BUSINESS_ADDRESS_COUNTRY_W,
2087 - PR_DEPARTMENT_NAME_W,
2088 - PR_COMPANY_NAME_W,
2089 - PR_BUSINESS_HOME_PAGE_W,
2090 - PR_PERSONAL_HOME_PAGE_W,
2092 + PR_DISPLAY_NAME_A,//0x8035001E
2093 + PR_EMAIL_ADDRESS_A,//0x8034001E
2094 + PR_SECOND_EMAIL_ADDRESS_A,//Second Email Address
2098 + PR_BUSINESS_TELEPHONE_NUMBER_A,
2099 + PR_HOME_TELEPHONE_NUMBER_A,
2100 + PR_BUSINESS_FAX_NUMBER_A,
2101 + PR_PAGER_TELEPHONE_NUMBER_A,
2102 + PR_MOBILE_TELEPHONE_NUMBER_A,
2103 + PR_HOME_ADDRESS_CITY_A,
2104 + PR_HOME_ADDRESS_STATE_OR_PROVINCE_A,
2105 + PR_HOME_ADDRESS_POSTAL_CODE_A,
2106 + PR_HOME_ADDRESS_COUNTRY_A,
2107 + PR_BUSINESS_ADDRESS_CITY_A,
2108 + PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE_A,
2109 + PR_BUSINESS_ADDRESS_POSTAL_CODE_A,
2110 + PR_BUSINESS_ADDRESS_COUNTRY_A,
2112 + PR_DEPARTMENT_NAME_A,
2113 + PR_COMPANY_NAME_A,
2114 + PR_BUSINESS_HOME_PAGE_A,
2115 + PR_PERSONAL_HOME_PAGE_A,
2120 nsresult nsAbOutlookCard::Init(const char *aUri)
2122 nsresult retCode = nsRDFResource::Init(aUri) ;
2124 SetDisplayName(unichars [index_DisplayName]->get()) ;
2125 SetNickName(unichars [index_NickName]->get()) ;
2126 SetPrimaryEmail(unichars [index_EmailAddress]->get()) ;
2127 + SetSecondEmail(unichars [index_SecondEmailAddress]->get()) ;
2128 SetWorkPhone(unichars [index_WorkPhoneNumber]->get()) ;
2129 SetHomePhone(unichars [index_HomePhoneNumber]->get()) ;
2130 SetFaxNumber(unichars [index_WorkFaxNumber]->get()) ;
2131 @@ -207,12 +211,12 @@
2132 nsAutoString unichar ;
2133 nsAutoString unicharBis ;
2135 - if (mapiAddBook->GetPropertyUString(*mMapiData, PR_HOME_ADDRESS_STREET_W, unichar)) {
2136 + if (mapiAddBook->GetPropertyUString(*mMapiData, PR_HOME_ADDRESS_STREET_A, unichar)) {
2137 splitString(unichar, unicharBis) ;
2138 SetHomeAddress(unichar.get()) ;
2139 SetHomeAddress2(unicharBis.get()) ;
2141 - if (mapiAddBook->GetPropertyUString(*mMapiData, PR_BUSINESS_ADDRESS_STREET_W, unichar)) {
2142 + if (mapiAddBook->GetPropertyUString(*mMapiData, PR_BUSINESS_ADDRESS_STREET_A, unichar)) {
2143 splitString(unichar, unicharBis) ;
2144 SetWorkAddress(unichar.get()) ;
2145 SetWorkAddress2(unicharBis.get()) ;
2147 SetDisplayName(properties [index_DisplayName]) ;
2148 GetNickName(getter_Copies(properties [index_NickName])) ;
2149 GetPrimaryEmail(getter_Copies(properties [index_EmailAddress])) ;
2150 + GetSecondEmail(getter_Copies(properties [index_SecondEmailAddress])) ;
2151 GetWorkPhone(getter_Copies(properties [index_WorkPhoneNumber])) ;
2152 GetHomePhone(getter_Copies(properties [index_HomePhoneNumber])) ;
2153 GetFaxNumber(getter_Copies(properties [index_WorkFaxNumber])) ;
2154 @@ -309,9 +314,16 @@
2155 GetWebPage1(getter_Copies(properties [index_WorkWebPage])) ;
2156 GetWebPage2(getter_Copies(properties [index_HomeWebPage])) ;
2157 GetNotes(getter_Copies(properties [index_Comments])) ;
2158 - if (!mapiAddBook->SetPropertiesUString(*mMapiData, OutlookCardMAPIProps,
2159 - index_LastProp, properties)) {
2160 - PRINTF(("Cannot set general properties.\n")) ;
2163 + for (i=0;i<index_LastProp;i++)
2165 + if (!mapiAddBook->SetPropertyUString(*mMapiData,
2166 + OutlookCardMAPIProps[i],
2169 + PRINTF(("Cannot set properties:%d.\n",OutlookCardMAPIProps[i])) ;
2172 delete [] properties ;
2173 nsXPIDLString unichar ;
2174 --- misc/mozilla/mailnews/addrbook/src/nsAbOutlookDirFactory.cpp 2004-04-17 20:32:14.000000000 +0200
2175 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbOutlookDirFactory.cpp 2008-08-14 16:22:21.000000000 +0200
2178 nsCOMPtr<nsIRDFResource> resource ;
2180 - for (ULONG i = 0 ; i < folders.mNbEntries ; ++ i) {
2181 - folders.mEntries [i].ToString(entryId) ;
2182 + for (ULONG i = 0 ; i < folders.GetSize() ; ++ i) {
2183 + folders[i].ToString(entryId) ;
2184 buildAbWinUri(kOutlookDirectoryScheme, abType, uri) ;
2185 uri.Append(entryId) ;
2187 --- misc/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.cpp 2006-12-22 14:51:38.000000000 +0100
2188 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.cpp 2008-08-14 16:22:21.000000000 +0200
2190 PRINTF(("Cannot get type.\n")) ;
2191 return NS_ERROR_FAILURE ;
2193 - if (!mapiAddBook->GetPropertyUString(*mMapiData, PR_DISPLAY_NAME_W, unichars)) {
2194 + if (!mapiAddBook->GetPropertyUString(*mMapiData, PR_DISPLAY_NAME_A, unichars)) {
2195 PRINTF(("Cannot get name.\n")) ;
2196 return NS_ERROR_FAILURE ;
2198 @@ -163,45 +163,85 @@
2202 +nsresult nsAbOutlookDirectory::BuildCardFromURI(const nsCString& uriName,nsIAbCard **aNewCard,
2203 + PRBool aSearchForOld, PRBool& aIsNewCard)
2205 + nsresult retCode = NS_OK ;
2206 + if (aSearchForOld) {
2207 + nsCStringKey key(uriName) ;
2208 + nsCOMPtr<nsISupports> existingCard = mCardList.Get(&key) ;
2210 + if (existingCard) {
2211 + nsCOMPtr<nsIAbCard> card(do_QueryInterface(existingCard, &retCode)) ;
2213 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2214 + NS_IF_ADDREF(*aNewCard = card) ;
2215 + aIsNewCard = PR_FALSE ;
2219 + aIsNewCard = PR_TRUE ;
2220 + nsCOMPtr<nsIRDFResource> resource ;
2222 + nsCOMPtr<nsIAbCard> childCard = do_CreateInstance(NS_ABOUTLOOKCARD_CONTRACTID, &retCode);
2223 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2224 + resource = do_QueryInterface(childCard, &retCode) ;
2225 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2226 + retCode = resource->Init(uriName.get()) ;
2227 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2228 + NS_IF_ADDREF(*aNewCard = childCard);
2232 NS_IMETHODIMP nsAbOutlookDirectory::GetChildCards(nsIEnumerator **aCards)
2234 if (!aCards) { return NS_ERROR_NULL_POINTER ; }
2236 nsCOMPtr<nsISupportsArray> cardList ;
2237 + nsCStringArray uriList ;
2238 + nsAbWinHelperGuard mapiAddBook (mAbWinType) ;
2241 - mCardList.Reset() ;
2243 retCode = StartSearch() ;
2244 - NS_NewISupportsArray(getter_AddRefs(cardList)) ;
2247 - retCode = GetChildCards(getter_AddRefs(cardList), nsnull) ;
2248 + retCode = GetChildCards(uriList, nsnull) ;
2250 + NS_NewISupportsArray(getter_AddRefs(cardList)) ;
2251 if (NS_SUCCEEDED(retCode)) {
2252 // Fill the results array and update the card list
2253 // Also update the address list and notify any changes.
2254 PRUint32 nbCards = 0 ;
2255 - nsCOMPtr<nsISupports> element ;
2256 + nsCAutoString uriName;
2257 + nsCOMPtr <nsIAbCard> childCard;
2258 + PRBool searchForOldCards = 0; //(mCardList.Count() != 0) ;
2260 + nbCards = uriList.Count();
2261 + NS_NewISupportsArray(getter_AddRefs(m_AddressList));
2263 - cardList->Enumerate(aCards) ;
2264 - cardList->Count(&nbCards) ;
2265 for (PRUint32 i = 0 ; i < nbCards ; ++ i) {
2266 - cardList->GetElementAt(i, getter_AddRefs(element)) ;
2267 - nsVoidKey newKey (NS_STATIC_CAST(void *, element)) ;
2268 - nsCOMPtr<nsISupports> oldElement = mCardList.Get(&newKey) ;
2269 + PRBool isNewCard = PR_FALSE ;
2271 - if (!oldElement) {
2272 + uriList.CStringAt(i,uriName);
2273 + retCode = BuildCardFromURI(uriName,getter_AddRefs(childCard), searchForOldCards, isNewCard);
2274 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2275 + cardList->AppendElement(childCard);
2278 // We are dealing with a new element (probably directly
2279 // added from Outlook), we may need to sync m_AddressList
2280 - mCardList.Put(&newKey, element) ;
2281 - nsCOMPtr<nsIAbCard> card (do_QueryInterface(element, &retCode)) ;
2282 + nsCStringKey newKey(uriName) ;
2284 + mCardList.Put(&newKey, childCard) ;
2285 + nsCOMPtr<nsIAbCard> card (do_QueryInterface(childCard, &retCode)) ;
2287 NS_ENSURE_SUCCESS(retCode, retCode) ;
2288 PRBool isMailList = PR_FALSE ;
2290 retCode = card->GetIsMailList(&isMailList) ;
2291 NS_ENSURE_SUCCESS(retCode, retCode) ;
2294 // We can have mailing lists only in folder,
2295 // we must add the directory to m_AddressList
2296 @@ -224,18 +264,33 @@
2297 NotifyItemAddition(card) ;
2301 - NS_ASSERTION(oldElement == element, "Different card stored") ;
2304 + return cardList->Enumerate(aCards) ;
2307 +static nsresult ExtractUriFromCard(nsIAbCard *aCard, nsCString& aUri) {
2308 + nsresult retCode = NS_OK ;
2309 + nsCOMPtr<nsIRDFResource> resource (do_QueryInterface(aCard, &retCode)) ;
2311 + // Receiving a non-RDF card is accepted
2312 + if (NS_FAILED(retCode)) { return NS_OK ; }
2313 + nsXPIDLCString uri ;
2315 + retCode = resource->GetValue(getter_Copies(uri)) ;
2316 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2317 + aUri = uri.get() ;
2321 NS_IMETHODIMP nsAbOutlookDirectory::HasCard(nsIAbCard *aCard, PRBool *aHasCard)
2323 if (!aCard || !aHasCard) { return NS_ERROR_NULL_POINTER ; }
2324 - nsVoidKey key (NS_STATIC_CAST(void *, aCard)) ;
2325 + *aHasCard = PR_FALSE ;
2328 + ExtractUriFromCard(aCard, uri) ;
2329 + nsCStringKey key(uri) ;
2331 *aHasCard = mCardList.Exists(&key) ;
2333 @@ -317,7 +372,10 @@
2334 PRINTF(("Cannot delete card %s.\n", entryString.get())) ;
2337 - nsVoidKey key (NS_STATIC_CAST(void *, element)) ;
2340 + ExtractUriFromCard(card, uri) ;
2341 + nsCStringKey key(uri) ;
2343 mCardList.Remove(&key) ;
2344 if (m_IsMailList) { m_AddressList->RemoveElement(element) ; }
2345 @@ -386,7 +444,10 @@
2347 retCode = CreateCard(aData, addedCard) ;
2348 NS_ENSURE_SUCCESS(retCode, retCode) ;
2349 - nsVoidKey newKey (NS_STATIC_CAST(void *, *addedCard)) ;
2352 + ExtractUriFromCard(*addedCard, uri) ;
2353 + nsCStringKey newKey(uri) ;
2355 mCardList.Put(&newKey, *addedCard) ;
2356 if (m_IsMailList) { m_AddressList->AppendElement(*addedCard) ; }
2358 if (!mapiAddBook->IsOK()) { return NS_ERROR_FAILURE ; }
2359 retCode = GetDirName(getter_Copies(name)) ;
2360 NS_ENSURE_SUCCESS(retCode, retCode) ;
2361 - if (!mapiAddBook->SetPropertyUString(*mMapiData, PR_DISPLAY_NAME_W, name.get())) {
2362 + if (!mapiAddBook->SetPropertyUString(*mMapiData, PR_DISPLAY_NAME_A, name.get())) {
2363 return NS_ERROR_FAILURE ;
2365 retCode = CommitAddressList() ;
2367 {"DisplayName", PR_DISPLAY_NAME_A},
2368 {"NickName", PR_NICKNAME_A},
2369 {"PrimaryEmail", PR_EMAIL_ADDRESS_A},
2370 + {"SecondEmail",PR_SECOND_EMAIL_ADDRESS_A},
2371 {"WorkPhone", PR_BUSINESS_TELEPHONE_NUMBER_A},
2372 {"HomePhone", PR_HOME_TELEPHONE_NUMBER_A},
2373 {"FaxNumber", PR_BUSINESS_FAX_NUMBER_A},
2374 @@ -1027,7 +1089,10 @@
2376 nsresult nsAbOutlookDirectory::OnSearchFoundCard(nsIAbCard *aCard)
2378 - nsVoidKey newKey (NS_STATIC_CAST(void *, aCard)) ;
2381 + ExtractUriFromCard(aCard, uri) ;
2382 + nsCStringKey newKey(uri) ;
2383 nsresult retCode = NS_OK ;
2385 mCardList.Put(&newKey, aCard) ;
2386 @@ -1051,14 +1116,14 @@
2387 retCode = BuildRestriction(aArguments, arguments) ;
2388 NS_ENSURE_SUCCESS(retCode, retCode) ;
2389 nsCOMPtr<nsISupportsArray> resultsArray ;
2390 + nsCStringArray uriArray ;
2391 PRUint32 nbResults = 0 ;
2393 - retCode = GetChildCards(getter_AddRefs(resultsArray),
2394 + retCode = GetChildCards(uriArray,
2395 arguments.rt == RES_COMMENT ? nsnull : &arguments) ;
2396 DestroyRestriction(arguments) ;
2397 NS_ENSURE_SUCCESS(retCode, retCode) ;
2398 - retCode = resultsArray->Count(&nbResults) ;
2399 - NS_ENSURE_SUCCESS(retCode, retCode) ;
2400 + nbResults = uriArray.Count() ;
2401 nsCOMPtr<nsIAbDirectoryQueryResult> result ;
2402 nsAbDirectoryQueryResult *newResult = nsnull ;
2404 @@ -1066,15 +1131,18 @@
2405 nbResults = NS_STATIC_CAST(PRUint32, aResultLimit) ;
2408 - nsCOMPtr<nsISupports> element ;
2409 nsCOMPtr<nsISupportsArray> propertyValues ;
2411 + nsCAutoString uriName;
2412 + nsCOMPtr <nsIAbCard> card;
2414 for (i = 0 ; i < nbResults ; ++ i) {
2415 - retCode = resultsArray->GetElementAt(i, getter_AddRefs(element)) ;
2416 - NS_ENSURE_SUCCESS(retCode, retCode) ;
2417 - nsCOMPtr<nsIAbCard> card (do_QueryInterface(element, &retCode)) ;
2418 + PRBool isNewCard = PR_FALSE ;
2420 + uriArray.CStringAt(i,uriName);
2421 + retCode = BuildCardFromURI(uriName,getter_AddRefs(card), PR_FALSE, isNewCard);
2422 NS_ENSURE_SUCCESS(retCode, retCode) ;
2424 FillPropertyValues(card, aArguments, getter_AddRefs(propertyValues)) ;
2425 newResult = new nsAbDirectoryQueryResult(0, aArguments,
2426 nsIAbDirectoryQueryResult::queryResultMatch,
2427 @@ -1099,13 +1167,43 @@
2428 if (!aCards) { return NS_ERROR_NULL_POINTER ; }
2430 nsresult retCode = NS_OK ;
2431 - nsCOMPtr<nsISupportsArray> cards ;
2433 + nsCOMPtr<nsISupportsArray> cards;
2434 + retCode = NS_NewISupportsArray(getter_AddRefs(cards));
2435 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2437 + nsCStringArray uriList;
2438 + retCode = GetChildCards(uriList,aRestriction);
2439 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2441 + nsCAutoString uriName;
2442 + nsCOMPtr <nsIAbCard> childCard;
2443 + PRUint32 nbURIs = 0 ;
2444 + nbURIs = uriList.Count();
2447 + for (i = 0 ; i < nbURIs ; ++ i) {
2448 + PRBool isNewCard = PR_FALSE ;
2450 + uriList.CStringAt(i,uriName);
2451 + retCode = BuildCardFromURI(uriName,getter_AddRefs(childCard), PR_TRUE, isNewCard);
2452 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2453 + cards->AppendElement(childCard);
2456 + NS_IF_ADDREF(*aCards = cards);
2460 +nsresult nsAbOutlookDirectory::GetChildCards(nsCStringArray& aURI,
2461 + void *aRestriction)
2463 + nsresult retCode = NS_OK ;
2464 nsAbWinHelperGuard mapiAddBook (mAbWinType) ;
2465 nsMapiEntryArray cardEntries ;
2466 LPSRestriction restriction = (LPSRestriction) aRestriction ;
2468 if (!mapiAddBook->IsOK()) { return NS_ERROR_FAILURE ; }
2469 - retCode = NS_NewISupportsArray(getter_AddRefs(cards)) ;
2470 NS_ENSURE_SUCCESS(retCode, retCode) ;
2471 if (!mapiAddBook->GetCards(*mMapiData, restriction, cardEntries)) {
2472 PRINTF(("Cannot get cards.\n")) ;
2473 @@ -1114,22 +1212,14 @@
2474 nsCAutoString entryId ;
2475 nsCAutoString uriName ;
2476 nsCOMPtr<nsIRDFResource> resource ;
2477 - nsCOMPtr <nsIAbCard> childCard;
2479 - for (ULONG card = 0 ; card < cardEntries.mNbEntries ; ++ card) {
2480 - cardEntries.mEntries [card].ToString(entryId) ;
2483 + for (ULONG card = 0 ; card < cardEntries.GetSize() ; ++ card) {
2484 + cardEntries [card].ToString(entryId) ;
2485 buildAbWinUri(kOutlookCardScheme, mAbWinType, uriName) ;
2486 uriName.Append(entryId) ;
2487 - childCard = do_CreateInstance(NS_ABOUTLOOKCARD_CONTRACTID, &retCode);
2488 - NS_ENSURE_SUCCESS(retCode, retCode) ;
2489 - resource = do_QueryInterface(childCard, &retCode) ;
2490 - NS_ENSURE_SUCCESS(retCode, retCode) ;
2491 - retCode = resource->Init(uriName.get()) ;
2492 - NS_ENSURE_SUCCESS(retCode, retCode) ;
2493 - cards->AppendElement(childCard) ;
2494 + aURI.AppendCString(uriName);
2497 - NS_ADDREF(*aCards) ;
2501 @@ -1153,8 +1243,8 @@
2502 nsCAutoString uriName ;
2503 nsCOMPtr <nsIRDFResource> resource ;
2505 - for (ULONG node = 0 ; node < nodeEntries.mNbEntries ; ++ node) {
2506 - nodeEntries.mEntries [node].ToString(entryId) ;
2507 + for (ULONG node = 0 ; node < nodeEntries.GetSize() ; ++ node) {
2508 + nodeEntries [node].ToString(entryId) ;
2509 buildAbWinUri(kOutlookDirectoryScheme, mAbWinType, uriName) ;
2510 uriName.Append(entryId) ;
2511 retCode = gRDFService->GetResource(uriName, getter_AddRefs(resource)) ;
2512 @@ -1275,7 +1365,7 @@
2513 // In the case of a mailing list, we cannot directly create a new card,
2514 // we have to create a temporary one in a real folder (to be able to use
2515 // templates) and then copy it to the mailing list.
2516 - if (m_IsMailList) {
2517 + if (m_IsMailList && mAbWinType == nsAbWinType_OutlookExp) {
2518 nsMapiEntry parentEntry ;
2519 nsMapiEntry temporaryEntry ;
2521 --- misc/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.h 2004-04-17 20:32:14.000000000 +0200
2522 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.h 2008-08-14 16:22:21.000000000 +0200
2524 #include "nsHashtable.h"
2526 #include "nsISupportsArray.h"
2527 +#include "nsVoidArray.h"
2529 struct nsMapiEntry ;
2533 // Retrieve hierarchy as cards, with an optional restriction
2534 nsresult GetChildCards(nsISupportsArray **aCards, void *aRestriction) ;
2535 + // Retrieve hierarchy as URIs, with an optional restriction
2536 + nsresult GetChildCards(nsCStringArray& aURI, void *aRestriction) ;
2537 // Retrieve hierarchy as directories
2538 nsresult GetChildNodes(nsISupportsArray **aNodes) ;
2539 // Create a new card
2541 nsresult CommitAddressList(void) ;
2542 // Read MAPI repository
2543 nsresult UpdateAddressList(void) ;
2544 + // Search for an existing card or build a new one
2545 + nsresult BuildCardFromURI(const nsCString& uriName,nsIAbCard **aNewCard,
2546 + PRBool aSearchForOld, PRBool& aIsNewCard) ;
2548 nsMapiEntry *mMapiData ;
2549 // Container for the query threads
2550 --- misc/mozilla/mailnews/addrbook/src/nsAbWinHelper.cpp 2005-05-07 08:11:28.000000000 +0200
2551 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbWinHelper.cpp 2008-08-14 16:22:21.000000000 +0200
2553 #define USES_IID_IABContainer
2554 #define USES_IID_IMAPITable
2555 #define USES_IID_IDistList
2556 +#define USES_IID_IMsgStore
2557 +#define USES_IID_IMessage
2558 +#define USES_IID_IMAPIFolder
2560 #include "nsAbWinHelper.h"
2561 #include "nsMapiAddressBook.h"
2564 #define PRINTF(args) PR_LOG(gAbWinHelperLog, PR_LOG_DEBUG, args)
2566 -// Small utility to ensure release of all MAPI interfaces
2567 -template <class tInterface> struct nsMapiInterfaceWrapper
2569 - tInterface mInterface ;
2571 - nsMapiInterfaceWrapper(void) : mInterface(NULL) {}
2572 - ~nsMapiInterfaceWrapper(void) {
2573 - if (mInterface != NULL) { mInterface->Release() ; }
2575 - operator LPUNKNOWN *(void) { return NS_REINTERPRET_CAST(LPUNKNOWN *, &mInterface) ; }
2576 - tInterface operator -> (void) const { return mInterface ; }
2577 - operator tInterface *(void) { return &mInterface ; }
2580 static void assignEntryID(LPENTRYID& aTarget, LPENTRYID aSource, ULONG aByteCount)
2582 @@ -249,24 +239,28 @@
2583 MOZ_DECL_CTOR_COUNTER(nsMapiEntryArray)
2585 nsMapiEntryArray::nsMapiEntryArray(void)
2586 -: mEntries(NULL), mNbEntries(0)
2588 MOZ_COUNT_CTOR(nsMapiEntryArray) ;
2591 nsMapiEntryArray::~nsMapiEntryArray(void)
2593 - if (mEntries) { delete [] mEntries ; }
2595 MOZ_COUNT_DTOR(nsMapiEntryArray) ;
2598 +void nsMapiEntryArray::AddItem(nsMapiEntry * aEntries)
2600 + m_array.AppendElement(aEntries);
2602 void nsMapiEntryArray::CleanUp(void)
2604 - if (mEntries != NULL) {
2605 - delete [] mEntries ;
2608 + nsMapiEntry *pEntries;
2609 + for (int i = 0; i < m_array.Count(); i++)
2611 + pEntries = (nsMapiEntry *)m_array.ElementAt( i);
2617 MOZ_DECL_CTOR_COUNTER(nsAbWinHelper)
2618 @@ -280,100 +274,55 @@
2619 // same protection (MAPI is supposed to be thread-safe).
2620 PRLock *nsAbWinHelper::mMutex = PR_NewLock() ;
2622 +int nsAbWinHelper::m_clients = 0;
2624 +PRUnichar * nsAbWinHelper::m_pUniBuff = NULL;
2625 +int nsAbWinHelper::m_uniBuffLen = 0;
2626 +char * nsAbWinHelper::m_pCStrBuff = NULL;
2627 +int nsAbWinHelper::m_cstrBuffLen = 0;
2629 nsAbWinHelper::nsAbWinHelper(void)
2630 -: mAddressBook(NULL), mLastError(S_OK)
2633 MOZ_COUNT_CTOR(nsAbWinHelper) ;
2637 nsAbWinHelper::~nsAbWinHelper(void)
2639 MOZ_COUNT_DTOR(nsAbWinHelper) ;
2642 -BOOL nsAbWinHelper::GetFolders(nsMapiEntryArray& aFolders)
2646 - aFolders.CleanUp() ;
2647 - nsMapiInterfaceWrapper<LPABCONT> rootFolder ;
2648 - nsMapiInterfaceWrapper<LPMAPITABLE> folders ;
2649 - ULONG objType = 0 ;
2650 - ULONG rowCount = 0 ;
2651 - SRestriction restriction ;
2652 - SPropTagArray folderColumns ;
2654 - mLastError = mAddressBook->OpenEntry(0, NULL, NULL, 0, &objType,
2656 - if (HR_FAILED(mLastError)) {
2657 - PRINTF(("Cannot open root %08x.\n", mLastError)) ;
2659 + delete [] m_pUniBuff;
2660 + m_pUniBuff = NULL;
2662 + delete [] m_pCStrBuff;
2663 + m_pCStrBuff = NULL;
2664 + m_cstrBuffLen = 0;
2666 - mLastError = rootFolder->GetHierarchyTable(0, folders) ;
2667 - if (HR_FAILED(mLastError)) {
2668 - PRINTF(("Cannot get hierarchy %08x.\n", mLastError)) ;
2671 - // We only take into account modifiable containers,
2672 - // otherwise, we end up with all the directory services...
2673 - restriction.rt = RES_BITMASK ;
2674 - restriction.res.resBitMask.ulPropTag = PR_CONTAINER_FLAGS ;
2675 - restriction.res.resBitMask.relBMR = BMR_NEZ ;
2676 - restriction.res.resBitMask.ulMask = AB_MODIFIABLE ;
2677 - mLastError = folders->Restrict(&restriction, 0) ;
2678 - if (HR_FAILED(mLastError)) {
2679 - PRINTF(("Cannot restrict table %08x.\n", mLastError)) ;
2681 - folderColumns.cValues = 1 ;
2682 - folderColumns.aulPropTag [0] = PR_ENTRYID ;
2683 - mLastError = folders->SetColumns(&folderColumns, 0) ;
2684 - if (HR_FAILED(mLastError)) {
2685 - PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
2688 - mLastError = folders->GetRowCount(0, &rowCount) ;
2689 - if (HR_SUCCEEDED(mLastError)) {
2690 - aFolders.mEntries = new nsMapiEntry [rowCount] ;
2691 - aFolders.mNbEntries = 0 ;
2693 - LPSRowSet rowSet = NULL ;
2696 - mLastError = folders->QueryRows(1, 0, &rowSet) ;
2697 - if (HR_SUCCEEDED(mLastError)) {
2698 - rowCount = rowSet->cRows ;
2699 - if (rowCount > 0) {
2700 - nsMapiEntry& current = aFolders.mEntries [aFolders.mNbEntries ++] ;
2701 - SPropValue& currentValue = rowSet->aRow->lpProps [0] ;
2703 - current.Assign(currentValue.Value.bin.cb,
2704 - NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
2706 - MyFreeProws(rowSet) ;
2709 - PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
2711 - } while (rowCount > 0) ;
2713 - return HR_SUCCEEDED(mLastError) ;
2717 BOOL nsAbWinHelper::GetCards(const nsMapiEntry& aParent, LPSRestriction aRestriction,
2718 nsMapiEntryArray& aCards)
2721 - return GetContents(aParent, aRestriction, &aCards.mEntries, aCards.mNbEntries, 0) ;
2722 + return GetContents(aParent, aRestriction, &aCards, 0) ;
2725 BOOL nsAbWinHelper::GetNodes(const nsMapiEntry& aParent, nsMapiEntryArray& aNodes)
2728 - return GetContents(aParent, NULL, &aNodes.mEntries, aNodes.mNbEntries, MAPI_DISTLIST) ;
2729 + return GetContents(aParent, NULL, &aNodes, MAPI_DISTLIST) ;
2732 BOOL nsAbWinHelper::GetCardsCount(const nsMapiEntry& aParent, ULONG& aNbCards)
2735 - return GetContents(aParent, NULL, NULL, aNbCards, 0) ;
2736 + nsMapiEntryArray aCards;
2737 + BOOL ret=GetContents(aParent, NULL, &aCards, 0) ;
2738 + aNbCards=aCards.GetSize();
2742 BOOL nsAbWinHelper::GetPropertyString(const nsMapiEntry& aObject,
2744 aName = values->Value.lpszA ;
2746 else if (PROP_TYPE(values->ulPropTag) == PT_UNICODE) {
2747 - aName.AssignWithConversion(values->Value.lpszW) ;
2748 + UnicodeToCStr(values->Value.lpszW,aName) ;
2751 FreeBuffer(values) ;
2753 aName = values->Value.lpszW ;
2755 else if (PROP_TYPE(values->ulPropTag) == PT_STRING8) {
2756 - aName.AssignWithConversion(values->Value.lpszA) ;
2757 + CStrToUnicode(values->Value.lpszA,aName) ;
2760 FreeBuffer(values) ;
2761 @@ -431,16 +380,22 @@
2764 for (i = 0 ; i < valueCount ; ++ i) {
2765 - if (PROP_ID(values [i].ulPropTag) == PROP_ID(aPropertyTags [i])) {
2766 + if (PROP_TYPE( values [i].ulPropTag) != PT_ERROR && values [i].Value.l != MAPI_E_NOT_FOUND){
2767 if (PROP_TYPE(values [i].ulPropTag) == PT_STRING8) {
2770 - temp.AssignWithConversion (values [i].Value.lpszA) ;
2771 + CStrToUnicode(values [i].Value.lpszA,temp) ;
2772 aNames.AppendString(temp) ;
2774 else if (PROP_TYPE(values [i].ulPropTag) == PT_UNICODE) {
2775 aNames.AppendString(nsAutoString (values [i].Value.lpszW)) ;
2777 + else if (aPropertyTags [i] == PR_EMAIL_ADDRESS_A) {
2778 + nsAutoString temp ;
2780 + CStrToUnicode (values [i].Value.lpszA,temp) ;
2781 + aNames.AppendString(temp) ;
2784 aNames.AppendString(nsAutoString((const PRUnichar *) "")) ;
2787 if (!GetMAPIProperties(aObject, &aPropertyTag, 1, values, valueCount)) { return FALSE ; }
2788 if (valueCount == 1 && values != NULL && PROP_TYPE(values->ulPropTag) == PT_SYSTIME) {
2789 SYSTEMTIME readableTime ;
2791 if (FileTimeToSystemTime(&values->Value.ft, &readableTime)) {
2792 aYear = readableTime.wYear ;
2793 aMonth = readableTime.wMonth ;
2795 nsMapiInterfaceWrapper<LPMAPIPROP> subObject ;
2798 - mLastError = mAddressBook->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
2799 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
2800 &IID_IMAPIContainer, 0, &objType,
2802 if (HR_FAILED(mLastError)) {
2805 SBinaryArray entryArray ;
2807 - mLastError = mAddressBook->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
2808 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
2809 &IID_IABContainer, MAPI_MODIFY, &objType,
2811 if (HR_FAILED(mLastError)) {
2812 @@ -567,14 +521,15 @@
2813 value.Value.lpszW = NS_CONST_CAST(WCHAR *, aValue) ;
2815 else if (PROP_TYPE(aPropertyTag) == PT_STRING8) {
2816 - alternativeValue.AssignWithConversion(aValue) ;
2817 + UnicodeToCStr(aValue,alternativeValue) ;
2818 value.Value.lpszA = NS_CONST_CAST(char *, alternativeValue.get()) ;
2821 PRINTF(("Property %08x is not a string.\n", aPropertyTag)) ;
2824 - return SetMAPIProperties(aObject, 1, &value) ;
2825 + LPSPropValue values=&value;
2826 + return SetMAPIProperties(aObject, 1, values) ;
2829 BOOL nsAbWinHelper::SetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
2831 values [currentValue ++].Value.lpszW = NS_CONST_CAST(WCHAR *, aValues [i].get()) ;
2833 else if (PROP_TYPE(aPropertiesTag [i]) == PT_STRING8) {
2834 - alternativeValue.AssignWithConversion(aValues [i].get()) ;
2835 + UnicodeToCStr(aValues [i].get(),alternativeValue) ;
2836 char *av = nsCRT::strdup(alternativeValue.get()) ;
2840 readableTime.wSecond = 0 ;
2841 readableTime.wMilliseconds = 0 ;
2842 if (SystemTimeToFileTime(&readableTime, &value.Value.ft)) {
2843 - return SetMAPIProperties(aObject, 1, &value) ;
2844 + LPSPropValue values=&value;
2845 + return SetMAPIProperties(aObject, 1, values) ;
2850 nsMapiInterfaceWrapper<LPABCONT> container ;
2853 - mLastError = mAddressBook->OpenEntry(aParent.mByteCount, aParent.mEntryId,
2854 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
2855 &IID_IABContainer, MAPI_MODIFY, &objType,
2857 if (HR_FAILED(mLastError)) {
2859 nsMapiInterfaceWrapper<LPABCONT> container ;
2862 - mLastError = mAddressBook->OpenEntry(aParent.mByteCount, aParent.mEntryId,
2863 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
2864 &IID_IABContainer, MAPI_MODIFY, &objType,
2866 if (HR_FAILED(mLastError)) {
2868 nsMapiInterfaceWrapper<LPABCONT> container ;
2871 - mLastError = mAddressBook->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
2872 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
2873 &IID_IABContainer, MAPI_MODIFY, &objType,
2875 if (HR_FAILED(mLastError)) {
2876 @@ -810,194 +766,77 @@
2880 -BOOL nsAbWinHelper::GetDefaultContainer(nsMapiEntry& aContainer)
2882 - LPENTRYID entryId = NULL ;
2883 - ULONG byteCount = 0 ;
2885 - mLastError = mAddressBook->GetPAB(&byteCount, &entryId) ;
2886 - if (HR_FAILED(mLastError)) {
2887 - PRINTF(("Cannot get PAB %08x.\n", mLastError)) ;
2890 - aContainer.Assign(byteCount, entryId) ;
2891 - FreeBuffer(entryId) ;
2897 - ContentsColumnEntryId = 0,
2898 - ContentsColumnObjectType,
2899 - ContentsColumnsSize
2902 -static const SizedSPropTagArray(ContentsColumnsSize, ContentsColumns) =
2904 - ContentsColumnsSize,
2911 -BOOL nsAbWinHelper::GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
2912 - nsMapiEntry **aList, ULONG& aNbElements, ULONG aMapiType)
2913 +void nsAbWinHelper::MyFreeProws(LPSRowSet aRowset)
2915 - if (aList != NULL) { *aList = NULL ; }
2917 - nsMapiInterfaceWrapper<LPMAPICONTAINER> parent ;
2918 - nsMapiInterfaceWrapper<LPMAPITABLE> contents ;
2919 - ULONG objType = 0 ;
2920 - ULONG rowCount = 0 ;
2921 + if (aRowset == NULL) { return ; }
2924 - mLastError = mAddressBook->OpenEntry(aParent.mByteCount, aParent.mEntryId,
2925 - &IID_IMAPIContainer, 0, &objType,
2927 - if (HR_FAILED(mLastError)) {
2928 - PRINTF(("Cannot open parent %08x.\n", mLastError)) ;
2931 - // Here, flags for WAB and MAPI could be different, so this works
2932 - // only as long as we don't want to use any flag in GetContentsTable
2933 - mLastError = parent->GetContentsTable(0, contents) ;
2934 - if (HR_FAILED(mLastError)) {
2935 - PRINTF(("Cannot get contents %08x.\n", mLastError)) ;
2937 + for (i = 0 ; i < aRowset->cRows ; ++ i) {
2938 + FreeBuffer(aRowset->aRow [i].lpProps) ;
2940 - if (aRestriction != NULL) {
2941 - mLastError = contents->Restrict(aRestriction, 0) ;
2942 - if (HR_FAILED(mLastError)) {
2943 - PRINTF(("Cannot set restriction %08x.\n", mLastError)) ;
2947 - mLastError = contents->SetColumns((LPSPropTagArray) &ContentsColumns, 0) ;
2948 - if (HR_FAILED(mLastError)) {
2949 - PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
2952 - mLastError = contents->GetRowCount(0, &rowCount) ;
2953 - if (HR_FAILED(mLastError)) {
2954 - PRINTF(("Cannot get result count %08x.\n", mLastError)) ;
2957 - if (aList != NULL) { *aList = new nsMapiEntry [rowCount] ; }
2960 - LPSRowSet rowSet = NULL ;
2963 - mLastError = contents->QueryRows(1, 0, &rowSet) ;
2964 - if (HR_FAILED(mLastError)) {
2965 - PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
2968 - rowCount = rowSet->cRows ;
2969 - if (rowCount > 0 &&
2970 - (aMapiType == 0 ||
2971 - rowSet->aRow->lpProps[ContentsColumnObjectType].Value.ul == aMapiType)) {
2972 - if (aList != NULL) {
2973 - nsMapiEntry& current = (*aList) [aNbElements] ;
2974 - SPropValue& currentValue = rowSet->aRow->lpProps[ContentsColumnEntryId] ;
2976 - current.Assign(currentValue.Value.bin.cb,
2977 - NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
2978 + FreeBuffer(aRowset) ;
2980 +void nsAbWinHelper::CStrToUnicode( const char *pStr, nsString& result)
2982 + result.Truncate( 0);
2983 + int wLen = MultiByteToWideChar( CP_ACP, 0, pStr, -1, m_pUniBuff, 0);
2984 + if (wLen >= m_uniBuffLen)
2986 + delete [] m_pUniBuff;
2987 + m_pUniBuff = new PRUnichar[wLen + 64];
2988 + m_uniBuffLen = wLen + 64;
2993 + MultiByteToWideChar( CP_ACP, 0, pStr, -1, m_pUniBuff, m_uniBuffLen);
2994 + result = m_pUniBuff;
2996 - MyFreeProws(rowSet) ;
2997 - } while (rowCount > 0) ;
3001 -BOOL nsAbWinHelper::GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
3002 - ULONG aNbProperties, LPSPropValue& aValue,
3003 - ULONG& aValueCount)
3004 +void nsAbWinHelper::UnicodeToCStr( const PRUnichar *pUStr,nsCString& result)
3006 - nsMapiInterfaceWrapper<LPMAPIPROP> object ;
3007 - ULONG objType = 0 ;
3008 - LPSPropTagArray properties = NULL ;
3011 - mLastError = mAddressBook->OpenEntry(aObject.mByteCount, aObject.mEntryId,
3012 - &IID_IMAPIProp, 0, &objType,
3014 - if (HR_FAILED(mLastError)) {
3015 - PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
3017 + result.Truncate( 0);
3018 + int cLen = WideCharToMultiByte( CP_ACP, 0, pUStr, -1, m_pCStrBuff, 0,NULL,NULL);
3019 + if (cLen >= m_cstrBuffLen) {
3021 + delete [] m_pCStrBuff;
3022 + m_pCStrBuff = new char[cLen + 64];
3023 + m_cstrBuffLen = cLen + 64;
3025 - AllocateBuffer(CbNewSPropTagArray(aNbProperties),
3026 - NS_REINTERPRET_CAST(void **, &properties)) ;
3027 - properties->cValues = aNbProperties ;
3028 - for (i = 0 ; i < aNbProperties ; ++ i) {
3029 - properties->aulPropTag [i] = aPropertyTags [i] ;
3031 - mLastError = object->GetProps(properties, 0, &aValueCount, &aValue) ;
3032 - FreeBuffer(properties) ;
3033 - if (HR_FAILED(mLastError)) {
3034 - PRINTF(("Cannot get props %08x.\n", mLastError)) ;
3036 + WideCharToMultiByte( CP_ACP, 0, pUStr, -1, m_pCStrBuff, m_cstrBuffLen,NULL,NULL);
3037 + result = m_pCStrBuff;
3039 - return HR_SUCCEEDED(mLastError) ;
3042 -BOOL nsAbWinHelper::SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
3043 - const LPSPropValue& aValues)
3045 - nsMapiInterfaceWrapper<LPMAPIPROP> object ;
3046 - ULONG objType = 0 ;
3047 - LPSPropProblemArray problems = NULL ;
3048 +static nsAbWinHelper *getOutlookAddressBook(void) {
3049 + static nsMapiAddressBook *addressBook = NULL ;
3051 - mLastError = mAddressBook->OpenEntry(aObject.mByteCount, aObject.mEntryId,
3052 - &IID_IMAPIProp, MAPI_MODIFY, &objType,
3054 - if (HR_FAILED(mLastError)) {
3055 - PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
3058 - mLastError = object->SetProps(aNbProperties, aValues, &problems) ;
3059 - if (HR_FAILED(mLastError)) {
3060 - PRINTF(("Cannot update the object %08x.\n", mLastError)) ;
3063 - if (problems != NULL) {
3064 - for (ULONG i = 0 ; i < problems->cProblem ; ++ i) {
3065 - PRINTF(("Problem %d: index %d code %08x.\n", i,
3066 - problems->aProblem [i].ulIndex,
3067 - problems->aProblem [i].scode)) ;
3070 - mLastError = object->SaveChanges(0) ;
3071 - if (HR_FAILED(mLastError)) {
3072 - PRINTF(("Cannot commit changes %08x.\n", mLastError)) ;
3074 - return HR_SUCCEEDED(mLastError) ;
3075 + if (addressBook == NULL) { addressBook = new nsMapiAddressBook ; }
3076 + return addressBook ;
3079 -void nsAbWinHelper::MyFreeProws(LPSRowSet aRowset)
3081 - if (aRowset == NULL) { return ; }
3083 +static nsAbWinHelper *getOutlookExpAddressBook(void) {
3084 + static nsWabAddressBook *addressBook = NULL ;
3086 - for (i = 0 ; i < aRowset->cRows ; ++ i) {
3087 - FreeBuffer(aRowset->aRow [i].lpProps) ;
3089 - FreeBuffer(aRowset) ;
3090 + if (addressBook == NULL) { addressBook = new nsWabAddressBook ; }
3091 + return addressBook ;
3094 nsAbWinHelperGuard::nsAbWinHelperGuard(PRUint32 aType)
3098 - case nsAbWinType_Outlook: mHelper = new nsMapiAddressBook ; break ;
3099 - case nsAbWinType_OutlookExp: mHelper = new nsWabAddressBook ; break ;
3100 + case nsAbWinType_Outlook: mHelper = getOutlookAddressBook() ; break ;
3101 + case nsAbWinType_OutlookExp: mHelper = getOutlookExpAddressBook() ; break ;
3106 nsAbWinHelperGuard::~nsAbWinHelperGuard(void)
3111 const char *kOutlookDirectoryScheme = "moz-aboutlookdirectory://" ;
3112 --- misc/mozilla/mailnews/addrbook/src/nsAbWinHelper.h 2004-04-17 20:32:14.000000000 +0200
3113 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbWinHelper.h 2008-08-14 16:22:21.000000000 +0200
3115 #include "nsVoidArray.h"
3116 #include "nsXPIDLString.h"
3118 +#define PR_SECOND_EMAIL_ADDRESS_A 0x8033001E
3119 +#define PR_SCREEN_NAME_A 0x805B001E
3122 +// Small utility to ensure release of all MAPI interfaces
3123 +template <class tInterface> struct nsMapiInterfaceWrapper
3125 + tInterface mInterface ;
3127 + nsMapiInterfaceWrapper(void) : mInterface(NULL) {}
3128 + ~nsMapiInterfaceWrapper(void) {
3129 + if (mInterface ) { mInterface->Release() ; }
3131 + operator LPUNKNOWN *(void) { return NS_REINTERPRET_CAST(LPUNKNOWN *, &mInterface) ; }
3132 + tInterface operator -> (void) const { return mInterface ; }
3133 + operator tInterface *(void) { return &mInterface ; }
3141 struct nsMapiEntryArray
3143 - nsMapiEntry *mEntries ;
3144 - ULONG mNbEntries ;
3146 nsMapiEntryArray(void) ;
3147 ~nsMapiEntryArray(void) ;
3149 - const nsMapiEntry& operator [] (int aIndex) const { return mEntries [aIndex] ; }
3150 + void AddItem(nsMapiEntry * aEntries);
3151 + void AddItem( ULONG mByteCount , LPENTRYID mEntryId )
3153 + nsMapiEntry * aEntries=new nsMapiEntry();
3154 + aEntries->Assign(mByteCount,mEntryId);
3155 + AddItem(aEntries);
3158 + ULONG GetSize( void) { return( m_array.Count());}
3159 + nsMapiEntry& operator [] (int aIndex) { return *(nsMapiEntry*)m_array.ElementAt(aIndex); }
3160 + nsMapiEntry* ElementAt(int aIndex) { return (nsMapiEntry*)m_array.ElementAt(aIndex); }
3161 void CleanUp(void) ;
3162 + void Remove(nsMapiEntry * aEntries){ m_array.RemoveElement(aEntries); }
3163 + void Remove(int index){ m_array.RemoveElementAt(index); }
3164 + ULONG IndexOf(nsMapiEntry * aEntries){return m_array.IndexOf(aEntries);};
3166 + nsVoidArray m_array;
3172 virtual ~nsAbWinHelper(void) ;
3174 // Get the top address books
3175 - BOOL GetFolders(nsMapiEntryArray& aFolders) ;
3176 + virtual BOOL GetFolders(nsMapiEntryArray& aFolders) =0;
3177 // Get a list of entries for cards/mailing lists in a folder/mailing list
3178 BOOL GetCards(const nsMapiEntry& aParent, LPSRestriction aRestriction,
3179 nsMapiEntryArray& aCards) ;
3180 @@ -97,18 +129,14 @@
3181 BOOL GetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
3182 ULONG aNbProperties, nsStringArray& aValues) ;
3183 // Get the value of a MAPI property of type SYSTIME
3184 - BOOL GetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
3185 + virtual BOOL GetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
3186 WORD& aYear, WORD& aMonth, WORD& aDay) ;
3187 - // Get the value of a MAPI property of type LONG
3188 - BOOL GetPropertyLong(const nsMapiEntry& aObject, ULONG aPropertyTag, ULONG& aValue) ;
3189 // Get the value of a MAPI property of type BIN
3190 BOOL GetPropertyBin(const nsMapiEntry& aObject, ULONG aPropertyTag, nsMapiEntry& aValue) ;
3191 // Tests if a container contains an entry
3192 BOOL TestOpenEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
3193 - // Delete an entry in the address book
3194 - BOOL DeleteEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
3195 // Set the value of a MAPI property of type string in unicode
3196 - BOOL SetPropertyUString (const nsMapiEntry& aObject, ULONG aPropertyTag,
3197 + virtual BOOL SetPropertyUString (const nsMapiEntry& aObject, ULONG aPropertyTag,
3198 const PRUnichar *aValue) ;
3199 // Same as previous, but with a bunch of properties in one call
3200 BOOL SetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
3201 @@ -117,32 +145,44 @@
3202 BOOL SetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
3203 WORD aYear, WORD aMonth, WORD aDay) ;
3204 // Create entry in the address book
3205 - BOOL CreateEntry(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
3206 + virtual BOOL CreateEntry(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
3207 + // Delete an entry in the address book
3208 + virtual BOOL DeleteEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
3209 // Create a distribution list in the address book
3210 - BOOL CreateDistList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
3211 + virtual BOOL CreateDistList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
3212 // Copy an existing entry in the address book
3213 - BOOL CopyEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aSource, nsMapiEntry& aTarget) ;
3214 + virtual BOOL CopyEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aSource, nsMapiEntry& aTarget) ;
3215 // Get a default address book container
3216 - BOOL GetDefaultContainer(nsMapiEntry& aContainer) ;
3217 + virtual BOOL GetDefaultContainer(nsMapiEntry& aContainer) =0;
3218 // Is the helper correctly initialised?
3219 - BOOL IsOK(void) const { return mAddressBook != NULL ; }
3220 + virtual BOOL IsOK(void) =0;/*const { return mAddressBook != NULL ; }*/
3222 + // Get the value of a MAPI property of type LONG
3223 + virtual BOOL GetPropertyLong(const nsMapiEntry& aObject, ULONG aPropertyTag, ULONG& aValue) ;
3226 HRESULT mLastError ;
3227 - LPADRBOOK mAddressBook ;
3228 static PRUint32 mEntryCounter ;
3229 static PRLock *mMutex ;
3231 + virtual HRESULT OpenEntry(ULONG cbEntryID,
3232 + LPENTRYID lpEntryID,
3233 + LPCIID lpInterface,
3235 + ULONG FAR * lpulObjType,
3236 + LPUNKNOWN FAR * lppUnk
3239 // Retrieve the contents of a container, with an optional restriction
3240 - BOOL GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
3241 - nsMapiEntry **aList, ULONG &aNbElements, ULONG aMapiType) ;
3242 + virtual BOOL GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
3243 + nsMapiEntryArray *aList, ULONG aMapiType) =0;
3244 // Retrieve the values of a set of properties on a MAPI object
3245 - BOOL GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
3246 + virtual BOOL GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
3247 ULONG aNbProperties,
3248 - LPSPropValue& aValues, ULONG& aValueCount) ;
3249 + LPSPropValue& aValues, ULONG& aValueCount) =0;
3250 // Set the values of a set of properties on a MAPI object
3251 - BOOL SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
3252 - const LPSPropValue& aValues) ;
3253 + virtual BOOL SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
3254 + LPSPropValue& aValues) =0;
3255 // Clean-up a rowset returned by QueryRows
3256 void MyFreeProws(LPSRowSet aSet) ;
3257 // Allocation of a buffer for transmission to interfaces
3258 @@ -150,7 +190,16 @@
3259 // Destruction of a buffer provided by the interfaces
3260 virtual void FreeBuffer(LPVOID aBuffer) = 0 ;
3262 + static void CStrToUnicode( const char *pStr, nsString& result);
3263 + static void UnicodeToCStr( const PRUnichar *pStr, nsCString& result);
3266 + static int m_clients;
3267 + static PRUnichar * m_pUniBuff;
3268 + static int m_uniBuffLen;
3269 + static char * m_pCStrBuff;
3270 + static int m_cstrBuffLen;
3277 nsAbWinHelper *operator ->(void) { return mHelper ; }
3279 + static void FreeWinAbLibrarys();
3281 nsAbWinHelper *mHelper ;
3283 --- misc/mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp 2006-12-22 14:51:39.000000000 +0100
3284 +++ misc/build/mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp 2008-08-20 15:09:45.000000000 +0200
3287 static const char kMailListAddressFormat[] = "Address%d";
3289 +extern int getMD5sum(const char * fileName,char * sum);
3290 +extern int testMD5sum(const char * fileName,char * sum);
3292 static NS_DEFINE_CID(kCMorkFactory, NS_MORK_CID);
3294 nsAddrDatabase::nsAddrDatabase()
3297 m_dbDirectory(nsnull)
3299 + memset(m_dbMd5Sum,0,33);
3302 nsAddrDatabase::~nsAddrDatabase()
3303 @@ -790,7 +794,11 @@
3305 ret = NS_ERROR_FILE_ACCESS_DENIED;
3309 + ret = getMD5sum(nativeFileName,m_dbMd5Sum);
3311 + ret = NS_ERROR_FAILURE;
3313 nsCRT::free(nativeFileName);
3315 if (NS_SUCCEEDED(ret) && thumb)
3316 @@ -883,6 +891,17 @@
3318 nsresult err = NS_OK;
3319 nsIMdbThumb *commitThumb = nsnull;
3321 + const char *pFilename = m_dbName.GetCString(); /* do not free */
3322 + char *nativeFileName = nsCRT::strdup(pFilename);
3323 +#if defined(XP_PC) || defined(XP_MAC)
3324 + UnixToNative(nativeFileName);
3326 + if (testMD5sum(nativeFileName,m_dbMd5Sum))
3328 + nsCRT::free(nativeFileName);
3329 + return NS_ERROR_FILE_ACCESS_DENIED;
3332 if (commitType == nsAddrDBCommitType::kLargeCommit ||
3333 commitType == nsAddrDBCommitType::kSessionCommit)
3334 @@ -936,6 +955,10 @@
3335 // ### do something with error, but clear it now because mork errors out on commits.
3337 m_mdbEnv->ClearErrors();
3338 + if (NS_SUCCEEDED(err) && getMD5sum(nativeFileName,m_dbMd5Sum))
3339 + err = NS_ERROR_FAILURE;
3340 + nsCRT::free(nativeFileName);
3345 --- misc/mozilla/mailnews/addrbook/src/nsAddrDatabase.h 2006-12-22 14:51:39.000000000 +0100
3346 +++ misc/build/mozilla/mailnews/addrbook/src/nsAddrDatabase.h 2008-08-14 16:29:20.000000000 +0200
3348 nsIMdbTable *m_mdbPabTable;
3349 nsIMdbTable *m_mdbDeletedCardsTable;
3350 nsFileSpec m_dbName;
3351 + char m_dbMd5Sum[33];
3352 PRBool m_mdbTokensInitialized;
3353 nsVoidArray /*<nsIAddrDBListener>*/ *m_ChangeListeners;
3355 --- misc/mozilla/mailnews/addrbook/src/nsMapiAddressBook.cpp 2004-11-05 16:13:32.000000000 +0100
3356 +++ misc/build/mozilla/mailnews/addrbook/src/nsMapiAddressBook.cpp 2008-08-14 16:22:21.000000000 +0200
3361 +static char * stristr(const char *big, const char *little)
3365 + if (!big || !little || !*big || !*little)
3367 + len = strlen(little);
3369 + for( ; *big; big++ )
3370 + if(!_strnicmp (big, little, 1) && ! _strnicmp (big, little, len) )
3371 + return (char *)big;
3378 static PRLogModuleInfo* gMapiAddressBookLog
3379 = PR_NewLogModule("nsMapiAddressBookLog");
3382 #define PRINTF(args) PR_LOG(gMapiAddressBookLog, PR_LOG_DEBUG, args)
3384 +#define OUTLOOK_EMAIL_DIAPLAY_MAPI_ID 0x00008005 //use to get and set display
3385 +#define OUTLOOK_EMAIL1_MAPI_ID 0x00008084 //use to get and set primary email address
3386 +#define OUTLOOK_EMAIL2_MAPI_ID 0x00008094 //use to get and set second email address
3387 +#define OUTLOOK_EMAIL_SCREEN_NAME 0x8061001E //use to get and set screen name
3388 +#define OUTLOOK_EMAIL_ORGID 0x00008085 //use to get orginal entryid to add to distlist
3389 +#define OUTLOOK_EMAIL_LIST1 0x00008054 //use to get distlist table
3390 +#define OUTLOOK_EMAIL_LIST2 0x00008055 //use to set distlist table
3392 +static const TagMap TagMaps[]={
3393 + {PR_DISPLAY_NAME_A, OUTLOOK_EMAIL_DIAPLAY_MAPI_ID, PT_STRING8},
3394 + {PR_EMAIL_ADDRESS_A, OUTLOOK_EMAIL1_MAPI_ID, PT_STRING8},
3395 + {PR_SECOND_EMAIL_ADDRESS_A, OUTLOOK_EMAIL2_MAPI_ID, PT_STRING8},
3396 + {PR_SCREEN_NAME_A, OUTLOOK_EMAIL_SCREEN_NAME, PT_STRING8}};
3399 + ieidPR_ENTRYID = 0,
3400 + ieidPR_OBJECT_TYPE,
3401 + ieidPR_DISPLAY_NAME,
3402 + ieidPR_MESSAGE_CLASS,
3403 + ieidPR_STORE_ENTRYID,
3404 + ieidPR_MESSAGE_RECIPIENTS,
3408 +static const SizedSPropTagArray(ieidMax, ptaEid)=
3417 + PR_MESSAGE_RECIPIENTS
3423 + ContentsColumnEntryId = 0,
3424 + ContentsColumnObjectType,
3425 + ContentsColumnMessageClass,
3426 + ContentsColumnsSize
3429 +static const SizedSPropTagArray(ContentsColumnsSize, ContentsColumns) =
3431 + ContentsColumnsSize,
3439 HMODULE nsMapiAddressBook::mLibrary = NULL ;
3440 PRInt32 nsMapiAddressBook::mLibUsage = 0 ;
3442 BOOL nsMapiAddressBook::mInitialized = FALSE ;
3443 BOOL nsMapiAddressBook::mLogonDone = FALSE ;
3444 LPMAPISESSION nsMapiAddressBook::mRootSession = NULL ;
3445 -LPADRBOOK nsMapiAddressBook::mRootBook = NULL ;
3446 +#define MAPI_NO_COINIT 8
3448 BOOL nsMapiAddressBook::LoadMapiLibrary(void)
3451 mMAPILogonEx = NS_REINTERPRET_CAST(LPMAPILOGONEX,
3452 GetProcAddress(mLibrary, "MAPILogonEx")) ;
3453 if (!mMAPILogonEx) { return FALSE ; }
3454 - MAPIINIT_0 mapiInit = { MAPI_INIT_VERSION, MAPI_MULTITHREAD_NOTIFICATIONS } ;
3455 + MAPIINIT_0 mapiInit = { MAPI_INIT_VERSION, MAPI_MULTITHREAD_NOTIFICATIONS | MAPI_NO_COINIT } ;
3456 HRESULT retCode = mMAPIInitialize(&mapiInit) ;
3458 if (HR_FAILED(retCode)) {
3459 @@ -105,22 +175,19 @@
3462 if (HR_FAILED(retCode)) {
3463 - PRINTF(("Cannot logon to MAPI %08x.\n", retCode)) ; return FALSE ;
3464 + PRINTF(("Cannot logon to MAPI %08x.\n", retCode)) ;
3468 - retCode = mRootSession->OpenAddressBook(0, NULL, 0, &mRootBook) ;
3469 - if (HR_FAILED(retCode)) {
3470 - PRINTF(("Cannot open MAPI address book %08x.\n", retCode)) ;
3473 return HR_SUCCEEDED(retCode) ;
3476 void nsMapiAddressBook::FreeMapiLibrary(void)
3479 - if (-- mLibUsage == 0) {
3480 + if (--mLibUsage < 0) {
3482 - if (mRootBook) { mRootBook->Release() ; }
3485 mRootSession->Logoff(NULL, 0, 0) ;
3489 FreeLibrary(mLibrary) ;
3490 + mRootSession = NULL;
3497 BOOL result = Initialize() ;
3499 NS_ASSERTION(result == TRUE, "Couldn't initialize Mapi Helper") ;
3500 MOZ_COUNT_CTOR(nsMapiAddressBook) ;
3502 @@ -153,22 +220,882 @@
3503 nsMapiAddressBook::~nsMapiAddressBook(void)
3505 nsAutoLock guard(mMutex) ;
3509 MOZ_COUNT_DTOR(nsMapiAddressBook) ;
3512 +LPSPropValue nsMapiAddressBook::GetMapiProperty( LPMAPIPROP pProp, ULONG tag)
3517 + int sz = CbNewSPropTagArray( 1);
3518 + SPropTagArray *pTag = (SPropTagArray *) new char[sz];
3519 + pTag->cValues = 1;
3520 + pTag->aulPropTag[0] = tag;
3521 + LPSPropValue lpProp = NULL;
3522 + ULONG cValues = 0;
3523 + HRESULT hr = pProp->GetProps( pTag, 0, &cValues, &lpProp);
3525 + if (HR_FAILED( hr) || (cValues != 1)) {
3527 + mMAPIFreeBuffer( lpProp);
3531 + if (PROP_TYPE( lpProp->ulPropTag) == PT_ERROR) {
3532 + if (lpProp->Value.l == MAPI_E_NOT_FOUND) {
3533 + mMAPIFreeBuffer( lpProp);
3541 +BOOL nsMapiAddressBook::GetEntryIdFromProp( LPSPropValue pVal, ULONG& cbEntryId, LPENTRYID& lpEntryId, BOOL delVal)
3546 + BOOL bResult = TRUE;
3547 + switch (PROP_TYPE(pVal->ulPropTag))
3550 + cbEntryId = pVal->Value.bin.cb;
3551 + mMAPIAllocateBuffer( cbEntryId, (LPVOID *) &lpEntryId);
3552 + memcpy( lpEntryId, pVal->Value.bin.lpb, cbEntryId);
3556 + PRINTF(( "EntryId not in BINARY prop value\n"));
3561 + if (pVal && delVal)
3562 + mMAPIFreeBuffer( pVal);
3567 +BOOL nsMapiAddressBook::HandleContentsItem(ULONG oType, ULONG cb, LPENTRYID pEntry,nsMapiEntryArray& aFolders)
3573 + if (oType == MAPI_MESSAGE)
3575 + if (oType == MAPI_STORE)
3577 + hr=mRootSession->OpenEntry(
3583 + (IUnknown**)&lpMsgStore);
3586 + //Add MDB to a list to make it can be released when class destroyed.
3587 + //We must leave it openned or else we can't open address store in it.
3588 + AddToMDBArray(lpMsgStore);
3590 + LPSPropValue pVal;
3591 + pVal=GetMapiProperty(lpMsgStore,PR_IPM_SUBTREE_ENTRYID);
3597 + nsMapiInterfaceWrapper<LPMAPICONTAINER> lpSubTree;
3599 + if (GetEntryIdFromProp( pVal, cbEntry, pEntry)) {
3600 + // Open up the folder!
3601 + BOOL bResult = TRUE;
3602 + bResult = lpMsgStore->OpenEntry(
3609 + mMAPIFreeBuffer( pEntry);
3610 + if (!bResult && *(LPMAPICONTAINER*)&lpSubTree) {
3611 + // Iterate the subtree with the results going into the folder list
3612 + bResult = IterateHierarchy(*(LPMAPICONTAINER*)&lpSubTree,aFolders);
3615 + PRINTF(( "GetStoreFolders: Error opening sub tree.\n"));
3619 + PRINTF(( "GetStoreFolders: Error getting entryID from sub tree property val.\n"));
3623 + PRINTF(( "GetStoreFolders: Error getting sub tree property.\n"));
3628 + PRINTF(("Type:%d\n",oType));
3634 +BOOL nsMapiAddressBook::IterateHierarchy(LPMAPICONTAINER pFolder,nsMapiEntryArray& aFolders, ULONG flags)
3636 + // flags can be CONVENIENT_DEPTH or 0
3637 + // CONVENIENT_DEPTH will return all depths I believe instead
3638 + // of just children
3640 + nsMapiInterfaceWrapper<LPMAPITABLE> lpTable;
3641 + hr = pFolder->GetHierarchyTable( CONVENIENT_DEPTH , lpTable);
3642 + if (HR_FAILED(hr)) {
3643 + PRINTF(( "IterateHierarchy: GetContentsTable failed: 0x%lx, %d\n", (long)hr, (int)hr));
3648 + hr = lpTable->GetRowCount( 0, &rowCount);
3653 + hr = lpTable->SetColumns( (LPSPropTagArray)&ptaEid, 0);
3654 + if (HR_FAILED(hr)) {
3655 + PRINTF(( "IterateHierarchy: SetColumns failed: 0x%lx, %d\n", (long)hr, (int)hr));
3659 + hr = lpTable->SeekRow( BOOKMARK_BEGINNING, 0, NULL);
3660 + if (HR_FAILED(hr)) {
3661 + PRINTF(( "IterateHierarchy: SeekRow failed: 0x%lx, %d\n", (long)hr, (int)hr));
3667 + BOOL keepGoing = TRUE;
3668 + BOOL bResult = TRUE;
3672 + hr = lpTable->QueryRows( 1, 0, &lpRow);
3674 + if (HR_FAILED(hr))
3676 + PRINTF(( "QueryRows failed: 0x%lx, %d\n", (long)hr, (int)hr));
3682 + cNumRows = lpRow->cRows;
3685 + LPENTRYID lpEntry = (LPENTRYID) lpRow->aRow[0].lpProps[ieidPR_ENTRYID].Value.bin.lpb;
3686 + ULONG cb = lpRow->aRow[0].lpProps[ieidPR_ENTRYID].Value.bin.cb;
3687 + ULONG oType = lpRow->aRow[0].lpProps[ieidPR_OBJECT_TYPE].Value.ul;
3689 + keepGoing = HandleHierarchyItem( oType, cb, lpEntry,aFolders);
3692 + MyFreeProws(lpRow);
3695 + } while ( SUCCEEDED(hr) && cNumRows && lpRow && keepGoing);
3698 + if (bResult && !keepGoing)
3703 +BOOL nsMapiAddressBook::HandleHierarchyItem( ULONG oType, ULONG cb, LPENTRYID pEntry,nsMapiEntryArray& aFolders)
3706 + if (oType == MAPI_FOLDER)
3708 + nsMapiInterfaceWrapper<LPMAPICONTAINER> pFolder ;
3709 + if (!mRootSession->OpenEntry(
3717 + LPSPropValue pVal;
3720 + pVal = GetMapiProperty(*(LPMAPICONTAINER*)&pFolder, PR_CONTAINER_CLASS);
3723 + if (strcmp("IPF.Contact",pVal->Value.lpszA) == 0)
3725 + SPropValue *currentValue=GetMapiProperty( *(LPMAPICONTAINER*)&pFolder, PR_ENTRYID);
3727 + aFolders.AddItem(currentValue->Value.bin.cb,
3728 + NS_REINTERPRET_CAST(LPENTRYID, currentValue->Value.bin.lpb)) ;
3736 + PRINTF(( "GetStoreFolders - HandleHierarchyItem: Unhandled ObjectType: %ld\n", oType));
3743 +BOOL nsMapiAddressBook::GetFolders(nsMapiEntryArray& aFolders)
3745 + aFolders.CleanUp() ;
3746 + nsMapiInterfaceWrapper<LPMAPICONTAINER> rootFolder ;
3747 + nsMapiInterfaceWrapper<LPMAPITABLE> folders ;
3748 + ULONG objType = 0 ;
3749 + ULONG rowCount = 0 ;
3751 + nsMapiInterfaceWrapper<LPMAPITABLE> lpTable;
3753 + mLastError = mRootSession->GetMsgStoresTable( 0, lpTable);
3754 + if (HR_FAILED(mLastError)) {
3755 + PRINTF(("Cannot open MAPI MsgStores %08x.\n", mLastError));
3756 + return mLastError;
3759 + mLastError = lpTable->GetRowCount( 0, &rowCount);
3761 + mLastError = lpTable->SetColumns( (LPSPropTagArray)&ptaEid, 0);
3762 + if (FAILED(mLastError))
3763 + return( mLastError);
3764 + mLastError = lpTable->SeekRow( BOOKMARK_BEGINNING, 0, NULL);
3765 + if (FAILED(mLastError))
3766 + return mLastError;
3770 + BOOL keepGoing = TRUE;
3771 + BOOL bResult = TRUE;
3775 + mLastError = lpTable->QueryRows( 1, 0, &lpRow);
3777 + if (HR_FAILED(mLastError)){
3783 + cNumRows = lpRow->cRows;
3786 + LPENTRYID lpEID = (LPENTRYID) lpRow->aRow[0].lpProps[ieidPR_ENTRYID].Value.bin.lpb;
3787 + ULONG cbEID = lpRow->aRow[0].lpProps[ieidPR_ENTRYID].Value.bin.cb;
3788 + ULONG oType = lpRow->aRow[0].lpProps[ieidPR_OBJECT_TYPE].Value.ul;
3791 + keepGoing = HandleContentsItem( oType, cbEID, lpEID,aFolders);
3793 + MyFreeProws( lpRow);
3796 + } while ( SUCCEEDED(mLastError) && cNumRows && lpRow && keepGoing);
3799 + return HR_SUCCEEDED(mLastError) ;
3801 +BOOL nsMapiAddressBook::CorrectRestriction(const LPMAPIPROP aMapiProp,ULONG aRestrictionNum, LPSRestriction aRestriction)
3803 + ULONG conditionType = 0 ;
3805 + if (!aRestriction)
3807 + for (ulResIndex=0;ulResIndex < aRestrictionNum;ulResIndex++)
3809 + conditionType = aRestriction[ulResIndex].rt;
3810 + switch (conditionType)
3813 + aRestriction[ulResIndex].res.resExist.ulPropTag =
3814 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resExist.ulPropTag);
3816 + case RES_BITMASK :
3817 + aRestriction[ulResIndex].res.resBitMask.ulPropTag =
3818 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resBitMask.ulPropTag);
3820 + case RES_CONTENT :
3821 + aRestriction[ulResIndex].res.resContent.ulPropTag =
3822 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resContent.ulPropTag);
3823 + aRestriction[ulResIndex].res.resContent.lpProp->ulPropTag =
3824 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resContent.lpProp->ulPropTag);
3826 + case RES_PROPERTY :
3827 + aRestriction[ulResIndex].res.resProperty.ulPropTag =
3828 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resProperty.ulPropTag);
3829 + aRestriction[ulResIndex].res.resProperty.lpProp->ulPropTag =
3830 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resProperty.lpProp->ulPropTag);
3833 + aRestriction[ulResIndex].res.resSize.ulPropTag =
3834 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resSize.ulPropTag);
3836 + case RES_COMPAREPROPS :
3837 + aRestriction[ulResIndex].res.resCompareProps.ulPropTag1 =
3838 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resCompareProps.ulPropTag1);
3839 + aRestriction[ulResIndex].res.resCompareProps.ulPropTag2 =
3840 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resCompareProps.ulPropTag2);
3843 + CorrectRestriction(aMapiProp,1,aRestriction[ulResIndex].res.resNot.lpRes);
3846 + CorrectRestriction(aMapiProp,
3847 + aRestriction[ulResIndex].res.resAnd.cRes,
3848 + aRestriction[ulResIndex].res.resAnd.lpRes);
3851 + CorrectRestriction(aMapiProp,
3852 + aRestriction[ulResIndex].res.resOr.cRes,
3853 + aRestriction[ulResIndex].res.resOr.lpRes);
3856 + case RES_COMMENT :
3857 + CorrectRestriction(aMapiProp,1,aRestriction[ulResIndex].res.resComment.lpRes);
3858 + aRestriction[ulResIndex].res.resComment.lpProp->ulPropTag =
3859 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resComment.lpProp->ulPropTag);
3861 + case RES_SUBRESTRICTION :
3862 + CorrectRestriction(aMapiProp,1,aRestriction[ulResIndex].res.resSub.lpRes);
3870 +BOOL nsMapiAddressBook::Filter( LPSRestriction aRestriction,nsMapiEntryArray * aList)
3872 + if (!aRestriction)
3875 + ULONG conditionType = 0 ;
3877 + nsMapiEntryArray listOut;
3878 + ULONG listindex=0;
3880 + nsMapiEntryArray listDel;
3884 + ULONG resCount = 0;
3885 + ULONG resIndex = 0;
3887 + listsize = aList->GetSize();
3888 + conditionType = aRestriction->rt;
3889 + switch (conditionType)
3892 + case RES_BITMASK :
3893 + case RES_CONTENT :
3894 + case RES_PROPERTY :
3896 + case RES_COMPAREPROPS :
3897 + case RES_COMMENT :
3898 + case RES_SUBRESTRICTION :
3900 + while(listindex < aList->GetSize())
3902 + if (!FilterOnOneRow(aList->ElementAt(listindex),aRestriction))
3903 + aList->Remove(listindex);
3910 + aRestriction->res.resNot.ulReserved = 1;
3914 + if (conditionType == RES_OR)
3916 + for(listindex=0;listindex<aList->GetSize();listindex++)
3918 + listDel.AddItem(aList->ElementAt(listindex));
3922 + resCount = aRestriction->res.resAnd.cRes;
3923 + //notice that SAndRestriction ,SNotRestriction ,SOrRestriction
3924 + //use the same struct
3925 + for (resIndex = 0;resIndex < resCount;resIndex++)
3927 + //can't call listOut.CleanUp() here
3928 + //because it will destroy all Element too
3929 + while(listOut.GetSize())
3931 + listOut.Remove(0);
3934 + for(listindex=0;listindex<aList->GetSize();listindex++)
3936 + listOut.AddItem(aList->ElementAt(listindex));
3939 + Filter(&aRestriction->res.resAnd.lpRes[resIndex],&listOut);
3940 + if (conditionType == RES_NOT)
3942 + for(listindex=0;listindex<listOut.GetSize();listindex++)
3944 + aList->Remove(listOut.ElementAt(listindex));
3947 + else if (conditionType == RES_AND )
3949 + for(listindex=0;listindex<listOut.GetSize();listindex++)
3951 + if (!aList->IndexOf(listOut.ElementAt(listindex)))
3953 + aList->Remove(listOut.ElementAt(listindex));
3957 + else if (conditionType == RES_OR )
3959 + for(listindex=0;listindex<listOut.GetSize();listindex++)
3961 + listDel.Remove(listOut.ElementAt(listindex));
3963 + if (listDel.GetSize() == 0)
3969 + if (conditionType == RES_OR)
3971 + for(listindex=0;listindex<listDel.GetSize();listindex++)
3973 + aList->Remove(listDel.ElementAt(listindex));
3979 + while(listDel.GetSize())
3981 + listDel.Remove(0);
3983 + while(listOut.GetSize())
3985 + listOut.Remove(0);
3992 +BOOL nsMapiAddressBook::FilterOnOneRow(nsMapiEntry *aEntry,LPSRestriction aRestriction)
3994 + LPMAPIPROP object ;
3995 + ULONG objType = 0 ;
3996 + LPSPropValue realValue = NULL ;
3997 + LPSPropValue resValue = NULL ;
3998 + ULONG valueCount = 0 ;
4000 + mLastError = OpenEntry(aEntry->mByteCount, aEntry->mEntryId,
4001 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
4002 + (IUnknown **)&object) ;
4004 + if (HR_FAILED(mLastError)) {
4005 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
4009 + ULONG conditionType = 0 ;
4010 + conditionType = aRestriction->rt;
4012 + switch (conditionType)
4015 + if (!GetMAPIProperties(*aEntry,&aRestriction->res.resExist.ulPropTag,1,realValue,valueCount))
4019 + case RES_CONTENT :
4020 + if (!GetMAPIProperties(*aEntry,&aRestriction->res.resContent.ulPropTag,1,realValue,valueCount))
4022 + resValue = aRestriction->res.resContent.lpProp;
4024 + case RES_PROPERTY :
4025 + if (!GetMAPIProperties(*aEntry,&aRestriction->res.resProperty.ulPropTag,1,realValue,valueCount))
4027 + resValue = aRestriction->res.resProperty.lpProp;
4029 + case RES_BITMASK :
4030 + return FALSE; //not support
4033 + return FALSE;//not been used now
4035 + case RES_COMPAREPROPS :
4036 + return FALSE;//not been used now
4039 + return FALSE;//not need care here
4042 + return FALSE;//not need care here
4045 + return FALSE;//not need care here
4047 + case RES_COMMENT :
4048 + return TRUE;//comment
4050 + case RES_SUBRESTRICTION :
4051 + return FALSE;//not been used now
4054 + return AtomyFilter(aRestriction,realValue,resValue);
4058 +BOOL nsMapiAddressBook::AtomyFilter(LPSRestriction aRestriction,LPSPropValue aRealValue,LPSPropValue aFilterValue)
4060 + ULONG conditionType = 0 ;
4061 + conditionType = aRestriction->rt;
4063 + BOOL bTagEq=(aRealValue &&
4064 + PROP_TYPE( aRealValue->ulPropTag ) != PT_ERROR) &&
4066 + // PROP_TYPE( aRealValue->ulPropTag ) == PROP_TYPE( aFilterValue->ulPropTag ));
4067 + switch (conditionType)
4070 + return (aRealValue && PROP_TYPE( aRealValue->ulPropTag ) != PT_ERROR) ;
4072 + case RES_CONTENT :
4075 + switch(aRestriction->res.resContent.ulFuzzyLevel)
4077 + case FL_FULLSTRING :
4078 + return !stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA);
4081 + return stristr(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) == aRealValue->Value.lpszA;
4083 + case FL_SUBSTRING :
4085 + return stristr(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) != NULL;
4091 + case RES_PROPERTY :
4094 + switch(aRestriction->res.resProperty.relop)
4097 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) >= 0;
4100 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) > 0;
4103 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) <= 0;
4106 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) < 0;
4109 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) == 0;
4112 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) != 0;
4116 + return stristr(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) != NULL;
4123 + case RES_BITMASK :
4124 + return FALSE; //not support
4127 + return FALSE;//not been used now
4129 + case RES_COMPAREPROPS :
4130 + return FALSE;//not been used now
4133 + return FALSE;//not need care here
4136 + return FALSE;//not need care here
4139 + return FALSE;//not need care here
4141 + case RES_COMMENT :
4142 + return TRUE;//comment
4144 + case RES_SUBRESTRICTION :
4145 + return FALSE;//not been used now
4151 +BOOL nsMapiAddressBook::GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
4152 + nsMapiEntryArray *aList, ULONG aMapiType)
4157 + nsMapiInterfaceWrapper<LPMAPICONTAINER> parent ;
4158 + nsMapiInterfaceWrapper<LPMAPITABLE> contents ;
4159 + ULONG objType = 0 ;
4160 + ULONG rowCount = 0 ;
4163 + nsMapiInterfaceWrapper<LPMAPIPROP> pFolder;
4165 + aParent.ToString(cs);
4167 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
4168 + 0, MAPI_BEST_ACCESS, &objType, pFolder);
4169 + if (HR_FAILED(mLastError))
4171 + PRINTF(("Cannot open folder %08x.\n", mLastError)) ;
4176 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIPROP*)&pFolder,PR_MESSAGE_CLASS);
4177 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
4180 + LPSPropValue aValue = NULL ;
4181 + ULONG aValueCount = 0 ;
4183 + LPSPropTagArray properties = NULL ;
4184 + mMAPIAllocateBuffer(CbNewSPropTagArray(1),
4185 + (void **)&properties);
4186 + properties->cValues = 1;
4187 + properties->aulPropTag [0] = GetEmailPropertyTag(*(LPMAPIPROP*)&pFolder,OUTLOOK_EMAIL_LIST1);
4188 + hr = pFolder->GetProps(properties, 0, &aValueCount, &aValue) ;
4190 + SBinaryArray *sa=&aValue->Value.MVbin;
4196 + nsMapiEntry testEntry;
4198 + for (idx=0;sa->lpbin && idx<sa->cValues ;idx++)
4200 + lpEID= (LPENTRYID) sa->lpbin[idx].lpb;
4201 + cbEID = sa->lpbin[idx].cb;
4202 + testEntry.Assign(sa->lpbin[idx].cb,NS_REINTERPRET_CAST(LPENTRYID,sa->lpbin[idx].lpb));
4204 + if (GetPropertyString(testEntry,PR_MESSAGE_CLASS,sClass)) //Error get property
4206 + aList->AddItem(cbEID,lpEID);
4209 + Filter(aRestriction,aList);
4213 + if (aRestriction && !CorrectRestriction(*(LPMAPICONTAINER*)&pFolder,1,aRestriction))
4215 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
4216 + &IID_IMAPIContainer, MAPI_BEST_ACCESS, &objType,
4218 + if (HR_FAILED(mLastError)) {
4219 + PRINTF(("Cannot open parent %08x.\n", mLastError)) ;
4223 + mLastError = parent->GetContentsTable(0, contents) ;
4224 + if (HR_FAILED(mLastError)) {
4225 + PRINTF(("Cannot get contents %08x.\n", mLastError)) ;
4228 + if (aRestriction) {
4229 + mLastError = contents->Restrict(aRestriction, TBL_BATCH) ;
4230 + if (HR_FAILED(mLastError)) {
4231 + PRINTF(("Cannot set restriction %08x.\n", mLastError)) ;
4235 + mLastError = contents->SetColumns((LPSPropTagArray)&ContentsColumns, 0);
4236 + if (HR_FAILED(mLastError)) {
4237 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
4240 + mLastError = contents->GetRowCount(0, &rowCount) ;
4241 + if (HR_FAILED(mLastError)) {
4242 + PRINTF(("Cannot get result count %08x.\n", mLastError)) ;
4246 + LPSRowSet rowSet = NULL ;
4249 + mLastError = contents->QueryRows(1, 0, &rowSet) ;
4250 + if (HR_FAILED(mLastError)) {
4251 + PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
4254 + rowCount = rowSet->cRows ;
4255 + if (rowCount > 0 && aList)
4257 + if (aMapiType == 0 || rowSet->aRow->lpProps[ContentsColumnObjectType].Value.ul == aMapiType)
4259 + SPropValue& currentValue = rowSet->aRow->lpProps[ContentsColumnEntryId] ;
4260 + aList->AddItem(currentValue.Value.bin.cb,
4261 + NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
4263 + else if (aMapiType == MAPI_DISTLIST)
4265 + if (strcmp("IPM.DistList",rowSet->aRow->lpProps[ContentsColumnMessageClass].Value.lpszA)==0)
4267 + SPropValue& currentValue = rowSet->aRow->lpProps[ContentsColumnEntryId] ;
4268 + aList->AddItem(currentValue.Value.bin.cb,
4269 + NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
4275 + MyFreeProws(rowSet) ;
4276 + } while (rowCount > 0) ;
4283 +BOOL nsMapiAddressBook::GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
4284 + ULONG aNbProperties, LPSPropValue& aValue,
4285 + ULONG& aValueCount)
4287 + nsMapiInterfaceWrapper<LPMAPIPROP> object ;
4288 + ULONG objType = 0 ;
4289 + LPSPropTagArray properties = NULL ;
4292 + mLastError = OpenEntry(aObject.mByteCount, aObject.mEntryId,
4293 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
4296 + if (HR_FAILED(mLastError)) {
4297 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
4300 + AllocateBuffer(CbNewSPropTagArray(aNbProperties),
4301 + NS_REINTERPRET_CAST(void **, &properties));
4302 + properties->cValues = aNbProperties ;
4303 + for (i = 0 ; i < aNbProperties ; ++ i)
4305 + properties->aulPropTag [i] = GetRealMapiPropertyTag(*(LPMAPIPROP*)&object,aPropertyTags [i],TRUE);
4307 + mLastError = object->GetProps(properties, 0 , &aValueCount, &aValue) ;
4308 + FreeBuffer(properties) ;
4310 + if (HR_FAILED(mLastError)) {
4311 + PRINTF(("Error get props %08x.\n", mLastError)) ;
4313 + return HR_SUCCEEDED(mLastError);
4316 +BOOL nsMapiAddressBook::SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
4317 + LPSPropValue& aValues)
4319 + nsMapiInterfaceWrapper<LPMESSAGE> object;
4320 + ULONG objType = 0 ;
4321 + LPSPropProblemArray problems = NULL ;
4324 + LPMDB lpMsgStore=GetMsgStore(aObject);
4330 + mLastError = lpMsgStore->OpenEntry(aObject.mByteCount, aObject.mEntryId,
4331 + &IID_IMAPIProp, MAPI_BEST_ACCESS , &objType,
4333 + lpMsgStore->Release();
4335 + if (HR_FAILED(mLastError)) {
4336 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
4339 + for (i = 0 ; i < aNbProperties ; ++ i)
4341 + aValues[i].ulPropTag = GetRealMapiPropertyTag(*(LPMESSAGE*)&object,aValues[i].ulPropTag,TRUE);
4343 + mLastError = object->SetProps(aNbProperties, aValues, &problems) ;
4344 + if (HR_FAILED(mLastError)) {
4345 + PRINTF(("Cannot update the object %08x.\n", mLastError)) ;
4349 + for (ULONG i = 0 ; i < problems->cProblem ; ++ i) {
4350 + PRINTF(("Problem %d: index %d code %08x.\n", i,
4351 + problems->aProblem [i].ulIndex,
4352 + problems->aProblem [i].scode)) ;
4355 + mLastError = object->SaveChanges(0) ;
4356 + if (MAPI_E_OBJECT_CHANGED == mLastError)
4358 + mLastError = object->SaveChanges(FORCE_SAVE ) ;
4360 + return HR_SUCCEEDED(mLastError) ;
4363 +BOOL nsMapiAddressBook::GetDefaultContainer(nsMapiEntry& aContainer)
4368 +BOOL nsMapiAddressBook::IsOK(void)
4370 + return mRootSession && mLibUsage;
4373 BOOL nsMapiAddressBook::Initialize(void)
4375 - if (mAddressBook) { return TRUE ; }
4377 nsAutoLock guard(mMutex) ;
4379 if (!LoadMapiLibrary()) {
4380 PRINTF(("Cannot load library.\n")) ;
4383 - mAddressBook = mRootBook ;
4388 void nsMapiAddressBook::AllocateBuffer(ULONG aByteCount, LPVOID *aBuffer)
4389 @@ -181,7 +1108,803 @@
4390 mMAPIFreeBuffer(aBuffer) ;
4393 +ULONG nsMapiAddressBook::GetEmailPropertyTag(LPMAPIPROP lpProp, LONG nameID)
4395 + static GUID emailGUID =
4397 + 0x00062004, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46
4401 + MAPINAMEID mapiNameID;
4402 + mapiNameID.lpguid = &emailGUID;
4403 + mapiNameID.ulKind = MNID_ID;
4404 + mapiNameID.Kind.lID = nameID;
4406 + LPMAPINAMEID lpMapiNames = &mapiNameID;
4407 + LPSPropTagArray lpMailTagArray = NULL;
4409 + HRESULT result = lpProp->GetIDsFromNames(1L, &lpMapiNames, 0, &lpMailTagArray);
4410 + if (result == S_OK)
4412 + ULONG lTag = lpMailTagArray->aulPropTag[0];
4413 + mMAPIFreeBuffer(lpMailTagArray);
4418 +ULONG nsMapiAddressBook::GetRealMapiPropertyTag(LPMAPIPROP lpProp, LONG aPropertyTag,BOOL aTest)
4420 + LPSPropValue addr;
4421 + ULONG upRealTag=aPropertyTag;
4422 + ULONG lSize=sizeof(TagMaps) / sizeof(TagMap);
4424 + for(int i=0; i<lSize; i++)
4426 + if (TagMaps[i].AddressTag == aPropertyTag)
4429 + ULONG kPriEmailColumn=GetEmailPropertyTag(lpProp,TagMaps[i].NameID);
4432 + if (PR_DISPLAY_NAME_A == aPropertyTag)
4434 + //We need not change PR_DISPLAY_NAME_A tag if we are not using an address
4435 + LPSPropValue msgClass=GetMapiProperty(lpProp,PR_MESSAGE_CLASS);
4436 + if (msgClass && !strcmp("IPM.Contact",msgClass->Value.lpszA))
4438 + if (kPriEmailColumn)
4439 + upRealTag = kPriEmailColumn | TagMaps[i].TypeMask;
4443 + FreeBuffer(msgClass);
4444 + upRealTag = aPropertyTag;
4447 + else //PR_DISPLAY_NAME_A == aPropertyTag
4449 + addr=GetMapiProperty(lpProp,aPropertyTag);
4450 + if (!addr || PROP_TYPE( addr->ulPropTag) == PT_ERROR ||
4451 + addr->Value.l == MAPI_E_NOT_FOUND)
4453 + if (kPriEmailColumn)
4454 + upRealTag = kPriEmailColumn | TagMaps[i].TypeMask;
4460 + if (kPriEmailColumn)
4461 + upRealTag = kPriEmailColumn | TagMaps[i].TypeMask;
4464 + break; //we find it,exit
4471 +BOOL nsMapiAddressBook::GetPropertyLong(const nsMapiEntry& aObject,
4472 + ULONG aPropertyTag,
4476 + LPSPropValue values = NULL ;
4477 + ULONG valueCount = 0 ;
4479 + if (PR_OBJECT_TYPE == aPropertyTag)
4481 + nsMapiInterfaceWrapper<LPMAPIFOLDER> pFolder ;
4483 + mLastError = OpenEntry(aObject.mByteCount,aObject.mEntryId,
4484 + NULL,MAPI_BEST_ACCESS,&objType, pFolder);
4485 + if (HR_FAILED(mLastError))
4487 + PRINTF(("Cannot open folder %08x.\n", mLastError)) ;
4490 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIFOLDER*)&pFolder,PR_MESSAGE_CLASS);
4491 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
4493 + FreeBuffer(msgClass);
4494 + aValue = MAPI_DISTLIST;
4499 + if (!GetMAPIProperties(aObject, &aPropertyTag, 1, values, valueCount))
4502 + if (valueCount == 1 && values && PROP_TYPE(values->ulPropTag) == PT_LONG) {
4503 + aValue = values->Value.ul ;
4505 + FreeBuffer(values) ;
4509 +BOOL nsMapiAddressBook::GetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
4510 + WORD& aYear, WORD& aMonth, WORD& aDay)
4515 + LPSPropValue values = NULL ;
4516 + ULONG valueCount = 0 ;
4518 + if (!GetMAPIProperties(aObject, &aPropertyTag, 1, values, valueCount))
4521 + if (valueCount == 1 && values && PROP_TYPE(values->ulPropTag) == PT_SYSTIME) {
4522 + SYSTEMTIME readableTime ;
4523 + FILETIME localTime ;
4524 + FileTimeToLocalFileTime(&values->Value.ft,&localTime);
4525 + if (FileTimeToSystemTime(&localTime, &readableTime)) {
4526 + aYear = readableTime.wYear ;
4527 + aMonth = readableTime.wMonth ;
4528 + aDay = readableTime.wDay ;
4531 + FreeBuffer(values) ;
4535 +HRESULT nsMapiAddressBook::OpenEntry(ULONG cbEntryID,
4536 + LPENTRYID lpEntryID,
4537 + LPCIID lpInterface,
4539 + ULONG FAR * lpulObjType,
4540 + LPUNKNOWN FAR * lppUnk
4548 + rv=mRootSession->OpenEntry(cbEntryID,
4560 + if (HR_FAILED(rv) && !m_MDBArray.Count())
4562 + //There are no openned Message store,so we have to open them all
4563 + nsMapiEntryArray aFolders;
4564 + if (GetFolders(aFolders))
4568 + rv=mRootSession->OpenEntry(cbEntryID,
4585 +BOOL nsMapiAddressBook::AddEntryToList(const nsMapiEntry& aDistlist, const nsMapiEntry& aNewEntry)
4587 + nsMapiInterfaceWrapper<LPMAPIPROP> container ;
4588 + ULONG objType = 0 ;
4590 + nsMapiEntry parentEntry;
4591 + if (!GetEntryParent(aDistlist,parentEntry))
4594 + LPMDB lpMsgStore=GetMsgStore(parentEntry);
4598 + mLastError = lpMsgStore->OpenEntry(aDistlist.mByteCount, aDistlist.mEntryId,
4599 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
4601 + lpMsgStore->Release();
4603 + if (HR_FAILED(mLastError))
4608 + When add mail address to distlist,Mapi need update 2 tag.
4610 + //update OUTLOOK_EMAIL_LIST1
4611 + ULONG listTag=GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_LIST1) | PT_MV_BINARY;
4612 + SBinaryArray oldChilds;
4613 + LPSBinary bins=NULL;
4614 + SBinaryArray newChilds;
4615 + LPSPropValue oldChildValue = NULL ;
4616 + ULONG valueCount = 0 ;
4618 + if (!GetMAPIProperties(aDistlist, &listTag, 1, oldChildValue, valueCount))
4620 + PRINTF(("Cannot get old childs %08x.\n", mLastError)) ;
4624 + if (! (oldChildValue->Value.l == MAPI_E_NOT_FOUND))
4626 + oldChilds = oldChildValue->Value.MVbin;
4627 + newChilds.cValues=oldChilds.cValues + 1;
4628 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
4629 + newChilds.lpbin = bins;
4630 + for (ULONG i=0;i<oldChilds.cValues;i++)
4632 + newChilds.lpbin[i].lpb = oldChilds.lpbin[i].lpb;
4633 + newChilds.lpbin[i].cb = oldChilds.lpbin[i].cb;
4638 + newChilds.cValues = 1;
4639 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
4640 + newChilds.lpbin = bins;
4643 + nsMapiEntry orgEntryID;
4644 + if (!GetPropertyBin(aNewEntry,
4645 + GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_ORGID) | PT_BINARY,
4650 + newChilds.lpbin[newChilds.cValues-1].lpb = NS_REINTERPRET_CAST(unsigned char *, orgEntryID.mEntryId);
4651 + newChilds.lpbin[newChilds.cValues-1].cb = orgEntryID.mByteCount;
4653 + SPropValue childs;
4654 + childs.ulPropTag = listTag;
4655 + childs.Value.MVbin = newChilds;
4657 + LPSPropProblemArray problems = NULL ;
4658 + mLastError = container->SetProps(1, &childs, &problems) ;
4659 + if (HR_FAILED(mLastError)) {
4660 + PRINTF(("Cannot set childs %08x.\n", mLastError)) ;
4664 + //update OUTLOOK_EMAIL_LIST2
4665 + listTag = GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_LIST2) | PT_MV_BINARY;
4666 + if (!GetMAPIProperties(aDistlist, &listTag, 1, oldChildValue, valueCount))
4668 + PRINTF(("Cannot get old childs %08x.\n", mLastError)) ;
4672 + if (! (oldChildValue->Value.l == MAPI_E_NOT_FOUND))
4674 + oldChilds = oldChildValue->Value.MVbin;
4675 + newChilds.cValues=oldChilds.cValues + 1;
4676 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
4677 + newChilds.lpbin = bins;
4678 + for (ULONG i=0;i<oldChilds.cValues;i++)
4680 + newChilds.lpbin[i].lpb = oldChilds.lpbin[i].lpb;
4681 + newChilds.lpbin[i].cb = oldChilds.lpbin[i].cb;
4686 + newChilds.cValues = 1;
4687 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
4688 + newChilds.lpbin = bins;
4692 + Need more work here.
4693 + There are two kind of mail address in outlook DistList.
4694 + One is sample,not include in parent folder.
4695 + The other is a link to a unattached address in parents folders.
4696 + Currently we can only add first kind of address to a outlook distlist.
4699 + newChilds.lpbin[newChilds.cValues-1].lpb = NS_REINTERPRET_CAST(unsigned char *, orgEntryID.mEntryId);
4700 + newChilds.lpbin[newChilds.cValues-1].cb = orgEntryID.mByteCount;
4702 + childs.ulPropTag = listTag;
4703 + childs.Value.MVbin = newChilds;
4705 + mLastError = container->SetProps(1, &childs, &problems) ;
4706 + if (HR_FAILED(mLastError))
4708 + PRINTF(("Cannot set childs %08x.\n", mLastError)) ;
4712 + mMAPIFreeBuffer(bins);
4714 + mLastError = container->SaveChanges(KEEP_OPEN_READONLY) ;
4715 + if (HR_FAILED(mLastError)) {
4716 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
4722 +BOOL nsMapiAddressBook::DeleteEntryFromList(const nsMapiEntry& aDistlist, const nsMapiEntry& aNewEntry)
4724 + nsMapiInterfaceWrapper<LPMAPIPROP> container ;
4725 + ULONG objType = 0 ;
4727 + nsMapiEntry parentEntry;
4728 + if (!GetEntryParent(aDistlist,parentEntry))
4731 + LPMDB lpMsgStore=GetMsgStore(parentEntry);
4735 + mLastError = lpMsgStore->OpenEntry(aDistlist.mByteCount, aDistlist.mEntryId,
4736 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
4738 + lpMsgStore->Release();
4740 + if (HR_FAILED(mLastError))
4743 + When delete mail address from distlist,Mapi need update 2 tag.
4745 + //update OUTLOOK_EMAIL_LIST1
4746 + ULONG listTag=GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_LIST1) | PT_MV_BINARY;
4748 + SBinaryArray oldChilds;
4749 + LPSBinary bins=NULL;
4750 + SBinaryArray newChilds;
4751 + LPSPropValue oldChildValue = NULL ;
4752 + ULONG valueCount = 0 ;
4754 + newChilds.lpbin=NULL;
4756 + ULONG lDeleteEntry=0;
4759 + if (!GetMAPIProperties(aDistlist, &listTag, 1, oldChildValue, valueCount))
4761 + PRINTF(("Cannot get old childs %08x.\n", mLastError)) ;
4765 + if (! (oldChildValue->Value.l == MAPI_E_NOT_FOUND))
4767 + oldChilds = oldChildValue->Value.MVbin;
4768 + newChilds.cValues=oldChilds.cValues - 1;
4769 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
4770 + newChilds.lpbin = bins;
4771 + for (oldIndex=0;oldIndex<oldChilds.cValues;oldIndex++)
4773 + if ( oldChilds.lpbin[oldIndex].cb == aNewEntry.mByteCount &&
4774 + !memcmp((void*)(oldChilds.lpbin[oldIndex].lpb+4),
4775 + (void*)(aNewEntry.mEntryId->ab),
4776 + oldChilds.lpbin[oldIndex].cb-4))
4778 + lDeleteEntry=oldIndex;
4782 + newChilds.lpbin[newIndex].lpb = oldChilds.lpbin[oldIndex].lpb;
4783 + newChilds.lpbin[newIndex].cb = oldChilds.lpbin[oldIndex].cb;
4792 + SPropValue childs;
4793 + LPSPropProblemArray problems = NULL ;
4795 + if (newChilds.cValues == 0)
4797 + SPropTagArray delTags;
4798 + delTags.cValues = 1;
4799 + delTags.aulPropTag[0] = listTag;
4801 + mLastError = container->DeleteProps(&delTags, &problems) ;
4805 + childs.ulPropTag = listTag;
4806 + childs.Value.MVbin = newChilds;
4807 + mLastError = container->SetProps(1, &childs, &problems) ;
4810 + if (HR_FAILED(mLastError)) {
4811 + PRINTF(("Cannot set childs %08x.\n", mLastError)) ;
4815 + //update OUTLOOK_EMAIL_LIST2
4816 + listTag = GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_LIST2) | PT_MV_BINARY;
4817 + if (!GetMAPIProperties(aDistlist, &listTag, 1, oldChildValue, valueCount))
4819 + PRINTF(("Cannot get old childs %08x.\n", mLastError)) ;
4824 + if (! (oldChildValue->Value.l == MAPI_E_NOT_FOUND))
4826 + oldChilds = oldChildValue->Value.MVbin;
4827 + newChilds.cValues=oldChilds.cValues - 1;
4828 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
4829 + newChilds.lpbin = bins;
4830 + for (oldIndex=0;oldIndex<oldChilds.cValues;oldIndex++)
4832 + if (oldIndex != lDeleteEntry)
4834 + newChilds.lpbin[newIndex].lpb = oldChilds.lpbin[oldIndex].lpb;
4835 + newChilds.lpbin[newIndex].cb = oldChilds.lpbin[oldIndex].cb;
4842 + newChilds.cValues = 1;
4843 + mMAPIAllocateBuffer(sizeof(SBinary) * newChilds.cValues,(void**)& bins);
4844 + newChilds.lpbin = bins;
4849 + if (newChilds.cValues == 0)
4851 + SPropTagArray delTags;
4852 + delTags.cValues = 1;
4853 + delTags.aulPropTag[0] = listTag;
4855 + mLastError = container->DeleteProps(&delTags, &problems) ;
4859 + childs.ulPropTag = listTag;
4860 + childs.Value.MVbin = newChilds;
4861 + mLastError = container->SetProps(1, &childs, &problems) ;
4863 + if (HR_FAILED(mLastError)) {
4864 + PRINTF(("Cannot set childs %08x.\n", mLastError)) ;
4868 + mMAPIFreeBuffer(bins);
4870 + mLastError = container->SaveChanges(KEEP_OPEN_READONLY) ;
4871 + if (HR_FAILED(mLastError)) {
4872 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
4879 +BOOL nsMapiAddressBook::GetEntryParent(const nsMapiEntry& aParent, nsMapiEntry& aParentEntry)
4881 + nsMapiInterfaceWrapper<LPMAPIPROP> object ;
4882 + ULONG objType = 0 ;
4883 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
4884 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
4885 + (IUnknown **)&object) ;
4887 + if (HR_FAILED(mLastError)) {
4888 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
4891 + SPropValue *parentID=GetMapiProperty(*(LPMAPIPROP*)&object, PR_PARENT_ENTRYID);
4893 + if (parentID->Value.l == MAPI_E_NOT_FOUND)
4895 + aParentEntry.Assign(parentID->Value.bin.cb, NS_REINTERPRET_CAST(LPENTRYID, parentID->Value.bin.lpb));
4898 +BOOL nsMapiAddressBook::CreateEntryInList(const nsMapiEntry& aDistlist, nsMapiEntry& aNewEntry)
4900 + nsMapiInterfaceWrapper<LPMAPIPROP> container ;
4901 + ULONG objType = 0 ;
4903 + nsMapiEntry parentEntry;
4904 + if (!GetEntryParent(aDistlist,parentEntry))
4908 + nsMapiInterfaceWrapper<LPMESSAGE> newEntry ;
4909 + if (!CreateEntry(parentEntry,aNewEntry)) //Create a entry in parent folder
4912 + return AddEntryToList(aDistlist,aNewEntry);
4915 +BOOL nsMapiAddressBook::CreateEntry(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry)
4917 + nsMapiInterfaceWrapper<LPMAPIFOLDER> container ;
4918 + ULONG objType = 0 ;
4920 + nsMapiInterfaceWrapper<LPMAPIPROP> object;
4921 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
4922 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
4925 + if (HR_FAILED(mLastError)) {
4926 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
4929 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIPROP*)&object,PR_MESSAGE_CLASS);
4931 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
4932 + return CreateEntryInList(aParent,aNewEntry); //Create entry in DistList
4934 + LPMDB lpMsgStore=GetMsgStore(aParent);
4939 + mLastError = lpMsgStore->OpenEntry(aParent.mByteCount, aParent.mEntryId,
4940 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
4942 + lpMsgStore->Release();
4944 + if (HR_FAILED(mLastError))
4947 + nsMapiInterfaceWrapper<LPMESSAGE> newEntry ;
4949 + mLastError = container->CreateMessage(&IID_IMessage,
4952 + if (HR_FAILED(mLastError)) {
4953 + PRINTF(("Cannot create new entry %08x.\n", mLastError)) ;
4956 + SPropValue messageclass ;
4957 + LPSPropProblemArray problems = NULL ;
4958 + nsCString tempName ;
4960 + messageclass.ulPropTag = PR_MESSAGE_CLASS_A ;
4961 + tempName.Assign("IPM.Contact") ;
4962 + messageclass.Value.lpszA = NS_CONST_CAST(char *, tempName.get()) ;
4963 + mLastError = newEntry->SetProps(1, &messageclass, &problems) ;
4964 + if (HR_FAILED(mLastError)) {
4965 + PRINTF(("Cannot set temporary name %08x.\n", mLastError)) ;
4968 + mLastError = newEntry->SaveChanges(KEEP_OPEN_READONLY) ;
4969 + if (HR_FAILED(mLastError)) {
4970 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
4974 + SPropTagArray property ;
4975 + LPSPropValue value = NULL ;
4976 + ULONG valueCount = 0 ;
4978 + property.cValues = 1 ;
4979 + property.aulPropTag [0] = PR_ENTRYID ;
4980 + mLastError = newEntry->GetProps(&property, 0, &valueCount, &value) ;
4981 + if (HR_FAILED(mLastError) || valueCount != 1) {
4982 + PRINTF(("Cannot get entry id %08x.\n", mLastError)) ;
4985 + aNewEntry.Assign(value->Value.bin.cb, NS_REINTERPRET_CAST(LPENTRYID, value->Value.bin.lpb)) ;
4986 + FreeBuffer(value) ;
4990 +BOOL nsMapiAddressBook::CreateDistList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry)
4992 + nsMapiInterfaceWrapper<LPMAPIFOLDER> container ;
4993 + ULONG objType = 0 ;
4995 + LPMDB lpMsgStore=GetMsgStore(aParent);
4998 + mLastError = lpMsgStore->OpenEntry(aParent.mByteCount, aParent.mEntryId,
4999 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
5001 + lpMsgStore->Release();
5003 + if (HR_FAILED(mLastError)) {
5004 + PRINTF(("Cannot open container %08x.\n", mLastError)) ;
5008 + nsMapiInterfaceWrapper<LPMESSAGE> newEntry ;
5009 + mLastError = container->CreateMessage(&IID_IMAPIProp,
5012 + if (HR_FAILED(mLastError)) {
5013 + PRINTF(("Cannot create new entry %08x.\n", mLastError)) ;
5016 + SPropValue messageclass ;
5017 + LPSPropProblemArray problems = NULL ;
5018 + nsCString tempName ;
5020 + messageclass.ulPropTag = PR_MESSAGE_CLASS_A ;
5021 + tempName.Assign("IPM.DistList") ;
5022 + messageclass.Value.lpszA = NS_CONST_CAST(char *, tempName.get()) ;
5023 + mLastError = newEntry->SetProps(1, &messageclass, &problems) ;
5024 + if (HR_FAILED(mLastError)) {
5025 + PRINTF(("Cannot set PR_MESSAGE_CLASS_A %08x.\n", mLastError)) ;
5028 + mLastError = newEntry->SaveChanges(KEEP_OPEN_READONLY) ;
5029 + if (HR_FAILED(mLastError)) {
5030 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
5034 + ULONG valueCount = 0 ;
5035 + SPropTagArray property ;
5036 + LPSPropValue value = NULL ;
5038 + property.cValues = 1 ;
5039 + property.aulPropTag [0] = PR_ENTRYID ;
5040 + mLastError = newEntry->GetProps(&property, 0, &valueCount, &value) ;
5041 + if (HR_FAILED(mLastError) || valueCount != 1) {
5042 + PRINTF(("Cannot get entry id %08x.\n", mLastError)) ;
5045 + aNewEntry.Assign(value->Value.bin.cb, NS_REINTERPRET_CAST(LPENTRYID, value->Value.bin.lpb)) ;
5047 + FreeBuffer(value) ;
5052 +BOOL nsMapiAddressBook::CopyEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aSource,
5053 + nsMapiEntry& aTarget)
5055 + nsMapiInterfaceWrapper<LPMAPIFOLDER> container ;
5056 + nsMapiInterfaceWrapper<LPMAPIFOLDER> targetFolder ;
5057 + ULONG objType = 0 ;
5058 + nsMapiInterfaceWrapper<LPMAPIPROP> object;
5059 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
5060 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
5063 + if (HR_FAILED(mLastError)) {
5064 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
5067 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIPROP*)&object,PR_MESSAGE_CLASS);
5069 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
5071 + //Add Entry To DistList
5072 + if (!AddEntryToList(aContainer,aSource))
5074 + aTarget.Assign(aSource.mByteCount,aSource.mEntryId);
5079 + SBinaryArray entryArray ;
5081 + entry.cb = aSource.mByteCount ;
5082 + entry.lpb = NS_REINTERPRET_CAST(LPBYTE, aSource.mEntryId) ;
5083 + entryArray.cValues = 1 ;
5084 + entryArray.lpbin = &entry ;
5086 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
5087 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
5089 + if (HR_FAILED(mLastError)) {
5090 + PRINTF(("Cannot open container %08x.\n", mLastError)) ;
5094 + mLastError = OpenEntry(aTarget.mByteCount, aTarget.mEntryId,
5095 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
5097 + if (HR_FAILED(mLastError)) {
5098 + PRINTF(("Cannot open Target folder %08x.\n", mLastError)) ;
5102 + nsMapiInterfaceWrapper<LPMAPIPROP> newEntry ;
5104 + mLastError = container->CopyMessages(&entryArray,
5106 + (void*)&targetFolder,
5110 + if (HR_FAILED(mLastError)) {
5111 + PRINTF(("Cannot create new entry %08x.\n", mLastError)) ;
5117 +BOOL nsMapiAddressBook::DeleteEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry)
5119 + nsMapiInterfaceWrapper<LPMAPIFOLDER> container ;
5120 + ULONG objType = 0 ;
5122 + SBinaryArray entryArray ;
5125 + nsMapiInterfaceWrapper<LPMAPIPROP> object;
5126 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
5127 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
5130 + if (HR_FAILED(mLastError)) {
5131 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
5134 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIPROP*)&object,PR_MESSAGE_CLASS);
5136 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
5137 + return DeleteEntryFromList(aContainer,aEntry); //Delete Entry from DistList
5139 + LPMDB lpMsgStore=GetMsgStore(aContainer);
5143 + mLastError = lpMsgStore->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
5144 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
5146 + lpMsgStore->Release();
5147 + if (HR_FAILED(mLastError)) {
5148 + PRINTF(("Cannot open container %08x.\n", mLastError)) ;
5151 + entry.cb = aEntry.mByteCount ;
5152 + entry.lpb = NS_REINTERPRET_CAST(LPBYTE, aEntry.mEntryId) ;
5153 + entryArray.cValues = 1 ;
5154 + entryArray.lpbin = &entry ;
5155 + mLastError = container->DeleteMessages(&entryArray, 0,0,0) ;
5156 + if (HR_FAILED(mLastError)) {
5157 + PRINTF(("Cannot delete entry %08x.\n", mLastError)) ;
5163 +//Use to open message store in write mode
5164 +LPMDB nsMapiAddressBook::GetMsgStore(const nsMapiEntry& aEntry)
5166 + nsMapiInterfaceWrapper<LPMAPIPROP> object;
5169 + mLastError = OpenEntry(aEntry.mByteCount, aEntry.mEntryId,
5170 + &IID_IMAPIProp, MAPI_BEST_ACCESS , &objType,
5172 + if (HR_FAILED(mLastError)) {
5173 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
5176 + SPropValue *svMsgSore=GetMapiProperty( *(LPMAPIPROP*)&object, PR_STORE_ENTRYID);;
5178 + LPMDB lpMsgStore=NULL;
5179 + mLastError=mRootSession->OpenMsgStore(0,
5180 + svMsgSore->Value.bin.cb,
5181 + (ENTRYID*)svMsgSore->Value.bin.lpb,
5183 + MAPI_BEST_ACCESS ,
5186 + if (HR_FAILED(mLastError)) {
5187 + PRINTF(("Cannot open MsgStore %08x.\n", mLastError)) ;
5191 + return lpMsgStore;
5193 --- misc/mozilla/mailnews/addrbook/src/nsMapiAddressBook.h 2004-04-17 20:32:14.000000000 +0200
5194 +++ misc/build/mozilla/mailnews/addrbook/src/nsMapiAddressBook.h 2008-08-14 16:22:21.000000000 +0200
5197 #include "nsAbWinHelper.h"
5205 class nsMapiAddressBook : public nsAbWinHelper
5208 nsMapiAddressBook(void) ;
5209 virtual ~nsMapiAddressBook(void) ;
5211 + // Get the top address books
5212 + virtual BOOL GetFolders(nsMapiEntryArray& aFolders);
5214 + // Get a default address book container
5215 + virtual BOOL GetDefaultContainer(nsMapiEntry& aContainer);
5216 + // Is the helper correctly initialised?
5217 + virtual BOOL IsOK(void);
5218 + virtual BOOL GetPropertyLong(const nsMapiEntry& aObject,
5219 + ULONG aPropertyTag,
5221 + // Get the value of a MAPI property of type SYSTIME
5222 + virtual BOOL GetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
5223 + WORD& aYear, WORD& aMonth, WORD& aDay);
5224 + // Create entry in the address book
5225 + virtual BOOL CreateEntry(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
5226 + // Delete an entry in the address book
5227 + virtual BOOL DeleteEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
5228 + // Create a distribution list in the address book
5229 + virtual BOOL CreateDistList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
5230 + // Copy an existing entry in the address book
5231 + virtual BOOL CopyEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aSource, nsMapiEntry& aTarget) ;
5233 + static void FreeMapiLibrary(void) ;
5236 // Class members to handle the library/entry points
5237 static HMODULE mLibrary ;
5239 static BOOL mInitialized ;
5240 static BOOL mLogonDone ;
5241 static LPMAPISESSION mRootSession ;
5242 - static LPADRBOOK mRootBook ;
5245 // Load the MAPI environment
5246 BOOL Initialize(void) ;
5248 + virtual HRESULT OpenEntry(ULONG cbEntryID,
5249 + LPENTRYID lpEntryID,
5250 + LPCIID lpInterface,
5252 + ULONG FAR * lpulObjType,
5253 + LPUNKNOWN FAR * lppUnk
5257 + // Retrieve the contents of a container, with an optional restriction
5258 + virtual BOOL GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
5259 + nsMapiEntryArray *aList, ULONG aMapiType) ;
5260 + // Retrieve the values of a set of properties on a MAPI object
5261 + virtual BOOL GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
5262 + ULONG aNbProperties,
5263 + LPSPropValue& aValues, ULONG& aValueCount) ;
5264 + // Set the values of a set of properties on a MAPI object
5265 + virtual BOOL SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
5266 + LPSPropValue& aValues);
5269 // Allocation of a buffer for transmission to interfaces
5270 virtual void AllocateBuffer(ULONG aByteCount, LPVOID *aBuffer) ;
5271 // Destruction of a buffer provided by the interfaces
5272 virtual void FreeBuffer(LPVOID aBuffer) ;
5273 // Library management
5274 static BOOL LoadMapiLibrary(void) ;
5275 - static void FreeMapiLibrary(void) ;
5277 + BOOL HandleContentsItem(ULONG oType, ULONG cb, LPENTRYID pEntry,nsMapiEntryArray& aFolders);
5278 + LPSPropValue GetMapiProperty( LPMAPIPROP pProp, ULONG tag);
5279 + BOOL GetEntryIdFromProp( LPSPropValue pVal, ULONG& cbEntryId, LPENTRYID& lpEntryId, BOOL delVal=FALSE);
5280 + BOOL HandleHierarchyItem( ULONG oType, ULONG cb, LPENTRYID pEntry,nsMapiEntryArray& aFolders);
5281 + BOOL IterateHierarchy(IMAPIContainer * pFolder, nsMapiEntryArray& aFolders,ULONG flags=0);
5282 + ULONG GetEmailPropertyTag(LPMAPIPROP lpProp, LONG nameID);
5283 + ULONG GetRealMapiPropertyTag(LPMAPIPROP lpProp, LONG aPropertyTag,BOOL aTest=FALSE);
5284 + LPMDB GetMsgStore(const nsMapiEntry& aEntry);
5285 + BOOL CreateEntryInList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry);
5286 + BOOL AddEntryToList(const nsMapiEntry& aParent,const nsMapiEntry& aNewEntry);
5287 + BOOL DeleteEntryFromList(const nsMapiEntry& aDistlist, const nsMapiEntry& aNewEntry);
5288 + BOOL GetEntryParent(const nsMapiEntry& aParent, nsMapiEntry& aParentEntry);
5289 + BOOL CorrectRestriction(const LPMAPIPROP aMapiProp,ULONG aRestrictionNum, LPSRestriction aRestriction);
5292 + BOOL Filter( LPSRestriction aRestriction,nsMapiEntryArray * aList);
5293 + BOOL FilterOnOneRow(nsMapiEntry *aEntry,LPSRestriction aRestriction);
5294 + BOOL AtomyFilter(LPSRestriction aRestriction,LPSPropValue aRealValue,LPSPropValue aFilterValue);
5296 + void AddToMDBArray(LPMDB aMDB)
5298 + m_MDBArray.AppendElement(aMDB);
5303 + for (int i = 0; i < m_MDBArray.Count(); i++)
5305 + mdb = (LPMDB)m_MDBArray.ElementAt(i);
5308 + m_MDBArray.Clear();
5312 + //use to keep all openned MsgStore,if we not open a message store,we can't open any thing on it
5313 + //so we have to kill message stores openned
5314 + nsVoidArray m_MDBArray;
5317 #endif // nsMapiAddressBook_h___
5318 --- misc/mozilla/mailnews/addrbook/src/nsWabAddressBook.cpp 2004-11-05 16:13:32.000000000 +0100
5319 +++ misc/build/mozilla/mailnews/addrbook/src/nsWabAddressBook.cpp 2008-08-14 16:22:21.000000000 +0200
5322 #define PRINTF(args) PR_LOG(gWabAddressBookLog, PR_LOG_DEBUG, args)
5326 + ContentsColumnEntryId = 0,
5327 + ContentsColumnObjectType,
5328 + ContentsColumnsSize
5331 +static const SizedSPropTagArray(ContentsColumnsSize, ContentsColumns) =
5333 + ContentsColumnsSize,
5340 HMODULE nsWabAddressBook::mLibrary = NULL ;
5341 PRInt32 nsWabAddressBook::mLibUsage = 0 ;
5342 LPWABOPEN nsWabAddressBook::mWABOpen = NULL ;
5344 MOZ_DECL_CTOR_COUNTER(nsWabAddressBook)
5346 nsWabAddressBook::nsWabAddressBook(void)
5348 +: nsAbWinHelper(),mAddressBook(NULL)
5350 BOOL result = Initialize() ;
5352 @@ -109,9 +125,254 @@
5353 MOZ_COUNT_DTOR(nsWabAddressBook) ;
5356 +BOOL nsWabAddressBook::GetFolders(nsMapiEntryArray& aFolders)
5358 + aFolders.CleanUp() ;
5359 + nsMapiInterfaceWrapper<LPABCONT> rootFolder ;
5360 + nsMapiInterfaceWrapper<LPMAPITABLE> folders ;
5361 + ULONG objType = 0 ;
5362 + ULONG rowCount = 0 ;
5363 + SRestriction restriction ;
5364 + SPropTagArray folderColumns ;
5366 + mLastError = OpenEntry(0, NULL, NULL, 0, &objType,
5368 + if (HR_FAILED(mLastError)){
5369 + PRINTF(("Cannot open root %08x.\n", mLastError));
5372 + mLastError = rootFolder->GetHierarchyTable(0, folders);
5373 + if (HR_FAILED(mLastError)){
5374 + PRINTF(("Cannot get hierarchy %08x.\n", mLastError));
5377 + // We only take into account modifiable containers,
5378 + // otherwise, we end up with all the directory services...
5379 + restriction.rt = RES_BITMASK ;
5380 + restriction.res.resBitMask.ulPropTag = PR_CONTAINER_FLAGS ;
5381 + restriction.res.resBitMask.relBMR = BMR_NEZ ;
5382 + restriction.res.resBitMask.ulMask = AB_MODIFIABLE ;
5383 + mLastError = folders->Restrict(&restriction, 0) ;
5384 + if (HR_FAILED(mLastError)) {
5385 + PRINTF(("Cannot restrict table %08x.\n", mLastError)) ;
5387 + folderColumns.cValues = 1 ;
5388 + folderColumns.aulPropTag [0] = PR_ENTRYID ;
5389 + mLastError = folders->SetColumns(&folderColumns, 0) ;
5390 + if (HR_FAILED(mLastError)) {
5391 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
5394 + mLastError = folders->GetRowCount(0, &rowCount) ;
5395 + if (HR_SUCCEEDED(mLastError)) {
5397 + LPSRowSet rowSet = NULL ;
5400 + mLastError = folders->QueryRows(1, 0, &rowSet) ;
5401 + if (HR_SUCCEEDED(mLastError)) {
5402 + rowCount = rowSet->cRows ;
5403 + if (rowCount > 0) {
5404 + SPropValue& currentValue = rowSet->aRow->lpProps [0] ;
5406 + aFolders.AddItem(currentValue.Value.bin.cb,
5407 + NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
5409 + MyFreeProws(rowSet) ;
5412 + PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
5414 + } while (rowCount > 0) ;
5416 + return HR_SUCCEEDED(mLastError) ;
5418 +BOOL nsWabAddressBook::GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
5419 + nsMapiEntryArray *aList, ULONG aMapiType)
5421 + if (aList) { aList->CleanUp(); }
5422 + nsMapiInterfaceWrapper<LPMAPICONTAINER> parent ;
5423 + nsMapiInterfaceWrapper<LPMAPITABLE> contents ;
5424 + ULONG objType = 0 ;
5425 + ULONG rowCount = 0 ;
5427 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
5428 + &IID_IMAPIContainer, 0, &objType,
5430 + if (HR_FAILED(mLastError)) {
5431 + PRINTF(("Cannot open parent %08x.\n", mLastError)) ;
5434 + // Here, flags for WAB and MAPI could be different, so this works
5435 + // only as long as we don't want to use any flag in GetContentsTable
5436 + mLastError = parent->GetContentsTable(0, contents) ;
5437 + if (HR_FAILED(mLastError)) {
5438 + PRINTF(("Cannot get contents %08x.\n", mLastError)) ;
5441 + if (aRestriction) {
5442 + mLastError = contents->Restrict(aRestriction, 0) ;
5443 + if (HR_FAILED(mLastError)) {
5444 + PRINTF(("Cannot set restriction %08x.\n", mLastError)) ;
5448 + int entryId = ContentsColumnEntryId ;
5449 + int objectType = ContentsColumnObjectType ;
5453 + LPSPropTagArray allColumns = NULL ;
5455 + mLastError = contents->QueryColumns(TBL_ALL_COLUMNS, &allColumns) ;
5456 + if (HR_FAILED(mLastError)) {
5457 + PRINTF(("Cannot query columns %08x.\n", mLastError)) ;
5461 + for (unsigned int j = 0 ; j < allColumns->cValues ; ++ j) {
5462 + if (allColumns->aulPropTag [j] == PR_ENTRYID) {
5465 + else if (allColumns->aulPropTag [j] == PR_OBJECT_TYPE) {
5469 + mLastError = contents->SetColumns(allColumns, 0) ;
5470 + if (HR_FAILED(mLastError)) {
5471 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
5474 + FreeBuffer(allColumns) ;
5479 + mLastError = contents->SetColumns((LPSPropTagArray) &ContentsColumns, 0) ;
5480 + if (HR_FAILED(mLastError)) {
5481 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
5486 + mLastError = contents->GetRowCount(0, &rowCount) ;
5487 + if (HR_FAILED(mLastError)) {
5488 + PRINTF(("Cannot get result count %08x.\n", mLastError)) ;
5492 + LPSRowSet rowSet = NULL ;
5495 + mLastError = contents->QueryRows(1, 0, &rowSet) ;
5496 + if (HR_FAILED(mLastError)) {
5497 + PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
5500 + rowCount = rowSet->cRows ;
5501 + if (rowCount > 0 &&
5502 + (aMapiType == 0 ||
5503 + rowSet->aRow->lpProps[objectType].Value.ul == aMapiType)) {
5505 + SPropValue& currentValue = rowSet->aRow->lpProps[entryId] ;
5507 + aList->AddItem(currentValue.Value.bin.cb,
5508 + NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
5512 + MyFreeProws(rowSet) ;
5513 + } while (rowCount > 0) ;
5517 +BOOL nsWabAddressBook::GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
5518 + ULONG aNbProperties, LPSPropValue& aValue,
5519 + ULONG& aValueCount)
5521 + nsMapiInterfaceWrapper<LPMAPIPROP> object ;
5522 + IMsgStore * mdb=NULL;
5523 + ULONG objType = 0 ;
5524 + LPSPropTagArray properties = NULL ;
5527 + mLastError = OpenEntry(aObject.mByteCount, aObject.mEntryId,
5528 + &IID_IMAPIProp, 0, &objType,
5531 + if (HR_FAILED(mLastError)){
5532 + PRINTF(("Cannot open entry %08x.\n", mLastError));
5535 + AllocateBuffer(CbNewSPropTagArray(aNbProperties),
5536 + NS_REINTERPRET_CAST(void **, &properties));
5537 + properties->cValues = aNbProperties;
5538 + for (i = 0 ; i < aNbProperties ; ++ i) {
5539 + properties->aulPropTag [i] = aPropertyTags [i];
5541 + mLastError = object->GetProps(properties, 0, &aValueCount, &aValue);
5542 + FreeBuffer(properties);
5543 + if (HR_FAILED(mLastError)){
5544 + PRINTF(("Cannot get props %08x.\n", mLastError));
5546 + return HR_SUCCEEDED(mLastError) ;
5549 +BOOL nsWabAddressBook::SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
5550 + LPSPropValue& aValues)
5552 + nsMapiInterfaceWrapper<LPMAPIPROP> object ;
5553 + ULONG objType = 0 ;
5554 + LPSPropProblemArray problems = NULL ;
5556 + mLastError = OpenEntry(aObject.mByteCount, aObject.mEntryId,
5557 + &IID_IMAPIProp, MAPI_MODIFY, &objType,
5559 + if (HR_FAILED(mLastError)) {
5560 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
5563 + mLastError = object->SetProps(aNbProperties, aValues, &problems) ;
5564 + if (HR_FAILED(mLastError)) {
5565 + PRINTF(("Cannot update the object %08x.\n", mLastError)) ;
5569 + for (ULONG i = 0 ; i < problems->cProblem ; ++ i) {
5570 + PRINTF(("Problem %d: index %d code %08x.\n", i,
5571 + problems->aProblem [i].ulIndex,
5572 + problems->aProblem [i].scode));
5575 + mLastError = object->SaveChanges(0) ;
5576 + if (HR_FAILED(mLastError)) {
5577 + PRINTF(("Cannot commit changes %08x.\n", mLastError)) ;
5579 + return HR_SUCCEEDED(mLastError) ;
5582 +BOOL nsWabAddressBook::GetDefaultContainer(nsMapiEntry& aContainer)
5584 + LPENTRYID entryId = NULL;
5585 + ULONG byteCount = 0;
5587 + mLastError = mAddressBook->GetPAB(&byteCount, &entryId);
5588 + if (HR_FAILED(mLastError)){
5589 + PRINTF(("Cannot get PAB %08x.\n", mLastError));
5592 + aContainer.Assign(byteCount, entryId);
5593 + FreeBuffer(entryId) ;
5597 +BOOL nsWabAddressBook::IsOK(void)
5599 + return mAddressBook != NULL ;
5602 BOOL nsWabAddressBook::Initialize(void)
5604 - if (mAddressBook) { return TRUE ; }
5605 nsAutoLock guard(mMutex) ;
5607 if (!LoadWabLibrary()) {
5608 --- misc/mozilla/mailnews/addrbook/src/nsWabAddressBook.h 2004-04-17 20:32:14.000000000 +0200
5609 +++ misc/build/mozilla/mailnews/addrbook/src/nsWabAddressBook.h 2008-08-14 16:22:21.000000000 +0200
5611 nsWabAddressBook(void) ;
5612 virtual ~nsWabAddressBook(void) ;
5614 + // Get the top address books
5615 + virtual BOOL GetFolders(nsMapiEntryArray& aFolders);
5617 + // Get a default address book container
5618 + virtual BOOL GetDefaultContainer(nsMapiEntry& aContainer);
5619 + // Is the helper correctly initialised?
5620 + virtual BOOL IsOK(void);
5621 + static void FreeWabLibrary(void) ;
5624 // Session and address book that will be shared by all instances
5625 // (see nsMapiAddressBook.h for details)
5627 static HMODULE mLibrary ;
5628 static LPWABOPEN mWABOpen ;
5630 + LPADRBOOK mAddressBook ;
5632 // Load the WAB environment
5633 BOOL Initialize(void) ;
5635 + virtual HRESULT OpenEntry(ULONG cbEntryID,
5636 + LPENTRYID lpEntryID,
5637 + LPCIID lpInterface,
5639 + ULONG FAR * lpulObjType,
5640 + LPUNKNOWN FAR * lppUnk
5643 + return mAddressBook->OpenEntry(cbEntryID,
5653 + // Retrieve the contents of a container, with an optional restriction
5654 + virtual BOOL GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
5655 + nsMapiEntryArray *aList, ULONG aMapiType) ;
5656 + // Retrieve the values of a set of properties on a MAPI object
5657 + virtual BOOL GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
5658 + ULONG aNbProperties,
5659 + LPSPropValue& aValues, ULONG& aValueCount) ;
5660 + // Set the values of a set of properties on a MAPI object
5661 + virtual BOOL SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
5662 + LPSPropValue& aValues) ;
5664 // Allocation of a buffer for transmission to interfaces
5665 virtual void AllocateBuffer(ULONG aByteCount, LPVOID *aBuffer) ;
5666 // Destruction of a buffer provided by the interfaces
5667 virtual void FreeBuffer(LPVOID aBuffer) ;
5668 // Manage the library
5669 static BOOL LoadWabLibrary(void) ;
5670 - static void FreeWabLibrary(void) ;
5674 --- misc/mozilla/modules/libpref/src/Makefile.in 2006-02-03 15:44:52.000000000 +0100
5675 +++ misc/build/mozilla/modules/libpref/src/Makefile.in 2008-08-14 16:22:21.000000000 +0200
5677 PREF_JS_EXPORTS += $(srcdir)/init/non-shared.txt
5680 -EXTRA_DSO_LDOPTS = \
5681 +EXTRA_DSO_LDOPTS += \
5684 $(MOZ_COMPONENT_LIBS) \
5685 --- misc/mozilla/netwerk/protocol/http/src/nsHttpConnectionMgr.cpp 2005-07-20 20:31:42.000000000 +0200
5686 +++ misc/build/mozilla/netwerk/protocol/http/src/nsHttpConnectionMgr.cpp 2008-08-20 15:45:06.000000000 +0200
5689 nsHttpConnectionMgr::UpdateParam(nsParamName name, PRUint16 value)
5691 - PRUint32 param = (PRUint32(name) << 16) | PRUint32(value);
5692 + PRUint32 param = (NS_PTR_TO_INT32(name) << 16) | NS_PTR_TO_INT32(value);
5693 return PostEvent(&nsHttpConnectionMgr::OnMsgUpdateParam, 0, (void *) param);
5696 --- misc/mozilla/nsprpub/build/cygwin-wrapper 2006-12-22 14:47:17.000000000 +0100
5697 +++ misc/build/mozilla/nsprpub/build/cygwin-wrapper 2008-08-14 16:22:21.000000000 +0200
5702 # Stupid wrapper to avoid win32 dospath/cygdrive issues
5703 # Try not to spawn programs from within this file. If the stuff in here looks royally
5704 --- misc/mozilla/nsprpub/config/autoconf.mk.in 2006-12-22 14:47:17.000000000 +0100
5705 +++ misc/build/mozilla/nsprpub/config/autoconf.mk.in 2008-08-14 16:22:21.000000000 +0200
5707 RELEASE_OBJDIR_NAME = @RELEASE_OBJDIR_NAME@
5708 OBJDIR_NAME = @OBJDIR_NAME@
5710 +LIB_PREFIX = @LIB_PREFIX@
5711 OBJ_SUFFIX = @OBJ_SUFFIX@
5712 LIB_SUFFIX = @LIB_SUFFIX@
5713 DLL_SUFFIX = @DLL_SUFFIX@
5714 --- misc/mozilla/nsprpub/config/rules.mk 2006-12-22 14:47:17.000000000 +0100
5715 +++ misc/build/mozilla/nsprpub/config/rules.mk 2008-12-12 10:09:34.437500000 +0100
5717 # other platforms do not.
5719 ifeq (,$(filter-out WIN95 OS2,$(OS_TARGET)))
5720 -LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
5721 +LIBRARY = $(OBJDIR)/$(LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
5722 SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
5723 -IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
5724 +IMPORT_LIBRARY = $(OBJDIR)/$(LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
5725 SHARED_LIB_PDB = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
5727 LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
5728 @@ -340,6 +340,10 @@
5730 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
5731 $(LINK_DLL) -MAP $(DLLBASE) $(DLL_LIBS) $(EXTRA_LIBS) $(OBJS) $(RES)
5732 + @if test -f $@.manifest; then \
5733 + mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;2; \
5734 + rm -f $@.manifest; \
5737 ifeq ($(MOZ_OS2_TOOLS),VACPP)
5738 $(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $(MAPFILE)
5739 --- misc/mozilla/nsprpub/configure 2008-01-29 20:27:43.000000000 +0100
5740 +++ misc/build/mozilla/nsprpub/configure 2008-08-14 16:22:21.000000000 +0200
5741 @@ -2737,6 +2737,7 @@
5746 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
5749 @@ -3475,7 +3476,7 @@
5752 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
5753 - MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
5754 + MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
5755 if test "$MOZ_OBJFORMAT" = "elf"; then
5758 @@ -3941,7 +3942,7 @@
5759 CC="$CC -mno-cygwin"
5760 CXX="$CXX -mno-cygwin"
5762 - MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
5763 + MKSHLIB='$(CC) -shared -Wl,--enable-runtime-pseudo-reloc -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
5765 # Use temp file for windres (bug 213281)
5766 RCFLAGS='-O coff --use-temp-file'
5767 @@ -3958,6 +3959,7 @@
5773 # Determine compiler version
5774 CC_VERSION=`"${CC}" -v 2>&1 | grep Version | sed -e 's|.* Version ||' -e 's| .*||'`
5775 @@ -5766,6 +5768,7 @@
5776 CC="\$(CYGWIN_WRAPPER) $CC"
5777 CXX="\$(CYGWIN_WRAPPER) $CXX"
5778 RC="\$(CYGWIN_WRAPPER) $RC"
5779 + LD="\$(CYGWIN_WRAPPER) $LD"
5783 @@ -6127,6 +6130,7 @@
5784 s%@LIB_SUFFIX@%$LIB_SUFFIX%g
5785 s%@DLL_SUFFIX@%$DLL_SUFFIX%g
5786 s%@ASM_SUFFIX@%$ASM_SUFFIX%g
5787 +s%@LIB_PREFIX@%$LIB_PREFIX%g
5788 s%@MKSHLIB@%$MKSHLIB%g
5789 s%@DSO_CFLAGS@%$DSO_CFLAGS%g
5790 s%@DSO_LDOPTS@%$DSO_LDOPTS%g
5791 --- misc/mozilla/nsprpub/configure.in 2008-01-29 20:27:44.000000000 +0100
5792 +++ misc/build/mozilla/nsprpub/configure.in 2008-08-14 16:22:21.000000000 +0200
5793 @@ -1137,7 +1137,7 @@
5794 AC_DEFINE(HAVE_BSD_FLOCK)
5795 AC_DEFINE(HAVE_SOCKLEN_T)
5796 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
5797 - MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
5798 + MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
5799 if test "$MOZ_OBJFORMAT" = "elf"; then
5802 --- misc/mozilla/nsprpub/lib/ds/Makefile.in 2006-12-22 14:47:17.000000000 +0100
5803 +++ misc/build/mozilla/nsprpub/lib/ds/Makefile.in 2008-08-14 16:22:21.000000000 +0200
5808 +ifeq ($(OS_ARCH),Linux)
5809 +MKSHLIB += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
5812 ifeq ($(OS_ARCH),SunOS)
5814 MAPFILE = $(OBJDIR)/pldsmap.sun
5815 GARBAGE += $(MAPFILE)
5817 ifdef GCC_USE_GNU_LD
5818 -MKSHLIB += -Wl,--version-script,$(MAPFILE)
5819 +MKSHLIB += -Wl,--version-script,$(MAPFILE) -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
5821 -MKSHLIB += -Wl,-M,$(MAPFILE)
5822 +MKSHLIB += -Wl,-M,$(MAPFILE) -Wl,-R,'$$ORIGIN'
5825 -MKSHLIB += -M $(MAPFILE)
5826 +MKSHLIB += -M $(MAPFILE) -Wl,-R,'$$ORIGIN'
5828 # The -R '$ORIGIN' linker option instructs this library to search for its
5829 # dependencies in the same directory where it resides.
5830 --- misc/mozilla/nsprpub/lib/libc/src/Makefile.in 2006-12-22 14:47:17.000000000 +0100
5831 +++ misc/build/mozilla/nsprpub/lib/libc/src/Makefile.in 2008-08-14 16:22:21.000000000 +0200
5836 +ifeq ($(OS_ARCH),Linux)
5837 +MKSHLIB += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
5840 ifeq ($(OS_ARCH),SunOS)
5842 MAPFILE = $(OBJDIR)/plcmap.sun
5843 GARBAGE += $(MAPFILE)
5845 ifdef GCC_USE_GNU_LD
5846 -MKSHLIB += -Wl,--version-script,$(MAPFILE)
5847 +MKSHLIB += -Wl,--version-script,$(MAPFILE) -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
5849 -MKSHLIB += -Wl,-M,$(MAPFILE)
5850 +MKSHLIB += -Wl,-M,$(MAPFILE) -Wl,-R,'$$ORIGIN'
5853 -MKSHLIB += -M $(MAPFILE)
5854 +MKSHLIB += -M $(MAPFILE) -Wl,-R,'$$ORIGIN'
5856 # The -R '$ORIGIN' linker option instructs this library to search for its
5857 # dependencies in the same directory where it resides.
5858 --- misc/mozilla/nsprpub/pr/src/misc/prnetdb.c 2006-12-22 14:47:27.000000000 +0100
5859 +++ misc/build/mozilla/nsprpub/pr/src/misc/prnetdb.c 2008-08-14 16:22:21.000000000 +0200
5861 #define _PR_HAVE_5_ARG_GETPROTO_R
5864 -#if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2)
5865 +#if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2) || \
5866 + (defined(__FreeBSD__) && __FreeBSD_version > 601103)
5867 #define _PR_HAVE_GETPROTO_R
5868 #define _PR_HAVE_5_ARG_GETPROTO_R
5870 --- misc/mozilla/security/coreconf/FreeBSD.mk 2006-12-22 14:48:06.000000000 +0100
5871 +++ misc/build/mozilla/security/coreconf/FreeBSD.mk 2008-08-14 16:22:21.000000000 +0200
5876 -MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo aout)
5877 +MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo elf)
5879 ifeq ($(MOZ_OBJFORMAT),elf)
5881 --- misc/mozilla/security/coreconf/Linux.mk 2006-12-22 14:48:06.000000000 +0100
5882 +++ misc/build/mozilla/security/coreconf/Linux.mk 2008-08-18 10:16:15.000000000 +0200
5885 ifeq ($(OS_RELEASE),2.0)
5886 OS_REL_CFLAGS += -DLINUX2_0
5887 - MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
5888 + MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
5890 MKSHLIB += -Wl,--version-script,$(MAPFILE)
5895 DSO_LDOPTS = -shared $(ARCHFLAG)
5896 +DSO_LDOPTS += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
5898 LDFLAGS += $(ARCHFLAG)
5900 --- misc/mozilla/security/coreconf/SunOS5.mk 2008-06-16 00:22:15.000000000 +0200
5901 +++ misc/build/mozilla/security/coreconf/SunOS5.mk 2008-08-14 16:22:21.000000000 +0200
5902 @@ -161,12 +161,14 @@
5905 # -G: produce a shared object
5906 +# -R '$ORIGIN': search for dependencies in same directory
5907 # -z defs: no unresolved symbols allowed
5912 DSO_LDOPTS += -shared -h $(notdir $@)
5913 + DSO_LDOPTS += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
5916 ifeq ($(OS_TEST),i86pc)
5920 DSO_LDOPTS += -G -h $(notdir $@)
5921 + DSO_LDOPTS += -R '$$ORIGIN'
5923 DSO_LDOPTS += -z combreloc -z defs -z ignore
5925 --- misc/mozilla/security/coreconf/WIN32.mk 2008-06-16 00:22:15.000000000 +0200
5926 +++ misc/build/mozilla/security/coreconf/WIN32.mk 2008-08-18 16:04:59.000000000 +0200
5928 DEFAULT_COMPILER = cl
5935 + CC = $(CYGWIN_WRAPPER) gcc
5936 + CCC = $(CYGWIN_WRAPPER) g++
5937 + LINK = $(CYGWIN_WRAPPER) ld
5938 + AR = $(CYGWIN_WRAPPER) ar
5941 + RANLIB = $(CYGWIN_WRAPPER) ranlib
5943 - RC = windres.exe -O coff --use-temp-file
5944 - LINK_DLL = $(CC) $(OS_DLLFLAGS) $(DLLFLAGS)
5945 + RC = $(CYGWIN_WRAPPER) windres.exe -O coff --use-temp-file
5946 + LINK_DLL = $(CYGWIN_WRAPPER) $(CC) $(OS_DLLFLAGS) $(DLLFLAGS)
5952 + CC = $(CYGWIN_WRAPPER) cl
5953 + CCC = $(CYGWIN_WRAPPER) cl
5954 + LINK = $(CYGWIN_WRAPPER) link
5955 + AR = $(CYGWIN_WRAPPER) lib
5956 AR += -NOLOGO -OUT:"$@"
5960 + RC = $(CYGWIN_WRAPPER) rc.exe
5966 NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
5968 -NSINSTALL = nsinstall
5969 +NSINSTALL = $(CYGWIN_WRAPPER) nsinstall
5971 MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend
5972 MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend.exe
5974 # dllimport cannot be used as as a constant address.
5975 OS_CFLAGS += -mno-cygwin -mms-bitfields -mnop-fun-dllimport
5976 _GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY)
5977 - DLLFLAGS += -mno-cygwin -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))
5978 + DLLFLAGS += -mno-cygwin -o $@ -shared -Wl,--enable-runtime-pseudo-reloc,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))
5981 DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
5982 --- misc/mozilla/security/coreconf/WIN954.0.mk 2008-06-16 00:22:15.000000000 +0200
5983 +++ misc/build/mozilla/security/coreconf/WIN954.0.mk 2008-08-14 16:22:21.000000000 +0200
5990 +NSPR31_LIB_PREFIX = lib
5992 --- misc/mozilla/security/coreconf/command.mk 2008-06-16 00:22:15.000000000 +0200
5993 +++ misc/build/mozilla/security/coreconf/command.mk 2008-08-19 09:58:11.000000000 +0200
5995 CCF = $(CC) $(CFLAGS)
5996 LINK_DLL = $(LINK) $(OS_DLLFLAGS) $(DLLFLAGS)
5997 LINK_EXE = $(LINK) $(OS_LFLAGS) $(LFLAGS)
5998 -CFLAGS = $(OPTIMIZER) $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) \
5999 +CFLAGS += $(OPTIMIZER) $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) \
6003 --- misc/mozilla/security/coreconf/rules.mk 2008-06-16 00:22:15.000000000 +0200
6004 +++ misc/build/mozilla/security/coreconf/rules.mk 2008-08-19 10:46:57.000000000 +0200
6006 $(PROGRAM): $(OBJS) $(EXTRA_LIBS)
6008 ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
6009 - $(MKPROG) $(subst /,\\,$(OBJS)) -Fe$@ -link $(LDFLAGS) $(subst /,\\,$(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS))
6010 + $(MKPROG) $(OBJS) -Fe$@ -link $(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)
6012 if test -f $@.manifest; then \
6013 $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
6014 @@ -305,11 +305,7 @@
6018 -ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
6019 - $(AR) $(subst /,\\,$(OBJS))
6028 $(LINK_DLL) $(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES)
6030 - $(LINK_DLL) -MAP $(DLLBASE) $(subst /,\\,$(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES))
6031 + $(LINK_DLL) -MAP $(DLLBASE) $(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES)
6033 if test -f $@.manifest; then \
6034 $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;2; \
6035 @@ -429,15 +425,15 @@
6039 -core_abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
6040 +mozabspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
6042 $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
6044 ifdef USE_NT_C_SYNTAX
6045 - $(CC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<)
6046 + $(CC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
6048 ifdef NEED_ABSOLUTE_PATH
6049 - $(CC) -o $@ -c $(CFLAGS) $(call core_abspath,$<)
6050 + $(CC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
6052 $(CC) -o $@ -c $(CFLAGS) $<
6054 @@ -445,10 +441,10 @@
6056 $(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
6057 ifdef USE_NT_C_SYNTAX
6058 - $(CC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<)
6059 + $(CC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
6061 ifdef NEED_ABSOLUTE_PATH
6062 - $(CC) -o $@ -c $(CFLAGS) $(call core_abspath,$<)
6063 + $(CC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
6065 $(CC) -o $@ -c $(CFLAGS) $<
6067 @@ -477,10 +473,10 @@
6068 $(OBJDIR)/$(PROG_PREFIX)%: %.cpp
6070 ifdef USE_NT_C_SYNTAX
6071 - $(CCC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<)
6072 + $(CCC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
6074 ifdef NEED_ABSOLUTE_PATH
6075 - $(CCC) -o $@ -c $(CFLAGS) $(call core_abspath,$<)
6076 + $(CCC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
6078 $(CCC) -o $@ -c $(CFLAGS) $<
6080 @@ -501,10 +497,10 @@
6081 rm -f $(OBJDIR)/t_$*.cc
6083 ifdef USE_NT_C_SYNTAX
6084 - $(CCC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<)
6085 + $(CCC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
6087 ifdef NEED_ABSOLUTE_PATH
6088 - $(CCC) -o $@ -c $(CFLAGS) $(call core_abspath,$<)
6089 + $(CCC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
6091 $(CCC) -o $@ -c $(CFLAGS) $<
6093 --- misc/mozilla/security/manager/Makefile.in 2008-06-16 00:23:29.000000000 +0200
6094 +++ misc/build/mozilla/security/manager/Makefile.in 2008-08-14 16:22:21.000000000 +0200
6095 @@ -123,8 +123,11 @@
6096 ifdef CYGDRIVE_MOUNT
6097 ABS_DIST := $(shell cygpath -w $(ABS_DIST) | sed -e 's|\\|/|g')
6099 +ifneq (,$(filter cygwin%,$(host_os)))
6100 +ABS_DIST := $(shell cygpath -u $(ABS_DIST))
6102 ifneq (,$(filter mingw%,$(host_os)))
6103 -ABS_DIST := $(shell cd $(DIST) && pwd -W)
6104 +ABS_DIST := $(shell cygpath -u $(ABS_DIST))
6107 NSPR_INCLUDE_DIR = $(firstword $(filter -I%,$(NSPR_CFLAGS)))
6110 ifeq ($(OS_ARCH),WINNT)
6111 DEFAULT_GMAKE_FLAGS += OS_TARGET=WIN95
6112 +DEFAULT_GMAKE_FLAGS += CYGWIN_WRAPPER=@CYGWIN_WRAPPER@
6114 ifndef MOZ_NO_DEBUG_RTL
6115 DEFAULT_GMAKE_FLAGS += USE_DEBUG_RTL=1
6116 --- misc/mozilla/security/nss/cmd/shlibsign/Makefile 2007-02-16 03:16:24.000000000 +0100
6117 +++ misc/build/mozilla/security/nss/cmd/shlibsign/Makefile 2009-02-12 15:42:13.033408000 +0100
6120 include ../platrules.mk
6122 -SRCDIR = $(call core_abspath,.)
6124 +ifeq ($(OS_TARGET), Darwin)
6127 +ifeq ($(OS_TARGET), Linux)
6133 %.chk: %.$(DLL_SUFFIX)
6134 ifeq ($(OS_TARGET), OS2)
6135 cd $(OBJDIR) ; cmd.exe /c $(SRCDIR)/sign.cmd $(DIST) \
6136 $(call core_abspath,$(OBJDIR)) $(OS_TARGET) \
6137 $(call core_abspath,$(NSPR_LIB_DIR)) $(call core_abspath,$<)
6139 - cd $(OBJDIR) ; sh $(SRCDIR)/sign.sh $(call core_abspath,$(DIST)) \
6140 - $(call core_abspath,$(OBJDIR)) $(OS_TARGET) \
6141 - $(call core_abspath,$(NSPR_LIB_DIR)) $(call core_abspath,$<)
6142 +ifeq ($(OS_TARGET), WIN95)
6143 + cd $(SRCDIR) ; sh $(CYGWIN_WRAPPER) ./sign.sh $(DIST) \
6144 + $(OBJDIR) $(OS_TARGET) \
6145 + $(NSPR_LIB_DIR) $<
6147 +ifeq ($(OS_TARGET), Darwin)
6148 + cd $(SRCDIR) ; sh ./sign.sh $(DIST) \
6149 + $(OBJDIR) $(OS_TARGET) \
6150 + $(NSPR_LIB_DIR) $<
6152 +ifeq ($(OS_TARGET), Linux)
6153 + cd $(SRCDIR) ; sh ./sign.sh $(DIST) \
6154 + $(OBJDIR) $(OS_TARGET) \
6155 + $(NSPR_LIB_DIR) $<
6157 + cd $(SRCDIR) ; sh ./sign.sh $(DIST) \
6158 + $(OBJDIR) $(OS_TARGET) \
6159 + $(NSPR_LIB_DIR) $<
6165 libs install :: $(CHECKLOC)
6166 --- misc/mozilla/security/nss/lib/ckfw/builtins/config.mk 2005-01-20 03:25:46.000000000 +0100
6167 +++ misc/build/mozilla/security/nss/lib/ckfw/builtins/config.mk 2008-08-14 16:22:21.000000000 +0200
6169 DSO_LDOPTS = -bundle
6172 -ifeq ($(OS_TARGET),SunOS)
6173 -# The -R '$ORIGIN' linker option instructs this library to search for its
6174 -# dependencies in the same directory where it resides.
6175 -MKSHLIB += -R '$$ORIGIN'
6178 --- misc/mozilla/security/nss/lib/freebl/Makefile 2008-06-16 00:22:09.000000000 +0200
6179 +++ misc/build/mozilla/security/nss/lib/freebl/Makefile 2008-08-18 14:31:08.000000000 +0200
6180 @@ -199,10 +199,6 @@
6183 ifeq ($(OS_TARGET),SunOS)
6185 -# The -R '$ORIGIN' linker option instructs this library to search for its
6186 -# dependencies in the same directory where it resides.
6187 -MKSHLIB += -R '$$ORIGIN'
6189 ifdef GCC_USE_GNU_LD
6190 MKSHLIB += -Wl,-Bsymbolic,-z,now,-z,text
6192 MKSHLIB += -Wl,-B,symbolic,-z,now,-z,text
6193 endif # GCC_USE_GNU_LD
6195 - MKSHLIB += -B symbolic -z now -z text
6196 + MKSHLIB += -z now -z text
6199 # Sun's WorkShop defines v8, v8plus and v9 architectures.
6200 --- misc/mozilla/security/nss/lib/nss/config.mk 2006-12-22 14:47:56.000000000 +0100
6201 +++ misc/build/mozilla/security/nss/lib/nss/config.mk 2008-08-19 17:07:42.000000000 +0200
6202 @@ -113,12 +113,10 @@
6203 # The -R '$ORIGIN' linker option instructs this library to search for its
6204 # dependencies in the same directory where it resides.
6206 -MKSHLIB += -R '$$ORIGIN:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
6207 +DSO_LDOPTS += -R '$$ORIGIN:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
6209 -MKSHLIB += -R '$$ORIGIN:/usr/lib/mps/secv1:/usr/lib/mps'
6210 +DSO_LDOPTS += -R '$$ORIGIN:/usr/lib/mps/secv1:/usr/lib/mps'
6213 -MKSHLIB += -R '$$ORIGIN'
6220 MKSHLIB += +b '$$ORIGIN'
6228 ifeq (,$(filter-out WINNT WIN95,$(OS_TARGET)))
6230 --- misc/mozilla/security/nss/lib/nss/nss.def 2008-06-16 00:22:10.000000000 +0200
6231 +++ misc/build/mozilla/security/nss/lib/nss/nss.def 2008-08-14 16:22:21.000000000 +0200
6233 CERT_CheckCertValidTimes;
6234 CERT_CreateCertificateRequest;
6235 CERT_ChangeCertTrust;
6236 +CERT_DecodeDERCertificate;
6238 CERT_DestroyCertificateRequest;
6239 CERT_DestroyCertList;
6240 --- misc/mozilla/security/nss/lib/smime/config.mk 2006-12-22 14:48:00.000000000 +0100
6241 +++ misc/build/mozilla/security/nss/lib/smime/config.mk 2008-08-19 17:01:53.000000000 +0200
6246 -ifeq ($(OS_TARGET),SunOS)
6247 -# The -R '$ORIGIN' linker option instructs this library to search for its
6248 -# dependencies in the same directory where it resides.
6249 -MKSHLIB += -R '$$ORIGIN'
6251 --- misc/mozilla/security/nss/lib/softoken/config.mk 2006-12-22 14:48:00.000000000 +0100
6252 +++ misc/build/mozilla/security/nss/lib/softoken/config.mk 2008-08-20 10:36:17.000000000 +0200
6257 -ifeq ($(OS_TARGET),SunOS)
6258 -# The -R '$ORIGIN' linker option instructs this library to search for its
6259 -# dependencies in the same directory where it resides.
6260 -MKSHLIB += -R '$$ORIGIN'
6264 ifeq ($(OS_TARGET),WINCE)
6265 DEFINES += -DDBM_USING_NSPR
6267 --- misc/mozilla/security/nss/lib/ssl/config.mk 2008-06-16 00:22:12.000000000 +0200
6268 +++ misc/build/mozilla/security/nss/lib/ssl/config.mk 2008-08-19 17:03:03.000000000 +0200
6269 @@ -116,13 +116,6 @@
6270 EXTRA_SHARED_LIBS += -dylib_file @executable_path/libsoftokn3.dylib:$(DIST)/lib/libsoftokn3.dylib
6273 -ifeq ($(OS_TARGET),SunOS)
6274 -# The -R '$ORIGIN' linker option instructs this library to search for its
6275 -# dependencies in the same directory where it resides.
6276 -MKSHLIB += -R '$$ORIGIN'
6277 -#EXTRA_SHARED_LIBS += -ldl -lrt -lc -z defs
6282 # indicates dependency on freebl static lib
6283 --- misc/mozilla/webshell/tests/viewer/Makefile.in 2006-06-17 18:27:10.000000000 +0200
6284 +++ misc/build/mozilla/webshell/tests/viewer/Makefile.in 2008-08-14 16:22:21.000000000 +0200
6286 GTK_LIBS = unix/gtk/libviewer_gtk_s.a -lgtksuperwin $(XP_LIBS) $(MOZ_GTK_LDFLAGS)
6288 XP_DIST_DEP_LIBS := $(filter-out -L$(DIST)/bin -L$(DIST)/lib, $(XP_DIST_LIBS))
6289 -XP_DIST_DEP_LIBS := $(wildcard $(addprefix $(DIST)/,$(patsubst -l%,bin/$(LIB_PREFIX)%$(DLL_SUFFIX),$(XP_DIST_DEP_LIBS:-l%_s=lib/lib%_s)))*)
6290 +XP_DIST_DEP_LIBS := $(wildcard $(addprefix $(DIST)/,$(patsubst -l%,bin/$(DLL_PREFIX)%$(DLL_SUFFIX),$(XP_DIST_DEP_LIBS:-l%_s=lib/lib%_s)))*)
6293 $(XP_DIST_DEP_LIBS) \
6294 --- misc/mozilla/xpcom/reflect/xptinfo/public/xptinfo.h 2004-04-18 16:18:20.000000000 +0200
6295 +++ misc/build/mozilla/xpcom/reflect/xptinfo/public/xptinfo.h 2008-08-14 16:22:21.000000000 +0200
6299 PRBool IsArray() const
6300 - {return (PRBool) TagPart() == T_ARRAY;}
6301 + {return (PRBool) (TagPart() == T_ARRAY);}
6303 // 'Dependent' means that params of this type are dependent upon other
6304 // params. e.g. an T_INTERFACE_IS is dependent upon some other param at
6306 uint8 TagPart() const
6307 {return (uint8) (flags & XPT_TDP_TAGMASK);}
6314 --- misc/mozilla/xpfe/bootstrap/Makefile.in 2007-10-08 21:09:58.000000000 +0200
6315 +++ misc/build/mozilla/xpfe/bootstrap/Makefile.in 2008-08-18 14:10:04.000000000 +0200
6316 @@ -115,11 +115,14 @@
6318 include $(topsrcdir)/config/config.mk
6320 +# reduce prerequisites by disabling mozilla binary
6321 +ifndef DISABLE_MOZ_EXECUTABLE
6322 ifeq ($(USE_SHORT_LIBNAME),1)
6323 PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
6325 PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
6329 # Force applications to be built non-statically
6330 # when building the mozcomps meta component
6332 APP_NAME = $(MOZ_APP_DISPLAYNAME)
6337 mkdir -p $(DIST)/$(APP_NAME).app/Contents/MacOS
6338 rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app
6340 rsync -a --copy-unsafe-links $(DIST)/package/PrintPDE.plugin $(DIST)/$(APP_NAME).app/Contents/Plug-Ins
6341 cp -RL $(DIST)/package/mozillaSuite.rsrc $(DIST)/$(APP_NAME).app/Contents/Resources/$(PROGRAM).rsrc
6342 echo -n APPLMOZZ > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
6346 rm -rf $(DIST)/$(APP_NAME).app