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 @@ -1696,14 +1724,14 @@
199 define MAKE_DEPS_NOAUTO
202 - $(MKDEPEND) -w1024 -o'.$(OBJ_SUFFIX)' -f$@ $(DEFINES) $(ACDEFINES) $(INCLUDES) $(srcdir)/$(<F) >/dev/null 2>&1 && \
203 + $(MKDEPEND) -w1024 -o'.$(OBJ_SUFFIX)' -f$@ $(DEFINES) $(ACDEFINES) $(filter-out -I/so/env% ,$(INCLUDES)) $(srcdir)/$(<F) >/dev/null 2>&1 && \
204 mv $@ $@.old && cat $@.old | sed "s|^$(srcdir)/||g" > $@ && rm -f $@.old
207 define MAKE_DEPS_NOAUTO
210 - $(MKDEPEND) -w1024 -o'.$(OBJ_SUFFIX)' -f$@ $(DEFINES) $(ACDEFINES) $(INCLUDES) $< >/dev/null 2>&1 && \
211 + $(MKDEPEND) -w1024 -o'.$(OBJ_SUFFIX)' -f$@ $(DEFINES) $(ACDEFINES) $(filter-out -I/so/env% ,$(INCLUDES)) $< >/dev/null 2>&1 && \
212 mv $@ $@.old && cat $@.old | sed "s|^$(<D)/||g" > $@ && rm -f $@.old
215 --- misc/mozilla/configure 2008-10-30 23:05:30.000000000 +0100
216 +++ misc/build/mozilla/configure 2009-02-12 15:20:18.597579000 +0100
217 @@ -1068,6 +1068,8 @@
224 for ac_prog in gawk mawk nawk awk
226 @@ -3022,9 +3024,26 @@
228 elif test "$_CC_MAJOR_VERSION" = "14"; then
230 + CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
232 { echo "configure: error: This version of the MSVC compiler, $CC_VERSION , is unsupported." 1>&2; exit 1; }
236 + # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
237 + if test "$_CC_SUITE" -ge "8"; then
238 + MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
239 + if test -n "MSMT_TOOL"; then
240 + MSMANIFEST_TOOL_VERSION=`echo ${MSMANIFEST_TOOL}|grep -Po "(^|\s)[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(\s|$)"`
241 + if test -z "MSMANIFEST_TOOL_VERSION"; then
242 + echo "configure: warning: Unknown version of the Microsoft (R) Manifest Tool." 1>&2
247 + { echo "Microsoft (R) Manifest Tool must be in your \$PATH." 1>&2; exit 1; }
251 # Check linker version
252 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
253 @@ -3422,6 +3441,8 @@
254 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
255 cross_compiling=$ac_cv_prog_cc_cross
258 + ac_cv_prog_CXXCPP="$CXXCPP"
260 CXXCPP="$ac_cv_prog_CXXCPP"
261 echo "$ac_t""$CXXCPP" 1>&6
262 @@ -5726,6 +5747,7 @@
263 if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
265 CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
266 + CYGWIN_WRAPPER=`cygpath -u $CYGWIN_WRAPPER`
268 if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
270 @@ -6036,7 +6058,7 @@
271 CXXFLAGS="$CXXFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
274 - STRIP="$STRIP -x -S"
275 + STRIP="$STRIP -X -S" # MACOSX 10.5 strip -x sometimes fails
276 _PLATFORM_DEFAULT_TOOLKIT='mac'
277 MOZ_ENABLE_POSTSCRIPT=
278 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
279 @@ -6075,7 +6097,7 @@
283 - if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` != "elf"; then
284 + if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
288 @@ -6455,12 +6477,12 @@
294 + *-cygwin*|*-mingw*)
295 + CYGPATH_W="cygpath -u"
297 - MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
298 + MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
300 - *-cygwin*|*-msvc*|*-mks*)
302 CYGPATH_W="cygpath -a -w"
303 CYGPATH_S="sed -e s|\\\\|/|g"
304 MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
305 @@ -6718,7 +6740,7 @@
306 MOZ_USER_DIR="Mozilla"
308 if test "$MOZTOOLS"; then
309 - MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
310 + MOZ_TOOLS_DIR=`echo $MOZTOOLS`
312 { echo "configure: error: MOZTOOLS is not set" 1>&2; exit 1; }
314 @@ -8614,6 +8636,8 @@
321 echo $ac_n "checking for gethostbyname_r in -lc_r""... $ac_c" 1>&6
322 echo "configure:8620: checking for gethostbyname_r in -lc_r" >&5
323 @@ -19233,7 +19257,8 @@
324 MOZ_CAIRO_LIBS="-lmozcairo -lmozlibpixman $CAIRO_FT_LIBS"
326 if test "$MOZ_X11"; then
327 - MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender $XLIBS -lfontconfig -lfreetype"
328 +# MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender $XLIBS -lfontconfig -lfreetype"
329 + MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $XLIBS -lfontconfig -lfreetype"
331 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
332 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS -lgdi32"
333 @@ -20076,8 +20101,12 @@
334 WIN_TOP_SRC=`cd $srcdir; pwd -W`
337 - HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
338 - HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
339 +# Don't add the wrapper for the HOST_* versions as they contain an
340 +# unexpanded $CC and therfore wil get the wrapper below.
341 + if test -n "$GNU_CC"; then
342 + HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
343 + HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
345 CC="\$(CYGWIN_WRAPPER) $CC"
346 CXX="\$(CYGWIN_WRAPPER) $CXX"
347 CPP="\$(CYGWIN_WRAPPER) $CPP"
348 --- misc/mozilla/configure.in 2008-10-30 23:05:31.000000000 +0100
349 +++ misc/build/mozilla/configure.in 2009-02-05 20:12:45.456777753 +0100
356 dnl Set various checks
357 dnl ========================================================
361 elif test "$_CC_MAJOR_VERSION" = "14"; then
363 + CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
365 AC_MSG_ERROR([This version of the MSVC compiler, $CC_VERSION , is unsupported.])
369 + # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
370 + if test "$_CC_SUITE" -ge "8"; then
371 + MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
372 + if test -n "MSMT_TOOL"; then
373 + MSMANIFEST_TOOL_VERSION=`echo ${MSMANIFEST_TOOL}|grep -Po "(^|\s)[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(\s|$)"`
374 + if test -z "MSMANIFEST_TOOL_VERSION"; then
375 + AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
380 + AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
384 # Check linker version
385 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
386 @@ -1530,7 +1549,7 @@
387 CXXFLAGS="$CXXFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
390 - STRIP="$STRIP -x -S"
391 + STRIP="$STRIP -X -S" # MACOSX 10.5 strip -x sometimes fails
392 _PLATFORM_DEFAULT_TOOLKIT='mac'
393 MOZ_ENABLE_POSTSCRIPT=
394 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
395 @@ -1552,7 +1571,7 @@
399 - if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` != "elf"; then
400 + if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
404 @@ -1853,10 +1872,10 @@
406 dnl MinGW/MSYS doesn't provide or need cygpath
410 + *-cygwin*|*-mingw*)
411 + CYGPATH_W="cygpath -u"
413 - MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
414 + MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
416 *-cygwin*|*-msvc*|*-mks*)
417 CYGPATH_W="cygpath -a -w"
418 @@ -2749,6 +2768,8 @@
425 AC_CHECK_LIB(c_r, gethostbyname_r)
427 @@ -7321,6 +7342,7 @@
430 AC_SUBST(CXX_VERSION)
431 +AC_SUBST(MSMANIFEST_TOOL)
433 if test "$USING_HCC"; then
434 CC='${topsrcdir}/build/hcc'
435 @@ -7416,8 +7438,12 @@
436 WIN_TOP_SRC=`cd $srcdir; pwd -W`
439 - HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
440 - HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
441 +# Don't add the wrapper for the HOST_* versions as they contain an
442 +# unexpanded $CC and therfore wil get the wrapper below.
443 + if test -n "$GNU_CC"; then
444 + HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
445 + HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
447 CC="\$(CYGWIN_WRAPPER) $CC"
448 CXX="\$(CYGWIN_WRAPPER) $CXX"
449 CPP="\$(CYGWIN_WRAPPER) $CPP"
450 --- misc/mozilla/directory/c-sdk/build.mk 2006-02-03 15:44:29.000000000 +0100
451 +++ misc/build/mozilla/directory/c-sdk/build.mk 2008-08-14 16:22:21.000000000 +0200
454 LINK_EXE = $(CC) -o $@ $(LDFLAGS) $(LCFLAGS) $(DEPLIBS) $(OBJS) $(EXTRA_LIBS) $(PLATFORMLIBS)
455 LINK_LIB = $(AR) cr $@ $(OBJS)
456 -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)
457 +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)
459 DEBUG_LINK_OPT=-DEBUG
460 ifeq ($(BUILD_OPT), 1)
461 --- misc/mozilla/directory/c-sdk/config/FreeBSD.mk 2006-02-03 15:41:11.000000000 +0100
462 +++ misc/build/mozilla/directory/c-sdk/config/FreeBSD.mk 2008-08-14 16:22:21.000000000 +0200
467 -MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo aout)
468 +MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo elf)
470 ifeq ($(MOZ_OBJFORMAT),elf)
472 --- misc/mozilla/directory/c-sdk/config/autoconf.mk.in 2006-02-23 00:58:25.000000000 +0100
473 +++ misc/build/mozilla/directory/c-sdk/config/autoconf.mk.in 2008-08-14 16:22:21.000000000 +0200
475 LIB_SUFFIX = @LIB_SUFFIX@
476 LIB_PREFIX = @LIB_PREFIX@
477 DLL_SUFFIX = @DLL_SUFFIX@
478 +DLL_PREFIX = @DLL_PREFIX@
479 ASM_SUFFIX = @ASM_SUFFIX@
480 PROG_SUFFIX = @PROG_SUFFIX@
481 MOD_NAME = @NSPR_MODNAME@
482 --- misc/mozilla/directory/c-sdk/config/cygwin-wrapper 2004-08-19 01:18:55.000000000 +0200
483 +++ misc/build/mozilla/directory/c-sdk/config/cygwin-wrapper 2008-08-14 16:22:21.000000000 +0200
488 # Stupid wrapper to avoid win32 dospath/cygdrive issues
489 # Try not to spawn programs from within this file. If the stuff in here looks royally
490 --- misc/mozilla/directory/c-sdk/configure 2006-02-23 01:58:13.000000000 +0100
491 +++ misc/build/mozilla/directory/c-sdk/configure 2008-08-14 16:22:21.000000000 +0200
492 @@ -2738,6 +2738,7 @@
498 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
500 @@ -3444,7 +3445,7 @@
503 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
504 - MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
505 + MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
506 if test "$MOZ_OBJFORMAT" = "elf"; then
509 @@ -3811,6 +3812,7 @@
510 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
512 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
513 + DSO_LDOPTS="$DSO_LDOPTS -Wl,-rpath,'$\$ORIGIN:$\$ORIGIN/../ure-link/lib'"
514 OS_LIBS="$OS_LIBS -lc"
516 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
517 @@ -3880,7 +3882,8 @@
519 CXX="$CXX -mno-cygwin"
521 - MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) -o $@'
523 + MKSHLIB='$(CC) -shared -Wl,--enable-runtime-pseudo-reloc -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) -o $@'
524 # Use temp file for windres (bug 213281)
525 RC="$WINDRES -O coff --use-temp-file"
527 @@ -3897,6 +3900,7 @@
533 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
535 @@ -4293,6 +4297,7 @@
543 @@ -4660,6 +4665,7 @@
545 RANLIB=/usr/ccs/bin/ranlib
546 DSO_LDOPTS='-G -h $(notdir $@)'
547 + DSO_LDOPTS="$DSO_LDOPTS -R '$\$ORIGIN'"
548 if test -n "$GNU_CC"; then
551 @@ -5844,6 +5850,7 @@
552 s%@LIB_SUFFIX@%$LIB_SUFFIX%g
553 s%@LIB_PREFIX@%$LIB_PREFIX%g
554 s%@DLL_SUFFIX@%$DLL_SUFFIX%g
555 +s%@DLL_PREFIX@%$DLL_PREFIX%g
556 s%@ASM_SUFFIX@%$ASM_SUFFIX%g
557 s%@PROG_SUFFIX@%$PROG_SUFFIX%g
558 s%@MKSHLIB@%$MKSHLIB%g
559 --- misc/mozilla/directory/c-sdk/configure.in 2007-07-15 16:41:07.000000000 +0200
560 +++ misc/build/mozilla/directory/c-sdk/configure.in 2008-08-14 16:22:21.000000000 +0200
567 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
569 @@ -1037,7 +1038,7 @@
571 AC_DEFINE(HAVE_BSD_FLOCK)
572 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
573 - MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
574 + MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
575 if test "$MOZ_OBJFORMAT" = "elf"; then
578 @@ -1285,6 +1286,7 @@
579 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
581 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
582 + DSO_LDOPTS="$DSO_LDOPTS -Wl,-rpath,'$\$ORIGIN:$\$ORIGIN/../ure-link/lib'"
583 OS_LIBS="$OS_LIBS -lc"
585 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
586 @@ -1336,6 +1338,8 @@
588 CXX="$CXX -mno-cygwin"
592 MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) -o $@'
593 # Use temp file for windres (bug 213281)
594 RC="$WINDRES -O coff --use-temp-file"
595 @@ -1353,6 +1357,7 @@
601 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
603 @@ -1820,6 +1825,7 @@
605 RANLIB=/usr/ccs/bin/ranlib
606 DSO_LDOPTS='-G -h $(notdir $@)'
607 + DSO_LDOPTS="$DSO_LDOPTS -R '$\$ORIGIN'"
608 if test -n "$GNU_CC"; then
611 @@ -2410,6 +2416,7 @@
615 +AC_SUBST(DLL_PREFIX)
617 AC_SUBST(PROG_SUFFIX)
619 --- misc/mozilla/directory/c-sdk/ldap/include/Makefile.in 2006-02-03 15:44:33.000000000 +0100
620 +++ misc/build/mozilla/directory/c-sdk/ldap/include/Makefile.in 2008-11-02 21:55:34.929250000 +0100
623 ###########################################################################
625 +ifeq ($(TERM),cygwin)
626 +INCLUDEDIR:=$(shell cygpath -u $(INCLUDEDIR))
627 +GENHEADERS:=$(shell cygpath -u $(GENHEADERS))
630 all export:: $(INCLUDEDIR) $(GENHEADERS)
631 $(NSINSTALL) -D $(PRIVATEINCDIR)
632 $(INSTALL) $(INSTALLFLAGS) -m 644 $(HEADERS) $(INCLUDEDIR)
633 --- misc/mozilla/directory/c-sdk/ldap/libraries/libldap/Makefile.in 2006-02-03 15:44:42.000000000 +0100
634 +++ misc/build/mozilla/directory/c-sdk/ldap/libraries/libldap/Makefile.in 2008-08-14 16:22:21.000000000 +0200
636 HDIR = $(topsrcdir)/ldap/include
638 LIBLDAP = $(addprefix $(OBJDIR_NAME)/, $(LIB_PREFIX)$(LDAP_LIBNAME).$(LIB_SUFFIX))
639 -DLLLDAP = $(addprefix $(OBJDIR_NAME)/, $(LIB_PREFIX)$(LDAP_LIBNAME).$(DLL_SUFFIX))
640 +DLLLDAP = $(addprefix $(OBJDIR_NAME)/, $(DLL_PREFIX)$(LDAP_LIBNAME).$(DLL_SUFFIX))
642 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
645 -$(RM) $(SO_FILES_TO_REMOVE)
647 $(LINK_DLL) $(LDAP_EXPORT_FLAGS) $(EXTRA_LIBS)
648 + if test -f $@.manifest; then \
649 + mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;2; \
650 + rm -f $@.manifest; \
655 --- misc/mozilla/directory/c-sdk/ldap/libraries/libprldap/Makefile.in 2006-02-03 15:44:49.000000000 +0100
656 +++ misc/build/mozilla/directory/c-sdk/ldap/libraries/libprldap/Makefile.in 2008-08-14 16:22:21.000000000 +0200
660 DLLPRLDAP = $(addprefix $(OBJDIR_NAME)/, \
661 - $(LIB_PREFIX)$(PRLDAP_LIBNAME).$(DLL_SUFFIX))
662 + $(DLL_PREFIX)$(PRLDAP_LIBNAME).$(DLL_SUFFIX))
664 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
666 --- misc/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile 2004-08-26 01:02:30.000000000 +0200
667 +++ misc/build/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile 2008-08-14 16:22:21.000000000 +0200
669 HDIR = $(topsrcdir)/ldap/include
671 LIBSSLDAP = $(addprefix $(SSLOBJDEST)/, $(LIB_PREFIX)$(SSLDAP_LIBNAME).$(LIB_SUFFIX))
672 -DLLSSLDAP = $(addprefix $(SSLOBJDEST)/, $(LIB_PREFIX)$(SSLDAP_LIBNAME).$(DLL_SUFFIX))
673 +DLLSSLDAP = $(addprefix $(SSLOBJDEST)/, $(DLL_PREFIX)$(SSLDAP_LIBNAME).$(DLL_SUFFIX))
675 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
679 # variable definitions for exported symbols
680 ifeq ($(OS_ARCH), WINNT)
681 - SSLDAP_EXPORT_DEFS= $(srcdir)/../msdos/winsock/nsldapssl32.def
682 + SSLDAP_EXPORT_DEFS= $(win_srcdir)/../msdos/winsock/nsldapssl32.def
684 SSLDAP_EXPORT_DEFS= $(SSLOBJDEST)/libldap_ssl.exp
686 --- misc/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile.in 2006-02-03 15:44:49.000000000 +0100
687 +++ misc/build/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile.in 2008-08-14 16:22:21.000000000 +0200
689 HDIR = $(topsrcdir)/ldap/include
691 LIBSSLDAP = $(addprefix $(SSLOBJDEST)/, $(LIB_PREFIX)$(SSLDAP_LIBNAME).$(LIB_SUFFIX))
692 -DLLSSLDAP = $(addprefix $(SSLOBJDEST)/, $(LIB_PREFIX)$(SSLDAP_LIBNAME).$(DLL_SUFFIX))
693 +DLLSSLDAP = $(addprefix $(SSLOBJDEST)/, $(DLL_PREFIX)$(SSLDAP_LIBNAME).$(DLL_SUFFIX))
695 INSTALLDIR = $(DIST)/$(OBJDIR_NAME)
697 --- misc/mozilla/embedding/browser/gtk/src/Makefile.in 2006-03-22 19:22:41.000000000 +0100
698 +++ misc/build/mozilla/embedding/browser/gtk/src/Makefile.in 2008-08-14 16:22:21.000000000 +0200
699 @@ -112,14 +112,14 @@
700 gtkmozembed_internal.h
703 -EXTRA_DSO_LDOPTS = \
704 +EXTRA_DSO_LDOPTS += \
705 $(MOZ_COMPONENT_LIBS) \
710 ifdef MOZ_ENABLE_GTK2
711 -EXTRA_DSO_LDOPTS = \
712 +EXTRA_DSO_LDOPTS += \
713 $(MOZ_COMPONENT_LIBS) \
716 --- misc/mozilla/embedding/browser/gtk/tests/Makefile.in 2006-03-24 17:10:37.000000000 +0100
717 +++ misc/build/mozilla/embedding/browser/gtk/tests/Makefile.in 2008-08-14 16:22:21.000000000 +0200
719 TestGtkEmbedNotebook.cpp \
720 TestGtkEmbedSocket.cpp \
721 TestGtkEmbedChild.cpp
724 SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=)
731 --- misc/mozilla/embedding/components/printingui/src/mac/printpde/Makefile.in 2005-06-20 21:24:51.000000000 +0200
732 +++ misc/build/mozilla/embedding/components/printingui/src/mac/printpde/Makefile.in 2009-02-19 13:11:39.000000000 +0100
737 -ABS_topsrcdir := $(shell cd $(topsrcdir); pwd)
738 -ifneq ($(ABS_topsrcdir),$(MOZ_BUILD_ROOT))
740 - rsync -a --exclude .DS_Store --exclude "CVS/" $(srcdir)/$(PROJECT) .
741 - ln -fs $(srcdir)/src
742 - ln -fs $(srcdir)/res
743 - ln -fs $(srcdir)/public
744 - ln -fs $(srcdir)/Info-*.plist .
748 # Bug 297227: The next line doesn't need to stay around forever, only
749 # long enough to clean up existing depend builds from when xcodebuild
750 # was being instructed to "install"
751 if test -e build/UninstalledProducts ; then $(MAKE) clean ; rm -rf $(DIST)/package/PrintPDE.plugin ; fi
753 - $(PBBUILD) $(PROJECT_ARG) -target PrintPDE -buildstyle $(BUILDSTYLE) $(PBBUILD_ARG)
754 - mkdir -p $(DIST)/package
755 - $(INSTALL) $(XCODE_PRODUCT_DIR)/PrintPDE.plugin $(DIST)/package
756 +# $(PBBUILD) $(PROJECT_ARG) -target PrintPDE -buildstyle $(BUILDSTYLE) $(PBBUILD_ARG)
757 +# mkdir -p $(DIST)/package
758 +# $(INSTALL) $(XCODE_PRODUCT_DIR)/PrintPDE.plugin $(DIST)/package
762 --- misc/mozilla/embedding/config/Makefile.in 2007-10-08 21:08:15.000000000 +0200
763 +++ misc/build/mozilla/embedding/config/Makefile.in 2008-08-14 16:22:21.000000000 +0200
765 $(NSINSTALL) -t $(srcdir)/installed-chrome.txt $(DIST)/Embed/chrome
766 $(NSINSTALL) -t $(srcdir)/readme.html $(DIST)/Embed
768 - -$(NSINSTALL) -t $(DEPTH)/embedding/lite/$(LIB_PREFIX)embed_lite$(DLL_SUFFIX) $(DIST)/Embed/components
769 + -$(NSINSTALL) -t $(DEPTH)/embedding/lite/$(DLL_PREFIX)embed_lite$(DLL_SUFFIX) $(DIST)/Embed/components
771 ifeq ($(OS_ARCH),WINNT)
772 ifeq ($(WINAPP),mfcembed)
773 --- misc/mozilla/extensions/pref/autoconfig/src/Makefile.in 2006-02-03 15:41:09.000000000 +0100
774 +++ misc/build/mozilla/extensions/pref/autoconfig/src/Makefile.in 2008-08-14 16:22:21.000000000 +0200
779 -EXTRA_DSO_LDOPTS = \
780 +EXTRA_DSO_LDOPTS += \
783 $(MOZ_COMPONENT_LIBS) \
784 --- misc/mozilla/extensions/sql/build/Makefile.in 2004-11-29 18:39:08.000000000 +0100
785 +++ misc/build/mozilla/extensions/sql/build/Makefile.in 2008-08-18 14:03:04.000000000 +0200
787 bin/components/sqlpgsql.xpt \
788 bin/components/sqlsqlite.xpt \
789 bin/components/sqlmysql.xpt \
790 - bin/components/$(LIB_PREFIX)sql$(DLL_SUFFIX) \
791 + bin/components/$(DLL_PREFIX)sql$(DLL_SUFFIX) \
793 --- misc/mozilla/gfx/idl/nsIFreeType2.idl 2004-04-16 01:30:02.000000000 +0200
794 +++ misc/build/mozilla/gfx/idl/nsIFreeType2.idl 2008-08-14 16:22:21.000000000 +0200
796 native FT_Sfnt_Tag(FT_Sfnt_Tag);
797 native FT_Size(FT_Size);
799 -[ptr] native FTC_Image_Desc_p(FTC_Image_Desc);
800 +[ptr] native FTC_ImageType_p(FTC_ImageType);
801 native FTC_Face_Requester(FTC_Face_Requester);
802 native FTC_Font(FTC_Font);
803 -native FTC_Image_Cache(FTC_Image_Cache);
804 +native FTC_FaceID(FTC_FaceID);
805 +native FTC_ImageCache(FTC_ImageCache);
806 native FTC_Manager(FTC_Manager);
811 readonly attribute FT_Library library;
812 readonly attribute FTC_Manager FTCacheManager;
813 - readonly attribute FTC_Image_Cache ImageCache;
814 + readonly attribute FTC_ImageCache ImageCache;
816 void doneFace(in FT_Face face);
817 void doneFreeType(in FT_Library lib);
818 @@ -115,16 +116,16 @@
819 void outlineDecompose(in FT_Outline_p outline,
820 in const_FT_Outline_Funcs_p funcs, in voidPtr p);
821 void setCharmap(in FT_Face face, in FT_CharMap charmap);
822 - void imageCacheLookup(in FTC_Image_Cache cache, in FTC_Image_Desc_p desc,
823 + void imageCacheLookup(in FTC_ImageCache cache, in FTC_ImageType_p desc,
824 in FT_UInt gindex, out FT_Glyph glyph);
825 - void managerLookupSize(in FTC_Manager manager, in FTC_Font font,
826 - out FT_Face face, out FT_Size size);
827 + void managerLookupFace(in FTC_Manager manager, in FTC_FaceID face_id,
829 void managerDone(in FTC_Manager manager);
830 void managerNew(in FT_Library lib, in FT_UInt max_faces,
831 in FT_UInt max_sizes, in FT_ULong max_bytes,
832 in FTC_Face_Requester requester, in FT_Pointer req_data,
833 out FTC_Manager manager);
834 - void imageCacheNew(in FTC_Manager manager, out FTC_Image_Cache cache);
835 + void imageCacheNew(in FTC_Manager manager, out FTC_ImageCache cache);
837 void glyphTransform(in FT_Glyph glyph, in FT_Matrix_p matrix,
838 in FT_Vector_p delta);
839 --- misc/mozilla/gfx/src/freetype/nsFreeType.cpp 2005-07-13 20:21:10.000000000 +0200
840 +++ misc/build/mozilla/gfx/src/freetype/nsFreeType.cpp 2008-08-14 16:22:21.000000000 +0200
842 {"FT_Outline_Decompose", NS_FT2_OFFSET(nsFT_Outline_Decompose), PR_TRUE},
843 {"FT_Set_Charmap", NS_FT2_OFFSET(nsFT_Set_Charmap), PR_TRUE},
844 {"FTC_Image_Cache_Lookup", NS_FT2_OFFSET(nsFTC_Image_Cache_Lookup), PR_TRUE},
845 - {"FTC_Manager_Lookup_Size", NS_FT2_OFFSET(nsFTC_Manager_Lookup_Size), PR_TRUE},
846 + {"FTC_Manager_LookupFace", NS_FT2_OFFSET(nsFTC_Manager_LookupFace), PR_TRUE},
847 {"FTC_Manager_Done", NS_FT2_OFFSET(nsFTC_Manager_Done), PR_TRUE},
848 {"FTC_Manager_New", NS_FT2_OFFSET(nsFTC_Manager_New), PR_TRUE},
849 {"FTC_Image_Cache_New", NS_FT2_OFFSET(nsFTC_Image_Cache_New), PR_TRUE},
854 -nsFreeType2::ImageCacheLookup(FTC_Image_Cache cache, FTC_Image_Desc *desc,
855 +nsFreeType2::ImageCacheLookup(FTC_ImageCache cache, FTC_ImageType *desc,
856 FT_UInt glyphID, FT_Glyph *glyph)
858 // call the FreeType2 function via the function pointer
859 @@ -297,11 +297,11 @@
863 -nsFreeType2::ManagerLookupSize(FTC_Manager manager, FTC_Font font,
864 - FT_Face *face, FT_Size *size)
865 +nsFreeType2::ManagerLookupFace(FTC_Manager manager, FTC_FaceID font,
868 // call the FreeType2 function via the function pointer
869 - FT_Error error = nsFTC_Manager_Lookup_Size(manager, font, face, size);
870 + FT_Error error = nsFTC_Manager_LookupFace(manager, font, face);
871 return error ? NS_ERROR_FAILURE : NS_OK;
878 -nsFreeType2::ImageCacheNew(FTC_Manager manager, FTC_Image_Cache *cache)
879 +nsFreeType2::ImageCacheNew(FTC_Manager manager, FTC_ImageCache *cache)
881 // call the FreeType2 function via the function pointer
882 FT_Error error = nsFTC_Image_Cache_New(manager, cache);
887 -nsFreeType2::GetImageCache(FTC_Image_Cache *aCache)
888 +nsFreeType2::GetImageCache(FTC_ImageCache *aCache)
890 *aCache = mImageCache;
892 --- misc/mozilla/gfx/src/freetype/nsFreeType.h 2005-05-01 19:36:19.000000000 +0200
893 +++ misc/build/mozilla/gfx/src/freetype/nsFreeType.h 2008-08-14 16:22:21.000000000 +0200
894 @@ -120,13 +120,13 @@
895 typedef FT_Error (*FT_New_Face_t)(FT_Library, const char*, FT_Long, FT_Face*);
896 typedef FT_Error (*FT_Set_Charmap_t)(FT_Face face, FT_CharMap charmap);
897 typedef FT_Error (*FTC_Image_Cache_Lookup_t)
898 - (FTC_Image_Cache, FTC_Image_Desc*, FT_UInt, FT_Glyph*);
899 -typedef FT_Error (*FTC_Manager_Lookup_Size_t)
900 - (FTC_Manager, FTC_Font, FT_Face*, FT_Size*);
901 + (FTC_ImageCache, FTC_ImageType*, FT_UInt, FT_Glyph*);
902 +typedef FT_Error (*FTC_Manager_LookupFace_t)
903 + (FTC_Manager, FTC_FaceID, FT_Face*);
904 typedef FT_Error (*FTC_Manager_Done_t)(FTC_Manager);
905 typedef FT_Error (*FTC_Manager_New_t)(FT_Library, FT_UInt, FT_UInt, FT_ULong,
906 FTC_Face_Requester, FT_Pointer, FTC_Manager*);
907 -typedef FT_Error (*FTC_Image_Cache_New_t)(FTC_Manager, FTC_Image_Cache*);
908 +typedef FT_Error (*FTC_Image_Cache_New_t)(FTC_Manager, FTC_ImageCache*);
910 typedef FT_Error (*FT_Glyph_Transform_t)(FT_Glyph, FT_Matrix*, FT_Vector*);
911 typedef FT_Error (*FT_Get_Kerning_t)
913 FT_Outline_Decompose_t nsFT_Outline_Decompose;
914 FT_Set_Charmap_t nsFT_Set_Charmap;
915 FTC_Image_Cache_Lookup_t nsFTC_Image_Cache_Lookup;
916 - FTC_Manager_Lookup_Size_t nsFTC_Manager_Lookup_Size;
917 + FTC_Manager_LookupFace_t nsFTC_Manager_LookupFace;
918 FTC_Manager_Done_t nsFTC_Manager_Done;
919 FTC_Manager_New_t nsFTC_Manager_New;
920 FTC_Image_Cache_New_t nsFTC_Image_Cache_New;
922 PRLibrary *mSharedLib;
923 FT_Library mFreeTypeLibrary;
924 FTC_Manager mFTCacheManager;
925 - FTC_Image_Cache mImageCache;
926 + FTC_ImageCache mImageCache;
928 static nsHashtable *sFontFamilies;
929 static nsHashtable *sRange1CharSetNames;
930 --- misc/mozilla/gfx/src/gtk/Makefile.in 2006-07-20 07:12:33.000000000 +0200
931 +++ misc/build/mozilla/gfx/src/gtk/Makefile.in 2008-08-14 16:22:21.000000000 +0200
933 CXXFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS)
934 CFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS)
936 +ifeq ($(OS_ARCH), Darwin)
937 +EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS)
940 ifeq ($(OS_ARCH), SunOS)
942 # When using Sun's WorkShop compiler, including
943 --- misc/mozilla/gfx/src/ps/nsFontMetricsPS.cpp 2006-12-22 14:51:16.000000000 +0100
944 +++ misc/build/mozilla/gfx/src/ps/nsFontMetricsPS.cpp 2008-08-14 16:22:21.000000000 +0200
945 @@ -1870,10 +1870,10 @@
947 mPixelSize = NSToIntRound(app2dev * mFont->size);
949 - mImageDesc.font.face_id = (void*)mEntry;
950 - mImageDesc.font.pix_width = mPixelSize;
951 - mImageDesc.font.pix_height = mPixelSize;
952 - mImageDesc.image_type = 0;
953 + mImageDesc->face_id = (FTC_FaceID)&mEntry;
954 + mImageDesc->width = mPixelSize;
955 + mImageDesc->height = mPixelSize;
956 + mImageDesc->flags = 0;
959 mFt2 = do_GetService(NS_FREETYPE2_CONTRACTID, &rv);
960 @@ -1907,7 +1907,7 @@
964 - FTC_Image_Cache iCache;
965 + FTC_ImageCache iCache;
966 nsresult rv = mFt2->GetImageCache(&iCache);
968 NS_ERROR("Failed to get Image Cache");
969 @@ -1945,8 +1945,8 @@
971 FTC_Manager cManager;
972 mFt2->GetFTCacheManager(&cManager);
973 - nsresult rv = mFt2->ManagerLookupSize(cManager, &mImageDesc.font,
975 + nsresult rv = mFt2->ManagerLookupFace(cManager, mImageDesc->face_id,
977 NS_ASSERTION(rv==0, "failed to get face/size");
980 @@ -2392,16 +2392,16 @@
981 mEntry->GetFamilyName(fontName);
982 mEntry->GetStyleName(styleName);
984 - mImageDesc.font.face_id = (void*)mEntry;
985 + mImageDesc->face_id = (FTC_FaceID)&mEntry;
986 // TT glyph has no relation to size
987 - mImageDesc.font.pix_width = 16;
988 - mImageDesc.font.pix_height = 16;
989 - mImageDesc.image_type = 0;
990 + mImageDesc->width = 16;
991 + mImageDesc->height = 16;
992 + mImageDesc->flags = 0;
993 FT_Face face = nsnull;
994 FTC_Manager cManager;
995 mFt2->GetFTCacheManager(&cManager);
996 - nsresult rv = mFt2->ManagerLookupSize(cManager, &mImageDesc.font,
998 + nsresult rv = mFt2->ManagerLookupFace(cManager, mImageDesc->face_id,
1003 --- misc/mozilla/gfx/src/ps/nsFontMetricsPS.h 2005-06-28 20:29:10.000000000 +0200
1004 +++ misc/build/mozilla/gfx/src/ps/nsFontMetricsPS.h 2008-08-20 15:42:50.000000000 +0200
1006 nsCOMPtr<nsITrueTypeFontCatalogEntry> mFaceID;
1007 nsCOMPtr<nsIFreeType2> mFt2;
1008 PRUint16 mPixelSize;
1009 - FTC_Image_Desc mImageDesc;
1010 + FTC_ImageType mImageDesc;
1011 nsCString mFontNameBase; // the base name of type 1 (sub) fonts
1016 nsCOMPtr<nsITrueTypeFontCatalogEntry> mEntry;
1017 nsCOMPtr<nsIFreeType2> mFt2;
1018 - FTC_Image_Desc mImageDesc;
1019 + FTC_ImageType mImageDesc;
1021 #endif // MOZ_ENABLE_FREETYPE2
1022 #endif // MOZ_ENABLE_XFT
1023 --- misc/mozilla/gfx/src/x11shared/nsFontFreeType.cpp 2004-04-17 23:52:34.000000000 +0200
1024 +++ misc/build/mozilla/gfx/src/x11shared/nsFontFreeType.cpp 2008-08-14 16:22:21.000000000 +0200
1028 mFt2->GetFTCacheManager(&mgr);
1029 - rv = mFt2->ManagerLookupSize(mgr, &mImageDesc.font, &face, nsnull);
1030 + rv = mFt2->ManagerLookupFace(mgr, mImageDesc->face_id, &face);
1031 NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get face/size");
1034 @@ -191,22 +191,15 @@
1035 PRBool embedded_bimap = PR_FALSE;
1037 mPixelSize = aPixelSize;
1038 - mImageDesc.font.face_id = (void*)mFaceID;
1039 - mImageDesc.font.pix_width = aPixelSize;
1040 - mImageDesc.font.pix_height = aPixelSize;
1041 - mImageDesc.image_type = 0;
1042 + mImageDesc->face_id = (FTC_FaceID)&mFaceID;
1043 + mImageDesc->width = aPixelSize;
1044 + mImageDesc->height = aPixelSize;
1045 + mImageDesc->flags = 0;
1047 if (aPixelSize < nsFreeType2::gAntiAliasMinimum) {
1048 - mImageDesc.image_type |= ftc_image_mono;
1049 anti_alias = PR_FALSE;
1052 - if (nsFreeType2::gFreeType2Autohinted)
1053 - mImageDesc.image_type |= ftc_image_flag_autohinted;
1055 - if (nsFreeType2::gFreeType2Unhinted)
1056 - mImageDesc.image_type |= ftc_image_flag_unhinted;
1058 PRUint32 num_embedded_bitmaps, i;
1059 PRInt32* embedded_bitmapheights;
1060 mFaceID->GetEmbeddedBitmapHeights(&num_embedded_bitmaps,
1062 if (embedded_bitmapheights[i] == aPixelSize) {
1063 embedded_bimap = PR_TRUE;
1064 // unhinted must be set for embedded bitmaps to be used
1065 - mImageDesc.image_type |= ftc_image_flag_unhinted;
1071 return NS_ERROR_FAILURE;
1073 - FTC_Image_Cache icache;
1074 + FTC_ImageCache icache;
1075 mFt2->GetImageCache(&icache);
1077 return NS_ERROR_FAILURE;
1082 - FTC_Image_Cache icache;
1083 + FTC_ImageCache icache;
1084 mFt2->GetImageCache(&icache);
1088 if (y%4==0) (*blendPixelFunc)(sub_image, y, ascent-1, black, 255/2);
1091 - FTC_Image_Cache icache;
1092 + FTC_ImageCache icache;
1093 mFt2->GetImageCache(&icache);
1096 --- misc/mozilla/gfx/src/x11shared/nsFontFreeType.h 2004-04-17 23:52:34.000000000 +0200
1097 +++ misc/build/mozilla/gfx/src/x11shared/nsFontFreeType.h 2008-08-14 16:22:21.000000000 +0200
1099 XImage *GetXImage(PRUint32 width, PRUint32 height);
1100 nsITrueTypeFontCatalogEntry *mFaceID;
1101 PRUint16 mPixelSize;
1102 - FTC_Image_Desc mImageDesc;
1103 + FTC_ImageType mImageDesc;
1104 nsCOMPtr<nsIFreeType2> mFt2;
1107 --- misc/mozilla/jpeg/jmorecfg.h 2004-12-12 01:57:39.000000000 +0100
1108 +++ misc/build/mozilla/jpeg/jmorecfg.h 2008-08-18 09:06:05.000000000 +0200
1110 /* Defines for MMX/SSE2 support. */
1112 #if defined(XP_WIN32) && defined(_M_IX86) && !defined(__GNUC__)
1113 -#define HAVE_MMX_INTEL_MNEMONICS
1114 +//#define HAVE_MMX_INTEL_MNEMONICS
1116 /* SSE2 code appears broken for some cpus (bug 247437) */
1117 /* #define HAVE_SSE2_INTEL_MNEMONICS */
1118 --- misc/mozilla/layout/svg/renderer/src/libart/nsSVGLibartGlyphMetricsFT.cpp 2006-03-16 18:09:14.000000000 +0100
1119 +++ misc/build/mozilla/layout/svg/renderer/src/libart/nsSVGLibartGlyphMetricsFT.cpp 2008-08-14 16:22:21.000000000 +0200
1120 @@ -423,19 +423,19 @@
1124 - FTC_Image_Desc imageDesc;
1125 - imageDesc.font.face_id=(void*)font_data.font_entry.get(); // XXX do we need to addref?
1126 + FTC_ImageType imageDesc;
1127 + imageDesc->face_id=(FTC_FaceID)font_data.font_entry.get(); // XXX do we need to addref?
1128 float twipstopixel = GetTwipsToPixels();
1129 float scale = GetPixelScale();
1130 - imageDesc.font.pix_width = (int)((float)(font_data.font.size)*twipstopixel/scale);
1131 - imageDesc.font.pix_height = (int)((float)(font_data.font.size)*twipstopixel/scale);
1132 - imageDesc.image_type |= ftc_image_grays;
1133 + imageDesc->width = (int)((float)(font_data.font.size)*twipstopixel/scale);
1134 + imageDesc->height = (int)((float)(font_data.font.size)*twipstopixel/scale);
1135 + imageDesc->flags |= /* ftc_image_grays */0;
1140 nsSVGLibartFreetype::ft2->GetFTCacheManager(&mgr);
1141 - rv = nsSVGLibartFreetype::ft2->ManagerLookupSize(mgr, &imageDesc.font, &mFace, nsnull);
1142 + rv = nsSVGLibartFreetype::ft2->ManagerLookupFace(mgr, imageDesc->face_id, &mFace);
1143 NS_ASSERTION(mFace, "failed to get face/size");
1146 --- misc/mozilla/mailnews/addrbook/src/Makefile.in 2007-05-03 03:39:37.000000000 +0200
1147 +++ misc/build/mozilla/mailnews/addrbook/src/Makefile.in 2008-10-16 12:59:35.000000000 +0200
1151 nsMsgVCardService.cpp \
1153 nsAbLDIFService.cpp \
1158 nsAbCardProperty.h \
1159 nsAbMDBCardProperty.h \
1162 + nsAbAddressCollecter.h \
1163 + nsAbDirectoryQuery.h \
1166 ifeq ($(OS_ARCH),WINNT)
1167 --- misc/mozilla/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.h 2005-05-11 06:16:53.000000000 +0200
1168 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.h 2008-08-14 16:22:21.000000000 +0200
1170 #include "nsIAbBooleanExpression.h"
1171 #include "nsCOMPtr.h"
1172 #include "nsString.h"
1173 +#include "nsAbUtils.h"
1175 class nsIAbLDAPAttributeMap;
1178 nsIAbBooleanConditionString* condition,
1181 + static void GenerateMultipleFilter(
1182 + nsAbBooleanConditionType conditionType,
1183 + nsCString& filter,
1184 + NS_ConvertUCS2toUTF8 &vUTF8,
1185 + CharPtrArrayGuard *pAttrs);
1186 + static void GenerateSingleFilter(
1187 + nsAbBooleanConditionType conditionType,
1188 + nsCString& filter,
1189 + NS_ConvertUCS2toUTF8 &vUTF8,
1190 + const char *ldapProperty);
1194 --- misc/mozilla/mailnews/addrbook/src/nsAbLDAPDirectory.cpp 2007-02-18 23:18:13.000000000 +0100
1195 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbLDAPDirectory.cpp 2008-08-20 12:16:50.000000000 +0200
1196 @@ -126,11 +126,13 @@
1198 // use mURINoQuery to get a prefName
1199 nsCAutoString prefName;
1200 - prefName = nsDependentCString(mURINoQuery.get() + kLDAPDirectoryRootLen) + NS_LITERAL_CSTRING(".uri");
1201 + prefName = nsDependentCString(mURINoQuery.get() + kLDAPDirectoryRootLen);
1203 // turn moz-abldapdirectory://ldap_2.servers.nscpphonebook into -> "ldap_2.servers.nscpphonebook.uri"
1205 - rv = prefs->GetCharPref(prefName.get(), getter_Copies(URI));
1206 + nsCAutoString uriPrefName;
1207 + uriPrefName = prefName + NS_LITERAL_CSTRING(".uri");
1208 + rv = prefs->GetCharPref(uriPrefName.get(), getter_Copies(URI));
1212 @@ -154,6 +156,27 @@
1213 nsCAutoString tempLDAPURL(mURINoQuery);
1214 tempLDAPURL.ReplaceSubstring("moz-abldapdirectory:", "ldap:");
1215 rv = mURL->SetSpec(tempLDAPURL);
1216 + NS_ENSURE_SUCCESS(rv,rv);
1218 + nsCAutoString aHost;
1219 + mURL->GetHost(aHost);
1220 + aHost.ReplaceChar('.','_');
1221 + prefName = nsDependentCString("ldap_2.servers.") + aHost;
1223 + rv = prefs->GetBoolPref(
1224 + PromiseFlatCString(prefName
1225 + + NS_LITERAL_CSTRING(".UseSSL")).get(),
1229 + // If use SSL,ldap url will look like this ldaps://host:port/.....
1230 + if (!NS_FAILED(rv) && useSSL)
1232 + tempLDAPURL.ReplaceSubstring("ldap:", "ldaps:");
1233 + rv = mURL->SetSpec(tempLDAPURL);
1235 + //NS_FAILED(rv) means ldap_2.servers.nscpphonebook.UseSSL not exist
1240 @@ -164,24 +187,29 @@
1241 // get the login information, if there is any
1243 rv = prefs->GetCharPref(
1244 - PromiseFlatCString(
1245 - Substring(mURINoQuery, kLDAPDirectoryRootLen,
1246 - mURINoQuery.Length() - kLDAPDirectoryRootLen)
1247 + PromiseFlatCString(prefName
1248 + NS_LITERAL_CSTRING(".auth.dn")).get(),
1249 getter_Copies(mLogin));
1250 if (NS_FAILED(rv)) {
1251 mLogin.Truncate(); // zero out mLogin
1254 + // get the password information, if there is any
1256 + rv = prefs->GetCharPref(
1257 + PromiseFlatCString(prefName
1258 + + NS_LITERAL_CSTRING(".auth.pwd")).get(),
1259 + getter_Copies(mPassword));
1260 + if (NS_FAILED(rv)) {
1261 + mPassword.Truncate(); // zero out mLogin
1263 // get the protocol version, if there is any. using a string pref
1264 // here instead of an int, as protocol versions sometimes have names like
1267 nsXPIDLCString protocolVersion;
1268 rv = prefs->GetCharPref(
1269 - PromiseFlatCString(
1270 - Substring(mURINoQuery, kLDAPDirectoryRootLen,
1271 - mURINoQuery.Length() - kLDAPDirectoryRootLen)
1272 + PromiseFlatCString(prefName
1273 + NS_LITERAL_CSTRING(".protocolVersion")).get(),
1274 getter_Copies(protocolVersion));
1276 --- misc/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp 2006-12-22 14:51:38.000000000 +0100
1277 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp 2008-08-20 15:01:16.000000000 +0200
1279 PRInt32 resultLimit = -1,
1280 PRInt32 timeOut = 0);
1281 virtual ~nsAbQueryLDAPMessageListener ();
1283 + void SetPassword(const nsAString& aPassword){m_sPassword = aPassword;};
1285 nsresult OnLDAPMessageBind (nsILDAPMessage *aMessage);
1286 nsresult OnLDAPMessageSearchEntry (nsILDAPMessage *aMessage,
1289 PRBool mWaitingForPrevQueryToFinish;
1291 + nsAutoString m_sPassword;
1293 nsCOMPtr<nsILDAPOperation> mSearchOperation;
1298 // If mLogin is set, we're expected to use it to get a password.
1300 - if (!mDirectoryQuery->mLogin.IsEmpty()) {
1301 + if (!mDirectoryQuery->mLogin.IsEmpty() && !m_sPassword.Length()) {
1302 // XXX hack until nsUTF8AutoString exists
1303 #define nsUTF8AutoString nsCAutoString
1304 nsUTF8AutoString spec;
1305 @@ -415,10 +417,13 @@
1306 rv = ldapOperation->Init(mConnection, proxyListener, nsnull);
1307 NS_ENSURE_SUCCESS(rv, rv);
1310 - rv = ldapOperation->SimpleBind(NS_ConvertUCS2toUTF8(passwd));
1313 + if (m_sPassword.Length())
1314 + rv = ldapOperation->SimpleBind(NS_ConvertUCS2toUTF8(m_sPassword));
1316 + rv = ldapOperation->SimpleBind(NS_ConvertUCS2toUTF8(passwd));
1317 NS_ENSURE_SUCCESS(rv, rv);
1323 rv = getLdapReturnAttributes (arguments, returnAttributes);
1324 NS_ENSURE_SUCCESS(rv, rv);
1329 nsCOMPtr<nsISupports> supportsExpression;
1330 rv = arguments->GetExpression (getter_AddRefs (supportsExpression));
1331 @@ -828,6 +833,10 @@
1334 msgListener->mUrl = url;
1335 + msgListener->mQueryListener = listener;
1336 + msgListener->mResultLimit = resultLimit;
1337 + msgListener->mTimeOut = timeOut;
1338 + msgListener->mQueryArguments = arguments;
1339 return msgListener->DoSearch();
1342 @@ -845,6 +854,11 @@
1344 if (_messageListener == NULL)
1345 return NS_ERROR_OUT_OF_MEMORY;
1347 + nsAutoString wPassword;
1348 + wPassword.AssignWithConversion(mPassword.get());
1349 + _messageListener->SetPassword(wPassword);
1351 mListener = _messageListener;
1354 --- misc/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.h 2004-07-24 21:50:29.000000000 +0200
1355 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.h 2008-08-14 16:22:21.000000000 +0200
1357 friend class nsAbQueryLDAPMessageListener;
1358 nsresult Initiate ();
1359 nsXPIDLCString mLogin; // authenticate to the LDAP server as...
1360 + nsXPIDLCString mPassword; // password to the LDAP server as...
1361 nsCOMPtr<nsILDAPURL> mDirectoryUrl; // the URL for the server
1362 PRUint32 mProtocolVersion; // version of LDAP (see nsILDAPConnection.idl)
1364 --- misc/mozilla/mailnews/addrbook/src/nsAbMD5sum.cpp 2008-08-14 16:30:14.000000000 +0200
1365 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbMD5sum.cpp 2008-08-14 16:22:21.000000000 +0200
1369 + * The contents of this file are subject to the Mozilla Public
1370 + * License Version 1.1 (the "License"); you may not use this file
1371 + * except in compliance with the License. You may obtain a copy of
1372 + * the License at http://www.mozilla.org/MPL/
1374 + * Software distributed under the License is distributed on an "AS
1375 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
1376 + * implied. See the License for the specific language governing
1377 + * rights and limitations under the License.
1379 + * The Original Code is the Netscape security libraries.
1381 + * The Initial Developer of the Original Code is Netscape
1382 + * Communications Corporation. Portions created by Netscape are
1383 + * Copyright (C) 1994-2000 Netscape Communications Corporation. All
1384 + * Rights Reserved.
1388 + * Alternatively, the contents of this file may be used under the
1389 + * terms of the GNU General Public License Version 2 or later (the
1390 + * "GPL"), in which case the provisions of the GPL are applicable
1391 + * instead of those above. If you wish to allow use of your
1392 + * version of this file only under the terms of the GPL and not to
1393 + * allow others to use your version of this file under the MPL,
1394 + * indicate your decision by deleting the provisions above and
1395 + * replace them with the notice and other provisions required by
1396 + * the GPL. If you do not delete the provisions above, a recipient
1397 + * may use your version of this file under either the MPL or the
1401 +#include <stdlib.h>
1405 +#include "prtypes.h"
1406 +#include "prlong.h"
1408 +#include "nsMemory.h"
1410 +#define MD5_HASH_LEN 16
1411 +#define MD5_BUFFER_SIZE 64
1412 +#define MD5_END_BUFFER (MD5_BUFFER_SIZE - 8)
1414 +#define CV0_1 0x67452301
1415 +#define CV0_2 0xefcdab89
1416 +#define CV0_3 0x98badcfe
1417 +#define CV0_4 0x10325476
1419 +#define T1_0 0xd76aa478
1420 +#define T1_1 0xe8c7b756
1421 +#define T1_2 0x242070db
1422 +#define T1_3 0xc1bdceee
1423 +#define T1_4 0xf57c0faf
1424 +#define T1_5 0x4787c62a
1425 +#define T1_6 0xa8304613
1426 +#define T1_7 0xfd469501
1427 +#define T1_8 0x698098d8
1428 +#define T1_9 0x8b44f7af
1429 +#define T1_10 0xffff5bb1
1430 +#define T1_11 0x895cd7be
1431 +#define T1_12 0x6b901122
1432 +#define T1_13 0xfd987193
1433 +#define T1_14 0xa679438e
1434 +#define T1_15 0x49b40821
1436 +#define T2_0 0xf61e2562
1437 +#define T2_1 0xc040b340
1438 +#define T2_2 0x265e5a51
1439 +#define T2_3 0xe9b6c7aa
1440 +#define T2_4 0xd62f105d
1441 +#define T2_5 0x02441453
1442 +#define T2_6 0xd8a1e681
1443 +#define T2_7 0xe7d3fbc8
1444 +#define T2_8 0x21e1cde6
1445 +#define T2_9 0xc33707d6
1446 +#define T2_10 0xf4d50d87
1447 +#define T2_11 0x455a14ed
1448 +#define T2_12 0xa9e3e905
1449 +#define T2_13 0xfcefa3f8
1450 +#define T2_14 0x676f02d9
1451 +#define T2_15 0x8d2a4c8a
1453 +#define T3_0 0xfffa3942
1454 +#define T3_1 0x8771f681
1455 +#define T3_2 0x6d9d6122
1456 +#define T3_3 0xfde5380c
1457 +#define T3_4 0xa4beea44
1458 +#define T3_5 0x4bdecfa9
1459 +#define T3_6 0xf6bb4b60
1460 +#define T3_7 0xbebfbc70
1461 +#define T3_8 0x289b7ec6
1462 +#define T3_9 0xeaa127fa
1463 +#define T3_10 0xd4ef3085
1464 +#define T3_11 0x04881d05
1465 +#define T3_12 0xd9d4d039
1466 +#define T3_13 0xe6db99e5
1467 +#define T3_14 0x1fa27cf8
1468 +#define T3_15 0xc4ac5665
1470 +#define T4_0 0xf4292244
1471 +#define T4_1 0x432aff97
1472 +#define T4_2 0xab9423a7
1473 +#define T4_3 0xfc93a039
1474 +#define T4_4 0x655b59c3
1475 +#define T4_5 0x8f0ccc92
1476 +#define T4_6 0xffeff47d
1477 +#define T4_7 0x85845dd1
1478 +#define T4_8 0x6fa87e4f
1479 +#define T4_9 0xfe2ce6e0
1480 +#define T4_10 0xa3014314
1481 +#define T4_11 0x4e0811a1
1482 +#define T4_12 0xf7537e82
1483 +#define T4_13 0xbd3af235
1484 +#define T4_14 0x2ad7d2bb
1485 +#define T4_15 0xeb86d391
1575 +struct MD5ContextStr {
1576 + PRUint32 lsbInput;
1577 + PRUint32 msbInput;
1584 +typedef struct MD5ContextStr MD5Context;
1588 +int MD5_Hash(unsigned char *dest, const char *src);
1589 +int MD5_HashBuf(unsigned char *dest, const unsigned char *src, uint32 src_length);
1590 +MD5Context * MD5_NewContext(void);
1591 +void MD5_DestroyContext(MD5Context *cx, PRBool freeit);
1592 +void MD5_Begin(MD5Context *cx);
1593 +static void md5_compress(MD5Context *cx);
1594 +void MD5_Update(MD5Context *cx, const unsigned char *input, unsigned int inputLen);
1595 +void MD5_End(MD5Context *cx, unsigned char *digest,
1596 + unsigned int *digestLen, unsigned int maxDigestLen);
1597 +unsigned int MD5_FlattenSize(MD5Context *cx);
1598 +int MD5_Flatten(MD5Context *cx, unsigned char *space);
1599 +MD5Context * MD5_Resurrect(unsigned char *space, void *arg);
1600 +void MD5_TraceState(MD5Context *cx);
1603 +MD5_Hash(unsigned char *dest, const char *src)
1605 + return MD5_HashBuf(dest, (unsigned char *)src, PL_strlen(src));
1609 +MD5_HashBuf(unsigned char *dest, const unsigned char *src, uint32 src_length)
1612 + MD5Context *cx = MD5_NewContext();
1614 +// PORT_SetError(PR_OUT_OF_MEMORY_ERROR);
1618 + MD5_Update(cx, src, src_length);
1619 + MD5_End(cx, dest, &len, MD5_HASH_LEN);
1620 + MD5_DestroyContext(cx, PR_TRUE);
1625 +MD5_NewContext(void)
1627 + MD5Context *cx = (MD5Context *)malloc(sizeof(MD5Context));
1629 +// PORT_SetError(PR_OUT_OF_MEMORY_ERROR);
1636 +MD5_DestroyContext(MD5Context *cx, PRBool freeit)
1644 +MD5_Begin(MD5Context *cx)
1648 + memset(cx->inBuf, 0, sizeof(cx->inBuf));
1649 + cx->cv[0] = CV0_1;
1650 + cx->cv[1] = CV0_2;
1651 + cx->cv[2] = CV0_3;
1652 + cx->cv[3] = CV0_4;
1655 +#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
1657 +#define MASK 0x00ff00ff
1658 +#ifdef IS_LITTLE_ENDIAN
1659 +#define lendian(i32) \
1662 +#define lendian(i32) \
1663 + (tmp = i32 >> 16 | i32 << 16, (tmp & MASK) << 8 | tmp >> 8 & MASK)
1666 +#if defined(SOLARIS) || defined(HPUX)
1667 +#define addto64(sumhigh, sumlow, addend) \
1668 + sumlow += addend; sumhigh += (sumlow < addend);
1670 +#define addto64(sumhigh, sumlow, addend) \
1671 + sumlow += addend; if (sumlow < addend) ++sumhigh;
1674 +#define F(X, Y, Z) \
1675 + ((X & Y) | ((~X) & Z))
1677 +#define G(X, Y, Z) \
1678 + ((X & Z) | (Y & (~Z)))
1680 +#define H(X, Y, Z) \
1683 +#define I(X, Y, Z) \
1686 +#define FF(a, b, c, d, bufint, s, ti) \
1687 + a = b + cls(a + F(b, c, d) + bufint + ti, s)
1689 +#define GG(a, b, c, d, bufint, s, ti) \
1690 + a = b + cls(a + G(b, c, d) + bufint + ti, s)
1692 +#define HH(a, b, c, d, bufint, s, ti) \
1693 + a = b + cls(a + H(b, c, d) + bufint + ti, s)
1695 +#define II(a, b, c, d, bufint, s, ti) \
1696 + a = b + cls(a + I(b, c, d) + bufint + ti, s)
1699 +md5_compress(MD5Context *cx)
1701 + PRUint32 a, b, c, d;
1707 +#ifndef IS_LITTLE_ENDIAN
1708 + cx->u.w[0] = lendian(cx->u.w[0]);
1709 + cx->u.w[1] = lendian(cx->u.w[1]);
1710 + cx->u.w[2] = lendian(cx->u.w[2]);
1711 + cx->u.w[3] = lendian(cx->u.w[3]);
1712 + cx->u.w[4] = lendian(cx->u.w[4]);
1713 + cx->u.w[5] = lendian(cx->u.w[5]);
1714 + cx->u.w[6] = lendian(cx->u.w[6]);
1715 + cx->u.w[7] = lendian(cx->u.w[7]);
1716 + cx->u.w[8] = lendian(cx->u.w[8]);
1717 + cx->u.w[9] = lendian(cx->u.w[9]);
1718 + cx->u.w[10] = lendian(cx->u.w[10]);
1719 + cx->u.w[11] = lendian(cx->u.w[11]);
1720 + cx->u.w[12] = lendian(cx->u.w[12]);
1721 + cx->u.w[13] = lendian(cx->u.w[13]);
1722 + cx->u.w[14] = lendian(cx->u.w[14]);
1723 + cx->u.w[15] = lendian(cx->u.w[15]);
1725 + FF(a, b, c, d, cx->u.w[R1B0 ], S1_0, T1_0);
1726 + FF(d, a, b, c, cx->u.w[R1B1 ], S1_1, T1_1);
1727 + FF(c, d, a, b, cx->u.w[R1B2 ], S1_2, T1_2);
1728 + FF(b, c, d, a, cx->u.w[R1B3 ], S1_3, T1_3);
1729 + FF(a, b, c, d, cx->u.w[R1B4 ], S1_0, T1_4);
1730 + FF(d, a, b, c, cx->u.w[R1B5 ], S1_1, T1_5);
1731 + FF(c, d, a, b, cx->u.w[R1B6 ], S1_2, T1_6);
1732 + FF(b, c, d, a, cx->u.w[R1B7 ], S1_3, T1_7);
1733 + FF(a, b, c, d, cx->u.w[R1B8 ], S1_0, T1_8);
1734 + FF(d, a, b, c, cx->u.w[R1B9 ], S1_1, T1_9);
1735 + FF(c, d, a, b, cx->u.w[R1B10], S1_2, T1_10);
1736 + FF(b, c, d, a, cx->u.w[R1B11], S1_3, T1_11);
1737 + FF(a, b, c, d, cx->u.w[R1B12], S1_0, T1_12);
1738 + FF(d, a, b, c, cx->u.w[R1B13], S1_1, T1_13);
1739 + FF(c, d, a, b, cx->u.w[R1B14], S1_2, T1_14);
1740 + FF(b, c, d, a, cx->u.w[R1B15], S1_3, T1_15);
1741 + GG(a, b, c, d, cx->u.w[R2B0 ], S2_0, T2_0);
1742 + GG(d, a, b, c, cx->u.w[R2B1 ], S2_1, T2_1);
1743 + GG(c, d, a, b, cx->u.w[R2B2 ], S2_2, T2_2);
1744 + GG(b, c, d, a, cx->u.w[R2B3 ], S2_3, T2_3);
1745 + GG(a, b, c, d, cx->u.w[R2B4 ], S2_0, T2_4);
1746 + GG(d, a, b, c, cx->u.w[R2B5 ], S2_1, T2_5);
1747 + GG(c, d, a, b, cx->u.w[R2B6 ], S2_2, T2_6);
1748 + GG(b, c, d, a, cx->u.w[R2B7 ], S2_3, T2_7);
1749 + GG(a, b, c, d, cx->u.w[R2B8 ], S2_0, T2_8);
1750 + GG(d, a, b, c, cx->u.w[R2B9 ], S2_1, T2_9);
1751 + GG(c, d, a, b, cx->u.w[R2B10], S2_2, T2_10);
1752 + GG(b, c, d, a, cx->u.w[R2B11], S2_3, T2_11);
1753 + GG(a, b, c, d, cx->u.w[R2B12], S2_0, T2_12);
1754 + GG(d, a, b, c, cx->u.w[R2B13], S2_1, T2_13);
1755 + GG(c, d, a, b, cx->u.w[R2B14], S2_2, T2_14);
1756 + GG(b, c, d, a, cx->u.w[R2B15], S2_3, T2_15);
1757 + HH(a, b, c, d, cx->u.w[R3B0 ], S3_0, T3_0);
1758 + HH(d, a, b, c, cx->u.w[R3B1 ], S3_1, T3_1);
1759 + HH(c, d, a, b, cx->u.w[R3B2 ], S3_2, T3_2);
1760 + HH(b, c, d, a, cx->u.w[R3B3 ], S3_3, T3_3);
1761 + HH(a, b, c, d, cx->u.w[R3B4 ], S3_0, T3_4);
1762 + HH(d, a, b, c, cx->u.w[R3B5 ], S3_1, T3_5);
1763 + HH(c, d, a, b, cx->u.w[R3B6 ], S3_2, T3_6);
1764 + HH(b, c, d, a, cx->u.w[R3B7 ], S3_3, T3_7);
1765 + HH(a, b, c, d, cx->u.w[R3B8 ], S3_0, T3_8);
1766 + HH(d, a, b, c, cx->u.w[R3B9 ], S3_1, T3_9);
1767 + HH(c, d, a, b, cx->u.w[R3B10], S3_2, T3_10);
1768 + HH(b, c, d, a, cx->u.w[R3B11], S3_3, T3_11);
1769 + HH(a, b, c, d, cx->u.w[R3B12], S3_0, T3_12);
1770 + HH(d, a, b, c, cx->u.w[R3B13], S3_1, T3_13);
1771 + HH(c, d, a, b, cx->u.w[R3B14], S3_2, T3_14);
1772 + HH(b, c, d, a, cx->u.w[R3B15], S3_3, T3_15);
1773 + II(a, b, c, d, cx->u.w[R4B0 ], S4_0, T4_0);
1774 + II(d, a, b, c, cx->u.w[R4B1 ], S4_1, T4_1);
1775 + II(c, d, a, b, cx->u.w[R4B2 ], S4_2, T4_2);
1776 + II(b, c, d, a, cx->u.w[R4B3 ], S4_3, T4_3);
1777 + II(a, b, c, d, cx->u.w[R4B4 ], S4_0, T4_4);
1778 + II(d, a, b, c, cx->u.w[R4B5 ], S4_1, T4_5);
1779 + II(c, d, a, b, cx->u.w[R4B6 ], S4_2, T4_6);
1780 + II(b, c, d, a, cx->u.w[R4B7 ], S4_3, T4_7);
1781 + II(a, b, c, d, cx->u.w[R4B8 ], S4_0, T4_8);
1782 + II(d, a, b, c, cx->u.w[R4B9 ], S4_1, T4_9);
1783 + II(c, d, a, b, cx->u.w[R4B10], S4_2, T4_10);
1784 + II(b, c, d, a, cx->u.w[R4B11], S4_3, T4_11);
1785 + II(a, b, c, d, cx->u.w[R4B12], S4_0, T4_12);
1786 + II(d, a, b, c, cx->u.w[R4B13], S4_1, T4_13);
1787 + II(c, d, a, b, cx->u.w[R4B14], S4_2, T4_14);
1788 + II(b, c, d, a, cx->u.w[R4B15], S4_3, T4_15);
1796 +MD5_Update(MD5Context *cx, const unsigned char *input, unsigned int inputLen)
1798 + PRUint32 bytesToConsume;
1799 + PRUint32 inBufIndex = cx->lsbInput & 63;
1801 + /* Add the number of input bytes to the 64-bit input counter. */
1802 + addto64(cx->msbInput, cx->lsbInput, inputLen);
1804 + /* There is already data in the buffer. Fill with input. */
1805 + bytesToConsume = PR_MIN(inputLen, MD5_BUFFER_SIZE - inBufIndex);
1806 + memcpy(&cx->inBuf[inBufIndex], input, bytesToConsume);
1807 + if (inBufIndex + bytesToConsume >= MD5_BUFFER_SIZE)
1808 + /* The buffer is filled. Run the compression function. */
1810 + /* Remaining input. */
1811 + inputLen -= bytesToConsume;
1812 + input += bytesToConsume;
1815 + /* Iterate over 64-byte chunks of the message. */
1816 + while (inputLen >= MD5_BUFFER_SIZE) {
1817 + memcpy(cx->inBuf, input, MD5_BUFFER_SIZE);
1819 + inputLen -= MD5_BUFFER_SIZE;
1820 + input += MD5_BUFFER_SIZE;
1823 + /* Tail of message (message bytes mod 64). */
1825 + memcpy(cx->inBuf, input, inputLen);
1828 +static const unsigned char padbytes[] = {
1829 + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1830 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1831 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1832 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1833 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1834 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1835 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1836 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1837 + 0x00, 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
1844 +MD5_End(MD5Context *cx, unsigned char *digest,
1845 + unsigned int *digestLen, unsigned int maxDigestLen)
1847 +#ifndef IS_LITTLE_ENDIAN
1850 + PRUint32 lowInput, highInput;
1851 + PRUint32 inBufIndex = cx->lsbInput & 63;
1853 + if (maxDigestLen < MD5_HASH_LEN) {
1854 +// PORT_SetError(SEC_ERROR_INVALID_ARGS);
1858 + /* Copy out the length of bits input before padding. */
1859 + lowInput = cx->lsbInput;
1860 + highInput = (cx->msbInput << 3) | (lowInput >> 29);
1863 + if (inBufIndex < MD5_END_BUFFER) {
1864 + MD5_Update(cx, padbytes, MD5_END_BUFFER - inBufIndex);
1866 + MD5_Update(cx, padbytes,
1867 + MD5_END_BUFFER + MD5_BUFFER_SIZE - inBufIndex);
1870 + /* Store the number of bytes input (before padding) in final 64 bits. */
1871 + cx->u.w[14] = lendian(lowInput);
1872 + cx->u.w[15] = lendian(highInput);
1874 + /* Final call to compress. */
1877 + /* Copy the resulting values out of the chain variables into return buf. */
1878 + *digestLen = MD5_HASH_LEN;
1879 +#ifndef IS_LITTLE_ENDIAN
1880 + cx->cv[0] = lendian(cx->cv[0]);
1881 + cx->cv[1] = lendian(cx->cv[1]);
1882 + cx->cv[2] = lendian(cx->cv[2]);
1883 + cx->cv[3] = lendian(cx->cv[3]);
1885 + memcpy(digest, cx->cv, MD5_HASH_LEN);
1889 +MD5_FlattenSize(MD5Context *cx)
1891 + return sizeof(*cx);
1895 +MD5_Flatten(MD5Context *cx, unsigned char *space)
1897 + memcpy(space, cx, sizeof(*cx));
1902 +MD5_Resurrect(unsigned char *space, void *arg)
1904 + MD5Context *cx = MD5_NewContext();
1906 + memcpy(cx, space, sizeof(*cx));
1911 +MD5_TraceState(MD5Context *cx)
1913 +// PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
1917 +md5_stream (FILE *stream, unsigned char *dest)
1919 + /* Important: BLOCKSIZE must be a multiple of 64. */
1920 +#define BLOCKSIZE 4096
1922 + MD5Context *cx = MD5_NewContext();
1924 +// PORT_SetError(PR_OUT_OF_MEMORY_ERROR);
1928 + unsigned char buffer[BLOCKSIZE + 72];
1931 + /* Initialize the computation context. */
1934 + /* Iterate over full file contents. */
1937 + /* We read the file in blocks of BLOCKSIZE bytes. One call of the
1938 + computation function processes the whole buffer so that with the
1939 + next round of the loop another block can be read. */
1943 + /* Read block. Take care for partial reads. */
1946 + n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
1950 + while (sum < BLOCKSIZE && n != 0);
1951 + if (n == 0 && ferror (stream))
1954 + /* If end of file is reached, end the loop. */
1958 + /* Process buffer with BLOCKSIZE bytes. Note that
1959 + BLOCKSIZE % 64 == 0
1961 + MD5_Update(cx, buffer, BLOCKSIZE);
1964 + /* Add the last bytes if necessary. */
1966 + MD5_Update(cx, buffer, sum);
1968 + MD5_End(cx, dest, &len, MD5_HASH_LEN);
1969 + MD5_DestroyContext(cx, PR_TRUE);
1974 +int getMD5sum(const char * fileName,char * sum)
1976 + unsigned char bin_sum[16];
1980 + FILE *fp=fopen(fileName,"rb");
1983 + len=md5_stream(fp,bin_sum);
1985 + for (int i = 0; i < len; ++i)
1986 + sprintf (sum,"%s%02x",sum, bin_sum[i]);
1994 +int testMD5sum(const char * fileName,char * sum)
1996 + char newSum[33]="";
1997 + if (getMD5sum(fileName,newSum))
1999 + return strcmp(newSum,sum);
2001 --- misc/mozilla/mailnews/addrbook/src/nsAbMDBCardProperty.cpp 2006-12-22 14:51:38.000000000 +0100
2002 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbMDBCardProperty.cpp 2008-08-14 16:22:21.000000000 +0200
2006 mCardDatabase->EditCard(this, PR_TRUE);
2007 - mCardDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
2009 + return mCardDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
2012 return NS_ERROR_FAILURE;
2013 --- misc/mozilla/mailnews/addrbook/src/nsAbMDBDirectory.cpp 2008-01-29 20:31:58.000000000 +0100
2014 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbMDBDirectory.cpp 2008-08-14 16:22:21.000000000 +0200
2019 - mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
2020 + rv = mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
2025 return NS_ERROR_NOT_IMPLEMENTED;
2027 nsresult rv = NS_OK;
2030 rv = GetAbDatabase();
2032 @@ -736,10 +737,11 @@
2033 mDatabase->CreateNewListCardAndAddToDB(this, m_dbRowID, newCard, PR_TRUE /* notify */);
2035 mDatabase->CreateNewCardAndAddToDB(newCard, PR_TRUE);
2036 - mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
2037 + rv = mDatabase->Commit(nsAddrDBCommitType::kLargeCommit);
2039 + NS_ENSURE_SUCCESS(rv, rv);
2040 NS_IF_ADDREF(*addedCard = newCard);
2045 NS_IMETHODIMP nsAbMDBDirectory::DropCard(nsIAbCard* aCard, PRBool needToCopyCard)
2046 --- misc/mozilla/mailnews/addrbook/src/nsAbOutlookCard.cpp 2004-07-31 20:04:18.000000000 +0200
2047 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbOutlookCard.cpp 2008-08-14 16:22:21.000000000 +0200
2050 index_DisplayName = 0,
2052 + index_SecondEmailAddress,
2056 @@ -121,32 +122,34 @@
2058 static const ULONG OutlookCardMAPIProps [] =
2060 - PR_DISPLAY_NAME_W,
2061 - PR_EMAIL_ADDRESS_W,
2065 - PR_BUSINESS_TELEPHONE_NUMBER_W,
2066 - PR_HOME_TELEPHONE_NUMBER_W,
2067 - PR_BUSINESS_FAX_NUMBER_W,
2068 - PR_PAGER_TELEPHONE_NUMBER_W,
2069 - PR_MOBILE_TELEPHONE_NUMBER_W,
2070 - PR_HOME_ADDRESS_CITY_W,
2071 - PR_HOME_ADDRESS_STATE_OR_PROVINCE_W,
2072 - PR_HOME_ADDRESS_POSTAL_CODE_W,
2073 - PR_HOME_ADDRESS_COUNTRY_W,
2074 - PR_BUSINESS_ADDRESS_CITY_W,
2075 - PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE_W,
2076 - PR_BUSINESS_ADDRESS_POSTAL_CODE_W,
2077 - PR_BUSINESS_ADDRESS_COUNTRY_W,
2079 - PR_DEPARTMENT_NAME_W,
2080 - PR_COMPANY_NAME_W,
2081 - PR_BUSINESS_HOME_PAGE_W,
2082 - PR_PERSONAL_HOME_PAGE_W,
2084 + PR_DISPLAY_NAME_A,//0x8035001E
2085 + PR_EMAIL_ADDRESS_A,//0x8034001E
2086 + PR_SECOND_EMAIL_ADDRESS_A,//Second Email Address
2090 + PR_BUSINESS_TELEPHONE_NUMBER_A,
2091 + PR_HOME_TELEPHONE_NUMBER_A,
2092 + PR_BUSINESS_FAX_NUMBER_A,
2093 + PR_PAGER_TELEPHONE_NUMBER_A,
2094 + PR_MOBILE_TELEPHONE_NUMBER_A,
2095 + PR_HOME_ADDRESS_CITY_A,
2096 + PR_HOME_ADDRESS_STATE_OR_PROVINCE_A,
2097 + PR_HOME_ADDRESS_POSTAL_CODE_A,
2098 + PR_HOME_ADDRESS_COUNTRY_A,
2099 + PR_BUSINESS_ADDRESS_CITY_A,
2100 + PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE_A,
2101 + PR_BUSINESS_ADDRESS_POSTAL_CODE_A,
2102 + PR_BUSINESS_ADDRESS_COUNTRY_A,
2104 + PR_DEPARTMENT_NAME_A,
2105 + PR_COMPANY_NAME_A,
2106 + PR_BUSINESS_HOME_PAGE_A,
2107 + PR_PERSONAL_HOME_PAGE_A,
2112 nsresult nsAbOutlookCard::Init(const char *aUri)
2114 nsresult retCode = nsRDFResource::Init(aUri) ;
2116 SetDisplayName(unichars [index_DisplayName]->get()) ;
2117 SetNickName(unichars [index_NickName]->get()) ;
2118 SetPrimaryEmail(unichars [index_EmailAddress]->get()) ;
2119 + SetSecondEmail(unichars [index_SecondEmailAddress]->get()) ;
2120 SetWorkPhone(unichars [index_WorkPhoneNumber]->get()) ;
2121 SetHomePhone(unichars [index_HomePhoneNumber]->get()) ;
2122 SetFaxNumber(unichars [index_WorkFaxNumber]->get()) ;
2123 @@ -207,12 +211,12 @@
2124 nsAutoString unichar ;
2125 nsAutoString unicharBis ;
2127 - if (mapiAddBook->GetPropertyUString(*mMapiData, PR_HOME_ADDRESS_STREET_W, unichar)) {
2128 + if (mapiAddBook->GetPropertyUString(*mMapiData, PR_HOME_ADDRESS_STREET_A, unichar)) {
2129 splitString(unichar, unicharBis) ;
2130 SetHomeAddress(unichar.get()) ;
2131 SetHomeAddress2(unicharBis.get()) ;
2133 - if (mapiAddBook->GetPropertyUString(*mMapiData, PR_BUSINESS_ADDRESS_STREET_W, unichar)) {
2134 + if (mapiAddBook->GetPropertyUString(*mMapiData, PR_BUSINESS_ADDRESS_STREET_A, unichar)) {
2135 splitString(unichar, unicharBis) ;
2136 SetWorkAddress(unichar.get()) ;
2137 SetWorkAddress2(unicharBis.get()) ;
2139 SetDisplayName(properties [index_DisplayName]) ;
2140 GetNickName(getter_Copies(properties [index_NickName])) ;
2141 GetPrimaryEmail(getter_Copies(properties [index_EmailAddress])) ;
2142 + GetSecondEmail(getter_Copies(properties [index_SecondEmailAddress])) ;
2143 GetWorkPhone(getter_Copies(properties [index_WorkPhoneNumber])) ;
2144 GetHomePhone(getter_Copies(properties [index_HomePhoneNumber])) ;
2145 GetFaxNumber(getter_Copies(properties [index_WorkFaxNumber])) ;
2146 @@ -309,9 +314,16 @@
2147 GetWebPage1(getter_Copies(properties [index_WorkWebPage])) ;
2148 GetWebPage2(getter_Copies(properties [index_HomeWebPage])) ;
2149 GetNotes(getter_Copies(properties [index_Comments])) ;
2150 - if (!mapiAddBook->SetPropertiesUString(*mMapiData, OutlookCardMAPIProps,
2151 - index_LastProp, properties)) {
2152 - PRINTF(("Cannot set general properties.\n")) ;
2155 + for (i=0;i<index_LastProp;i++)
2157 + if (!mapiAddBook->SetPropertyUString(*mMapiData,
2158 + OutlookCardMAPIProps[i],
2161 + PRINTF(("Cannot set properties:%d.\n",OutlookCardMAPIProps[i])) ;
2164 delete [] properties ;
2165 nsXPIDLString unichar ;
2166 --- misc/mozilla/mailnews/addrbook/src/nsAbOutlookDirFactory.cpp 2004-04-17 20:32:14.000000000 +0200
2167 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbOutlookDirFactory.cpp 2008-08-14 16:22:21.000000000 +0200
2170 nsCOMPtr<nsIRDFResource> resource ;
2172 - for (ULONG i = 0 ; i < folders.mNbEntries ; ++ i) {
2173 - folders.mEntries [i].ToString(entryId) ;
2174 + for (ULONG i = 0 ; i < folders.GetSize() ; ++ i) {
2175 + folders[i].ToString(entryId) ;
2176 buildAbWinUri(kOutlookDirectoryScheme, abType, uri) ;
2177 uri.Append(entryId) ;
2179 --- misc/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.cpp 2006-12-22 14:51:38.000000000 +0100
2180 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.cpp 2008-08-14 16:22:21.000000000 +0200
2182 PRINTF(("Cannot get type.\n")) ;
2183 return NS_ERROR_FAILURE ;
2185 - if (!mapiAddBook->GetPropertyUString(*mMapiData, PR_DISPLAY_NAME_W, unichars)) {
2186 + if (!mapiAddBook->GetPropertyUString(*mMapiData, PR_DISPLAY_NAME_A, unichars)) {
2187 PRINTF(("Cannot get name.\n")) ;
2188 return NS_ERROR_FAILURE ;
2190 @@ -163,45 +163,85 @@
2194 +nsresult nsAbOutlookDirectory::BuildCardFromURI(const nsCString& uriName,nsIAbCard **aNewCard,
2195 + PRBool aSearchForOld, PRBool& aIsNewCard)
2197 + nsresult retCode = NS_OK ;
2198 + if (aSearchForOld) {
2199 + nsCStringKey key(uriName) ;
2200 + nsCOMPtr<nsISupports> existingCard = mCardList.Get(&key) ;
2202 + if (existingCard) {
2203 + nsCOMPtr<nsIAbCard> card(do_QueryInterface(existingCard, &retCode)) ;
2205 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2206 + NS_IF_ADDREF(*aNewCard = card) ;
2207 + aIsNewCard = PR_FALSE ;
2211 + aIsNewCard = PR_TRUE ;
2212 + nsCOMPtr<nsIRDFResource> resource ;
2214 + nsCOMPtr<nsIAbCard> childCard = do_CreateInstance(NS_ABOUTLOOKCARD_CONTRACTID, &retCode);
2215 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2216 + resource = do_QueryInterface(childCard, &retCode) ;
2217 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2218 + retCode = resource->Init(uriName.get()) ;
2219 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2220 + NS_IF_ADDREF(*aNewCard = childCard);
2224 NS_IMETHODIMP nsAbOutlookDirectory::GetChildCards(nsIEnumerator **aCards)
2226 if (!aCards) { return NS_ERROR_NULL_POINTER ; }
2228 nsCOMPtr<nsISupportsArray> cardList ;
2229 + nsCStringArray uriList ;
2230 + nsAbWinHelperGuard mapiAddBook (mAbWinType) ;
2233 - mCardList.Reset() ;
2235 retCode = StartSearch() ;
2236 - NS_NewISupportsArray(getter_AddRefs(cardList)) ;
2239 - retCode = GetChildCards(getter_AddRefs(cardList), nsnull) ;
2240 + retCode = GetChildCards(uriList, nsnull) ;
2242 + NS_NewISupportsArray(getter_AddRefs(cardList)) ;
2243 if (NS_SUCCEEDED(retCode)) {
2244 // Fill the results array and update the card list
2245 // Also update the address list and notify any changes.
2246 PRUint32 nbCards = 0 ;
2247 - nsCOMPtr<nsISupports> element ;
2248 + nsCAutoString uriName;
2249 + nsCOMPtr <nsIAbCard> childCard;
2250 + PRBool searchForOldCards = 0; //(mCardList.Count() != 0) ;
2252 + nbCards = uriList.Count();
2253 + NS_NewISupportsArray(getter_AddRefs(m_AddressList));
2255 - cardList->Enumerate(aCards) ;
2256 - cardList->Count(&nbCards) ;
2257 for (PRUint32 i = 0 ; i < nbCards ; ++ i) {
2258 - cardList->GetElementAt(i, getter_AddRefs(element)) ;
2259 - nsVoidKey newKey (NS_STATIC_CAST(void *, element)) ;
2260 - nsCOMPtr<nsISupports> oldElement = mCardList.Get(&newKey) ;
2261 + PRBool isNewCard = PR_FALSE ;
2263 - if (!oldElement) {
2264 + uriList.CStringAt(i,uriName);
2265 + retCode = BuildCardFromURI(uriName,getter_AddRefs(childCard), searchForOldCards, isNewCard);
2266 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2267 + cardList->AppendElement(childCard);
2270 // We are dealing with a new element (probably directly
2271 // added from Outlook), we may need to sync m_AddressList
2272 - mCardList.Put(&newKey, element) ;
2273 - nsCOMPtr<nsIAbCard> card (do_QueryInterface(element, &retCode)) ;
2274 + nsCStringKey newKey(uriName) ;
2276 + mCardList.Put(&newKey, childCard) ;
2277 + nsCOMPtr<nsIAbCard> card (do_QueryInterface(childCard, &retCode)) ;
2279 NS_ENSURE_SUCCESS(retCode, retCode) ;
2280 PRBool isMailList = PR_FALSE ;
2282 retCode = card->GetIsMailList(&isMailList) ;
2283 NS_ENSURE_SUCCESS(retCode, retCode) ;
2286 // We can have mailing lists only in folder,
2287 // we must add the directory to m_AddressList
2288 @@ -224,18 +264,33 @@
2289 NotifyItemAddition(card) ;
2293 - NS_ASSERTION(oldElement == element, "Different card stored") ;
2296 + return cardList->Enumerate(aCards) ;
2299 +static nsresult ExtractUriFromCard(nsIAbCard *aCard, nsCString& aUri) {
2300 + nsresult retCode = NS_OK ;
2301 + nsCOMPtr<nsIRDFResource> resource (do_QueryInterface(aCard, &retCode)) ;
2303 + // Receiving a non-RDF card is accepted
2304 + if (NS_FAILED(retCode)) { return NS_OK ; }
2305 + nsXPIDLCString uri ;
2307 + retCode = resource->GetValue(getter_Copies(uri)) ;
2308 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2309 + aUri = uri.get() ;
2313 NS_IMETHODIMP nsAbOutlookDirectory::HasCard(nsIAbCard *aCard, PRBool *aHasCard)
2315 if (!aCard || !aHasCard) { return NS_ERROR_NULL_POINTER ; }
2316 - nsVoidKey key (NS_STATIC_CAST(void *, aCard)) ;
2317 + *aHasCard = PR_FALSE ;
2320 + ExtractUriFromCard(aCard, uri) ;
2321 + nsCStringKey key(uri) ;
2323 *aHasCard = mCardList.Exists(&key) ;
2325 @@ -317,7 +372,10 @@
2326 PRINTF(("Cannot delete card %s.\n", entryString.get())) ;
2329 - nsVoidKey key (NS_STATIC_CAST(void *, element)) ;
2332 + ExtractUriFromCard(card, uri) ;
2333 + nsCStringKey key(uri) ;
2335 mCardList.Remove(&key) ;
2336 if (m_IsMailList) { m_AddressList->RemoveElement(element) ; }
2337 @@ -386,7 +444,10 @@
2339 retCode = CreateCard(aData, addedCard) ;
2340 NS_ENSURE_SUCCESS(retCode, retCode) ;
2341 - nsVoidKey newKey (NS_STATIC_CAST(void *, *addedCard)) ;
2344 + ExtractUriFromCard(*addedCard, uri) ;
2345 + nsCStringKey newKey(uri) ;
2347 mCardList.Put(&newKey, *addedCard) ;
2348 if (m_IsMailList) { m_AddressList->AppendElement(*addedCard) ; }
2350 if (!mapiAddBook->IsOK()) { return NS_ERROR_FAILURE ; }
2351 retCode = GetDirName(getter_Copies(name)) ;
2352 NS_ENSURE_SUCCESS(retCode, retCode) ;
2353 - if (!mapiAddBook->SetPropertyUString(*mMapiData, PR_DISPLAY_NAME_W, name.get())) {
2354 + if (!mapiAddBook->SetPropertyUString(*mMapiData, PR_DISPLAY_NAME_A, name.get())) {
2355 return NS_ERROR_FAILURE ;
2357 retCode = CommitAddressList() ;
2359 {"DisplayName", PR_DISPLAY_NAME_A},
2360 {"NickName", PR_NICKNAME_A},
2361 {"PrimaryEmail", PR_EMAIL_ADDRESS_A},
2362 + {"SecondEmail",PR_SECOND_EMAIL_ADDRESS_A},
2363 {"WorkPhone", PR_BUSINESS_TELEPHONE_NUMBER_A},
2364 {"HomePhone", PR_HOME_TELEPHONE_NUMBER_A},
2365 {"FaxNumber", PR_BUSINESS_FAX_NUMBER_A},
2366 @@ -1027,7 +1089,10 @@
2368 nsresult nsAbOutlookDirectory::OnSearchFoundCard(nsIAbCard *aCard)
2370 - nsVoidKey newKey (NS_STATIC_CAST(void *, aCard)) ;
2373 + ExtractUriFromCard(aCard, uri) ;
2374 + nsCStringKey newKey(uri) ;
2375 nsresult retCode = NS_OK ;
2377 mCardList.Put(&newKey, aCard) ;
2378 @@ -1051,14 +1116,14 @@
2379 retCode = BuildRestriction(aArguments, arguments) ;
2380 NS_ENSURE_SUCCESS(retCode, retCode) ;
2381 nsCOMPtr<nsISupportsArray> resultsArray ;
2382 + nsCStringArray uriArray ;
2383 PRUint32 nbResults = 0 ;
2385 - retCode = GetChildCards(getter_AddRefs(resultsArray),
2386 + retCode = GetChildCards(uriArray,
2387 arguments.rt == RES_COMMENT ? nsnull : &arguments) ;
2388 DestroyRestriction(arguments) ;
2389 NS_ENSURE_SUCCESS(retCode, retCode) ;
2390 - retCode = resultsArray->Count(&nbResults) ;
2391 - NS_ENSURE_SUCCESS(retCode, retCode) ;
2392 + nbResults = uriArray.Count() ;
2393 nsCOMPtr<nsIAbDirectoryQueryResult> result ;
2394 nsAbDirectoryQueryResult *newResult = nsnull ;
2396 @@ -1066,15 +1131,18 @@
2397 nbResults = NS_STATIC_CAST(PRUint32, aResultLimit) ;
2400 - nsCOMPtr<nsISupports> element ;
2401 nsCOMPtr<nsISupportsArray> propertyValues ;
2403 + nsCAutoString uriName;
2404 + nsCOMPtr <nsIAbCard> card;
2406 for (i = 0 ; i < nbResults ; ++ i) {
2407 - retCode = resultsArray->GetElementAt(i, getter_AddRefs(element)) ;
2408 - NS_ENSURE_SUCCESS(retCode, retCode) ;
2409 - nsCOMPtr<nsIAbCard> card (do_QueryInterface(element, &retCode)) ;
2410 + PRBool isNewCard = PR_FALSE ;
2412 + uriArray.CStringAt(i,uriName);
2413 + retCode = BuildCardFromURI(uriName,getter_AddRefs(card), PR_FALSE, isNewCard);
2414 NS_ENSURE_SUCCESS(retCode, retCode) ;
2416 FillPropertyValues(card, aArguments, getter_AddRefs(propertyValues)) ;
2417 newResult = new nsAbDirectoryQueryResult(0, aArguments,
2418 nsIAbDirectoryQueryResult::queryResultMatch,
2419 @@ -1099,13 +1167,43 @@
2420 if (!aCards) { return NS_ERROR_NULL_POINTER ; }
2422 nsresult retCode = NS_OK ;
2423 - nsCOMPtr<nsISupportsArray> cards ;
2425 + nsCOMPtr<nsISupportsArray> cards;
2426 + retCode = NS_NewISupportsArray(getter_AddRefs(cards));
2427 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2429 + nsCStringArray uriList;
2430 + retCode = GetChildCards(uriList,aRestriction);
2431 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2433 + nsCAutoString uriName;
2434 + nsCOMPtr <nsIAbCard> childCard;
2435 + PRUint32 nbURIs = 0 ;
2436 + nbURIs = uriList.Count();
2439 + for (i = 0 ; i < nbURIs ; ++ i) {
2440 + PRBool isNewCard = PR_FALSE ;
2442 + uriList.CStringAt(i,uriName);
2443 + retCode = BuildCardFromURI(uriName,getter_AddRefs(childCard), PR_TRUE, isNewCard);
2444 + NS_ENSURE_SUCCESS(retCode, retCode) ;
2445 + cards->AppendElement(childCard);
2448 + NS_IF_ADDREF(*aCards = cards);
2452 +nsresult nsAbOutlookDirectory::GetChildCards(nsCStringArray& aURI,
2453 + void *aRestriction)
2455 + nsresult retCode = NS_OK ;
2456 nsAbWinHelperGuard mapiAddBook (mAbWinType) ;
2457 nsMapiEntryArray cardEntries ;
2458 LPSRestriction restriction = (LPSRestriction) aRestriction ;
2460 if (!mapiAddBook->IsOK()) { return NS_ERROR_FAILURE ; }
2461 - retCode = NS_NewISupportsArray(getter_AddRefs(cards)) ;
2462 NS_ENSURE_SUCCESS(retCode, retCode) ;
2463 if (!mapiAddBook->GetCards(*mMapiData, restriction, cardEntries)) {
2464 PRINTF(("Cannot get cards.\n")) ;
2465 @@ -1114,22 +1212,14 @@
2466 nsCAutoString entryId ;
2467 nsCAutoString uriName ;
2468 nsCOMPtr<nsIRDFResource> resource ;
2469 - nsCOMPtr <nsIAbCard> childCard;
2471 - for (ULONG card = 0 ; card < cardEntries.mNbEntries ; ++ card) {
2472 - cardEntries.mEntries [card].ToString(entryId) ;
2475 + for (ULONG card = 0 ; card < cardEntries.GetSize() ; ++ card) {
2476 + cardEntries [card].ToString(entryId) ;
2477 buildAbWinUri(kOutlookCardScheme, mAbWinType, uriName) ;
2478 uriName.Append(entryId) ;
2479 - childCard = do_CreateInstance(NS_ABOUTLOOKCARD_CONTRACTID, &retCode);
2480 - NS_ENSURE_SUCCESS(retCode, retCode) ;
2481 - resource = do_QueryInterface(childCard, &retCode) ;
2482 - NS_ENSURE_SUCCESS(retCode, retCode) ;
2483 - retCode = resource->Init(uriName.get()) ;
2484 - NS_ENSURE_SUCCESS(retCode, retCode) ;
2485 - cards->AppendElement(childCard) ;
2486 + aURI.AppendCString(uriName);
2489 - NS_ADDREF(*aCards) ;
2493 @@ -1153,8 +1243,8 @@
2494 nsCAutoString uriName ;
2495 nsCOMPtr <nsIRDFResource> resource ;
2497 - for (ULONG node = 0 ; node < nodeEntries.mNbEntries ; ++ node) {
2498 - nodeEntries.mEntries [node].ToString(entryId) ;
2499 + for (ULONG node = 0 ; node < nodeEntries.GetSize() ; ++ node) {
2500 + nodeEntries [node].ToString(entryId) ;
2501 buildAbWinUri(kOutlookDirectoryScheme, mAbWinType, uriName) ;
2502 uriName.Append(entryId) ;
2503 retCode = gRDFService->GetResource(uriName, getter_AddRefs(resource)) ;
2504 @@ -1275,7 +1365,7 @@
2505 // In the case of a mailing list, we cannot directly create a new card,
2506 // we have to create a temporary one in a real folder (to be able to use
2507 // templates) and then copy it to the mailing list.
2508 - if (m_IsMailList) {
2509 + if (m_IsMailList && mAbWinType == nsAbWinType_OutlookExp) {
2510 nsMapiEntry parentEntry ;
2511 nsMapiEntry temporaryEntry ;
2513 --- misc/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.h 2004-04-17 20:32:14.000000000 +0200
2514 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbOutlookDirectory.h 2008-08-14 16:22:21.000000000 +0200
2516 #include "nsHashtable.h"
2518 #include "nsISupportsArray.h"
2519 +#include "nsVoidArray.h"
2521 struct nsMapiEntry ;
2525 // Retrieve hierarchy as cards, with an optional restriction
2526 nsresult GetChildCards(nsISupportsArray **aCards, void *aRestriction) ;
2527 + // Retrieve hierarchy as URIs, with an optional restriction
2528 + nsresult GetChildCards(nsCStringArray& aURI, void *aRestriction) ;
2529 // Retrieve hierarchy as directories
2530 nsresult GetChildNodes(nsISupportsArray **aNodes) ;
2531 // Create a new card
2533 nsresult CommitAddressList(void) ;
2534 // Read MAPI repository
2535 nsresult UpdateAddressList(void) ;
2536 + // Search for an existing card or build a new one
2537 + nsresult BuildCardFromURI(const nsCString& uriName,nsIAbCard **aNewCard,
2538 + PRBool aSearchForOld, PRBool& aIsNewCard) ;
2540 nsMapiEntry *mMapiData ;
2541 // Container for the query threads
2542 --- misc/mozilla/mailnews/addrbook/src/nsAbWinHelper.cpp 2005-05-07 08:11:28.000000000 +0200
2543 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbWinHelper.cpp 2008-08-14 16:22:21.000000000 +0200
2545 #define USES_IID_IABContainer
2546 #define USES_IID_IMAPITable
2547 #define USES_IID_IDistList
2548 +#define USES_IID_IMsgStore
2549 +#define USES_IID_IMessage
2550 +#define USES_IID_IMAPIFolder
2552 #include "nsAbWinHelper.h"
2553 #include "nsMapiAddressBook.h"
2556 #define PRINTF(args) PR_LOG(gAbWinHelperLog, PR_LOG_DEBUG, args)
2558 -// Small utility to ensure release of all MAPI interfaces
2559 -template <class tInterface> struct nsMapiInterfaceWrapper
2561 - tInterface mInterface ;
2563 - nsMapiInterfaceWrapper(void) : mInterface(NULL) {}
2564 - ~nsMapiInterfaceWrapper(void) {
2565 - if (mInterface != NULL) { mInterface->Release() ; }
2567 - operator LPUNKNOWN *(void) { return NS_REINTERPRET_CAST(LPUNKNOWN *, &mInterface) ; }
2568 - tInterface operator -> (void) const { return mInterface ; }
2569 - operator tInterface *(void) { return &mInterface ; }
2572 static void assignEntryID(LPENTRYID& aTarget, LPENTRYID aSource, ULONG aByteCount)
2574 @@ -249,24 +239,28 @@
2575 MOZ_DECL_CTOR_COUNTER(nsMapiEntryArray)
2577 nsMapiEntryArray::nsMapiEntryArray(void)
2578 -: mEntries(NULL), mNbEntries(0)
2580 MOZ_COUNT_CTOR(nsMapiEntryArray) ;
2583 nsMapiEntryArray::~nsMapiEntryArray(void)
2585 - if (mEntries) { delete [] mEntries ; }
2587 MOZ_COUNT_DTOR(nsMapiEntryArray) ;
2590 +void nsMapiEntryArray::AddItem(nsMapiEntry * aEntries)
2592 + m_array.AppendElement(aEntries);
2594 void nsMapiEntryArray::CleanUp(void)
2596 - if (mEntries != NULL) {
2597 - delete [] mEntries ;
2600 + nsMapiEntry *pEntries;
2601 + for (int i = 0; i < m_array.Count(); i++)
2603 + pEntries = (nsMapiEntry *)m_array.ElementAt( i);
2609 MOZ_DECL_CTOR_COUNTER(nsAbWinHelper)
2610 @@ -280,100 +274,55 @@
2611 // same protection (MAPI is supposed to be thread-safe).
2612 PRLock *nsAbWinHelper::mMutex = PR_NewLock() ;
2614 +int nsAbWinHelper::m_clients = 0;
2616 +PRUnichar * nsAbWinHelper::m_pUniBuff = NULL;
2617 +int nsAbWinHelper::m_uniBuffLen = 0;
2618 +char * nsAbWinHelper::m_pCStrBuff = NULL;
2619 +int nsAbWinHelper::m_cstrBuffLen = 0;
2621 nsAbWinHelper::nsAbWinHelper(void)
2622 -: mAddressBook(NULL), mLastError(S_OK)
2625 MOZ_COUNT_CTOR(nsAbWinHelper) ;
2629 nsAbWinHelper::~nsAbWinHelper(void)
2631 MOZ_COUNT_DTOR(nsAbWinHelper) ;
2634 -BOOL nsAbWinHelper::GetFolders(nsMapiEntryArray& aFolders)
2638 - aFolders.CleanUp() ;
2639 - nsMapiInterfaceWrapper<LPABCONT> rootFolder ;
2640 - nsMapiInterfaceWrapper<LPMAPITABLE> folders ;
2641 - ULONG objType = 0 ;
2642 - ULONG rowCount = 0 ;
2643 - SRestriction restriction ;
2644 - SPropTagArray folderColumns ;
2646 - mLastError = mAddressBook->OpenEntry(0, NULL, NULL, 0, &objType,
2648 - if (HR_FAILED(mLastError)) {
2649 - PRINTF(("Cannot open root %08x.\n", mLastError)) ;
2651 + delete [] m_pUniBuff;
2652 + m_pUniBuff = NULL;
2654 + delete [] m_pCStrBuff;
2655 + m_pCStrBuff = NULL;
2656 + m_cstrBuffLen = 0;
2658 - mLastError = rootFolder->GetHierarchyTable(0, folders) ;
2659 - if (HR_FAILED(mLastError)) {
2660 - PRINTF(("Cannot get hierarchy %08x.\n", mLastError)) ;
2663 - // We only take into account modifiable containers,
2664 - // otherwise, we end up with all the directory services...
2665 - restriction.rt = RES_BITMASK ;
2666 - restriction.res.resBitMask.ulPropTag = PR_CONTAINER_FLAGS ;
2667 - restriction.res.resBitMask.relBMR = BMR_NEZ ;
2668 - restriction.res.resBitMask.ulMask = AB_MODIFIABLE ;
2669 - mLastError = folders->Restrict(&restriction, 0) ;
2670 - if (HR_FAILED(mLastError)) {
2671 - PRINTF(("Cannot restrict table %08x.\n", mLastError)) ;
2673 - folderColumns.cValues = 1 ;
2674 - folderColumns.aulPropTag [0] = PR_ENTRYID ;
2675 - mLastError = folders->SetColumns(&folderColumns, 0) ;
2676 - if (HR_FAILED(mLastError)) {
2677 - PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
2680 - mLastError = folders->GetRowCount(0, &rowCount) ;
2681 - if (HR_SUCCEEDED(mLastError)) {
2682 - aFolders.mEntries = new nsMapiEntry [rowCount] ;
2683 - aFolders.mNbEntries = 0 ;
2685 - LPSRowSet rowSet = NULL ;
2688 - mLastError = folders->QueryRows(1, 0, &rowSet) ;
2689 - if (HR_SUCCEEDED(mLastError)) {
2690 - rowCount = rowSet->cRows ;
2691 - if (rowCount > 0) {
2692 - nsMapiEntry& current = aFolders.mEntries [aFolders.mNbEntries ++] ;
2693 - SPropValue& currentValue = rowSet->aRow->lpProps [0] ;
2695 - current.Assign(currentValue.Value.bin.cb,
2696 - NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
2698 - MyFreeProws(rowSet) ;
2701 - PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
2703 - } while (rowCount > 0) ;
2705 - return HR_SUCCEEDED(mLastError) ;
2709 BOOL nsAbWinHelper::GetCards(const nsMapiEntry& aParent, LPSRestriction aRestriction,
2710 nsMapiEntryArray& aCards)
2713 - return GetContents(aParent, aRestriction, &aCards.mEntries, aCards.mNbEntries, 0) ;
2714 + return GetContents(aParent, aRestriction, &aCards, 0) ;
2717 BOOL nsAbWinHelper::GetNodes(const nsMapiEntry& aParent, nsMapiEntryArray& aNodes)
2720 - return GetContents(aParent, NULL, &aNodes.mEntries, aNodes.mNbEntries, MAPI_DISTLIST) ;
2721 + return GetContents(aParent, NULL, &aNodes, MAPI_DISTLIST) ;
2724 BOOL nsAbWinHelper::GetCardsCount(const nsMapiEntry& aParent, ULONG& aNbCards)
2727 - return GetContents(aParent, NULL, NULL, aNbCards, 0) ;
2728 + nsMapiEntryArray aCards;
2729 + BOOL ret=GetContents(aParent, NULL, &aCards, 0) ;
2730 + aNbCards=aCards.GetSize();
2734 BOOL nsAbWinHelper::GetPropertyString(const nsMapiEntry& aObject,
2736 aName = values->Value.lpszA ;
2738 else if (PROP_TYPE(values->ulPropTag) == PT_UNICODE) {
2739 - aName.AssignWithConversion(values->Value.lpszW) ;
2740 + UnicodeToCStr(values->Value.lpszW,aName) ;
2743 FreeBuffer(values) ;
2745 aName = values->Value.lpszW ;
2747 else if (PROP_TYPE(values->ulPropTag) == PT_STRING8) {
2748 - aName.AssignWithConversion(values->Value.lpszA) ;
2749 + CStrToUnicode(values->Value.lpszA,aName) ;
2752 FreeBuffer(values) ;
2753 @@ -431,16 +380,22 @@
2756 for (i = 0 ; i < valueCount ; ++ i) {
2757 - if (PROP_ID(values [i].ulPropTag) == PROP_ID(aPropertyTags [i])) {
2758 + if (PROP_TYPE( values [i].ulPropTag) != PT_ERROR && values [i].Value.l != MAPI_E_NOT_FOUND){
2759 if (PROP_TYPE(values [i].ulPropTag) == PT_STRING8) {
2762 - temp.AssignWithConversion (values [i].Value.lpszA) ;
2763 + CStrToUnicode(values [i].Value.lpszA,temp) ;
2764 aNames.AppendString(temp) ;
2766 else if (PROP_TYPE(values [i].ulPropTag) == PT_UNICODE) {
2767 aNames.AppendString(nsAutoString (values [i].Value.lpszW)) ;
2769 + else if (aPropertyTags [i] == PR_EMAIL_ADDRESS_A) {
2770 + nsAutoString temp ;
2772 + CStrToUnicode (values [i].Value.lpszA,temp) ;
2773 + aNames.AppendString(temp) ;
2776 aNames.AppendString(nsAutoString((const PRUnichar *) "")) ;
2779 if (!GetMAPIProperties(aObject, &aPropertyTag, 1, values, valueCount)) { return FALSE ; }
2780 if (valueCount == 1 && values != NULL && PROP_TYPE(values->ulPropTag) == PT_SYSTIME) {
2781 SYSTEMTIME readableTime ;
2783 if (FileTimeToSystemTime(&values->Value.ft, &readableTime)) {
2784 aYear = readableTime.wYear ;
2785 aMonth = readableTime.wMonth ;
2787 nsMapiInterfaceWrapper<LPMAPIPROP> subObject ;
2790 - mLastError = mAddressBook->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
2791 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
2792 &IID_IMAPIContainer, 0, &objType,
2794 if (HR_FAILED(mLastError)) {
2797 SBinaryArray entryArray ;
2799 - mLastError = mAddressBook->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
2800 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
2801 &IID_IABContainer, MAPI_MODIFY, &objType,
2803 if (HR_FAILED(mLastError)) {
2804 @@ -567,14 +521,15 @@
2805 value.Value.lpszW = NS_CONST_CAST(WCHAR *, aValue) ;
2807 else if (PROP_TYPE(aPropertyTag) == PT_STRING8) {
2808 - alternativeValue.AssignWithConversion(aValue) ;
2809 + UnicodeToCStr(aValue,alternativeValue) ;
2810 value.Value.lpszA = NS_CONST_CAST(char *, alternativeValue.get()) ;
2813 PRINTF(("Property %08x is not a string.\n", aPropertyTag)) ;
2816 - return SetMAPIProperties(aObject, 1, &value) ;
2817 + LPSPropValue values=&value;
2818 + return SetMAPIProperties(aObject, 1, values) ;
2821 BOOL nsAbWinHelper::SetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
2823 values [currentValue ++].Value.lpszW = NS_CONST_CAST(WCHAR *, aValues [i].get()) ;
2825 else if (PROP_TYPE(aPropertiesTag [i]) == PT_STRING8) {
2826 - alternativeValue.AssignWithConversion(aValues [i].get()) ;
2827 + UnicodeToCStr(aValues [i].get(),alternativeValue) ;
2828 char *av = nsCRT::strdup(alternativeValue.get()) ;
2832 readableTime.wSecond = 0 ;
2833 readableTime.wMilliseconds = 0 ;
2834 if (SystemTimeToFileTime(&readableTime, &value.Value.ft)) {
2835 - return SetMAPIProperties(aObject, 1, &value) ;
2836 + LPSPropValue values=&value;
2837 + return SetMAPIProperties(aObject, 1, values) ;
2842 nsMapiInterfaceWrapper<LPABCONT> container ;
2845 - mLastError = mAddressBook->OpenEntry(aParent.mByteCount, aParent.mEntryId,
2846 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
2847 &IID_IABContainer, MAPI_MODIFY, &objType,
2849 if (HR_FAILED(mLastError)) {
2851 nsMapiInterfaceWrapper<LPABCONT> container ;
2854 - mLastError = mAddressBook->OpenEntry(aParent.mByteCount, aParent.mEntryId,
2855 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
2856 &IID_IABContainer, MAPI_MODIFY, &objType,
2858 if (HR_FAILED(mLastError)) {
2860 nsMapiInterfaceWrapper<LPABCONT> container ;
2863 - mLastError = mAddressBook->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
2864 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
2865 &IID_IABContainer, MAPI_MODIFY, &objType,
2867 if (HR_FAILED(mLastError)) {
2868 @@ -810,194 +766,77 @@
2872 -BOOL nsAbWinHelper::GetDefaultContainer(nsMapiEntry& aContainer)
2874 - LPENTRYID entryId = NULL ;
2875 - ULONG byteCount = 0 ;
2877 - mLastError = mAddressBook->GetPAB(&byteCount, &entryId) ;
2878 - if (HR_FAILED(mLastError)) {
2879 - PRINTF(("Cannot get PAB %08x.\n", mLastError)) ;
2882 - aContainer.Assign(byteCount, entryId) ;
2883 - FreeBuffer(entryId) ;
2889 - ContentsColumnEntryId = 0,
2890 - ContentsColumnObjectType,
2891 - ContentsColumnsSize
2894 -static const SizedSPropTagArray(ContentsColumnsSize, ContentsColumns) =
2896 - ContentsColumnsSize,
2903 -BOOL nsAbWinHelper::GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
2904 - nsMapiEntry **aList, ULONG& aNbElements, ULONG aMapiType)
2905 +void nsAbWinHelper::MyFreeProws(LPSRowSet aRowset)
2907 - if (aList != NULL) { *aList = NULL ; }
2909 - nsMapiInterfaceWrapper<LPMAPICONTAINER> parent ;
2910 - nsMapiInterfaceWrapper<LPMAPITABLE> contents ;
2911 - ULONG objType = 0 ;
2912 - ULONG rowCount = 0 ;
2913 + if (aRowset == NULL) { return ; }
2916 - mLastError = mAddressBook->OpenEntry(aParent.mByteCount, aParent.mEntryId,
2917 - &IID_IMAPIContainer, 0, &objType,
2919 - if (HR_FAILED(mLastError)) {
2920 - PRINTF(("Cannot open parent %08x.\n", mLastError)) ;
2923 - // Here, flags for WAB and MAPI could be different, so this works
2924 - // only as long as we don't want to use any flag in GetContentsTable
2925 - mLastError = parent->GetContentsTable(0, contents) ;
2926 - if (HR_FAILED(mLastError)) {
2927 - PRINTF(("Cannot get contents %08x.\n", mLastError)) ;
2929 + for (i = 0 ; i < aRowset->cRows ; ++ i) {
2930 + FreeBuffer(aRowset->aRow [i].lpProps) ;
2932 - if (aRestriction != NULL) {
2933 - mLastError = contents->Restrict(aRestriction, 0) ;
2934 - if (HR_FAILED(mLastError)) {
2935 - PRINTF(("Cannot set restriction %08x.\n", mLastError)) ;
2939 - mLastError = contents->SetColumns((LPSPropTagArray) &ContentsColumns, 0) ;
2940 - if (HR_FAILED(mLastError)) {
2941 - PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
2944 - mLastError = contents->GetRowCount(0, &rowCount) ;
2945 - if (HR_FAILED(mLastError)) {
2946 - PRINTF(("Cannot get result count %08x.\n", mLastError)) ;
2949 - if (aList != NULL) { *aList = new nsMapiEntry [rowCount] ; }
2952 - LPSRowSet rowSet = NULL ;
2955 - mLastError = contents->QueryRows(1, 0, &rowSet) ;
2956 - if (HR_FAILED(mLastError)) {
2957 - PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
2960 - rowCount = rowSet->cRows ;
2961 - if (rowCount > 0 &&
2962 - (aMapiType == 0 ||
2963 - rowSet->aRow->lpProps[ContentsColumnObjectType].Value.ul == aMapiType)) {
2964 - if (aList != NULL) {
2965 - nsMapiEntry& current = (*aList) [aNbElements] ;
2966 - SPropValue& currentValue = rowSet->aRow->lpProps[ContentsColumnEntryId] ;
2968 - current.Assign(currentValue.Value.bin.cb,
2969 - NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
2970 + FreeBuffer(aRowset) ;
2972 +void nsAbWinHelper::CStrToUnicode( const char *pStr, nsString& result)
2974 + result.Truncate( 0);
2975 + int wLen = MultiByteToWideChar( CP_ACP, 0, pStr, -1, m_pUniBuff, 0);
2976 + if (wLen >= m_uniBuffLen)
2978 + delete [] m_pUniBuff;
2979 + m_pUniBuff = new PRUnichar[wLen + 64];
2980 + m_uniBuffLen = wLen + 64;
2985 + MultiByteToWideChar( CP_ACP, 0, pStr, -1, m_pUniBuff, m_uniBuffLen);
2986 + result = m_pUniBuff;
2988 - MyFreeProws(rowSet) ;
2989 - } while (rowCount > 0) ;
2993 -BOOL nsAbWinHelper::GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
2994 - ULONG aNbProperties, LPSPropValue& aValue,
2995 - ULONG& aValueCount)
2996 +void nsAbWinHelper::UnicodeToCStr( const PRUnichar *pUStr,nsCString& result)
2998 - nsMapiInterfaceWrapper<LPMAPIPROP> object ;
2999 - ULONG objType = 0 ;
3000 - LPSPropTagArray properties = NULL ;
3003 - mLastError = mAddressBook->OpenEntry(aObject.mByteCount, aObject.mEntryId,
3004 - &IID_IMAPIProp, 0, &objType,
3006 - if (HR_FAILED(mLastError)) {
3007 - PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
3009 + result.Truncate( 0);
3010 + int cLen = WideCharToMultiByte( CP_ACP, 0, pUStr, -1, m_pCStrBuff, 0,NULL,NULL);
3011 + if (cLen >= m_cstrBuffLen) {
3013 + delete [] m_pCStrBuff;
3014 + m_pCStrBuff = new char[cLen + 64];
3015 + m_cstrBuffLen = cLen + 64;
3017 - AllocateBuffer(CbNewSPropTagArray(aNbProperties),
3018 - NS_REINTERPRET_CAST(void **, &properties)) ;
3019 - properties->cValues = aNbProperties ;
3020 - for (i = 0 ; i < aNbProperties ; ++ i) {
3021 - properties->aulPropTag [i] = aPropertyTags [i] ;
3023 - mLastError = object->GetProps(properties, 0, &aValueCount, &aValue) ;
3024 - FreeBuffer(properties) ;
3025 - if (HR_FAILED(mLastError)) {
3026 - PRINTF(("Cannot get props %08x.\n", mLastError)) ;
3028 + WideCharToMultiByte( CP_ACP, 0, pUStr, -1, m_pCStrBuff, m_cstrBuffLen,NULL,NULL);
3029 + result = m_pCStrBuff;
3031 - return HR_SUCCEEDED(mLastError) ;
3034 -BOOL nsAbWinHelper::SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
3035 - const LPSPropValue& aValues)
3037 - nsMapiInterfaceWrapper<LPMAPIPROP> object ;
3038 - ULONG objType = 0 ;
3039 - LPSPropProblemArray problems = NULL ;
3040 +static nsAbWinHelper *getOutlookAddressBook(void) {
3041 + static nsMapiAddressBook *addressBook = NULL ;
3043 - mLastError = mAddressBook->OpenEntry(aObject.mByteCount, aObject.mEntryId,
3044 - &IID_IMAPIProp, MAPI_MODIFY, &objType,
3046 - if (HR_FAILED(mLastError)) {
3047 - PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
3050 - mLastError = object->SetProps(aNbProperties, aValues, &problems) ;
3051 - if (HR_FAILED(mLastError)) {
3052 - PRINTF(("Cannot update the object %08x.\n", mLastError)) ;
3055 - if (problems != NULL) {
3056 - for (ULONG i = 0 ; i < problems->cProblem ; ++ i) {
3057 - PRINTF(("Problem %d: index %d code %08x.\n", i,
3058 - problems->aProblem [i].ulIndex,
3059 - problems->aProblem [i].scode)) ;
3062 - mLastError = object->SaveChanges(0) ;
3063 - if (HR_FAILED(mLastError)) {
3064 - PRINTF(("Cannot commit changes %08x.\n", mLastError)) ;
3066 - return HR_SUCCEEDED(mLastError) ;
3067 + if (addressBook == NULL) { addressBook = new nsMapiAddressBook ; }
3068 + return addressBook ;
3071 -void nsAbWinHelper::MyFreeProws(LPSRowSet aRowset)
3073 - if (aRowset == NULL) { return ; }
3075 +static nsAbWinHelper *getOutlookExpAddressBook(void) {
3076 + static nsWabAddressBook *addressBook = NULL ;
3078 - for (i = 0 ; i < aRowset->cRows ; ++ i) {
3079 - FreeBuffer(aRowset->aRow [i].lpProps) ;
3081 - FreeBuffer(aRowset) ;
3082 + if (addressBook == NULL) { addressBook = new nsWabAddressBook ; }
3083 + return addressBook ;
3086 nsAbWinHelperGuard::nsAbWinHelperGuard(PRUint32 aType)
3090 - case nsAbWinType_Outlook: mHelper = new nsMapiAddressBook ; break ;
3091 - case nsAbWinType_OutlookExp: mHelper = new nsWabAddressBook ; break ;
3092 + case nsAbWinType_Outlook: mHelper = getOutlookAddressBook() ; break ;
3093 + case nsAbWinType_OutlookExp: mHelper = getOutlookExpAddressBook() ; break ;
3098 nsAbWinHelperGuard::~nsAbWinHelperGuard(void)
3103 const char *kOutlookDirectoryScheme = "moz-aboutlookdirectory://" ;
3104 --- misc/mozilla/mailnews/addrbook/src/nsAbWinHelper.h 2004-04-17 20:32:14.000000000 +0200
3105 +++ misc/build/mozilla/mailnews/addrbook/src/nsAbWinHelper.h 2008-08-14 16:22:21.000000000 +0200
3107 #include "nsVoidArray.h"
3108 #include "nsXPIDLString.h"
3110 +#define PR_SECOND_EMAIL_ADDRESS_A 0x8033001E
3111 +#define PR_SCREEN_NAME_A 0x805B001E
3114 +// Small utility to ensure release of all MAPI interfaces
3115 +template <class tInterface> struct nsMapiInterfaceWrapper
3117 + tInterface mInterface ;
3119 + nsMapiInterfaceWrapper(void) : mInterface(NULL) {}
3120 + ~nsMapiInterfaceWrapper(void) {
3121 + if (mInterface ) { mInterface->Release() ; }
3123 + operator LPUNKNOWN *(void) { return NS_REINTERPRET_CAST(LPUNKNOWN *, &mInterface) ; }
3124 + tInterface operator -> (void) const { return mInterface ; }
3125 + operator tInterface *(void) { return &mInterface ; }
3133 struct nsMapiEntryArray
3135 - nsMapiEntry *mEntries ;
3136 - ULONG mNbEntries ;
3138 nsMapiEntryArray(void) ;
3139 ~nsMapiEntryArray(void) ;
3141 - const nsMapiEntry& operator [] (int aIndex) const { return mEntries [aIndex] ; }
3142 + void AddItem(nsMapiEntry * aEntries);
3143 + void AddItem( ULONG mByteCount , LPENTRYID mEntryId )
3145 + nsMapiEntry * aEntries=new nsMapiEntry();
3146 + aEntries->Assign(mByteCount,mEntryId);
3147 + AddItem(aEntries);
3150 + ULONG GetSize( void) { return( m_array.Count());}
3151 + nsMapiEntry& operator [] (int aIndex) { return *(nsMapiEntry*)m_array.ElementAt(aIndex); }
3152 + nsMapiEntry* ElementAt(int aIndex) { return (nsMapiEntry*)m_array.ElementAt(aIndex); }
3153 void CleanUp(void) ;
3154 + void Remove(nsMapiEntry * aEntries){ m_array.RemoveElement(aEntries); }
3155 + void Remove(int index){ m_array.RemoveElementAt(index); }
3156 + ULONG IndexOf(nsMapiEntry * aEntries){return m_array.IndexOf(aEntries);};
3158 + nsVoidArray m_array;
3164 virtual ~nsAbWinHelper(void) ;
3166 // Get the top address books
3167 - BOOL GetFolders(nsMapiEntryArray& aFolders) ;
3168 + virtual BOOL GetFolders(nsMapiEntryArray& aFolders) =0;
3169 // Get a list of entries for cards/mailing lists in a folder/mailing list
3170 BOOL GetCards(const nsMapiEntry& aParent, LPSRestriction aRestriction,
3171 nsMapiEntryArray& aCards) ;
3172 @@ -97,18 +129,14 @@
3173 BOOL GetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
3174 ULONG aNbProperties, nsStringArray& aValues) ;
3175 // Get the value of a MAPI property of type SYSTIME
3176 - BOOL GetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
3177 + virtual BOOL GetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
3178 WORD& aYear, WORD& aMonth, WORD& aDay) ;
3179 - // Get the value of a MAPI property of type LONG
3180 - BOOL GetPropertyLong(const nsMapiEntry& aObject, ULONG aPropertyTag, ULONG& aValue) ;
3181 // Get the value of a MAPI property of type BIN
3182 BOOL GetPropertyBin(const nsMapiEntry& aObject, ULONG aPropertyTag, nsMapiEntry& aValue) ;
3183 // Tests if a container contains an entry
3184 BOOL TestOpenEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
3185 - // Delete an entry in the address book
3186 - BOOL DeleteEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
3187 // Set the value of a MAPI property of type string in unicode
3188 - BOOL SetPropertyUString (const nsMapiEntry& aObject, ULONG aPropertyTag,
3189 + virtual BOOL SetPropertyUString (const nsMapiEntry& aObject, ULONG aPropertyTag,
3190 const PRUnichar *aValue) ;
3191 // Same as previous, but with a bunch of properties in one call
3192 BOOL SetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
3193 @@ -117,32 +145,44 @@
3194 BOOL SetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
3195 WORD aYear, WORD aMonth, WORD aDay) ;
3196 // Create entry in the address book
3197 - BOOL CreateEntry(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
3198 + virtual BOOL CreateEntry(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
3199 + // Delete an entry in the address book
3200 + virtual BOOL DeleteEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
3201 // Create a distribution list in the address book
3202 - BOOL CreateDistList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
3203 + virtual BOOL CreateDistList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
3204 // Copy an existing entry in the address book
3205 - BOOL CopyEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aSource, nsMapiEntry& aTarget) ;
3206 + virtual BOOL CopyEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aSource, nsMapiEntry& aTarget) ;
3207 // Get a default address book container
3208 - BOOL GetDefaultContainer(nsMapiEntry& aContainer) ;
3209 + virtual BOOL GetDefaultContainer(nsMapiEntry& aContainer) =0;
3210 // Is the helper correctly initialised?
3211 - BOOL IsOK(void) const { return mAddressBook != NULL ; }
3212 + virtual BOOL IsOK(void) =0;/*const { return mAddressBook != NULL ; }*/
3214 + // Get the value of a MAPI property of type LONG
3215 + virtual BOOL GetPropertyLong(const nsMapiEntry& aObject, ULONG aPropertyTag, ULONG& aValue) ;
3218 HRESULT mLastError ;
3219 - LPADRBOOK mAddressBook ;
3220 static PRUint32 mEntryCounter ;
3221 static PRLock *mMutex ;
3223 + virtual HRESULT OpenEntry(ULONG cbEntryID,
3224 + LPENTRYID lpEntryID,
3225 + LPCIID lpInterface,
3227 + ULONG FAR * lpulObjType,
3228 + LPUNKNOWN FAR * lppUnk
3231 // Retrieve the contents of a container, with an optional restriction
3232 - BOOL GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
3233 - nsMapiEntry **aList, ULONG &aNbElements, ULONG aMapiType) ;
3234 + virtual BOOL GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
3235 + nsMapiEntryArray *aList, ULONG aMapiType) =0;
3236 // Retrieve the values of a set of properties on a MAPI object
3237 - BOOL GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
3238 + virtual BOOL GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
3239 ULONG aNbProperties,
3240 - LPSPropValue& aValues, ULONG& aValueCount) ;
3241 + LPSPropValue& aValues, ULONG& aValueCount) =0;
3242 // Set the values of a set of properties on a MAPI object
3243 - BOOL SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
3244 - const LPSPropValue& aValues) ;
3245 + virtual BOOL SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
3246 + LPSPropValue& aValues) =0;
3247 // Clean-up a rowset returned by QueryRows
3248 void MyFreeProws(LPSRowSet aSet) ;
3249 // Allocation of a buffer for transmission to interfaces
3250 @@ -150,7 +190,16 @@
3251 // Destruction of a buffer provided by the interfaces
3252 virtual void FreeBuffer(LPVOID aBuffer) = 0 ;
3254 + static void CStrToUnicode( const char *pStr, nsString& result);
3255 + static void UnicodeToCStr( const PRUnichar *pStr, nsCString& result);
3258 + static int m_clients;
3259 + static PRUnichar * m_pUniBuff;
3260 + static int m_uniBuffLen;
3261 + static char * m_pCStrBuff;
3262 + static int m_cstrBuffLen;
3269 nsAbWinHelper *operator ->(void) { return mHelper ; }
3271 + static void FreeWinAbLibrarys();
3273 nsAbWinHelper *mHelper ;
3275 --- misc/mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp 2006-12-22 14:51:39.000000000 +0100
3276 +++ misc/build/mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp 2008-08-20 15:09:45.000000000 +0200
3279 static const char kMailListAddressFormat[] = "Address%d";
3281 +extern int getMD5sum(const char * fileName,char * sum);
3282 +extern int testMD5sum(const char * fileName,char * sum);
3284 static NS_DEFINE_CID(kCMorkFactory, NS_MORK_CID);
3286 nsAddrDatabase::nsAddrDatabase()
3289 m_dbDirectory(nsnull)
3291 + memset(m_dbMd5Sum,0,33);
3294 nsAddrDatabase::~nsAddrDatabase()
3295 @@ -790,7 +794,11 @@
3297 ret = NS_ERROR_FILE_ACCESS_DENIED;
3301 + ret = getMD5sum(nativeFileName,m_dbMd5Sum);
3303 + ret = NS_ERROR_FAILURE;
3305 nsCRT::free(nativeFileName);
3307 if (NS_SUCCEEDED(ret) && thumb)
3308 @@ -883,6 +891,17 @@
3310 nsresult err = NS_OK;
3311 nsIMdbThumb *commitThumb = nsnull;
3313 + const char *pFilename = m_dbName.GetCString(); /* do not free */
3314 + char *nativeFileName = nsCRT::strdup(pFilename);
3315 +#if defined(XP_PC) || defined(XP_MAC)
3316 + UnixToNative(nativeFileName);
3318 + if (testMD5sum(nativeFileName,m_dbMd5Sum))
3320 + nsCRT::free(nativeFileName);
3321 + return NS_ERROR_FILE_ACCESS_DENIED;
3324 if (commitType == nsAddrDBCommitType::kLargeCommit ||
3325 commitType == nsAddrDBCommitType::kSessionCommit)
3326 @@ -936,6 +955,10 @@
3327 // ### do something with error, but clear it now because mork errors out on commits.
3329 m_mdbEnv->ClearErrors();
3330 + if (NS_SUCCEEDED(err) && getMD5sum(nativeFileName,m_dbMd5Sum))
3331 + err = NS_ERROR_FAILURE;
3332 + nsCRT::free(nativeFileName);
3337 --- misc/mozilla/mailnews/addrbook/src/nsAddrDatabase.h 2006-12-22 14:51:39.000000000 +0100
3338 +++ misc/build/mozilla/mailnews/addrbook/src/nsAddrDatabase.h 2008-08-14 16:29:20.000000000 +0200
3340 nsIMdbTable *m_mdbPabTable;
3341 nsIMdbTable *m_mdbDeletedCardsTable;
3342 nsFileSpec m_dbName;
3343 + char m_dbMd5Sum[33];
3344 PRBool m_mdbTokensInitialized;
3345 nsVoidArray /*<nsIAddrDBListener>*/ *m_ChangeListeners;
3347 --- misc/mozilla/mailnews/addrbook/src/nsMapiAddressBook.cpp 2004-11-05 16:13:32.000000000 +0100
3348 +++ misc/build/mozilla/mailnews/addrbook/src/nsMapiAddressBook.cpp 2008-08-14 16:22:21.000000000 +0200
3353 +static char * stristr(const char *big, const char *little)
3357 + if (!big || !little || !*big || !*little)
3359 + len = strlen(little);
3361 + for( ; *big; big++ )
3362 + if(!_strnicmp (big, little, 1) && ! _strnicmp (big, little, len) )
3363 + return (char *)big;
3370 static PRLogModuleInfo* gMapiAddressBookLog
3371 = PR_NewLogModule("nsMapiAddressBookLog");
3374 #define PRINTF(args) PR_LOG(gMapiAddressBookLog, PR_LOG_DEBUG, args)
3376 +#define OUTLOOK_EMAIL_DIAPLAY_MAPI_ID 0x00008005 //use to get and set display
3377 +#define OUTLOOK_EMAIL1_MAPI_ID 0x00008084 //use to get and set primary email address
3378 +#define OUTLOOK_EMAIL2_MAPI_ID 0x00008094 //use to get and set second email address
3379 +#define OUTLOOK_EMAIL_SCREEN_NAME 0x8061001E //use to get and set screen name
3380 +#define OUTLOOK_EMAIL_ORGID 0x00008085 //use to get orginal entryid to add to distlist
3381 +#define OUTLOOK_EMAIL_LIST1 0x00008054 //use to get distlist table
3382 +#define OUTLOOK_EMAIL_LIST2 0x00008055 //use to set distlist table
3384 +static const TagMap TagMaps[]={
3385 + {PR_DISPLAY_NAME_A, OUTLOOK_EMAIL_DIAPLAY_MAPI_ID, PT_STRING8},
3386 + {PR_EMAIL_ADDRESS_A, OUTLOOK_EMAIL1_MAPI_ID, PT_STRING8},
3387 + {PR_SECOND_EMAIL_ADDRESS_A, OUTLOOK_EMAIL2_MAPI_ID, PT_STRING8},
3388 + {PR_SCREEN_NAME_A, OUTLOOK_EMAIL_SCREEN_NAME, PT_STRING8}};
3391 + ieidPR_ENTRYID = 0,
3392 + ieidPR_OBJECT_TYPE,
3393 + ieidPR_DISPLAY_NAME,
3394 + ieidPR_MESSAGE_CLASS,
3395 + ieidPR_STORE_ENTRYID,
3396 + ieidPR_MESSAGE_RECIPIENTS,
3400 +static const SizedSPropTagArray(ieidMax, ptaEid)=
3409 + PR_MESSAGE_RECIPIENTS
3415 + ContentsColumnEntryId = 0,
3416 + ContentsColumnObjectType,
3417 + ContentsColumnMessageClass,
3418 + ContentsColumnsSize
3421 +static const SizedSPropTagArray(ContentsColumnsSize, ContentsColumns) =
3423 + ContentsColumnsSize,
3431 HMODULE nsMapiAddressBook::mLibrary = NULL ;
3432 PRInt32 nsMapiAddressBook::mLibUsage = 0 ;
3434 BOOL nsMapiAddressBook::mInitialized = FALSE ;
3435 BOOL nsMapiAddressBook::mLogonDone = FALSE ;
3436 LPMAPISESSION nsMapiAddressBook::mRootSession = NULL ;
3437 -LPADRBOOK nsMapiAddressBook::mRootBook = NULL ;
3438 +#define MAPI_NO_COINIT 8
3440 BOOL nsMapiAddressBook::LoadMapiLibrary(void)
3443 mMAPILogonEx = NS_REINTERPRET_CAST(LPMAPILOGONEX,
3444 GetProcAddress(mLibrary, "MAPILogonEx")) ;
3445 if (!mMAPILogonEx) { return FALSE ; }
3446 - MAPIINIT_0 mapiInit = { MAPI_INIT_VERSION, MAPI_MULTITHREAD_NOTIFICATIONS } ;
3447 + MAPIINIT_0 mapiInit = { MAPI_INIT_VERSION, MAPI_MULTITHREAD_NOTIFICATIONS | MAPI_NO_COINIT } ;
3448 HRESULT retCode = mMAPIInitialize(&mapiInit) ;
3450 if (HR_FAILED(retCode)) {
3451 @@ -105,22 +175,19 @@
3454 if (HR_FAILED(retCode)) {
3455 - PRINTF(("Cannot logon to MAPI %08x.\n", retCode)) ; return FALSE ;
3456 + PRINTF(("Cannot logon to MAPI %08x.\n", retCode)) ;
3460 - retCode = mRootSession->OpenAddressBook(0, NULL, 0, &mRootBook) ;
3461 - if (HR_FAILED(retCode)) {
3462 - PRINTF(("Cannot open MAPI address book %08x.\n", retCode)) ;
3465 return HR_SUCCEEDED(retCode) ;
3468 void nsMapiAddressBook::FreeMapiLibrary(void)
3471 - if (-- mLibUsage == 0) {
3472 + if (--mLibUsage < 0) {
3474 - if (mRootBook) { mRootBook->Release() ; }
3477 mRootSession->Logoff(NULL, 0, 0) ;
3481 FreeLibrary(mLibrary) ;
3482 + mRootSession = NULL;
3489 BOOL result = Initialize() ;
3491 NS_ASSERTION(result == TRUE, "Couldn't initialize Mapi Helper") ;
3492 MOZ_COUNT_CTOR(nsMapiAddressBook) ;
3494 @@ -153,22 +220,882 @@
3495 nsMapiAddressBook::~nsMapiAddressBook(void)
3497 nsAutoLock guard(mMutex) ;
3501 MOZ_COUNT_DTOR(nsMapiAddressBook) ;
3504 +LPSPropValue nsMapiAddressBook::GetMapiProperty( LPMAPIPROP pProp, ULONG tag)
3509 + int sz = CbNewSPropTagArray( 1);
3510 + SPropTagArray *pTag = (SPropTagArray *) new char[sz];
3511 + pTag->cValues = 1;
3512 + pTag->aulPropTag[0] = tag;
3513 + LPSPropValue lpProp = NULL;
3514 + ULONG cValues = 0;
3515 + HRESULT hr = pProp->GetProps( pTag, 0, &cValues, &lpProp);
3517 + if (HR_FAILED( hr) || (cValues != 1)) {
3519 + mMAPIFreeBuffer( lpProp);
3523 + if (PROP_TYPE( lpProp->ulPropTag) == PT_ERROR) {
3524 + if (lpProp->Value.l == MAPI_E_NOT_FOUND) {
3525 + mMAPIFreeBuffer( lpProp);
3533 +BOOL nsMapiAddressBook::GetEntryIdFromProp( LPSPropValue pVal, ULONG& cbEntryId, LPENTRYID& lpEntryId, BOOL delVal)
3538 + BOOL bResult = TRUE;
3539 + switch (PROP_TYPE(pVal->ulPropTag))
3542 + cbEntryId = pVal->Value.bin.cb;
3543 + mMAPIAllocateBuffer( cbEntryId, (LPVOID *) &lpEntryId);
3544 + memcpy( lpEntryId, pVal->Value.bin.lpb, cbEntryId);
3548 + PRINTF(( "EntryId not in BINARY prop value\n"));
3553 + if (pVal && delVal)
3554 + mMAPIFreeBuffer( pVal);
3559 +BOOL nsMapiAddressBook::HandleContentsItem(ULONG oType, ULONG cb, LPENTRYID pEntry,nsMapiEntryArray& aFolders)
3565 + if (oType == MAPI_MESSAGE)
3567 + if (oType == MAPI_STORE)
3569 + hr=mRootSession->OpenEntry(
3575 + (IUnknown**)&lpMsgStore);
3578 + //Add MDB to a list to make it can be released when class destroyed.
3579 + //We must leave it openned or else we can't open address store in it.
3580 + AddToMDBArray(lpMsgStore);
3582 + LPSPropValue pVal;
3583 + pVal=GetMapiProperty(lpMsgStore,PR_IPM_SUBTREE_ENTRYID);
3589 + nsMapiInterfaceWrapper<LPMAPICONTAINER> lpSubTree;
3591 + if (GetEntryIdFromProp( pVal, cbEntry, pEntry)) {
3592 + // Open up the folder!
3593 + BOOL bResult = TRUE;
3594 + bResult = lpMsgStore->OpenEntry(
3601 + mMAPIFreeBuffer( pEntry);
3602 + if (!bResult && *(LPMAPICONTAINER*)&lpSubTree) {
3603 + // Iterate the subtree with the results going into the folder list
3604 + bResult = IterateHierarchy(*(LPMAPICONTAINER*)&lpSubTree,aFolders);
3607 + PRINTF(( "GetStoreFolders: Error opening sub tree.\n"));
3611 + PRINTF(( "GetStoreFolders: Error getting entryID from sub tree property val.\n"));
3615 + PRINTF(( "GetStoreFolders: Error getting sub tree property.\n"));
3620 + PRINTF(("Type:%d\n",oType));
3626 +BOOL nsMapiAddressBook::IterateHierarchy(LPMAPICONTAINER pFolder,nsMapiEntryArray& aFolders, ULONG flags)
3628 + // flags can be CONVENIENT_DEPTH or 0
3629 + // CONVENIENT_DEPTH will return all depths I believe instead
3630 + // of just children
3632 + nsMapiInterfaceWrapper<LPMAPITABLE> lpTable;
3633 + hr = pFolder->GetHierarchyTable( CONVENIENT_DEPTH , lpTable);
3634 + if (HR_FAILED(hr)) {
3635 + PRINTF(( "IterateHierarchy: GetContentsTable failed: 0x%lx, %d\n", (long)hr, (int)hr));
3640 + hr = lpTable->GetRowCount( 0, &rowCount);
3645 + hr = lpTable->SetColumns( (LPSPropTagArray)&ptaEid, 0);
3646 + if (HR_FAILED(hr)) {
3647 + PRINTF(( "IterateHierarchy: SetColumns failed: 0x%lx, %d\n", (long)hr, (int)hr));
3651 + hr = lpTable->SeekRow( BOOKMARK_BEGINNING, 0, NULL);
3652 + if (HR_FAILED(hr)) {
3653 + PRINTF(( "IterateHierarchy: SeekRow failed: 0x%lx, %d\n", (long)hr, (int)hr));
3659 + BOOL keepGoing = TRUE;
3660 + BOOL bResult = TRUE;
3664 + hr = lpTable->QueryRows( 1, 0, &lpRow);
3666 + if (HR_FAILED(hr))
3668 + PRINTF(( "QueryRows failed: 0x%lx, %d\n", (long)hr, (int)hr));
3674 + cNumRows = lpRow->cRows;
3677 + LPENTRYID lpEntry = (LPENTRYID) lpRow->aRow[0].lpProps[ieidPR_ENTRYID].Value.bin.lpb;
3678 + ULONG cb = lpRow->aRow[0].lpProps[ieidPR_ENTRYID].Value.bin.cb;
3679 + ULONG oType = lpRow->aRow[0].lpProps[ieidPR_OBJECT_TYPE].Value.ul;
3681 + keepGoing = HandleHierarchyItem( oType, cb, lpEntry,aFolders);
3684 + MyFreeProws(lpRow);
3687 + } while ( SUCCEEDED(hr) && cNumRows && lpRow && keepGoing);
3690 + if (bResult && !keepGoing)
3695 +BOOL nsMapiAddressBook::HandleHierarchyItem( ULONG oType, ULONG cb, LPENTRYID pEntry,nsMapiEntryArray& aFolders)
3698 + if (oType == MAPI_FOLDER)
3700 + nsMapiInterfaceWrapper<LPMAPICONTAINER> pFolder ;
3701 + if (!mRootSession->OpenEntry(
3709 + LPSPropValue pVal;
3712 + pVal = GetMapiProperty(*(LPMAPICONTAINER*)&pFolder, PR_CONTAINER_CLASS);
3715 + if (strcmp("IPF.Contact",pVal->Value.lpszA) == 0)
3717 + SPropValue *currentValue=GetMapiProperty( *(LPMAPICONTAINER*)&pFolder, PR_ENTRYID);
3719 + aFolders.AddItem(currentValue->Value.bin.cb,
3720 + NS_REINTERPRET_CAST(LPENTRYID, currentValue->Value.bin.lpb)) ;
3728 + PRINTF(( "GetStoreFolders - HandleHierarchyItem: Unhandled ObjectType: %ld\n", oType));
3735 +BOOL nsMapiAddressBook::GetFolders(nsMapiEntryArray& aFolders)
3737 + aFolders.CleanUp() ;
3738 + nsMapiInterfaceWrapper<LPMAPICONTAINER> rootFolder ;
3739 + nsMapiInterfaceWrapper<LPMAPITABLE> folders ;
3740 + ULONG objType = 0 ;
3741 + ULONG rowCount = 0 ;
3743 + nsMapiInterfaceWrapper<LPMAPITABLE> lpTable;
3745 + mLastError = mRootSession->GetMsgStoresTable( 0, lpTable);
3746 + if (HR_FAILED(mLastError)) {
3747 + PRINTF(("Cannot open MAPI MsgStores %08x.\n", mLastError));
3748 + return mLastError;
3751 + mLastError = lpTable->GetRowCount( 0, &rowCount);
3753 + mLastError = lpTable->SetColumns( (LPSPropTagArray)&ptaEid, 0);
3754 + if (FAILED(mLastError))
3755 + return( mLastError);
3756 + mLastError = lpTable->SeekRow( BOOKMARK_BEGINNING, 0, NULL);
3757 + if (FAILED(mLastError))
3758 + return mLastError;
3762 + BOOL keepGoing = TRUE;
3763 + BOOL bResult = TRUE;
3767 + mLastError = lpTable->QueryRows( 1, 0, &lpRow);
3769 + if (HR_FAILED(mLastError)){
3775 + cNumRows = lpRow->cRows;
3778 + LPENTRYID lpEID = (LPENTRYID) lpRow->aRow[0].lpProps[ieidPR_ENTRYID].Value.bin.lpb;
3779 + ULONG cbEID = lpRow->aRow[0].lpProps[ieidPR_ENTRYID].Value.bin.cb;
3780 + ULONG oType = lpRow->aRow[0].lpProps[ieidPR_OBJECT_TYPE].Value.ul;
3783 + keepGoing = HandleContentsItem( oType, cbEID, lpEID,aFolders);
3785 + MyFreeProws( lpRow);
3788 + } while ( SUCCEEDED(mLastError) && cNumRows && lpRow && keepGoing);
3791 + return HR_SUCCEEDED(mLastError) ;
3793 +BOOL nsMapiAddressBook::CorrectRestriction(const LPMAPIPROP aMapiProp,ULONG aRestrictionNum, LPSRestriction aRestriction)
3795 + ULONG conditionType = 0 ;
3797 + if (!aRestriction)
3799 + for (ulResIndex=0;ulResIndex < aRestrictionNum;ulResIndex++)
3801 + conditionType = aRestriction[ulResIndex].rt;
3802 + switch (conditionType)
3805 + aRestriction[ulResIndex].res.resExist.ulPropTag =
3806 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resExist.ulPropTag);
3808 + case RES_BITMASK :
3809 + aRestriction[ulResIndex].res.resBitMask.ulPropTag =
3810 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resBitMask.ulPropTag);
3812 + case RES_CONTENT :
3813 + aRestriction[ulResIndex].res.resContent.ulPropTag =
3814 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resContent.ulPropTag);
3815 + aRestriction[ulResIndex].res.resContent.lpProp->ulPropTag =
3816 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resContent.lpProp->ulPropTag);
3818 + case RES_PROPERTY :
3819 + aRestriction[ulResIndex].res.resProperty.ulPropTag =
3820 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resProperty.ulPropTag);
3821 + aRestriction[ulResIndex].res.resProperty.lpProp->ulPropTag =
3822 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resProperty.lpProp->ulPropTag);
3825 + aRestriction[ulResIndex].res.resSize.ulPropTag =
3826 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resSize.ulPropTag);
3828 + case RES_COMPAREPROPS :
3829 + aRestriction[ulResIndex].res.resCompareProps.ulPropTag1 =
3830 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resCompareProps.ulPropTag1);
3831 + aRestriction[ulResIndex].res.resCompareProps.ulPropTag2 =
3832 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resCompareProps.ulPropTag2);
3835 + CorrectRestriction(aMapiProp,1,aRestriction[ulResIndex].res.resNot.lpRes);
3838 + CorrectRestriction(aMapiProp,
3839 + aRestriction[ulResIndex].res.resAnd.cRes,
3840 + aRestriction[ulResIndex].res.resAnd.lpRes);
3843 + CorrectRestriction(aMapiProp,
3844 + aRestriction[ulResIndex].res.resOr.cRes,
3845 + aRestriction[ulResIndex].res.resOr.lpRes);
3848 + case RES_COMMENT :
3849 + CorrectRestriction(aMapiProp,1,aRestriction[ulResIndex].res.resComment.lpRes);
3850 + aRestriction[ulResIndex].res.resComment.lpProp->ulPropTag =
3851 + GetRealMapiPropertyTag(aMapiProp,aRestriction[ulResIndex].res.resComment.lpProp->ulPropTag);
3853 + case RES_SUBRESTRICTION :
3854 + CorrectRestriction(aMapiProp,1,aRestriction[ulResIndex].res.resSub.lpRes);
3862 +BOOL nsMapiAddressBook::Filter( LPSRestriction aRestriction,nsMapiEntryArray * aList)
3864 + if (!aRestriction)
3867 + ULONG conditionType = 0 ;
3869 + nsMapiEntryArray listOut;
3870 + ULONG listindex=0;
3872 + nsMapiEntryArray listDel;
3876 + ULONG resCount = 0;
3877 + ULONG resIndex = 0;
3879 + listsize = aList->GetSize();
3880 + conditionType = aRestriction->rt;
3881 + switch (conditionType)
3884 + case RES_BITMASK :
3885 + case RES_CONTENT :
3886 + case RES_PROPERTY :
3888 + case RES_COMPAREPROPS :
3889 + case RES_COMMENT :
3890 + case RES_SUBRESTRICTION :
3892 + while(listindex < aList->GetSize())
3894 + if (!FilterOnOneRow(aList->ElementAt(listindex),aRestriction))
3895 + aList->Remove(listindex);
3902 + aRestriction->res.resNot.ulReserved = 1;
3906 + if (conditionType == RES_OR)
3908 + for(listindex=0;listindex<aList->GetSize();listindex++)
3910 + listDel.AddItem(aList->ElementAt(listindex));
3914 + resCount = aRestriction->res.resAnd.cRes;
3915 + //notice that SAndRestriction ,SNotRestriction ,SOrRestriction
3916 + //use the same struct
3917 + for (resIndex = 0;resIndex < resCount;resIndex++)
3919 + //can't call listOut.CleanUp() here
3920 + //because it will destroy all Element too
3921 + while(listOut.GetSize())
3923 + listOut.Remove(0);
3926 + for(listindex=0;listindex<aList->GetSize();listindex++)
3928 + listOut.AddItem(aList->ElementAt(listindex));
3931 + Filter(&aRestriction->res.resAnd.lpRes[resIndex],&listOut);
3932 + if (conditionType == RES_NOT)
3934 + for(listindex=0;listindex<listOut.GetSize();listindex++)
3936 + aList->Remove(listOut.ElementAt(listindex));
3939 + else if (conditionType == RES_AND )
3941 + for(listindex=0;listindex<listOut.GetSize();listindex++)
3943 + if (!aList->IndexOf(listOut.ElementAt(listindex)))
3945 + aList->Remove(listOut.ElementAt(listindex));
3949 + else if (conditionType == RES_OR )
3951 + for(listindex=0;listindex<listOut.GetSize();listindex++)
3953 + listDel.Remove(listOut.ElementAt(listindex));
3955 + if (listDel.GetSize() == 0)
3961 + if (conditionType == RES_OR)
3963 + for(listindex=0;listindex<listDel.GetSize();listindex++)
3965 + aList->Remove(listDel.ElementAt(listindex));
3971 + while(listDel.GetSize())
3973 + listDel.Remove(0);
3975 + while(listOut.GetSize())
3977 + listOut.Remove(0);
3984 +BOOL nsMapiAddressBook::FilterOnOneRow(nsMapiEntry *aEntry,LPSRestriction aRestriction)
3986 + LPMAPIPROP object ;
3987 + ULONG objType = 0 ;
3988 + LPSPropValue realValue = NULL ;
3989 + LPSPropValue resValue = NULL ;
3990 + ULONG valueCount = 0 ;
3992 + mLastError = OpenEntry(aEntry->mByteCount, aEntry->mEntryId,
3993 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
3994 + (IUnknown **)&object) ;
3996 + if (HR_FAILED(mLastError)) {
3997 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
4001 + ULONG conditionType = 0 ;
4002 + conditionType = aRestriction->rt;
4004 + switch (conditionType)
4007 + if (!GetMAPIProperties(*aEntry,&aRestriction->res.resExist.ulPropTag,1,realValue,valueCount))
4011 + case RES_CONTENT :
4012 + if (!GetMAPIProperties(*aEntry,&aRestriction->res.resContent.ulPropTag,1,realValue,valueCount))
4014 + resValue = aRestriction->res.resContent.lpProp;
4016 + case RES_PROPERTY :
4017 + if (!GetMAPIProperties(*aEntry,&aRestriction->res.resProperty.ulPropTag,1,realValue,valueCount))
4019 + resValue = aRestriction->res.resProperty.lpProp;
4021 + case RES_BITMASK :
4022 + return FALSE; //not support
4025 + return FALSE;//not been used now
4027 + case RES_COMPAREPROPS :
4028 + return FALSE;//not been used now
4031 + return FALSE;//not need care here
4034 + return FALSE;//not need care here
4037 + return FALSE;//not need care here
4039 + case RES_COMMENT :
4040 + return TRUE;//comment
4042 + case RES_SUBRESTRICTION :
4043 + return FALSE;//not been used now
4046 + return AtomyFilter(aRestriction,realValue,resValue);
4050 +BOOL nsMapiAddressBook::AtomyFilter(LPSRestriction aRestriction,LPSPropValue aRealValue,LPSPropValue aFilterValue)
4052 + ULONG conditionType = 0 ;
4053 + conditionType = aRestriction->rt;
4055 + BOOL bTagEq=(aRealValue &&
4056 + PROP_TYPE( aRealValue->ulPropTag ) != PT_ERROR) &&
4058 + // PROP_TYPE( aRealValue->ulPropTag ) == PROP_TYPE( aFilterValue->ulPropTag ));
4059 + switch (conditionType)
4062 + return (aRealValue && PROP_TYPE( aRealValue->ulPropTag ) != PT_ERROR) ;
4064 + case RES_CONTENT :
4067 + switch(aRestriction->res.resContent.ulFuzzyLevel)
4069 + case FL_FULLSTRING :
4070 + return !stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA);
4073 + return stristr(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) == aRealValue->Value.lpszA;
4075 + case FL_SUBSTRING :
4077 + return stristr(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) != NULL;
4083 + case RES_PROPERTY :
4086 + switch(aRestriction->res.resProperty.relop)
4089 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) >= 0;
4092 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) > 0;
4095 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) <= 0;
4098 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) < 0;
4101 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) == 0;
4104 + return stricmp(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) != 0;
4108 + return stristr(aRealValue->Value.lpszA,aFilterValue->Value.lpszA) != NULL;
4115 + case RES_BITMASK :
4116 + return FALSE; //not support
4119 + return FALSE;//not been used now
4121 + case RES_COMPAREPROPS :
4122 + return FALSE;//not been used now
4125 + return FALSE;//not need care here
4128 + return FALSE;//not need care here
4131 + return FALSE;//not need care here
4133 + case RES_COMMENT :
4134 + return TRUE;//comment
4136 + case RES_SUBRESTRICTION :
4137 + return FALSE;//not been used now
4143 +BOOL nsMapiAddressBook::GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
4144 + nsMapiEntryArray *aList, ULONG aMapiType)
4149 + nsMapiInterfaceWrapper<LPMAPICONTAINER> parent ;
4150 + nsMapiInterfaceWrapper<LPMAPITABLE> contents ;
4151 + ULONG objType = 0 ;
4152 + ULONG rowCount = 0 ;
4155 + nsMapiInterfaceWrapper<LPMAPIPROP> pFolder;
4157 + aParent.ToString(cs);
4159 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
4160 + 0, MAPI_BEST_ACCESS, &objType, pFolder);
4161 + if (HR_FAILED(mLastError))
4163 + PRINTF(("Cannot open folder %08x.\n", mLastError)) ;
4168 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIPROP*)&pFolder,PR_MESSAGE_CLASS);
4169 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
4172 + LPSPropValue aValue = NULL ;
4173 + ULONG aValueCount = 0 ;
4175 + LPSPropTagArray properties = NULL ;
4176 + mMAPIAllocateBuffer(CbNewSPropTagArray(1),
4177 + (void **)&properties);
4178 + properties->cValues = 1;
4179 + properties->aulPropTag [0] = GetEmailPropertyTag(*(LPMAPIPROP*)&pFolder,OUTLOOK_EMAIL_LIST1);
4180 + hr = pFolder->GetProps(properties, 0, &aValueCount, &aValue) ;
4182 + SBinaryArray *sa=&aValue->Value.MVbin;
4188 + nsMapiEntry testEntry;
4190 + for (idx=0;sa->lpbin && idx<sa->cValues ;idx++)
4192 + lpEID= (LPENTRYID) sa->lpbin[idx].lpb;
4193 + cbEID = sa->lpbin[idx].cb;
4194 + testEntry.Assign(sa->lpbin[idx].cb,NS_REINTERPRET_CAST(LPENTRYID,sa->lpbin[idx].lpb));
4196 + if (GetPropertyString(testEntry,PR_MESSAGE_CLASS,sClass)) //Error get property
4198 + aList->AddItem(cbEID,lpEID);
4201 + Filter(aRestriction,aList);
4205 + if (aRestriction && !CorrectRestriction(*(LPMAPICONTAINER*)&pFolder,1,aRestriction))
4207 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
4208 + &IID_IMAPIContainer, MAPI_BEST_ACCESS, &objType,
4210 + if (HR_FAILED(mLastError)) {
4211 + PRINTF(("Cannot open parent %08x.\n", mLastError)) ;
4215 + mLastError = parent->GetContentsTable(0, contents) ;
4216 + if (HR_FAILED(mLastError)) {
4217 + PRINTF(("Cannot get contents %08x.\n", mLastError)) ;
4220 + if (aRestriction) {
4221 + mLastError = contents->Restrict(aRestriction, TBL_BATCH) ;
4222 + if (HR_FAILED(mLastError)) {
4223 + PRINTF(("Cannot set restriction %08x.\n", mLastError)) ;
4227 + mLastError = contents->SetColumns((LPSPropTagArray)&ContentsColumns, 0);
4228 + if (HR_FAILED(mLastError)) {
4229 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
4232 + mLastError = contents->GetRowCount(0, &rowCount) ;
4233 + if (HR_FAILED(mLastError)) {
4234 + PRINTF(("Cannot get result count %08x.\n", mLastError)) ;
4238 + LPSRowSet rowSet = NULL ;
4241 + mLastError = contents->QueryRows(1, 0, &rowSet) ;
4242 + if (HR_FAILED(mLastError)) {
4243 + PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
4246 + rowCount = rowSet->cRows ;
4247 + if (rowCount > 0 && aList)
4249 + if (aMapiType == 0 || rowSet->aRow->lpProps[ContentsColumnObjectType].Value.ul == aMapiType)
4251 + SPropValue& currentValue = rowSet->aRow->lpProps[ContentsColumnEntryId] ;
4252 + aList->AddItem(currentValue.Value.bin.cb,
4253 + NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
4255 + else if (aMapiType == MAPI_DISTLIST)
4257 + if (strcmp("IPM.DistList",rowSet->aRow->lpProps[ContentsColumnMessageClass].Value.lpszA)==0)
4259 + SPropValue& currentValue = rowSet->aRow->lpProps[ContentsColumnEntryId] ;
4260 + aList->AddItem(currentValue.Value.bin.cb,
4261 + NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
4267 + MyFreeProws(rowSet) ;
4268 + } while (rowCount > 0) ;
4275 +BOOL nsMapiAddressBook::GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
4276 + ULONG aNbProperties, LPSPropValue& aValue,
4277 + ULONG& aValueCount)
4279 + nsMapiInterfaceWrapper<LPMAPIPROP> object ;
4280 + ULONG objType = 0 ;
4281 + LPSPropTagArray properties = NULL ;
4284 + mLastError = OpenEntry(aObject.mByteCount, aObject.mEntryId,
4285 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
4288 + if (HR_FAILED(mLastError)) {
4289 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
4292 + AllocateBuffer(CbNewSPropTagArray(aNbProperties),
4293 + NS_REINTERPRET_CAST(void **, &properties));
4294 + properties->cValues = aNbProperties ;
4295 + for (i = 0 ; i < aNbProperties ; ++ i)
4297 + properties->aulPropTag [i] = GetRealMapiPropertyTag(*(LPMAPIPROP*)&object,aPropertyTags [i],TRUE);
4299 + mLastError = object->GetProps(properties, 0 , &aValueCount, &aValue) ;
4300 + FreeBuffer(properties) ;
4302 + if (HR_FAILED(mLastError)) {
4303 + PRINTF(("Error get props %08x.\n", mLastError)) ;
4305 + return HR_SUCCEEDED(mLastError);
4308 +BOOL nsMapiAddressBook::SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
4309 + LPSPropValue& aValues)
4311 + nsMapiInterfaceWrapper<LPMESSAGE> object;
4312 + ULONG objType = 0 ;
4313 + LPSPropProblemArray problems = NULL ;
4316 + LPMDB lpMsgStore=GetMsgStore(aObject);
4322 + mLastError = lpMsgStore->OpenEntry(aObject.mByteCount, aObject.mEntryId,
4323 + &IID_IMAPIProp, MAPI_BEST_ACCESS , &objType,
4325 + lpMsgStore->Release();
4327 + if (HR_FAILED(mLastError)) {
4328 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
4331 + for (i = 0 ; i < aNbProperties ; ++ i)
4333 + aValues[i].ulPropTag = GetRealMapiPropertyTag(*(LPMESSAGE*)&object,aValues[i].ulPropTag,TRUE);
4335 + mLastError = object->SetProps(aNbProperties, aValues, &problems) ;
4336 + if (HR_FAILED(mLastError)) {
4337 + PRINTF(("Cannot update the object %08x.\n", mLastError)) ;
4341 + for (ULONG i = 0 ; i < problems->cProblem ; ++ i) {
4342 + PRINTF(("Problem %d: index %d code %08x.\n", i,
4343 + problems->aProblem [i].ulIndex,
4344 + problems->aProblem [i].scode)) ;
4347 + mLastError = object->SaveChanges(0) ;
4348 + if (MAPI_E_OBJECT_CHANGED == mLastError)
4350 + mLastError = object->SaveChanges(FORCE_SAVE ) ;
4352 + return HR_SUCCEEDED(mLastError) ;
4355 +BOOL nsMapiAddressBook::GetDefaultContainer(nsMapiEntry& aContainer)
4360 +BOOL nsMapiAddressBook::IsOK(void)
4362 + return mRootSession && mLibUsage;
4365 BOOL nsMapiAddressBook::Initialize(void)
4367 - if (mAddressBook) { return TRUE ; }
4369 nsAutoLock guard(mMutex) ;
4371 if (!LoadMapiLibrary()) {
4372 PRINTF(("Cannot load library.\n")) ;
4375 - mAddressBook = mRootBook ;
4380 void nsMapiAddressBook::AllocateBuffer(ULONG aByteCount, LPVOID *aBuffer)
4381 @@ -181,7 +1108,803 @@
4382 mMAPIFreeBuffer(aBuffer) ;
4385 +ULONG nsMapiAddressBook::GetEmailPropertyTag(LPMAPIPROP lpProp, LONG nameID)
4387 + static GUID emailGUID =
4389 + 0x00062004, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46
4393 + MAPINAMEID mapiNameID;
4394 + mapiNameID.lpguid = &emailGUID;
4395 + mapiNameID.ulKind = MNID_ID;
4396 + mapiNameID.Kind.lID = nameID;
4398 + LPMAPINAMEID lpMapiNames = &mapiNameID;
4399 + LPSPropTagArray lpMailTagArray = NULL;
4401 + HRESULT result = lpProp->GetIDsFromNames(1L, &lpMapiNames, 0, &lpMailTagArray);
4402 + if (result == S_OK)
4404 + ULONG lTag = lpMailTagArray->aulPropTag[0];
4405 + mMAPIFreeBuffer(lpMailTagArray);
4410 +ULONG nsMapiAddressBook::GetRealMapiPropertyTag(LPMAPIPROP lpProp, LONG aPropertyTag,BOOL aTest)
4412 + LPSPropValue addr;
4413 + ULONG upRealTag=aPropertyTag;
4414 + ULONG lSize=sizeof(TagMaps) / sizeof(TagMap);
4416 + for(int i=0; i<lSize; i++)
4418 + if (TagMaps[i].AddressTag == aPropertyTag)
4421 + ULONG kPriEmailColumn=GetEmailPropertyTag(lpProp,TagMaps[i].NameID);
4424 + if (PR_DISPLAY_NAME_A == aPropertyTag)
4426 + //We need not change PR_DISPLAY_NAME_A tag if we are not using an address
4427 + LPSPropValue msgClass=GetMapiProperty(lpProp,PR_MESSAGE_CLASS);
4428 + if (msgClass && !strcmp("IPM.Contact",msgClass->Value.lpszA))
4430 + if (kPriEmailColumn)
4431 + upRealTag = kPriEmailColumn | TagMaps[i].TypeMask;
4435 + FreeBuffer(msgClass);
4436 + upRealTag = aPropertyTag;
4439 + else //PR_DISPLAY_NAME_A == aPropertyTag
4441 + addr=GetMapiProperty(lpProp,aPropertyTag);
4442 + if (!addr || PROP_TYPE( addr->ulPropTag) == PT_ERROR ||
4443 + addr->Value.l == MAPI_E_NOT_FOUND)
4445 + if (kPriEmailColumn)
4446 + upRealTag = kPriEmailColumn | TagMaps[i].TypeMask;
4452 + if (kPriEmailColumn)
4453 + upRealTag = kPriEmailColumn | TagMaps[i].TypeMask;
4456 + break; //we find it,exit
4463 +BOOL nsMapiAddressBook::GetPropertyLong(const nsMapiEntry& aObject,
4464 + ULONG aPropertyTag,
4468 + LPSPropValue values = NULL ;
4469 + ULONG valueCount = 0 ;
4471 + if (PR_OBJECT_TYPE == aPropertyTag)
4473 + nsMapiInterfaceWrapper<LPMAPIFOLDER> pFolder ;
4475 + mLastError = OpenEntry(aObject.mByteCount,aObject.mEntryId,
4476 + NULL,MAPI_BEST_ACCESS,&objType, pFolder);
4477 + if (HR_FAILED(mLastError))
4479 + PRINTF(("Cannot open folder %08x.\n", mLastError)) ;
4482 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIFOLDER*)&pFolder,PR_MESSAGE_CLASS);
4483 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
4485 + FreeBuffer(msgClass);
4486 + aValue = MAPI_DISTLIST;
4491 + if (!GetMAPIProperties(aObject, &aPropertyTag, 1, values, valueCount))
4494 + if (valueCount == 1 && values && PROP_TYPE(values->ulPropTag) == PT_LONG) {
4495 + aValue = values->Value.ul ;
4497 + FreeBuffer(values) ;
4501 +BOOL nsMapiAddressBook::GetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
4502 + WORD& aYear, WORD& aMonth, WORD& aDay)
4507 + LPSPropValue values = NULL ;
4508 + ULONG valueCount = 0 ;
4510 + if (!GetMAPIProperties(aObject, &aPropertyTag, 1, values, valueCount))
4513 + if (valueCount == 1 && values && PROP_TYPE(values->ulPropTag) == PT_SYSTIME) {
4514 + SYSTEMTIME readableTime ;
4515 + FILETIME localTime ;
4516 + FileTimeToLocalFileTime(&values->Value.ft,&localTime);
4517 + if (FileTimeToSystemTime(&localTime, &readableTime)) {
4518 + aYear = readableTime.wYear ;
4519 + aMonth = readableTime.wMonth ;
4520 + aDay = readableTime.wDay ;
4523 + FreeBuffer(values) ;
4527 +HRESULT nsMapiAddressBook::OpenEntry(ULONG cbEntryID,
4528 + LPENTRYID lpEntryID,
4529 + LPCIID lpInterface,
4531 + ULONG FAR * lpulObjType,
4532 + LPUNKNOWN FAR * lppUnk
4540 + rv=mRootSession->OpenEntry(cbEntryID,
4552 + if (HR_FAILED(rv) && !m_MDBArray.Count())
4554 + //There are no openned Message store,so we have to open them all
4555 + nsMapiEntryArray aFolders;
4556 + if (GetFolders(aFolders))
4560 + rv=mRootSession->OpenEntry(cbEntryID,
4577 +BOOL nsMapiAddressBook::AddEntryToList(const nsMapiEntry& aDistlist, const nsMapiEntry& aNewEntry)
4579 + nsMapiInterfaceWrapper<LPMAPIPROP> container ;
4580 + ULONG objType = 0 ;
4582 + nsMapiEntry parentEntry;
4583 + if (!GetEntryParent(aDistlist,parentEntry))
4586 + LPMDB lpMsgStore=GetMsgStore(parentEntry);
4590 + mLastError = lpMsgStore->OpenEntry(aDistlist.mByteCount, aDistlist.mEntryId,
4591 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
4593 + lpMsgStore->Release();
4595 + if (HR_FAILED(mLastError))
4600 + When add mail address to distlist,Mapi need update 2 tag.
4602 + //update OUTLOOK_EMAIL_LIST1
4603 + ULONG listTag=GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_LIST1) | PT_MV_BINARY;
4604 + SBinaryArray oldChildren;
4605 + LPSBinary bins=NULL;
4606 + SBinaryArray newChildren;
4607 + LPSPropValue oldChildValue = NULL ;
4608 + ULONG valueCount = 0 ;
4610 + if (!GetMAPIProperties(aDistlist, &listTag, 1, oldChildValue, valueCount))
4612 + PRINTF(("Cannot get old children %08x.\n", mLastError)) ;
4616 + if (! (oldChildValue->Value.l == MAPI_E_NOT_FOUND))
4618 + oldChildren = oldChildValue->Value.MVbin;
4619 + newChildren.cValues=oldChildren.cValues + 1;
4620 + mMAPIAllocateBuffer(sizeof(SBinary) * newChildren.cValues,(void**)& bins);
4621 + newChildren.lpbin = bins;
4622 + for (ULONG i=0;i<oldChildren.cValues;i++)
4624 + newChildren.lpbin[i].lpb = oldChildren.lpbin[i].lpb;
4625 + newChildren.lpbin[i].cb = oldChildren.lpbin[i].cb;
4630 + newChildren.cValues = 1;
4631 + mMAPIAllocateBuffer(sizeof(SBinary) * newChildren.cValues,(void**)& bins);
4632 + newChildren.lpbin = bins;
4635 + nsMapiEntry orgEntryID;
4636 + if (!GetPropertyBin(aNewEntry,
4637 + GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_ORGID) | PT_BINARY,
4642 + newChildren.lpbin[newChildren.cValues-1].lpb = NS_REINTERPRET_CAST(unsigned char *, orgEntryID.mEntryId);
4643 + newChildren.lpbin[newChildren.cValues-1].cb = orgEntryID.mByteCount;
4645 + SPropValue children;
4646 + children.ulPropTag = listTag;
4647 + children.Value.MVbin = newChildren;
4649 + LPSPropProblemArray problems = NULL ;
4650 + mLastError = container->SetProps(1, &children, &problems) ;
4651 + if (HR_FAILED(mLastError)) {
4652 + PRINTF(("Cannot set children %08x.\n", mLastError)) ;
4656 + //update OUTLOOK_EMAIL_LIST2
4657 + listTag = GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_LIST2) | PT_MV_BINARY;
4658 + if (!GetMAPIProperties(aDistlist, &listTag, 1, oldChildValue, valueCount))
4660 + PRINTF(("Cannot get old children %08x.\n", mLastError)) ;
4664 + if (! (oldChildValue->Value.l == MAPI_E_NOT_FOUND))
4666 + oldChildren = oldChildValue->Value.MVbin;
4667 + newChildren.cValues=oldChildren.cValues + 1;
4668 + mMAPIAllocateBuffer(sizeof(SBinary) * newChildren.cValues,(void**)& bins);
4669 + newChildren.lpbin = bins;
4670 + for (ULONG i=0;i<oldChildren.cValues;i++)
4672 + newChildren.lpbin[i].lpb = oldChildren.lpbin[i].lpb;
4673 + newChildren.lpbin[i].cb = oldChildren.lpbin[i].cb;
4678 + newChildren.cValues = 1;
4679 + mMAPIAllocateBuffer(sizeof(SBinary) * newChildren.cValues,(void**)& bins);
4680 + newChildren.lpbin = bins;
4684 + Need more work here.
4685 + There are two kind of mail address in outlook DistList.
4686 + One is sample,not include in parent folder.
4687 + The other is a link to a unattached address in parents folders.
4688 + Currently we can only add first kind of address to a outlook distlist.
4691 + newChildren.lpbin[newChildren.cValues-1].lpb = NS_REINTERPRET_CAST(unsigned char *, orgEntryID.mEntryId);
4692 + newChildren.lpbin[newChildren.cValues-1].cb = orgEntryID.mByteCount;
4694 + children.ulPropTag = listTag;
4695 + children.Value.MVbin = newChildren;
4697 + mLastError = container->SetProps(1, &children, &problems) ;
4698 + if (HR_FAILED(mLastError))
4700 + PRINTF(("Cannot set children %08x.\n", mLastError)) ;
4704 + mMAPIFreeBuffer(bins);
4706 + mLastError = container->SaveChanges(KEEP_OPEN_READONLY) ;
4707 + if (HR_FAILED(mLastError)) {
4708 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
4714 +BOOL nsMapiAddressBook::DeleteEntryFromList(const nsMapiEntry& aDistlist, const nsMapiEntry& aNewEntry)
4716 + nsMapiInterfaceWrapper<LPMAPIPROP> container ;
4717 + ULONG objType = 0 ;
4719 + nsMapiEntry parentEntry;
4720 + if (!GetEntryParent(aDistlist,parentEntry))
4723 + LPMDB lpMsgStore=GetMsgStore(parentEntry);
4727 + mLastError = lpMsgStore->OpenEntry(aDistlist.mByteCount, aDistlist.mEntryId,
4728 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
4730 + lpMsgStore->Release();
4732 + if (HR_FAILED(mLastError))
4735 + When delete mail address from distlist,Mapi need update 2 tag.
4737 + //update OUTLOOK_EMAIL_LIST1
4738 + ULONG listTag=GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_LIST1) | PT_MV_BINARY;
4740 + SBinaryArray oldChildren;
4741 + LPSBinary bins=NULL;
4742 + SBinaryArray newChildren;
4743 + LPSPropValue oldChildValue = NULL ;
4744 + ULONG valueCount = 0 ;
4746 + newChildren.lpbin=NULL;
4748 + ULONG lDeleteEntry=0;
4751 + if (!GetMAPIProperties(aDistlist, &listTag, 1, oldChildValue, valueCount))
4753 + PRINTF(("Cannot get old children %08x.\n", mLastError)) ;
4757 + if (! (oldChildValue->Value.l == MAPI_E_NOT_FOUND))
4759 + oldChildren = oldChildValue->Value.MVbin;
4760 + newChildren.cValues=oldChildren.cValues - 1;
4761 + mMAPIAllocateBuffer(sizeof(SBinary) * newChildren.cValues,(void**)& bins);
4762 + newChildren.lpbin = bins;
4763 + for (oldIndex=0;oldIndex<oldChildren.cValues;oldIndex++)
4765 + if ( oldChildren.lpbin[oldIndex].cb == aNewEntry.mByteCount &&
4766 + !memcmp((void*)(oldChildren.lpbin[oldIndex].lpb+4),
4767 + (void*)(aNewEntry.mEntryId->ab),
4768 + oldChildren.lpbin[oldIndex].cb-4))
4770 + lDeleteEntry=oldIndex;
4774 + newChildren.lpbin[newIndex].lpb = oldChildren.lpbin[oldIndex].lpb;
4775 + newChildren.lpbin[newIndex].cb = oldChildren.lpbin[oldIndex].cb;
4784 + SPropValue children;
4785 + LPSPropProblemArray problems = NULL ;
4787 + if (newChildren.cValues == 0)
4789 + SPropTagArray delTags;
4790 + delTags.cValues = 1;
4791 + delTags.aulPropTag[0] = listTag;
4793 + mLastError = container->DeleteProps(&delTags, &problems) ;
4797 + children.ulPropTag = listTag;
4798 + children.Value.MVbin = newChildren;
4799 + mLastError = container->SetProps(1, &children, &problems) ;
4802 + if (HR_FAILED(mLastError)) {
4803 + PRINTF(("Cannot set children %08x.\n", mLastError)) ;
4807 + //update OUTLOOK_EMAIL_LIST2
4808 + listTag = GetEmailPropertyTag(*(LPMAPIPROP*)&container,OUTLOOK_EMAIL_LIST2) | PT_MV_BINARY;
4809 + if (!GetMAPIProperties(aDistlist, &listTag, 1, oldChildValue, valueCount))
4811 + PRINTF(("Cannot get old children %08x.\n", mLastError)) ;
4816 + if (! (oldChildValue->Value.l == MAPI_E_NOT_FOUND))
4818 + oldChildren = oldChildValue->Value.MVbin;
4819 + newChildren.cValues=oldChildren.cValues - 1;
4820 + mMAPIAllocateBuffer(sizeof(SBinary) * newChildren.cValues,(void**)& bins);
4821 + newChildren.lpbin = bins;
4822 + for (oldIndex=0;oldIndex<oldChildren.cValues;oldIndex++)
4824 + if (oldIndex != lDeleteEntry)
4826 + newChildren.lpbin[newIndex].lpb = oldChildren.lpbin[oldIndex].lpb;
4827 + newChildren.lpbin[newIndex].cb = oldChildren.lpbin[oldIndex].cb;
4834 + newChildren.cValues = 1;
4835 + mMAPIAllocateBuffer(sizeof(SBinary) * newChildren.cValues,(void**)& bins);
4836 + newChildren.lpbin = bins;
4841 + if (newChildren.cValues == 0)
4843 + SPropTagArray delTags;
4844 + delTags.cValues = 1;
4845 + delTags.aulPropTag[0] = listTag;
4847 + mLastError = container->DeleteProps(&delTags, &problems) ;
4851 + children.ulPropTag = listTag;
4852 + children.Value.MVbin = newChildren;
4853 + mLastError = container->SetProps(1, &children, &problems) ;
4855 + if (HR_FAILED(mLastError)) {
4856 + PRINTF(("Cannot set children %08x.\n", mLastError)) ;
4860 + mMAPIFreeBuffer(bins);
4862 + mLastError = container->SaveChanges(KEEP_OPEN_READONLY) ;
4863 + if (HR_FAILED(mLastError)) {
4864 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
4871 +BOOL nsMapiAddressBook::GetEntryParent(const nsMapiEntry& aParent, nsMapiEntry& aParentEntry)
4873 + nsMapiInterfaceWrapper<LPMAPIPROP> object ;
4874 + ULONG objType = 0 ;
4875 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
4876 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
4877 + (IUnknown **)&object) ;
4879 + if (HR_FAILED(mLastError)) {
4880 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
4883 + SPropValue *parentID=GetMapiProperty(*(LPMAPIPROP*)&object, PR_PARENT_ENTRYID);
4885 + if (parentID->Value.l == MAPI_E_NOT_FOUND)
4887 + aParentEntry.Assign(parentID->Value.bin.cb, NS_REINTERPRET_CAST(LPENTRYID, parentID->Value.bin.lpb));
4890 +BOOL nsMapiAddressBook::CreateEntryInList(const nsMapiEntry& aDistlist, nsMapiEntry& aNewEntry)
4892 + nsMapiInterfaceWrapper<LPMAPIPROP> container ;
4893 + ULONG objType = 0 ;
4895 + nsMapiEntry parentEntry;
4896 + if (!GetEntryParent(aDistlist,parentEntry))
4900 + nsMapiInterfaceWrapper<LPMESSAGE> newEntry ;
4901 + if (!CreateEntry(parentEntry,aNewEntry)) //Create a entry in parent folder
4904 + return AddEntryToList(aDistlist,aNewEntry);
4907 +BOOL nsMapiAddressBook::CreateEntry(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry)
4909 + nsMapiInterfaceWrapper<LPMAPIFOLDER> container ;
4910 + ULONG objType = 0 ;
4912 + nsMapiInterfaceWrapper<LPMAPIPROP> object;
4913 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
4914 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
4917 + if (HR_FAILED(mLastError)) {
4918 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
4921 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIPROP*)&object,PR_MESSAGE_CLASS);
4923 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
4924 + return CreateEntryInList(aParent,aNewEntry); //Create entry in DistList
4926 + LPMDB lpMsgStore=GetMsgStore(aParent);
4931 + mLastError = lpMsgStore->OpenEntry(aParent.mByteCount, aParent.mEntryId,
4932 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
4934 + lpMsgStore->Release();
4936 + if (HR_FAILED(mLastError))
4939 + nsMapiInterfaceWrapper<LPMESSAGE> newEntry ;
4941 + mLastError = container->CreateMessage(&IID_IMessage,
4944 + if (HR_FAILED(mLastError)) {
4945 + PRINTF(("Cannot create new entry %08x.\n", mLastError)) ;
4948 + SPropValue messageclass ;
4949 + LPSPropProblemArray problems = NULL ;
4950 + nsCString tempName ;
4952 + messageclass.ulPropTag = PR_MESSAGE_CLASS_A ;
4953 + tempName.Assign("IPM.Contact") ;
4954 + messageclass.Value.lpszA = NS_CONST_CAST(char *, tempName.get()) ;
4955 + mLastError = newEntry->SetProps(1, &messageclass, &problems) ;
4956 + if (HR_FAILED(mLastError)) {
4957 + PRINTF(("Cannot set temporary name %08x.\n", mLastError)) ;
4960 + mLastError = newEntry->SaveChanges(KEEP_OPEN_READONLY) ;
4961 + if (HR_FAILED(mLastError)) {
4962 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
4966 + SPropTagArray property ;
4967 + LPSPropValue value = NULL ;
4968 + ULONG valueCount = 0 ;
4970 + property.cValues = 1 ;
4971 + property.aulPropTag [0] = PR_ENTRYID ;
4972 + mLastError = newEntry->GetProps(&property, 0, &valueCount, &value) ;
4973 + if (HR_FAILED(mLastError) || valueCount != 1) {
4974 + PRINTF(("Cannot get entry id %08x.\n", mLastError)) ;
4977 + aNewEntry.Assign(value->Value.bin.cb, NS_REINTERPRET_CAST(LPENTRYID, value->Value.bin.lpb)) ;
4978 + FreeBuffer(value) ;
4982 +BOOL nsMapiAddressBook::CreateDistList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry)
4984 + nsMapiInterfaceWrapper<LPMAPIFOLDER> container ;
4985 + ULONG objType = 0 ;
4987 + LPMDB lpMsgStore=GetMsgStore(aParent);
4990 + mLastError = lpMsgStore->OpenEntry(aParent.mByteCount, aParent.mEntryId,
4991 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
4993 + lpMsgStore->Release();
4995 + if (HR_FAILED(mLastError)) {
4996 + PRINTF(("Cannot open container %08x.\n", mLastError)) ;
5000 + nsMapiInterfaceWrapper<LPMESSAGE> newEntry ;
5001 + mLastError = container->CreateMessage(&IID_IMAPIProp,
5004 + if (HR_FAILED(mLastError)) {
5005 + PRINTF(("Cannot create new entry %08x.\n", mLastError)) ;
5008 + SPropValue messageclass ;
5009 + LPSPropProblemArray problems = NULL ;
5010 + nsCString tempName ;
5012 + messageclass.ulPropTag = PR_MESSAGE_CLASS_A ;
5013 + tempName.Assign("IPM.DistList") ;
5014 + messageclass.Value.lpszA = NS_CONST_CAST(char *, tempName.get()) ;
5015 + mLastError = newEntry->SetProps(1, &messageclass, &problems) ;
5016 + if (HR_FAILED(mLastError)) {
5017 + PRINTF(("Cannot set PR_MESSAGE_CLASS_A %08x.\n", mLastError)) ;
5020 + mLastError = newEntry->SaveChanges(KEEP_OPEN_READONLY) ;
5021 + if (HR_FAILED(mLastError)) {
5022 + PRINTF(("Cannot commit new entry %08x.\n", mLastError)) ;
5026 + ULONG valueCount = 0 ;
5027 + SPropTagArray property ;
5028 + LPSPropValue value = NULL ;
5030 + property.cValues = 1 ;
5031 + property.aulPropTag [0] = PR_ENTRYID ;
5032 + mLastError = newEntry->GetProps(&property, 0, &valueCount, &value) ;
5033 + if (HR_FAILED(mLastError) || valueCount != 1) {
5034 + PRINTF(("Cannot get entry id %08x.\n", mLastError)) ;
5037 + aNewEntry.Assign(value->Value.bin.cb, NS_REINTERPRET_CAST(LPENTRYID, value->Value.bin.lpb)) ;
5039 + FreeBuffer(value) ;
5044 +BOOL nsMapiAddressBook::CopyEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aSource,
5045 + nsMapiEntry& aTarget)
5047 + nsMapiInterfaceWrapper<LPMAPIFOLDER> container ;
5048 + nsMapiInterfaceWrapper<LPMAPIFOLDER> targetFolder ;
5049 + ULONG objType = 0 ;
5050 + nsMapiInterfaceWrapper<LPMAPIPROP> object;
5051 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
5052 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
5055 + if (HR_FAILED(mLastError)) {
5056 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
5059 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIPROP*)&object,PR_MESSAGE_CLASS);
5061 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
5063 + //Add Entry To DistList
5064 + if (!AddEntryToList(aContainer,aSource))
5066 + aTarget.Assign(aSource.mByteCount,aSource.mEntryId);
5071 + SBinaryArray entryArray ;
5073 + entry.cb = aSource.mByteCount ;
5074 + entry.lpb = NS_REINTERPRET_CAST(LPBYTE, aSource.mEntryId) ;
5075 + entryArray.cValues = 1 ;
5076 + entryArray.lpbin = &entry ;
5078 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
5079 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
5081 + if (HR_FAILED(mLastError)) {
5082 + PRINTF(("Cannot open container %08x.\n", mLastError)) ;
5086 + mLastError = OpenEntry(aTarget.mByteCount, aTarget.mEntryId,
5087 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
5089 + if (HR_FAILED(mLastError)) {
5090 + PRINTF(("Cannot open Target folder %08x.\n", mLastError)) ;
5094 + nsMapiInterfaceWrapper<LPMAPIPROP> newEntry ;
5096 + mLastError = container->CopyMessages(&entryArray,
5098 + (void*)&targetFolder,
5102 + if (HR_FAILED(mLastError)) {
5103 + PRINTF(("Cannot create new entry %08x.\n", mLastError)) ;
5109 +BOOL nsMapiAddressBook::DeleteEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry)
5111 + nsMapiInterfaceWrapper<LPMAPIFOLDER> container ;
5112 + ULONG objType = 0 ;
5114 + SBinaryArray entryArray ;
5117 + nsMapiInterfaceWrapper<LPMAPIPROP> object;
5118 + mLastError = OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
5119 + &IID_IMAPIProp, MAPI_BEST_ACCESS, &objType,
5122 + if (HR_FAILED(mLastError)) {
5123 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
5126 + LPSPropValue msgClass=GetMapiProperty(*(LPMAPIPROP*)&object,PR_MESSAGE_CLASS);
5128 + if (msgClass && strcmp("IPM.DistList",msgClass->Value.lpszA) == 0)
5129 + return DeleteEntryFromList(aContainer,aEntry); //Delete Entry from DistList
5131 + LPMDB lpMsgStore=GetMsgStore(aContainer);
5135 + mLastError = lpMsgStore->OpenEntry(aContainer.mByteCount, aContainer.mEntryId,
5136 + &IID_IMAPIFolder, MAPI_BEST_ACCESS, &objType,
5138 + lpMsgStore->Release();
5139 + if (HR_FAILED(mLastError)) {
5140 + PRINTF(("Cannot open container %08x.\n", mLastError)) ;
5143 + entry.cb = aEntry.mByteCount ;
5144 + entry.lpb = NS_REINTERPRET_CAST(LPBYTE, aEntry.mEntryId) ;
5145 + entryArray.cValues = 1 ;
5146 + entryArray.lpbin = &entry ;
5147 + mLastError = container->DeleteMessages(&entryArray, 0,0,0) ;
5148 + if (HR_FAILED(mLastError)) {
5149 + PRINTF(("Cannot delete entry %08x.\n", mLastError)) ;
5155 +//Use to open message store in write mode
5156 +LPMDB nsMapiAddressBook::GetMsgStore(const nsMapiEntry& aEntry)
5158 + nsMapiInterfaceWrapper<LPMAPIPROP> object;
5161 + mLastError = OpenEntry(aEntry.mByteCount, aEntry.mEntryId,
5162 + &IID_IMAPIProp, MAPI_BEST_ACCESS , &objType,
5164 + if (HR_FAILED(mLastError)) {
5165 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
5168 + SPropValue *svMsgSore=GetMapiProperty( *(LPMAPIPROP*)&object, PR_STORE_ENTRYID);;
5170 + LPMDB lpMsgStore=NULL;
5171 + mLastError=mRootSession->OpenMsgStore(0,
5172 + svMsgSore->Value.bin.cb,
5173 + (ENTRYID*)svMsgSore->Value.bin.lpb,
5175 + MAPI_BEST_ACCESS ,
5178 + if (HR_FAILED(mLastError)) {
5179 + PRINTF(("Cannot open MsgStore %08x.\n", mLastError)) ;
5183 + return lpMsgStore;
5185 --- misc/mozilla/mailnews/addrbook/src/nsMapiAddressBook.h 2004-04-17 20:32:14.000000000 +0200
5186 +++ misc/build/mozilla/mailnews/addrbook/src/nsMapiAddressBook.h 2008-08-14 16:22:21.000000000 +0200
5189 #include "nsAbWinHelper.h"
5197 class nsMapiAddressBook : public nsAbWinHelper
5200 nsMapiAddressBook(void) ;
5201 virtual ~nsMapiAddressBook(void) ;
5203 + // Get the top address books
5204 + virtual BOOL GetFolders(nsMapiEntryArray& aFolders);
5206 + // Get a default address book container
5207 + virtual BOOL GetDefaultContainer(nsMapiEntry& aContainer);
5208 + // Is the helper correctly initialised?
5209 + virtual BOOL IsOK(void);
5210 + virtual BOOL GetPropertyLong(const nsMapiEntry& aObject,
5211 + ULONG aPropertyTag,
5213 + // Get the value of a MAPI property of type SYSTIME
5214 + virtual BOOL GetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
5215 + WORD& aYear, WORD& aMonth, WORD& aDay);
5216 + // Create entry in the address book
5217 + virtual BOOL CreateEntry(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
5218 + // Delete an entry in the address book
5219 + virtual BOOL DeleteEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
5220 + // Create a distribution list in the address book
5221 + virtual BOOL CreateDistList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
5222 + // Copy an existing entry in the address book
5223 + virtual BOOL CopyEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aSource, nsMapiEntry& aTarget) ;
5225 + static void FreeMapiLibrary(void) ;
5228 // Class members to handle the library/entry points
5229 static HMODULE mLibrary ;
5231 static BOOL mInitialized ;
5232 static BOOL mLogonDone ;
5233 static LPMAPISESSION mRootSession ;
5234 - static LPADRBOOK mRootBook ;
5237 // Load the MAPI environment
5238 BOOL Initialize(void) ;
5240 + virtual HRESULT OpenEntry(ULONG cbEntryID,
5241 + LPENTRYID lpEntryID,
5242 + LPCIID lpInterface,
5244 + ULONG FAR * lpulObjType,
5245 + LPUNKNOWN FAR * lppUnk
5249 + // Retrieve the contents of a container, with an optional restriction
5250 + virtual BOOL GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
5251 + nsMapiEntryArray *aList, ULONG aMapiType) ;
5252 + // Retrieve the values of a set of properties on a MAPI object
5253 + virtual BOOL GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
5254 + ULONG aNbProperties,
5255 + LPSPropValue& aValues, ULONG& aValueCount) ;
5256 + // Set the values of a set of properties on a MAPI object
5257 + virtual BOOL SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
5258 + LPSPropValue& aValues);
5261 // Allocation of a buffer for transmission to interfaces
5262 virtual void AllocateBuffer(ULONG aByteCount, LPVOID *aBuffer) ;
5263 // Destruction of a buffer provided by the interfaces
5264 virtual void FreeBuffer(LPVOID aBuffer) ;
5265 // Library management
5266 static BOOL LoadMapiLibrary(void) ;
5267 - static void FreeMapiLibrary(void) ;
5269 + BOOL HandleContentsItem(ULONG oType, ULONG cb, LPENTRYID pEntry,nsMapiEntryArray& aFolders);
5270 + LPSPropValue GetMapiProperty( LPMAPIPROP pProp, ULONG tag);
5271 + BOOL GetEntryIdFromProp( LPSPropValue pVal, ULONG& cbEntryId, LPENTRYID& lpEntryId, BOOL delVal=FALSE);
5272 + BOOL HandleHierarchyItem( ULONG oType, ULONG cb, LPENTRYID pEntry,nsMapiEntryArray& aFolders);
5273 + BOOL IterateHierarchy(IMAPIContainer * pFolder, nsMapiEntryArray& aFolders,ULONG flags=0);
5274 + ULONG GetEmailPropertyTag(LPMAPIPROP lpProp, LONG nameID);
5275 + ULONG GetRealMapiPropertyTag(LPMAPIPROP lpProp, LONG aPropertyTag,BOOL aTest=FALSE);
5276 + LPMDB GetMsgStore(const nsMapiEntry& aEntry);
5277 + BOOL CreateEntryInList(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry);
5278 + BOOL AddEntryToList(const nsMapiEntry& aParent,const nsMapiEntry& aNewEntry);
5279 + BOOL DeleteEntryFromList(const nsMapiEntry& aDistlist, const nsMapiEntry& aNewEntry);
5280 + BOOL GetEntryParent(const nsMapiEntry& aParent, nsMapiEntry& aParentEntry);
5281 + BOOL CorrectRestriction(const LPMAPIPROP aMapiProp,ULONG aRestrictionNum, LPSRestriction aRestriction);
5284 + BOOL Filter( LPSRestriction aRestriction,nsMapiEntryArray * aList);
5285 + BOOL FilterOnOneRow(nsMapiEntry *aEntry,LPSRestriction aRestriction);
5286 + BOOL AtomyFilter(LPSRestriction aRestriction,LPSPropValue aRealValue,LPSPropValue aFilterValue);
5288 + void AddToMDBArray(LPMDB aMDB)
5290 + m_MDBArray.AppendElement(aMDB);
5295 + for (int i = 0; i < m_MDBArray.Count(); i++)
5297 + mdb = (LPMDB)m_MDBArray.ElementAt(i);
5300 + m_MDBArray.Clear();
5304 + //use to keep all openned MsgStore,if we not open a message store,we can't open any thing on it
5305 + //so we have to kill message stores openned
5306 + nsVoidArray m_MDBArray;
5309 #endif // nsMapiAddressBook_h___
5310 --- misc/mozilla/mailnews/addrbook/src/nsWabAddressBook.cpp 2004-11-05 16:13:32.000000000 +0100
5311 +++ misc/build/mozilla/mailnews/addrbook/src/nsWabAddressBook.cpp 2008-08-14 16:22:21.000000000 +0200
5314 #define PRINTF(args) PR_LOG(gWabAddressBookLog, PR_LOG_DEBUG, args)
5318 + ContentsColumnEntryId = 0,
5319 + ContentsColumnObjectType,
5320 + ContentsColumnsSize
5323 +static const SizedSPropTagArray(ContentsColumnsSize, ContentsColumns) =
5325 + ContentsColumnsSize,
5332 HMODULE nsWabAddressBook::mLibrary = NULL ;
5333 PRInt32 nsWabAddressBook::mLibUsage = 0 ;
5334 LPWABOPEN nsWabAddressBook::mWABOpen = NULL ;
5336 MOZ_DECL_CTOR_COUNTER(nsWabAddressBook)
5338 nsWabAddressBook::nsWabAddressBook(void)
5340 +: nsAbWinHelper(),mAddressBook(NULL)
5342 BOOL result = Initialize() ;
5344 @@ -109,9 +125,254 @@
5345 MOZ_COUNT_DTOR(nsWabAddressBook) ;
5348 +BOOL nsWabAddressBook::GetFolders(nsMapiEntryArray& aFolders)
5350 + aFolders.CleanUp() ;
5351 + nsMapiInterfaceWrapper<LPABCONT> rootFolder ;
5352 + nsMapiInterfaceWrapper<LPMAPITABLE> folders ;
5353 + ULONG objType = 0 ;
5354 + ULONG rowCount = 0 ;
5355 + SRestriction restriction ;
5356 + SPropTagArray folderColumns ;
5358 + mLastError = OpenEntry(0, NULL, NULL, 0, &objType,
5360 + if (HR_FAILED(mLastError)){
5361 + PRINTF(("Cannot open root %08x.\n", mLastError));
5364 + mLastError = rootFolder->GetHierarchyTable(0, folders);
5365 + if (HR_FAILED(mLastError)){
5366 + PRINTF(("Cannot get hierarchy %08x.\n", mLastError));
5369 + // We only take into account modifiable containers,
5370 + // otherwise, we end up with all the directory services...
5371 + restriction.rt = RES_BITMASK ;
5372 + restriction.res.resBitMask.ulPropTag = PR_CONTAINER_FLAGS ;
5373 + restriction.res.resBitMask.relBMR = BMR_NEZ ;
5374 + restriction.res.resBitMask.ulMask = AB_MODIFIABLE ;
5375 + mLastError = folders->Restrict(&restriction, 0) ;
5376 + if (HR_FAILED(mLastError)) {
5377 + PRINTF(("Cannot restrict table %08x.\n", mLastError)) ;
5379 + folderColumns.cValues = 1 ;
5380 + folderColumns.aulPropTag [0] = PR_ENTRYID ;
5381 + mLastError = folders->SetColumns(&folderColumns, 0) ;
5382 + if (HR_FAILED(mLastError)) {
5383 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
5386 + mLastError = folders->GetRowCount(0, &rowCount) ;
5387 + if (HR_SUCCEEDED(mLastError)) {
5389 + LPSRowSet rowSet = NULL ;
5392 + mLastError = folders->QueryRows(1, 0, &rowSet) ;
5393 + if (HR_SUCCEEDED(mLastError)) {
5394 + rowCount = rowSet->cRows ;
5395 + if (rowCount > 0) {
5396 + SPropValue& currentValue = rowSet->aRow->lpProps [0] ;
5398 + aFolders.AddItem(currentValue.Value.bin.cb,
5399 + NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
5401 + MyFreeProws(rowSet) ;
5404 + PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
5406 + } while (rowCount > 0) ;
5408 + return HR_SUCCEEDED(mLastError) ;
5410 +BOOL nsWabAddressBook::GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
5411 + nsMapiEntryArray *aList, ULONG aMapiType)
5413 + if (aList) { aList->CleanUp(); }
5414 + nsMapiInterfaceWrapper<LPMAPICONTAINER> parent ;
5415 + nsMapiInterfaceWrapper<LPMAPITABLE> contents ;
5416 + ULONG objType = 0 ;
5417 + ULONG rowCount = 0 ;
5419 + mLastError = OpenEntry(aParent.mByteCount, aParent.mEntryId,
5420 + &IID_IMAPIContainer, 0, &objType,
5422 + if (HR_FAILED(mLastError)) {
5423 + PRINTF(("Cannot open parent %08x.\n", mLastError)) ;
5426 + // Here, flags for WAB and MAPI could be different, so this works
5427 + // only as long as we don't want to use any flag in GetContentsTable
5428 + mLastError = parent->GetContentsTable(0, contents) ;
5429 + if (HR_FAILED(mLastError)) {
5430 + PRINTF(("Cannot get contents %08x.\n", mLastError)) ;
5433 + if (aRestriction) {
5434 + mLastError = contents->Restrict(aRestriction, 0) ;
5435 + if (HR_FAILED(mLastError)) {
5436 + PRINTF(("Cannot set restriction %08x.\n", mLastError)) ;
5440 + int entryId = ContentsColumnEntryId ;
5441 + int objectType = ContentsColumnObjectType ;
5445 + LPSPropTagArray allColumns = NULL ;
5447 + mLastError = contents->QueryColumns(TBL_ALL_COLUMNS, &allColumns) ;
5448 + if (HR_FAILED(mLastError)) {
5449 + PRINTF(("Cannot query columns %08x.\n", mLastError)) ;
5453 + for (unsigned int j = 0 ; j < allColumns->cValues ; ++ j) {
5454 + if (allColumns->aulPropTag [j] == PR_ENTRYID) {
5457 + else if (allColumns->aulPropTag [j] == PR_OBJECT_TYPE) {
5461 + mLastError = contents->SetColumns(allColumns, 0) ;
5462 + if (HR_FAILED(mLastError)) {
5463 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
5466 + FreeBuffer(allColumns) ;
5471 + mLastError = contents->SetColumns((LPSPropTagArray) &ContentsColumns, 0) ;
5472 + if (HR_FAILED(mLastError)) {
5473 + PRINTF(("Cannot set columns %08x.\n", mLastError)) ;
5478 + mLastError = contents->GetRowCount(0, &rowCount) ;
5479 + if (HR_FAILED(mLastError)) {
5480 + PRINTF(("Cannot get result count %08x.\n", mLastError)) ;
5484 + LPSRowSet rowSet = NULL ;
5487 + mLastError = contents->QueryRows(1, 0, &rowSet) ;
5488 + if (HR_FAILED(mLastError)) {
5489 + PRINTF(("Cannot query rows %08x.\n", mLastError)) ;
5492 + rowCount = rowSet->cRows ;
5493 + if (rowCount > 0 &&
5494 + (aMapiType == 0 ||
5495 + rowSet->aRow->lpProps[objectType].Value.ul == aMapiType)) {
5497 + SPropValue& currentValue = rowSet->aRow->lpProps[entryId] ;
5499 + aList->AddItem(currentValue.Value.bin.cb,
5500 + NS_REINTERPRET_CAST(LPENTRYID, currentValue.Value.bin.lpb)) ;
5504 + MyFreeProws(rowSet) ;
5505 + } while (rowCount > 0) ;
5509 +BOOL nsWabAddressBook::GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
5510 + ULONG aNbProperties, LPSPropValue& aValue,
5511 + ULONG& aValueCount)
5513 + nsMapiInterfaceWrapper<LPMAPIPROP> object ;
5514 + IMsgStore * mdb=NULL;
5515 + ULONG objType = 0 ;
5516 + LPSPropTagArray properties = NULL ;
5519 + mLastError = OpenEntry(aObject.mByteCount, aObject.mEntryId,
5520 + &IID_IMAPIProp, 0, &objType,
5523 + if (HR_FAILED(mLastError)){
5524 + PRINTF(("Cannot open entry %08x.\n", mLastError));
5527 + AllocateBuffer(CbNewSPropTagArray(aNbProperties),
5528 + NS_REINTERPRET_CAST(void **, &properties));
5529 + properties->cValues = aNbProperties;
5530 + for (i = 0 ; i < aNbProperties ; ++ i) {
5531 + properties->aulPropTag [i] = aPropertyTags [i];
5533 + mLastError = object->GetProps(properties, 0, &aValueCount, &aValue);
5534 + FreeBuffer(properties);
5535 + if (HR_FAILED(mLastError)){
5536 + PRINTF(("Cannot get props %08x.\n", mLastError));
5538 + return HR_SUCCEEDED(mLastError) ;
5541 +BOOL nsWabAddressBook::SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
5542 + LPSPropValue& aValues)
5544 + nsMapiInterfaceWrapper<LPMAPIPROP> object ;
5545 + ULONG objType = 0 ;
5546 + LPSPropProblemArray problems = NULL ;
5548 + mLastError = OpenEntry(aObject.mByteCount, aObject.mEntryId,
5549 + &IID_IMAPIProp, MAPI_MODIFY, &objType,
5551 + if (HR_FAILED(mLastError)) {
5552 + PRINTF(("Cannot open entry %08x.\n", mLastError)) ;
5555 + mLastError = object->SetProps(aNbProperties, aValues, &problems) ;
5556 + if (HR_FAILED(mLastError)) {
5557 + PRINTF(("Cannot update the object %08x.\n", mLastError)) ;
5561 + for (ULONG i = 0 ; i < problems->cProblem ; ++ i) {
5562 + PRINTF(("Problem %d: index %d code %08x.\n", i,
5563 + problems->aProblem [i].ulIndex,
5564 + problems->aProblem [i].scode));
5567 + mLastError = object->SaveChanges(0) ;
5568 + if (HR_FAILED(mLastError)) {
5569 + PRINTF(("Cannot commit changes %08x.\n", mLastError)) ;
5571 + return HR_SUCCEEDED(mLastError) ;
5574 +BOOL nsWabAddressBook::GetDefaultContainer(nsMapiEntry& aContainer)
5576 + LPENTRYID entryId = NULL;
5577 + ULONG byteCount = 0;
5579 + mLastError = mAddressBook->GetPAB(&byteCount, &entryId);
5580 + if (HR_FAILED(mLastError)){
5581 + PRINTF(("Cannot get PAB %08x.\n", mLastError));
5584 + aContainer.Assign(byteCount, entryId);
5585 + FreeBuffer(entryId) ;
5589 +BOOL nsWabAddressBook::IsOK(void)
5591 + return mAddressBook != NULL ;
5594 BOOL nsWabAddressBook::Initialize(void)
5596 - if (mAddressBook) { return TRUE ; }
5597 nsAutoLock guard(mMutex) ;
5599 if (!LoadWabLibrary()) {
5600 --- misc/mozilla/mailnews/addrbook/src/nsWabAddressBook.h 2004-04-17 20:32:14.000000000 +0200
5601 +++ misc/build/mozilla/mailnews/addrbook/src/nsWabAddressBook.h 2008-08-14 16:22:21.000000000 +0200
5603 nsWabAddressBook(void) ;
5604 virtual ~nsWabAddressBook(void) ;
5606 + // Get the top address books
5607 + virtual BOOL GetFolders(nsMapiEntryArray& aFolders);
5609 + // Get a default address book container
5610 + virtual BOOL GetDefaultContainer(nsMapiEntry& aContainer);
5611 + // Is the helper correctly initialised?
5612 + virtual BOOL IsOK(void);
5613 + static void FreeWabLibrary(void) ;
5616 // Session and address book that will be shared by all instances
5617 // (see nsMapiAddressBook.h for details)
5619 static HMODULE mLibrary ;
5620 static LPWABOPEN mWABOpen ;
5622 + LPADRBOOK mAddressBook ;
5624 // Load the WAB environment
5625 BOOL Initialize(void) ;
5627 + virtual HRESULT OpenEntry(ULONG cbEntryID,
5628 + LPENTRYID lpEntryID,
5629 + LPCIID lpInterface,
5631 + ULONG FAR * lpulObjType,
5632 + LPUNKNOWN FAR * lppUnk
5635 + return mAddressBook->OpenEntry(cbEntryID,
5645 + // Retrieve the contents of a container, with an optional restriction
5646 + virtual BOOL GetContents(const nsMapiEntry& aParent, LPSRestriction aRestriction,
5647 + nsMapiEntryArray *aList, ULONG aMapiType) ;
5648 + // Retrieve the values of a set of properties on a MAPI object
5649 + virtual BOOL GetMAPIProperties(const nsMapiEntry& aObject, const ULONG *aPropertyTags,
5650 + ULONG aNbProperties,
5651 + LPSPropValue& aValues, ULONG& aValueCount) ;
5652 + // Set the values of a set of properties on a MAPI object
5653 + virtual BOOL SetMAPIProperties(const nsMapiEntry& aObject, ULONG aNbProperties,
5654 + LPSPropValue& aValues) ;
5656 // Allocation of a buffer for transmission to interfaces
5657 virtual void AllocateBuffer(ULONG aByteCount, LPVOID *aBuffer) ;
5658 // Destruction of a buffer provided by the interfaces
5659 virtual void FreeBuffer(LPVOID aBuffer) ;
5660 // Manage the library
5661 static BOOL LoadWabLibrary(void) ;
5662 - static void FreeWabLibrary(void) ;
5666 --- misc/mozilla/modules/libpref/src/Makefile.in 2006-02-03 15:44:52.000000000 +0100
5667 +++ misc/build/mozilla/modules/libpref/src/Makefile.in 2008-08-14 16:22:21.000000000 +0200
5669 PREF_JS_EXPORTS += $(srcdir)/init/non-shared.txt
5672 -EXTRA_DSO_LDOPTS = \
5673 +EXTRA_DSO_LDOPTS += \
5676 $(MOZ_COMPONENT_LIBS) \
5677 --- misc/mozilla/netwerk/protocol/http/src/nsHttpConnectionMgr.cpp 2005-07-20 20:31:42.000000000 +0200
5678 +++ misc/build/mozilla/netwerk/protocol/http/src/nsHttpConnectionMgr.cpp 2008-08-20 15:45:06.000000000 +0200
5681 nsHttpConnectionMgr::UpdateParam(nsParamName name, PRUint16 value)
5683 - PRUint32 param = (PRUint32(name) << 16) | PRUint32(value);
5684 + PRUint32 param = (NS_PTR_TO_INT32(name) << 16) | NS_PTR_TO_INT32(value);
5685 return PostEvent(&nsHttpConnectionMgr::OnMsgUpdateParam, 0, (void *) param);
5688 --- misc/mozilla/nsprpub/build/cygwin-wrapper 2006-12-22 14:47:17.000000000 +0100
5689 +++ misc/build/mozilla/nsprpub/build/cygwin-wrapper 2008-08-14 16:22:21.000000000 +0200
5694 # Stupid wrapper to avoid win32 dospath/cygdrive issues
5695 # Try not to spawn programs from within this file. If the stuff in here looks royally
5696 --- misc/mozilla/nsprpub/config/autoconf.mk.in 2006-12-22 14:47:17.000000000 +0100
5697 +++ misc/build/mozilla/nsprpub/config/autoconf.mk.in 2008-08-14 16:22:21.000000000 +0200
5699 RELEASE_OBJDIR_NAME = @RELEASE_OBJDIR_NAME@
5700 OBJDIR_NAME = @OBJDIR_NAME@
5702 +LIB_PREFIX = @LIB_PREFIX@
5703 OBJ_SUFFIX = @OBJ_SUFFIX@
5704 LIB_SUFFIX = @LIB_SUFFIX@
5705 DLL_SUFFIX = @DLL_SUFFIX@
5706 --- misc/mozilla/nsprpub/config/rules.mk 2006-12-22 14:47:17.000000000 +0100
5707 +++ misc/build/mozilla/nsprpub/config/rules.mk 2008-12-12 10:09:34.437500000 +0100
5709 # other platforms do not.
5711 ifeq (,$(filter-out WIN95 OS2,$(OS_TARGET)))
5712 -LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
5713 +LIBRARY = $(OBJDIR)/$(LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
5714 SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
5715 -IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
5716 +IMPORT_LIBRARY = $(OBJDIR)/$(LIB_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
5717 SHARED_LIB_PDB = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
5719 LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
5720 @@ -340,6 +340,10 @@
5722 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
5723 $(LINK_DLL) -MAP $(DLLBASE) $(DLL_LIBS) $(EXTRA_LIBS) $(OBJS) $(RES)
5724 + @if test -f $@.manifest; then \
5725 + mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;2; \
5726 + rm -f $@.manifest; \
5729 ifeq ($(MOZ_OS2_TOOLS),VACPP)
5730 $(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $(MAPFILE)
5731 --- misc/mozilla/nsprpub/configure 2008-01-29 20:27:43.000000000 +0100
5732 +++ misc/build/mozilla/nsprpub/configure 2008-08-14 16:22:21.000000000 +0200
5733 @@ -2737,6 +2737,7 @@
5738 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
5741 @@ -3475,7 +3476,7 @@
5744 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
5745 - MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
5746 + MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
5747 if test "$MOZ_OBJFORMAT" = "elf"; then
5750 @@ -3941,7 +3942,7 @@
5751 CC="$CC -mno-cygwin"
5752 CXX="$CXX -mno-cygwin"
5754 - MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
5755 + MKSHLIB='$(CC) -shared -Wl,--enable-runtime-pseudo-reloc -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
5757 # Use temp file for windres (bug 213281)
5758 RCFLAGS='-O coff --use-temp-file'
5759 @@ -3958,6 +3959,7 @@
5765 # Determine compiler version
5766 CC_VERSION=`"${CC}" -v 2>&1 | grep Version | sed -e 's|.* Version ||' -e 's| .*||'`
5767 @@ -5766,6 +5768,7 @@
5768 CC="\$(CYGWIN_WRAPPER) $CC"
5769 CXX="\$(CYGWIN_WRAPPER) $CXX"
5770 RC="\$(CYGWIN_WRAPPER) $RC"
5771 + LD="\$(CYGWIN_WRAPPER) $LD"
5775 @@ -6127,6 +6130,7 @@
5776 s%@LIB_SUFFIX@%$LIB_SUFFIX%g
5777 s%@DLL_SUFFIX@%$DLL_SUFFIX%g
5778 s%@ASM_SUFFIX@%$ASM_SUFFIX%g
5779 +s%@LIB_PREFIX@%$LIB_PREFIX%g
5780 s%@MKSHLIB@%$MKSHLIB%g
5781 s%@DSO_CFLAGS@%$DSO_CFLAGS%g
5782 s%@DSO_LDOPTS@%$DSO_LDOPTS%g
5783 --- misc/mozilla/nsprpub/configure.in 2008-01-29 20:27:44.000000000 +0100
5784 +++ misc/build/mozilla/nsprpub/configure.in 2008-08-14 16:22:21.000000000 +0200
5785 @@ -1137,7 +1137,7 @@
5786 AC_DEFINE(HAVE_BSD_FLOCK)
5787 AC_DEFINE(HAVE_SOCKLEN_T)
5788 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
5789 - MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
5790 + MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
5791 if test "$MOZ_OBJFORMAT" = "elf"; then
5794 --- misc/mozilla/nsprpub/lib/ds/Makefile.in 2006-12-22 14:47:17.000000000 +0100
5795 +++ misc/build/mozilla/nsprpub/lib/ds/Makefile.in 2008-08-14 16:22:21.000000000 +0200
5800 +ifeq ($(OS_ARCH),Linux)
5801 +MKSHLIB += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
5804 ifeq ($(OS_ARCH),SunOS)
5806 MAPFILE = $(OBJDIR)/pldsmap.sun
5807 GARBAGE += $(MAPFILE)
5809 ifdef GCC_USE_GNU_LD
5810 -MKSHLIB += -Wl,--version-script,$(MAPFILE)
5811 +MKSHLIB += -Wl,--version-script,$(MAPFILE) -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
5813 -MKSHLIB += -Wl,-M,$(MAPFILE)
5814 +MKSHLIB += -Wl,-M,$(MAPFILE) -Wl,-R,'$$ORIGIN'
5817 -MKSHLIB += -M $(MAPFILE)
5818 +MKSHLIB += -M $(MAPFILE) -Wl,-R,'$$ORIGIN'
5820 # The -R '$ORIGIN' linker option instructs this library to search for its
5821 # dependencies in the same directory where it resides.
5822 --- misc/mozilla/nsprpub/lib/libc/src/Makefile.in 2006-12-22 14:47:17.000000000 +0100
5823 +++ misc/build/mozilla/nsprpub/lib/libc/src/Makefile.in 2008-08-14 16:22:21.000000000 +0200
5828 +ifeq ($(OS_ARCH),Linux)
5829 +MKSHLIB += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
5832 ifeq ($(OS_ARCH),SunOS)
5834 MAPFILE = $(OBJDIR)/plcmap.sun
5835 GARBAGE += $(MAPFILE)
5837 ifdef GCC_USE_GNU_LD
5838 -MKSHLIB += -Wl,--version-script,$(MAPFILE)
5839 +MKSHLIB += -Wl,--version-script,$(MAPFILE) -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
5841 -MKSHLIB += -Wl,-M,$(MAPFILE)
5842 +MKSHLIB += -Wl,-M,$(MAPFILE) -Wl,-R,'$$ORIGIN'
5845 -MKSHLIB += -M $(MAPFILE)
5846 +MKSHLIB += -M $(MAPFILE) -Wl,-R,'$$ORIGIN'
5848 # The -R '$ORIGIN' linker option instructs this library to search for its
5849 # dependencies in the same directory where it resides.
5850 --- misc/mozilla/nsprpub/pr/src/misc/prnetdb.c 2006-12-22 14:47:27.000000000 +0100
5851 +++ misc/build/mozilla/nsprpub/pr/src/misc/prnetdb.c 2008-08-14 16:22:21.000000000 +0200
5853 #define _PR_HAVE_5_ARG_GETPROTO_R
5856 -#if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2)
5857 +#if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2) || \
5858 + (defined(__FreeBSD__) && __FreeBSD_version > 601103)
5859 #define _PR_HAVE_GETPROTO_R
5860 #define _PR_HAVE_5_ARG_GETPROTO_R
5862 --- misc/mozilla/security/coreconf/FreeBSD.mk 2006-12-22 14:48:06.000000000 +0100
5863 +++ misc/build/mozilla/security/coreconf/FreeBSD.mk 2008-08-14 16:22:21.000000000 +0200
5868 -MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo aout)
5869 +MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo elf)
5871 ifeq ($(MOZ_OBJFORMAT),elf)
5873 --- misc/mozilla/security/coreconf/Linux.mk 2006-12-22 14:48:06.000000000 +0100
5874 +++ misc/build/mozilla/security/coreconf/Linux.mk 2008-08-18 10:16:15.000000000 +0200
5877 ifeq ($(OS_RELEASE),2.0)
5878 OS_REL_CFLAGS += -DLINUX2_0
5879 - MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
5880 + MKSHLIB = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
5882 MKSHLIB += -Wl,--version-script,$(MAPFILE)
5887 DSO_LDOPTS = -shared $(ARCHFLAG)
5888 +DSO_LDOPTS += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
5890 LDFLAGS += $(ARCHFLAG)
5892 --- misc/mozilla/security/coreconf/SunOS5.mk 2008-06-16 00:22:15.000000000 +0200
5893 +++ misc/build/mozilla/security/coreconf/SunOS5.mk 2008-08-14 16:22:21.000000000 +0200
5894 @@ -161,12 +161,14 @@
5897 # -G: produce a shared object
5898 +# -R '$ORIGIN': search for dependencies in same directory
5899 # -z defs: no unresolved symbols allowed
5904 DSO_LDOPTS += -shared -h $(notdir $@)
5905 + DSO_LDOPTS += -Wl,-rpath,\$$ORIGIN:\$$ORIGIN/../ure-link/lib
5908 ifeq ($(OS_TEST),i86pc)
5912 DSO_LDOPTS += -G -h $(notdir $@)
5913 + DSO_LDOPTS += -R '$$ORIGIN'
5915 DSO_LDOPTS += -z combreloc -z defs -z ignore
5917 --- misc/mozilla/security/coreconf/WIN32.mk 2008-06-16 00:22:15.000000000 +0200
5918 +++ misc/build/mozilla/security/coreconf/WIN32.mk 2008-08-18 16:04:59.000000000 +0200
5920 DEFAULT_COMPILER = cl
5927 + CC = $(CYGWIN_WRAPPER) gcc
5928 + CCC = $(CYGWIN_WRAPPER) g++
5929 + LINK = $(CYGWIN_WRAPPER) ld
5930 + AR = $(CYGWIN_WRAPPER) ar
5933 + RANLIB = $(CYGWIN_WRAPPER) ranlib
5935 - RC = windres.exe -O coff --use-temp-file
5936 - LINK_DLL = $(CC) $(OS_DLLFLAGS) $(DLLFLAGS)
5937 + RC = $(CYGWIN_WRAPPER) windres.exe -O coff --use-temp-file
5938 + LINK_DLL = $(CYGWIN_WRAPPER) $(CC) $(OS_DLLFLAGS) $(DLLFLAGS)
5944 + CC = $(CYGWIN_WRAPPER) cl
5945 + CCC = $(CYGWIN_WRAPPER) cl
5946 + LINK = $(CYGWIN_WRAPPER) link
5947 + AR = $(CYGWIN_WRAPPER) lib
5948 AR += -NOLOGO -OUT:"$@"
5952 + RC = $(CYGWIN_WRAPPER) rc.exe
5958 NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
5960 -NSINSTALL = nsinstall
5961 +NSINSTALL = $(CYGWIN_WRAPPER) nsinstall
5963 MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend
5964 MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend.exe
5966 # dllimport cannot be used as as a constant address.
5967 OS_CFLAGS += -mno-cygwin -mms-bitfields -mnop-fun-dllimport
5968 _GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY)
5969 - DLLFLAGS += -mno-cygwin -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))
5970 + DLLFLAGS += -mno-cygwin -o $@ -shared -Wl,--enable-runtime-pseudo-reloc,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))
5973 DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
5974 --- misc/mozilla/security/coreconf/WIN954.0.mk 2008-06-16 00:22:15.000000000 +0200
5975 +++ misc/build/mozilla/security/coreconf/WIN954.0.mk 2008-08-14 16:22:21.000000000 +0200
5982 +NSPR31_LIB_PREFIX = lib
5984 --- misc/mozilla/security/coreconf/command.mk 2008-06-16 00:22:15.000000000 +0200
5985 +++ misc/build/mozilla/security/coreconf/command.mk 2008-08-19 09:58:11.000000000 +0200
5987 CCF = $(CC) $(CFLAGS)
5988 LINK_DLL = $(LINK) $(OS_DLLFLAGS) $(DLLFLAGS)
5989 LINK_EXE = $(LINK) $(OS_LFLAGS) $(LFLAGS)
5990 -CFLAGS = $(OPTIMIZER) $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) \
5991 +CFLAGS += $(OPTIMIZER) $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) \
5995 --- misc/mozilla/security/coreconf/rules.mk 2008-06-16 00:22:15.000000000 +0200
5996 +++ misc/build/mozilla/security/coreconf/rules.mk 2008-08-19 10:46:57.000000000 +0200
5998 $(PROGRAM): $(OBJS) $(EXTRA_LIBS)
6000 ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
6001 - $(MKPROG) $(subst /,\\,$(OBJS)) -Fe$@ -link $(LDFLAGS) $(subst /,\\,$(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS))
6002 + $(MKPROG) $(OBJS) -Fe$@ -link $(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)
6004 if test -f $@.manifest; then \
6005 $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
6006 @@ -305,11 +305,7 @@
6010 -ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
6011 - $(AR) $(subst /,\\,$(OBJS))
6020 $(LINK_DLL) $(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES)
6022 - $(LINK_DLL) -MAP $(DLLBASE) $(subst /,\\,$(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES))
6023 + $(LINK_DLL) -MAP $(DLLBASE) $(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES)
6025 if test -f $@.manifest; then \
6026 $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;2; \
6027 @@ -429,15 +425,15 @@
6031 -core_abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
6032 +mozabspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
6034 $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
6036 ifdef USE_NT_C_SYNTAX
6037 - $(CC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<)
6038 + $(CC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
6040 ifdef NEED_ABSOLUTE_PATH
6041 - $(CC) -o $@ -c $(CFLAGS) $(call core_abspath,$<)
6042 + $(CC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
6044 $(CC) -o $@ -c $(CFLAGS) $<
6046 @@ -445,10 +441,10 @@
6048 $(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
6049 ifdef USE_NT_C_SYNTAX
6050 - $(CC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<)
6051 + $(CC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
6053 ifdef NEED_ABSOLUTE_PATH
6054 - $(CC) -o $@ -c $(CFLAGS) $(call core_abspath,$<)
6055 + $(CC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
6057 $(CC) -o $@ -c $(CFLAGS) $<
6059 @@ -477,10 +473,10 @@
6060 $(OBJDIR)/$(PROG_PREFIX)%: %.cpp
6062 ifdef USE_NT_C_SYNTAX
6063 - $(CCC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<)
6064 + $(CCC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
6066 ifdef NEED_ABSOLUTE_PATH
6067 - $(CCC) -o $@ -c $(CFLAGS) $(call core_abspath,$<)
6068 + $(CCC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
6070 $(CCC) -o $@ -c $(CFLAGS) $<
6072 @@ -501,10 +497,10 @@
6073 rm -f $(OBJDIR)/t_$*.cc
6075 ifdef USE_NT_C_SYNTAX
6076 - $(CCC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<)
6077 + $(CCC) -Fo$@ -c $(CFLAGS) $(call mozabspath,$<)
6079 ifdef NEED_ABSOLUTE_PATH
6080 - $(CCC) -o $@ -c $(CFLAGS) $(call core_abspath,$<)
6081 + $(CCC) -o $@ -c $(CFLAGS) $(call mozabspath,$<)
6083 $(CCC) -o $@ -c $(CFLAGS) $<
6085 --- misc/mozilla/security/manager/Makefile.in 2008-06-16 00:23:29.000000000 +0200
6086 +++ misc/build/mozilla/security/manager/Makefile.in 2008-08-14 16:22:21.000000000 +0200
6087 @@ -123,8 +123,11 @@
6088 ifdef CYGDRIVE_MOUNT
6089 ABS_DIST := $(shell cygpath -w $(ABS_DIST) | sed -e 's|\\|/|g')
6091 +ifneq (,$(filter cygwin%,$(host_os)))
6092 +ABS_DIST := $(shell cygpath -u $(ABS_DIST))
6094 ifneq (,$(filter mingw%,$(host_os)))
6095 -ABS_DIST := $(shell cd $(DIST) && pwd -W)
6096 +ABS_DIST := $(shell cygpath -u $(ABS_DIST))
6099 NSPR_INCLUDE_DIR = $(firstword $(filter -I%,$(NSPR_CFLAGS)))
6102 ifeq ($(OS_ARCH),WINNT)
6103 DEFAULT_GMAKE_FLAGS += OS_TARGET=WIN95
6104 +DEFAULT_GMAKE_FLAGS += CYGWIN_WRAPPER=@CYGWIN_WRAPPER@
6106 ifndef MOZ_NO_DEBUG_RTL
6107 DEFAULT_GMAKE_FLAGS += USE_DEBUG_RTL=1
6108 --- misc/mozilla/security/nss/cmd/shlibsign/Makefile 2007-02-16 03:16:24.000000000 +0100
6109 +++ misc/build/mozilla/security/nss/cmd/shlibsign/Makefile 2009-02-12 15:42:13.033408000 +0100
6112 include ../platrules.mk
6114 -SRCDIR = $(call core_abspath,.)
6116 +ifeq ($(OS_TARGET), Darwin)
6119 +ifeq ($(OS_TARGET), Linux)
6125 %.chk: %.$(DLL_SUFFIX)
6126 ifeq ($(OS_TARGET), OS2)
6127 cd $(OBJDIR) ; cmd.exe /c $(SRCDIR)/sign.cmd $(DIST) \
6128 $(call core_abspath,$(OBJDIR)) $(OS_TARGET) \
6129 $(call core_abspath,$(NSPR_LIB_DIR)) $(call core_abspath,$<)
6131 - cd $(OBJDIR) ; sh $(SRCDIR)/sign.sh $(call core_abspath,$(DIST)) \
6132 - $(call core_abspath,$(OBJDIR)) $(OS_TARGET) \
6133 - $(call core_abspath,$(NSPR_LIB_DIR)) $(call core_abspath,$<)
6134 +ifeq ($(OS_TARGET), WIN95)
6135 + cd $(SRCDIR) ; sh $(CYGWIN_WRAPPER) ./sign.sh $(DIST) \
6136 + $(OBJDIR) $(OS_TARGET) \
6137 + $(NSPR_LIB_DIR) $<
6139 +ifeq ($(OS_TARGET), Darwin)
6140 + cd $(SRCDIR) ; sh ./sign.sh $(DIST) \
6141 + $(OBJDIR) $(OS_TARGET) \
6142 + $(NSPR_LIB_DIR) $<
6144 +ifeq ($(OS_TARGET), Linux)
6145 + cd $(SRCDIR) ; sh ./sign.sh $(DIST) \
6146 + $(OBJDIR) $(OS_TARGET) \
6147 + $(NSPR_LIB_DIR) $<
6149 + cd $(SRCDIR) ; sh ./sign.sh $(DIST) \
6150 + $(OBJDIR) $(OS_TARGET) \
6151 + $(NSPR_LIB_DIR) $<
6157 libs install :: $(CHECKLOC)
6158 --- misc/mozilla/security/nss/lib/ckfw/builtins/config.mk 2005-01-20 03:25:46.000000000 +0100
6159 +++ misc/build/mozilla/security/nss/lib/ckfw/builtins/config.mk 2008-08-14 16:22:21.000000000 +0200
6161 DSO_LDOPTS = -bundle
6164 -ifeq ($(OS_TARGET),SunOS)
6165 -# The -R '$ORIGIN' linker option instructs this library to search for its
6166 -# dependencies in the same directory where it resides.
6167 -MKSHLIB += -R '$$ORIGIN'
6170 --- misc/mozilla/security/nss/lib/freebl/Makefile 2008-06-16 00:22:09.000000000 +0200
6171 +++ misc/build/mozilla/security/nss/lib/freebl/Makefile 2008-08-18 14:31:08.000000000 +0200
6172 @@ -199,10 +199,6 @@
6175 ifeq ($(OS_TARGET),SunOS)
6177 -# The -R '$ORIGIN' linker option instructs this library to search for its
6178 -# dependencies in the same directory where it resides.
6179 -MKSHLIB += -R '$$ORIGIN'
6181 ifdef GCC_USE_GNU_LD
6182 MKSHLIB += -Wl,-Bsymbolic,-z,now,-z,text
6184 MKSHLIB += -Wl,-B,symbolic,-z,now,-z,text
6185 endif # GCC_USE_GNU_LD
6187 - MKSHLIB += -B symbolic -z now -z text
6188 + MKSHLIB += -z now -z text
6191 # Sun's WorkShop defines v8, v8plus and v9 architectures.
6192 --- misc/mozilla/security/nss/lib/nss/config.mk 2006-12-22 14:47:56.000000000 +0100
6193 +++ misc/build/mozilla/security/nss/lib/nss/config.mk 2008-08-19 17:07:42.000000000 +0200
6194 @@ -113,12 +113,10 @@
6195 # The -R '$ORIGIN' linker option instructs this library to search for its
6196 # dependencies in the same directory where it resides.
6198 -MKSHLIB += -R '$$ORIGIN:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
6199 +DSO_LDOPTS += -R '$$ORIGIN:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
6201 -MKSHLIB += -R '$$ORIGIN:/usr/lib/mps/secv1:/usr/lib/mps'
6202 +DSO_LDOPTS += -R '$$ORIGIN:/usr/lib/mps/secv1:/usr/lib/mps'
6205 -MKSHLIB += -R '$$ORIGIN'
6212 MKSHLIB += +b '$$ORIGIN'
6220 ifeq (,$(filter-out WINNT WIN95,$(OS_TARGET)))
6222 --- misc/mozilla/security/nss/lib/nss/nss.def 2008-06-16 00:22:10.000000000 +0200
6223 +++ misc/build/mozilla/security/nss/lib/nss/nss.def 2008-08-14 16:22:21.000000000 +0200
6225 CERT_CheckCertValidTimes;
6226 CERT_CreateCertificateRequest;
6227 CERT_ChangeCertTrust;
6228 +CERT_DecodeDERCertificate;
6230 CERT_DestroyCertificateRequest;
6231 CERT_DestroyCertList;
6232 --- misc/mozilla/security/nss/lib/smime/config.mk 2006-12-22 14:48:00.000000000 +0100
6233 +++ misc/build/mozilla/security/nss/lib/smime/config.mk 2008-08-19 17:01:53.000000000 +0200
6238 -ifeq ($(OS_TARGET),SunOS)
6239 -# The -R '$ORIGIN' linker option instructs this library to search for its
6240 -# dependencies in the same directory where it resides.
6241 -MKSHLIB += -R '$$ORIGIN'
6243 --- misc/mozilla/security/nss/lib/softoken/config.mk 2006-12-22 14:48:00.000000000 +0100
6244 +++ misc/build/mozilla/security/nss/lib/softoken/config.mk 2008-08-20 10:36:17.000000000 +0200
6249 -ifeq ($(OS_TARGET),SunOS)
6250 -# The -R '$ORIGIN' linker option instructs this library to search for its
6251 -# dependencies in the same directory where it resides.
6252 -MKSHLIB += -R '$$ORIGIN'
6256 ifeq ($(OS_TARGET),WINCE)
6257 DEFINES += -DDBM_USING_NSPR
6259 --- misc/mozilla/security/nss/lib/ssl/config.mk 2008-06-16 00:22:12.000000000 +0200
6260 +++ misc/build/mozilla/security/nss/lib/ssl/config.mk 2008-08-19 17:03:03.000000000 +0200
6261 @@ -116,13 +116,6 @@
6262 EXTRA_SHARED_LIBS += -dylib_file @executable_path/libsoftokn3.dylib:$(DIST)/lib/libsoftokn3.dylib
6265 -ifeq ($(OS_TARGET),SunOS)
6266 -# The -R '$ORIGIN' linker option instructs this library to search for its
6267 -# dependencies in the same directory where it resides.
6268 -MKSHLIB += -R '$$ORIGIN'
6269 -#EXTRA_SHARED_LIBS += -ldl -lrt -lc -z defs
6274 # indicates dependency on freebl static lib
6275 --- misc/mozilla/webshell/tests/viewer/Makefile.in 2006-06-17 18:27:10.000000000 +0200
6276 +++ misc/build/mozilla/webshell/tests/viewer/Makefile.in 2008-08-14 16:22:21.000000000 +0200
6278 GTK_LIBS = unix/gtk/libviewer_gtk_s.a -lgtksuperwin $(XP_LIBS) $(MOZ_GTK_LDFLAGS)
6280 XP_DIST_DEP_LIBS := $(filter-out -L$(DIST)/bin -L$(DIST)/lib, $(XP_DIST_LIBS))
6281 -XP_DIST_DEP_LIBS := $(wildcard $(addprefix $(DIST)/,$(patsubst -l%,bin/$(LIB_PREFIX)%$(DLL_SUFFIX),$(XP_DIST_DEP_LIBS:-l%_s=lib/lib%_s)))*)
6282 +XP_DIST_DEP_LIBS := $(wildcard $(addprefix $(DIST)/,$(patsubst -l%,bin/$(DLL_PREFIX)%$(DLL_SUFFIX),$(XP_DIST_DEP_LIBS:-l%_s=lib/lib%_s)))*)
6285 $(XP_DIST_DEP_LIBS) \
6286 --- misc/mozilla/xpcom/reflect/xptinfo/public/xptinfo.h 2004-04-18 16:18:20.000000000 +0200
6287 +++ misc/build/mozilla/xpcom/reflect/xptinfo/public/xptinfo.h 2008-08-14 16:22:21.000000000 +0200
6291 PRBool IsArray() const
6292 - {return (PRBool) TagPart() == T_ARRAY;}
6293 + {return (PRBool) (TagPart() == T_ARRAY);}
6295 // 'Dependent' means that params of this type are dependent upon other
6296 // params. e.g. an T_INTERFACE_IS is dependent upon some other param at
6298 uint8 TagPart() const
6299 {return (uint8) (flags & XPT_TDP_TAGMASK);}
6306 --- misc/mozilla/xpfe/bootstrap/Makefile.in 2007-10-08 21:09:58.000000000 +0200
6307 +++ misc/build/mozilla/xpfe/bootstrap/Makefile.in 2008-08-18 14:10:04.000000000 +0200
6308 @@ -115,11 +115,14 @@
6310 include $(topsrcdir)/config/config.mk
6312 +# reduce prerequisites by disabling mozilla binary
6313 +ifndef DISABLE_MOZ_EXECUTABLE
6314 ifeq ($(USE_SHORT_LIBNAME),1)
6315 PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
6317 PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
6321 # Force applications to be built non-statically
6322 # when building the mozcomps meta component
6324 APP_NAME = $(MOZ_APP_DISPLAYNAME)
6329 mkdir -p $(DIST)/$(APP_NAME).app/Contents/MacOS
6330 rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app
6332 rsync -a --copy-unsafe-links $(DIST)/package/PrintPDE.plugin $(DIST)/$(APP_NAME).app/Contents/Plug-Ins
6333 cp -RL $(DIST)/package/mozillaSuite.rsrc $(DIST)/$(APP_NAME).app/Contents/Resources/$(PROGRAM).rsrc
6334 echo -n APPLMOZZ > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
6338 rm -rf $(DIST)/$(APP_NAME).app
6339 --- misc/mozilla/directory/c-sdk/ldap/libraries/libiutil/Makefile.in 2006-02-03 15:44:41.000000000 +0100
6340 +++ misc/build/mozilla/directory/c-sdk/ldap/libraries/libiutil/Makefile.in 2011-09-07 10:45:16.000000000 +0200
6342 -e "s|%VERSION%|$${v}|" \
6345 -export:: $(OBJDEST) $(LIBDIR) $(OBJS) $(LIBIUTIL)
6346 +export:: $(OBJDEST) $(OBJS) $(LIBIUTIL)
6349 - $(MKDIR) $(LIBDIR)
6351 -$(LIBIUTIL): $(OBJS) $(LIBDIR)
6352 +$(LIBIUTIL): $(OBJS)
6353 @echo ======= making $(LIBIUTIL)
6354 ifdef SO_FILES_TO_REMOVE
6355 -$(RM) $(SO_FILES_TO_REMOVE)
6356 --- misc/mozilla/directory/c-sdk/ldap/libraries/liblber/Makefile.in 2006-02-03 15:44:41.000000000 +0100
6357 +++ misc/build/mozilla/directory/c-sdk/ldap/libraries/liblber/Makefile.in 2011-09-07 10:45:02.000000000 +0200
6359 -e "s|%VERSION%|$${v}|" \
6362 -export:: $(OBJDEST) $(LIBDIR) $(OBJS) $(LIBLBER)
6363 +export:: $(OBJDEST) $(OBJS) $(LIBLBER)
6366 - $(MKDIR) $(LIBDIR)
6368 -$(LIBLBER): $(OBJS) $(LIBDIR)
6369 +$(LIBLBER): $(OBJS)
6370 @echo ======= making $(LIBLBER)
6371 ifdef SO_FILES_TO_REMOVE
6372 -$(RM) $(SO_FILES_TO_REMOVE)
6373 --- misc/mozilla/directory/c-sdk/ldap/libraries/libldap/Makefile.in 2011-09-07 10:53:57.000000000 +0200
6374 +++ misc/build/mozilla/directory/c-sdk/ldap/libraries/libldap/Makefile.in 2011-09-07 10:44:45.000000000 +0200
6375 @@ -279,13 +279,13 @@
6378 # Set the default sources for the export target
6379 -EXPDEPS = $(OBJDIR_NAME) $(LIBDIR) $(OBJS) $(LIBLDAP) $(DLLLDAP)
6380 +EXPDEPS = $(OBJDIR_NAME) $(OBJS) $(LIBLDAP) $(DLLLDAP)
6381 # Remove the LIB source if on win32 and using MSVC
6382 # This avoids problems with -jX builds where 'link' will make both the
6383 # .dll and .lib files in one pass
6384 ifeq ($(OS_ARCH), WINNT)
6386 -EXPDEPS = $(OBJDIR_NAME) $(LIBDIR) $(OBJS) $(DLLLDAP)
6387 +EXPDEPS = $(OBJDIR_NAME) $(OBJS) $(DLLLDAP)
6391 @@ -294,10 +294,7 @@
6392 ltest:: $(LIBLDAP) test.o
6396 - $(MKDIR) $(LIBDIR)
6398 -$(LIBLDAP): $(OBJS) $(LIBDIR) $(LDAP_EXPORT_DEFS)
6399 +$(LIBLDAP): $(OBJS) $(LDAP_EXPORT_DEFS)
6400 @echo ======= making $(LIBLDAP)
6401 ifdef SO_FILES_TO_REMOVE
6402 -$(RM) $(SO_FILES_TO_REMOVE)
6407 -$(DLLLDAP): $(OBJS) $(LIBDIR) $(LDAP_EXPORT_DEFS)
6408 +$(DLLLDAP): $(OBJS) $(LDAP_EXPORT_DEFS)
6409 @echo ======= making $(DLLLDAP)
6410 ifdef SO_FILES_TO_REMOVE
6411 -$(RM) $(SO_FILES_TO_REMOVE)
6412 --- misc/mozilla/directory/c-sdk/ldap/libraries/libldif/Makefile.in 2006-02-03 15:44:49.000000000 +0100
6413 +++ misc/build/mozilla/directory/c-sdk/ldap/libraries/libldif/Makefile.in 2011-09-07 10:44:15.000000000 +0200
6415 -e "s|%VERSION%|$${v}|" \
6418 -export:: $(OBJDEST) $(LIBDIR) $(OBJS) $(LIBLDIF)
6419 +export:: $(OBJDEST) $(OBJS) $(LIBLDIF)
6422 - $(MKDIR) $(LIBDIR)
6424 -$(LIBLDIF): $(OBJS) $(LIBDIR)
6425 +$(LIBLDIF): $(OBJS)
6426 @echo ======= making $(LIBLDIF)
6427 ifdef SO_FILES_TO_REMOVE
6428 -$(RM) $(SO_FILES_TO_REMOVE)
6429 --- misc/mozilla/directory/c-sdk/ldap/libraries/libprldap/Makefile.in 2011-09-07 10:53:57.000000000 +0200
6430 +++ misc/build/mozilla/directory/c-sdk/ldap/libraries/libprldap/Makefile.in 2011-09-07 10:43:59.000000000 +0200
6431 @@ -201,12 +201,9 @@
6432 -e "s|%VERSION%|$${v}|" \
6435 -export:: $(OBJDEST) $(LIBDIR) $(OBJS) $(DLLPRLDAP)
6436 +export:: $(OBJDEST) $(OBJS) $(DLLPRLDAP)
6439 - $(MKDIR) $(LIBDIR)
6441 -$(LIBPRLDAP): $(OBJS) $(LIBDIR) $(PRLDAP_EXPORT_DEFS)
6442 +$(LIBPRLDAP): $(OBJS) $(PRLDAP_EXPORT_DEFS)
6443 @echo ======= making $(LIBPRLDAP)
6444 ifdef SO_FILES_TO_REMOVE
6445 -$(RM) $(SO_FILES_TO_REMOVE)
6447 $(LINK_LIB) $(EXTRA_LIBS)
6450 -$(DLLPRLDAP): $(OBJS) $(LIBDIR) $(PRLDAP_EXPORT_DEFS)
6451 +$(DLLPRLDAP): $(OBJS) $(PRLDAP_EXPORT_DEFS)
6452 @echo ======= making $(DLLPRLDAP)
6453 ifdef SO_FILES_TO_REMOVE
6454 -$(RM) $(SO_FILES_TO_REMOVE)
6455 --- misc/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile.in 2011-09-07 10:53:57.000000000 +0200
6456 +++ misc/build/mozilla/directory/c-sdk/ldap/libraries/libssldap/Makefile.in 2011-09-07 10:42:48.000000000 +0200
6457 @@ -214,19 +214,16 @@
6458 -e "s|%VERSION%|$${v}|" \
6461 -export:: $(OBJDEST) $(LIBDIR) $(OBJS) $(DLLSSLDAP)
6462 +export:: $(OBJDEST) $(OBJS) $(DLLSSLDAP)
6465 - $(MKDIR) $(LIBDIR)
6467 -$(LIBSSLDAP): $(OBJS) $(LIBDIR) $(SSLDAP_EXPORT_DEFS)
6468 +$(LIBSSLDAP): $(OBJS) $(SSLDAP_EXPORT_DEFS)
6469 @echo ======= making $(LIBSSLDAP)
6470 ifdef SO_FILES_TO_REMOVE
6471 -$(RM) $(SO_FILES_TO_REMOVE)
6473 $(LINK_LIB) $(EXTRA_LIBS)
6475 -$(DLLSSLDAP): $(OBJS) $(LIBDIR) $(SSLDAP_EXPORT_DEFS)
6476 +$(DLLSSLDAP): $(OBJS) $(SSLDAP_EXPORT_DEFS)
6477 @echo ======= making $(DLLSSLDAP)
6478 ifdef SO_FILES_TO_REMOVE
6479 -$(RM) $(SO_FILES_TO_REMOVE)